hexsha
stringlengths 40
40
| size
int64 7
1.05M
| ext
stringclasses 13
values | lang
stringclasses 1
value | max_stars_repo_path
stringlengths 4
269
| max_stars_repo_name
stringlengths 5
109
| max_stars_repo_head_hexsha
stringlengths 40
40
| max_stars_repo_licenses
listlengths 1
9
| max_stars_count
int64 1
191k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 4
269
| max_issues_repo_name
stringlengths 5
116
| max_issues_repo_head_hexsha
stringlengths 40
40
| max_issues_repo_licenses
listlengths 1
9
| max_issues_count
int64 1
48.5k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 4
269
| max_forks_repo_name
stringlengths 5
116
| max_forks_repo_head_hexsha
stringlengths 40
40
| max_forks_repo_licenses
listlengths 1
9
| max_forks_count
int64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 7
1.05M
| avg_line_length
float64 1.21
330k
| max_line_length
int64 6
990k
| alphanum_fraction
float64 0.01
0.99
| author_id
stringlengths 2
40
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
07d0fc460e0805e5aa91ee91bb3fca6152cc415a
| 547
|
cpp
|
C++
|
UVaOnlineJudge/Problem_Set_Volumes_(100...1999)/Volume6(600-699)/621/code.cpp
|
luiscbr92/algorithmic-challenges
|
bc35729e54e4284e9ade1aa61b51a1c2d72aa62c
|
[
"MIT"
] | 3
|
2015-10-21T18:56:43.000Z
|
2017-06-06T10:44:22.000Z
|
UVaOnlineJudge/Problem_Set_Volumes_(100...1999)/Volume6(600-699)/621/code.cpp
|
luiscbr92/algorithmic-challenges
|
bc35729e54e4284e9ade1aa61b51a1c2d72aa62c
|
[
"MIT"
] | null | null | null |
UVaOnlineJudge/Problem_Set_Volumes_(100...1999)/Volume6(600-699)/621/code.cpp
|
luiscbr92/algorithmic-challenges
|
bc35729e54e4284e9ade1aa61b51a1c2d72aa62c
|
[
"MIT"
] | null | null | null |
#include <iostream>
#include <string>
using namespace std;
int main(){
int cases, length;
string s;
cin >> cases;
for(int i = 0; i < cases; i++){
cin >> s;
if(s=="1" || s == "4" || s == "78") cout << "+\n";
else if ((length = s.size()) >= 2){
if(s.substr(length - 2) == "35") cout << "-\n";
else if(s[0] == '9' && s[length-1] == '4') cout << "*\n";
else if (length >= 3 && s.substr(0, 3) == "190") cout << "?\n";
}
}
}
| 20.259259
| 78
| 0.380256
|
luiscbr92
|
07d4975fc21b06cc10bc666197e980aecd5ba151
| 31,090
|
cpp
|
C++
|
src/jsusfx.cpp
|
asb2m10/jsusfx
|
be2b3bafe90b0f2eb28739257138844bc9d2941c
|
[
"Apache-2.0"
] | 49
|
2015-01-05T06:58:59.000Z
|
2021-10-21T00:30:08.000Z
|
src/jsusfx.cpp
|
umlaeute/jsusfx
|
be2b3bafe90b0f2eb28739257138844bc9d2941c
|
[
"Apache-2.0"
] | 25
|
2016-02-25T15:59:03.000Z
|
2021-12-20T15:08:16.000Z
|
src/jsusfx.cpp
|
umlaeute/jsusfx
|
be2b3bafe90b0f2eb28739257138844bc9d2941c
|
[
"Apache-2.0"
] | 13
|
2015-06-17T07:47:39.000Z
|
2021-10-07T12:19:46.000Z
|
/*
* Copyright 2014-2015 Pascal Gauthier
* Copyright 2018 Pascal Gauthier, Marcel Smit
*
* 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 "jsusfx.h"
#include "jsusfx_file.h"
#include "jsusfx_gfx.h"
#include "jsusfx_serialize.h"
#include <string.h>
#ifndef WIN32
#include <unistd.h>
#endif
#include "WDL/ptrlist.h"
#include "WDL/assocarray.h"
#define REAPER_GET_INTERFACE(opaque) ((opaque) ? ((JsusFx*)opaque) : nullptr)
#define AUTOVAR(name) name = NSEEL_VM_regvar(m_vm, #name); *name = 0
#define AUTOVARV(name,value) name = NSEEL_VM_regvar(m_vm, #name); *name = value
#define EEL_STRING_GET_CONTEXT_POINTER(opaque) (((JsusFx *)opaque)->m_string_context)
#ifdef EEL_STRING_STDOUT_WRITE
#ifndef EELSCRIPT_NO_STDIO
#define EEL_STRING_STDOUT_WRITE(x,len) { fwrite(x,len,1,stdout); fflush(stdout); }
#endif
#endif
#include "WDL/eel2/eel_strings.h"
#include "WDL/eel2/eel_misc.h"
#include "WDL/eel2/eel_fft.h"
#include "WDL/eel2/eel_mdct.h"
#include <fstream> // to check if files exist
// Reaper API
static EEL_F * NSEEL_CGEN_CALL _reaper_slider(void *opaque, EEL_F *n)
{
JsusFx *ctx = REAPER_GET_INTERFACE(opaque);
const int index = *n;
if (index >= 0 && index < ctx->kMaxSliders)
return ctx->sliders[index].owner;
else {
ctx->dummyValue = 0;
return &ctx->dummyValue;
}
}
static EEL_F * NSEEL_CGEN_CALL _reaper_spl(void *opaque, EEL_F *n)
{
JsusFx *ctx = REAPER_GET_INTERFACE(opaque);
const int index = *n;
if (index >= 0 && index < ctx->numValidInputChannels)
return ctx->spl[index];
else {
ctx->dummyValue = 0;
return &ctx->dummyValue;
}
}
static EEL_F NSEEL_CGEN_CALL _midirecv(void *opaque, INT_PTR np, EEL_F **parms)
{
JsusFx *ctx = REAPER_GET_INTERFACE(opaque);
while (ctx->midiSize > 0) {
// peek the message type
const uint8_t b = ctx->midi[0];
if ((b & 0xf0) == 0xf0) {
// 0xf0 = system exclusive message
// consume the byte
ctx->midi++;
ctx->midiSize--;
// skip until we find a 0xf7 byte
for (;;) {
// end of data stream?
if (ctx->midiSize == 0)
break;
// consume the byte
const uint8_t b = ctx->midi[0];
ctx->midi++;
ctx->midiSize--;
// end of system exclusive message?
if (b == 0xf7)
break;
}
}
else if (b & 0x80) {
// status byte
const uint8_t event = b & 0xf0;
//const uint8_t channel = b & 0x0f;
// consume the byte
ctx->midi++;
ctx->midiSize--;
// data bytes
if (ctx->midiSize >= 2) {
*parms[0] = 0;
*parms[1] = event;
if (np >= 4) {
*parms[2] = ctx->midi[0];
*parms[3] = ctx->midi[1];
} else {
*parms[2] = ctx->midi[0] + ctx->midi[1] * 256;
}
ctx->midi += 2;
ctx->midiSize -= 2;
return 1;
} else {
ctx->midiSize = 0;
return 0;
}
} else {
// data byte without a preceeding status byte? something is wrong here
ctx->midiSize--; // decrement this otherwise it is an infinite loop
ctx->displayMsg("Inconsistent midi stream %x\n", b);
}
}
return 0;
}
static EEL_F NSEEL_CGEN_CALL _midisend(void *opaque, INT_PTR np, EEL_F **parms)
{
JsusFx *ctx = REAPER_GET_INTERFACE(opaque);
if (ctx->midiSendBufferSize + 3 > ctx->midiSendBufferCapacity) {
return 0;
} else if (np == 3) {
const int offset = (int)*parms[0];
(void)offset; // sample offset into current block. not used
const uint8_t msg1 = (uint8_t)*parms[1];
const uint16_t msg23 = (uint16_t)*parms[2];
const uint8_t msg2 = (msg23 >> 0) & 0xff;
const uint8_t msg3 = (msg23 >> 8) & 0xff;
//printf("midi send. cmd=%x, msg2=%d, msg3=%x\n", msg1, msg2, msg3);
ctx->midiSendBuffer[ctx->midiSendBufferSize++] = msg1;
ctx->midiSendBuffer[ctx->midiSendBufferSize++] = msg2;
ctx->midiSendBuffer[ctx->midiSendBufferSize++] = msg3;
return msg1;
} else if (np == 4) {
const int offset = (int)*parms[0];
(void)offset; // sample offset into current block. not used
const uint8_t msg1 = (uint8_t)*parms[1];
const uint8_t msg2 = (uint8_t)*parms[2];
const uint8_t msg3 = (uint8_t)*parms[3];
ctx->midiSendBuffer[ctx->midiSendBufferSize++] = msg1;
ctx->midiSendBuffer[ctx->midiSendBufferSize++] = msg2;
ctx->midiSendBuffer[ctx->midiSendBufferSize++] = msg3;
return msg1;
} else {
return 0;
}
}
static EEL_F NSEEL_CGEN_CALL _midisend_buf(void *opaque, INT_PTR np, EEL_F **parms)
{
JsusFx *ctx = REAPER_GET_INTERFACE(opaque);
if (np == 3) {
const int offset = (int)*parms[0];
(void)offset; // sample offset into current block. not used
void *buf = (void*)parms[1];
const int len = (int)*parms[2];
// note : should we auto-detect SysEx messages? Reaper does it, but it seems like a bad idea..
// auto-detection would automagically determine the message's length here by parsing the message stream
if (len < 0 || ctx->midiSendBufferSize + len > ctx->midiSendBufferCapacity) {
return 0;
} else {
memcpy(&ctx->midiSendBuffer[ctx->midiSendBufferSize], buf, len);
ctx->midiSendBufferSize += len;
return len;
}
} else {
return 0;
}
}
// todo : remove __stub
static EEL_F NSEEL_CGEN_CALL __stub(void *opaque, INT_PTR np, EEL_F **parms)
{
return 0.0;
}
//
struct JsusFx_Section {
WDL_String code;
int lineOffset;
JsusFx_Section()
{
lineOffset = 0;
}
};
struct JsusFx_Sections {
JsusFx_Section init;
JsusFx_Section slider;
JsusFx_Section block;
JsusFx_Section sample;
JsusFx_Section gfx;
JsusFx_Section serialize;
};
//
static const char *skipWhite(const char *text) {
while ( *text && isspace(*text) )
text++;
return text;
}
static const char *nextToken(const char *text) {
while ( *text && *text != ',' && *text != '=' && *text != '<' && *text != '>' && *text != '{' && *text != '}' )
text++;
return text;
}
bool JsusFx_Slider::config(JsusFx &fx, const int index, const char *param, const int lnumber) {
char buffer[2048];
strncpy(buffer, param, 2048);
def = min = max = inc = 0;
exists = false;
enumNames.clear();
isEnum = false;
bool hasName = false;
const char *tmp = strchr(buffer, '>');
if ( tmp != NULL ) {
tmp++;
while (*tmp == ' ')
tmp++;
strncpy(desc, tmp, 64);
tmp = 0;
} else {
desc[0] = 0;
}
tmp = buffer;
if ( isalpha(*tmp) ) {
// extended syntax of format "slider1:variable_name=5<0,10,1>slider description"
const char *begin = tmp;
while ( *tmp && *tmp != '=' )
tmp++;
if ( *tmp != '=' ) {
fx.displayError("Expected '=' at end of slider name %d", lnumber);
return false;
}
const char *end = tmp;
int len = end - begin;
if ( len > JsusFx_Slider::kMaxName ) {
fx.displayError("Slider name too long %d", lnumber);
return false;
}
for ( int i = 0; i < len; ++i )
name[i] = begin[i];
name[len] = 0;
hasName = true;
tmp++;
}
if ( !sscanf(tmp, "%f", &def) )
return false;
tmp = nextToken(tmp);
if ( *tmp != '<' )
{
fx.displayError("slider info is missing");
return false;
}
else
{
tmp++;
if ( !sscanf(tmp, "%f", &min) )
{
fx.displayError("failed to read min value");
return false;
}
tmp = nextToken(tmp);
if ( *tmp != ',' )
{
fx.displayError("max value is missing");
return false;
}
else
{
tmp++;
if ( !sscanf(tmp, "%f", &max) )
{
fx.displayError("failed to read max value");
return false;
}
tmp = nextToken(tmp);
if ( *tmp == ',')
{
tmp++;
tmp = skipWhite(tmp);
if ( !sscanf(tmp, "%f", &inc) )
{
//log("failed to read increment value");
//return false;
inc = 0;
}
tmp = nextToken(tmp);
if ( *tmp == '{' )
{
isEnum = true;
inc = 1;
tmp++;
while ( true )
{
const char *end = nextToken(tmp);
const std::string name(tmp, end);
enumNames.push_back(name);
tmp = end;
if ( *tmp == 0 )
{
fx.displayError("enum value list not properly terminated");
return false;
}
if ( *tmp == '}' )
{
break;
}
tmp++;
}
tmp++;
}
}
}
}
if (hasName == false) {
sprintf(name, "slider%d", index);
}
owner = NSEEL_VM_regvar(fx.m_vm, name);
*owner = def;
exists = true;
return true;
}
//
JsusFxPathLibrary_Basic::JsusFxPathLibrary_Basic(const char * _dataRoot) {
if ( _dataRoot != nullptr )
dataRoot = _dataRoot;
}
void JsusFxPathLibrary_Basic::addSearchPath(const std::string & path) {
if ( path.empty() )
return;
// make sure it ends with '/' or '\\'
if ( path.back() == '/' || path.back() == '\\' )
searchPaths.push_back(path);
else
searchPaths.push_back(path + "/");
}
bool JsusFxPathLibrary_Basic::fileExists(const std::string &filename) {
std::ifstream is(filename);
return is.is_open();
}
bool JsusFxPathLibrary_Basic::resolveImportPath(const std::string &importPath, const std::string &parentPath, std::string &resolvedPath) {
const size_t pos = parentPath.rfind('/');
if ( pos != std::string::npos )
resolvedPath = parentPath.substr(0, pos + 1);
if ( fileExists(resolvedPath + importPath) ) {
resolvedPath = resolvedPath + importPath;
return true;
}
for ( std::string & searchPath : searchPaths ) {
if ( fileExists(resolvedPath + searchPath + importPath) ) {
resolvedPath = resolvedPath + searchPath + importPath;
return true;
}
}
return false;
}
bool JsusFxPathLibrary_Basic::resolveDataPath(const std::string &importPath, std::string &resolvedPath) {
if ( !dataRoot.empty() )
resolvedPath = dataRoot + "/" + importPath;
else
resolvedPath = importPath;
return fileExists(resolvedPath);
}
std::istream* JsusFxPathLibrary_Basic::open(const std::string &path) {
std::ifstream *stream = new std::ifstream(path);
if ( stream->is_open() == false ) {
delete stream;
stream = nullptr;
}
return stream;
}
void JsusFxPathLibrary_Basic::close(std::istream *&stream) {
delete stream;
stream = nullptr;
}
//
JsusFx::JsusFx(JsusFxPathLibrary &_pathLibrary)
: pathLibrary(_pathLibrary) {
m_vm = NSEEL_VM_alloc();
codeInit = codeSlider = codeBlock = codeSample = codeGfx = codeSerialize = NULL;
NSEEL_VM_SetCustomFuncThis(m_vm,this);
m_string_context = new eel_string_context_state();
eel_string_initvm(m_vm);
computeSlider = false;
srate = 0;
pathLibrary = _pathLibrary;
fileAPI = nullptr;
midi = nullptr;
midiSize = 0;
midiSendBuffer = nullptr;
midiSendBufferCapacity = 0;
midiSendBufferSize = 0;
gfx = nullptr;
gfx_w = 0;
gfx_h = 0;
serializer = nullptr;
for (int i = 0; i < kMaxSamples; ++i) {
char name[16];
sprintf(name, "spl%d", i);
spl[i] = NSEEL_VM_regvar(m_vm, name);
*spl[i] = 0;
}
numInputs = 0;
numOutputs = 0;
numValidInputChannels = 0;
AUTOVAR(srate);
AUTOVARV(num_ch, 2);
AUTOVAR(samplesblock);
AUTOVAR(trigger);
// transport state. use setTransportValues to set these
AUTOVARV(tempo, 120); // playback tempo in beats per minute
AUTOVARV(play_state, 1); // playback state. see the PlaybackState enum for details
AUTOVAR(play_position); // current playback position in seconds
AUTOVAR(beat_position); // current playback position in beats (beats = quarternotes in /4 time signatures)
AUTOVARV(ts_num, 0); // time signature nominator. i.e. 3 if using 3/4 time
AUTOVARV(ts_denom, 4); // time signature denominator. i.e. 4 if using 3/4 time
AUTOVAR(ext_noinit);
AUTOVAR(ext_nodenorm); // set to 1 to disable noise added to signals to avoid denormals from popping up
// midi bus support
AUTOVAR(ext_midi_bus); // when set to 1, support for midi buses is enabled. otherwise, only bus 0 is active and others will pass through
AUTOVAR(midi_bus);
// Reaper API
NSEEL_addfunc_varparm("slider_automate",1,NSEEL_PProc_THIS,&__stub); // todo : implement slider_automate. add Reaper api interface?
NSEEL_addfunc_varparm("slider_next_chg",2,NSEEL_PProc_THIS,&__stub); // todo : implement slider_next_chg. add Reaper api interface?
NSEEL_addfunc_varparm("sliderchange",1,NSEEL_PProc_THIS,&__stub); // todo : implement sliderchange. add Reaper api interface?
NSEEL_addfunc_retptr("slider",1,NSEEL_PProc_THIS,&_reaper_slider);
NSEEL_addfunc_retptr("spl",1,NSEEL_PProc_THIS,&_reaper_spl);
NSEEL_addfunc_varparm("midirecv",3,NSEEL_PProc_THIS,&_midirecv);
NSEEL_addfunc_varparm("midisend",3,NSEEL_PProc_THIS,&_midisend);
NSEEL_addfunc_varparm("midisend_buf",3,NSEEL_PProc_THIS,&_midisend_buf);
}
JsusFx::~JsusFx() {
releaseCode();
if (m_vm)
NSEEL_VM_free(m_vm);
delete m_string_context;
}
bool JsusFx::compileSection(int state, const char *code, int line_offset) {
if ( code[0] == 0 )
return true;
char errorMsg[4096];
//printf("section code:\n");
//printf("%s", code);
switch(state) {
case 0:
codeInit = NSEEL_code_compile_ex(m_vm, code, line_offset, NSEEL_CODE_COMPILE_FLAG_COMMONFUNCS);
if ( codeInit == NULL ) {
snprintf(errorMsg, 4096, "@init line %s", NSEEL_code_getcodeerror(m_vm));
displayError(errorMsg);
return false;
}
break;
case 1:
codeSlider = NSEEL_code_compile_ex(m_vm, code, line_offset, NSEEL_CODE_COMPILE_FLAG_COMMONFUNCS);
if ( codeSlider == NULL ) {
snprintf(errorMsg, 4096, "@slider line %s", NSEEL_code_getcodeerror(m_vm));
displayError(errorMsg);
return false;
}
break;
case 2:
codeBlock = NSEEL_code_compile_ex(m_vm, code, line_offset, NSEEL_CODE_COMPILE_FLAG_COMMONFUNCS);
if ( codeBlock == NULL ) {
snprintf(errorMsg, 4096, "@block line %s", NSEEL_code_getcodeerror(m_vm));
displayError(errorMsg);
return false;
}
break;
case 3:
codeSample = NSEEL_code_compile_ex(m_vm, code, line_offset, NSEEL_CODE_COMPILE_FLAG_COMMONFUNCS);
if ( codeSample == NULL ) {
snprintf(errorMsg, 4096, "@sample line %s", NSEEL_code_getcodeerror(m_vm));
displayError(errorMsg);
return false;
}
break;
case 4:
codeGfx = NSEEL_code_compile_ex(m_vm, code, line_offset, NSEEL_CODE_COMPILE_FLAG_COMMONFUNCS);
if ( codeGfx == NULL ) {
snprintf(errorMsg, 4096, "@gfx line %s", NSEEL_code_getcodeerror(m_vm));
displayError(errorMsg);
return false;
}
break;
case 5:
codeSerialize = NSEEL_code_compile_ex(m_vm, code, line_offset, NSEEL_CODE_COMPILE_FLAG_COMMONFUNCS);
if ( codeSerialize == NULL ) {
snprintf(errorMsg, 4096, "@serialize line %s", NSEEL_code_getcodeerror(m_vm));
displayError(errorMsg);
return false;
}
break;
default:
//printf("unknown block");
break;
}
m_string_context->update_named_vars(m_vm);
return true;
}
bool JsusFx::processImport(JsusFxPathLibrary &pathLibrary, const std::string &path, const std::string &importPath, JsusFx_Sections §ions, const int compileFlags) {
bool result = true;
//displayMsg("Importing %s", path.c_str());
std::string resolvedPath;
if ( ! pathLibrary.resolveImportPath(importPath, path, resolvedPath) ) {
displayError("Failed to resolve import file path %s", importPath.c_str());
return false;
}
std::istream *is = pathLibrary.open(resolvedPath);
if ( is != nullptr ) {
result &= readSections(pathLibrary, resolvedPath, *is, sections, compileFlags);
} else {
displayError("Failed to open imported file %s", importPath.c_str());
result &= false;
}
pathLibrary.close(is);
return result;
}
static char *trim(char *line, bool trimStart, bool trimEnd)
{
if (trimStart) {
while (*line && isspace(*line))
line++;
}
if (trimEnd) {
char *last = line;
while (last[0] && last[1])
last++;
for (char *b = last; isspace(*b) && b >= line; b--)
*b = 0;
}
return line;
}
bool JsusFx::readHeader(JsusFxPathLibrary &pathLibrary, const std::string &path, std::istream &input) {
char line[4096];
for(int lnumber = 1; ! input.eof(); lnumber++) {
input.getline(line, sizeof(line), '\n');
if ( line[0] == '@' )
break;
if ( ! strnicmp(line, "slider", 6) ) {
int target = 0;
if ( ! sscanf(line, "slider%d:", &target) )
continue;
if ( target < 0 || target >= kMaxSliders )
continue;
JsusFx_Slider &slider = sliders[target];
char *p = line+7;
while ( *p && *p != ':' )
p++;
if ( *p != ':' )
continue;
p++;
if ( ! slider.config(*this, target, p, lnumber) ) {
displayError("Incomplete slider @line %d (%s)", lnumber, line);
return false;
}
trim(slider.desc, false, true);
continue;
}
else if ( ! strncmp(line, "desc:", 5) ) {
char *src = line+5;
src = trim(src, true, true);
strncpy(desc, src, 64);
continue;
}
else if ( ! strncmp(line, "in_pin:", 7) ) {
numInputs++;
}
else if ( ! strncmp(line, "out_pin:", 8) ) {
numOutputs++;
}
}
return true;
}
bool JsusFx::readSections(JsusFxPathLibrary &pathLibrary, const std::string &path, std::istream &input, JsusFx_Sections §ions, const int compileFlags) {
WDL_String * code = nullptr;
char line[4096];
// are we reading the header or sections?
bool isHeader = true;
for(int lnumber = 1; ! input.eof(); lnumber++) {
input.getline(line, sizeof(line), '\n');
const int l = input.gcount();
if ( line[0] == '@' ) {
char *b = line + 1;
b = trim(b, false, true);
// we've begun reading sections now
isHeader = false;
JsusFx_Section *section = nullptr;
if ( ! strnicmp(b, "init", 4) )
section = §ions.init;
else if ( ! strnicmp(b, "slider", 6) )
section = §ions.slider;
else if ( ! strnicmp(b, "block", 5) )
section = §ions.block;
else if ( ! strnicmp(b, "sample", 6) )
section = §ions.sample;
else if ( ! strnicmp(b, "gfx", 3) && (compileFlags & kCompileFlag_CompileGraphicsSection) != 0 ) {
if ( sscanf(b+3, "%d %d", &gfx_w, &gfx_h) != 2 ) {
gfx_w = 0;
gfx_h = 0;
}
section = §ions.gfx;
}
else if ( ! strnicmp(b, "serialize", 9) && (compileFlags & kCompileFlag_CompileSerializeSection) != 0 )
section = §ions.serialize;
if ( section != nullptr ) {
code = §ion->code;
section->lineOffset = lnumber;
} else {
code = nullptr;
}
continue;
}
if ( code != nullptr ) {
//int l = strlen(line);
if ( l > 0 && line[l-1] == '\r' )
line[l-1] = 0;
if ( line[0] != 0 ) {
code->Append(line);
}
code->Append("\n");
continue;
}
if (isHeader) {
if ( ! strnicmp(line, "slider", 6) ) {
int target = 0;
if ( ! sscanf(line, "slider%d:", &target) )
continue;
if ( target < 0 || target >= kMaxSliders )
continue;
JsusFx_Slider &slider = sliders[target];
char *p = line+7;
while ( *p && *p != ':' )
p++;
if ( *p != ':' )
continue;
p++;
if ( ! slider.config(*this, target, p, lnumber) ) {
displayError("Incomplete slider @line %d (%s)", lnumber, line);
return false;
}
trim(slider.desc, false, true);
continue;
}
else if ( ! strncmp(line, "desc:", 5) ) {
char *src = line+5;
src = trim(src, true, true);
strncpy(desc, src, 64);
continue;
}
else if ( ! strnicmp(line, "filename:", 9) ) {
// filename:0,filename.wav
char *src = line+8;
src = trim(src, true, false);
if ( *src != ':' )
return false;
src++;
src = trim(src, true, false);
int index;
if ( sscanf(src, "%d", &index) != 1 )
return false;
while ( isdigit(*src) )
src++;
src = trim(src, true, false);
if ( *src != ',' )
return false;
src++;
src = trim(src, true, true);
std::string resolvedPath;
if ( pathLibrary.resolveImportPath(src, path, resolvedPath) ) {
if ( ! handleFile(index, resolvedPath.c_str() ) ) {
return false;
}
}
}
else if ( ! strncmp(line, "import ", 7) ) {
char *src = line+7;
src = trim(src, true, true);
if (*src) {
processImport(pathLibrary, path, src, sections, compileFlags);
}
continue;
}
else if ( ! strncmp(line, "in_pin:", 7) ) {
if ( ! strncmp(line+7, "none", 4) ) {
numInputs = -1;
} else {
if ( numInputs != -1 )
numInputs++;
}
}
else if ( ! strncmp(line, "out_pin:", 8) ) {
if ( ! strncmp(line+8, "none", 4) ) {
numOutputs = -1;
} else {
if ( numOutputs != -1 )
numOutputs++;
}
}
}
}
return true;
}
bool JsusFx::compileSections(JsusFx_Sections §ions, const int compileFlags) {
bool result = true;
// 0 init
// 1 slider
// 2 block
// 3 sample
// 4 gfx
// 5 serialize
if (sections.init.code.GetLength() != 0)
result &= compileSection(0, sections.init.code.Get(), sections.init.lineOffset);
if (sections.slider.code.GetLength() != 0)
result &= compileSection(1, sections.slider.code.Get(), sections.slider.lineOffset);
if (sections.block.code.GetLength() != 0)
result &= compileSection(2, sections.block.code.Get(), sections.block.lineOffset);
if (sections.sample.code.GetLength() != 0)
result &= compileSection(3, sections.sample.code.Get(), sections.sample.lineOffset);
if (sections.gfx.code.GetLength() != 0 && (compileFlags & kCompileFlag_CompileGraphicsSection) != 0)
result &= compileSection(4, sections.gfx.code.Get(), sections.gfx.lineOffset);
if (sections.serialize.code.GetLength() != 0 && (compileFlags & kCompileFlag_CompileSerializeSection) != 0)
result &= compileSection(5, sections.serialize.code.Get(), sections.serialize.lineOffset);
if (result == false)
releaseCode();
return result;
}
bool JsusFx::compile(JsusFxPathLibrary &pathLibrary, const std::string &path, const int compileFlags) {
releaseCode();
std::string resolvedPath;
if ( ! pathLibrary.resolveImportPath(path, "", resolvedPath) ) {
displayError("Failed to open %s", path.c_str());
return false;
}
std::istream *input = pathLibrary.open(resolvedPath);
if ( input == nullptr ) {
displayError("Failed to open %s", resolvedPath.c_str());
return false;
}
// read code for the various sections inside the jsusfx script
JsusFx_Sections sections;
if ( ! readSections(pathLibrary, resolvedPath, *input, sections, compileFlags) )
return false;
pathLibrary.close(input);
// compile the sections
if ( ! compileSections(sections, compileFlags) ) {
releaseCode();
return false;
}
computeSlider = 1;
// in_pin and out_pin is optional, we default it to 2 in / 2 out if nothing is specified.
// if you really want no in or out, specify in_pin:none/out_pin:none
if ( numInputs == 0 )
numInputs = 2;
else if ( numInputs == -1 )
numInputs = 0;
if ( numOutputs == 0 )
numOutputs = 2;
else if ( numOutputs == -1 )
numOutputs = 0;
return true;
}
bool JsusFx::readHeader(JsusFxPathLibrary &pathLibrary, const std::string &path) {
std::string resolvedPath;
if ( ! pathLibrary.resolveImportPath(path, "", resolvedPath) ) {
displayError("Failed to open %s", path.c_str());
return false;
}
std::istream *input = pathLibrary.open(resolvedPath);
if ( input == nullptr ) {
displayError("Failed to open %s", resolvedPath.c_str());
return false;
}
if ( ! readHeader(pathLibrary, resolvedPath, *input) )
return false;
pathLibrary.close(input);
return true;
}
void JsusFx::prepare(int sampleRate, int blockSize) {
*srate = (double) sampleRate;
*samplesblock = blockSize;
NSEEL_code_execute(codeInit);
}
void JsusFx::moveSlider(int idx, float value, int normalizeSlider) {
if ( idx < 0 || idx >= kMaxSliders || !sliders[idx].exists )
return;
if ( normalizeSlider != 0 ) {
float steps = sliders[idx].max - sliders[idx].min;
value = (value * steps) / normalizeSlider;
value += sliders[idx].min;
}
if ( sliders[idx].inc != 0 ) {
int tmp = roundf(value / sliders[idx].inc);
value = sliders[idx].inc * tmp;
}
computeSlider |= sliders[idx].setValue(value);
}
void JsusFx::setMidi(const void * _midi, int numBytes) {
midi = (uint8_t*)_midi;
midiSize = numBytes;
}
void JsusFx::setMidiSendBuffer(void * buffer, int numBytes) {
midiSendBuffer = (uint8_t*)buffer;
midiSendBufferCapacity = numBytes;
midiSendBufferSize = 0;
}
void JsusFx::setTransportValues(
const double in_tempo,
const PlaybackState in_playbackState,
const double in_playbackPositionInSeconds,
const double in_beatPosition,
const int in_timeSignatureNumerator,
const int in_timeSignatureDenumerator)
{
*tempo = in_tempo;
*play_state = in_playbackState;
*play_position = in_playbackPositionInSeconds;
*beat_position = in_beatPosition;
*ts_num = in_timeSignatureNumerator;
*ts_denom = in_timeSignatureDenumerator;
}
bool JsusFx::process(const float **input, float **output, int size, int numInputChannels, int numOutputChannels) {
if ( codeSample == NULL )
return false;
if ( computeSlider ) {
NSEEL_code_execute(codeSlider);
computeSlider = false;
}
numValidInputChannels = numInputChannels;
*samplesblock = size;
*num_ch = numValidInputChannels;
NSEEL_code_execute(codeBlock);
for(int i=0;i<size;i++) {
for (int c = 0; c < numInputChannels; ++c)
*spl[c] = input[c][i];
NSEEL_code_execute(codeSample);
for (int c = 0; c < numOutputChannels; ++c)
output[c][i] = *spl[c];
}
return true;
}
bool JsusFx::process64(const double **input, double **output, int size, int numInputChannels, int numOutputChannels) {
if ( codeSample == NULL )
return false;
if ( computeSlider ) {
NSEEL_code_execute(codeSlider);
computeSlider = false;
}
numValidInputChannels = numInputChannels;
*samplesblock = size;
*num_ch = numValidInputChannels;
NSEEL_code_execute(codeBlock);
for(int i=0;i<size;i++) {
for (int c = 0; c < numInputChannels; ++c)
*spl[c] = input[c][i];
NSEEL_code_execute(codeSample);
for (int c = 0; c < numOutputChannels; ++c)
output[c][i] = *spl[c];
}
return true;
}
void JsusFx::draw() {
if ( codeGfx == NULL )
return;
if ( gfx != nullptr )
gfx->beginDraw();
NSEEL_code_execute(codeGfx);
if ( gfx != nullptr )
gfx->endDraw();
}
bool JsusFx::serialize(JsusFxSerializer & _serializer, const bool write) {
serializer = &_serializer;
serializer->begin(*this, write);
{
if (codeSerialize != nullptr)
NSEEL_code_execute(codeSerialize);
if (write == false)
{
if (codeSlider != nullptr)
NSEEL_code_execute(codeSlider);
computeSlider = false;
}
}
serializer->end();
serializer = nullptr;
return true;
}
const char * JsusFx::getString(const int index, WDL_FastString ** fs) {
void * opaque = this;
return EEL_STRING_GET_FOR_INDEX(index, fs);
}
bool JsusFx::handleFile(int index, const char *filename)
{
if (index < 0 || index >= kMaxFileInfos)
{
displayError("file index out of bounds %d:%s", index, filename);
return false;
}
if (fileInfos[index].isValid())
{
displayMsg("file already exists %d:%s", index, filename);
fileInfos[index] = JsusFx_FileInfo();
}
//
if (fileInfos[index].init(filename))
{
const char *ext = nullptr;
for (const char *p = filename; *p; ++p)
if (*p == '.')
ext = p + 1;
if (ext != nullptr && (stricmp(ext, "png") == 0 || stricmp(ext, "jpg") == 0))
{
if (gfx != nullptr)
{
gfx->gfx_loadimg(*this, index, index);
}
}
return true;
}
else
{
displayError("failed to find file %d:%s", index, filename);
return false;
}
}
void JsusFx::releaseCode() {
desc[0] = 0;
if ( codeInit )
NSEEL_code_free(codeInit);
if ( codeSlider )
NSEEL_code_free(codeSlider);
if ( codeBlock )
NSEEL_code_free(codeBlock);
if ( codeSample )
NSEEL_code_free(codeSample);
if ( codeGfx )
NSEEL_code_free(codeGfx);
codeInit = codeSlider = codeBlock = codeSample = codeGfx = codeSerialize = NULL;
NSEEL_code_compile_ex(m_vm, nullptr, 0, NSEEL_CODE_COMPILE_FLAG_COMMONFUNCS_RESET);
numInputs = 0;
numOutputs = 0;
for(int i=0;i<kMaxSliders;i++)
sliders[i].exists = false;
gfx_w = 0;
gfx_h = 0;
NSEEL_VM_remove_unused_vars(m_vm);
NSEEL_VM_remove_all_nonreg_vars(m_vm);
}
void JsusFx::init() {
EEL_string_register();
EEL_fft_register();
EEL_mdct_register();
EEL_string_register();
EEL_misc_register();
}
static int dumpvarsCallback(const char *name, EEL_F *val, void *ctx) {
JsusFx *fx = (JsusFx *) ctx;
int target;
if ( sscanf(name, "slider%d", &target) ) {
if ( target >= 0 && target < JsusFx::kMaxSliders ) {
if ( ! fx->sliders[target].exists ) {
return 1;
} else {
fx->displayMsg("%s --> %f (%s)", name, *val, fx->sliders[target].desc);
return 1;
}
}
}
fx->displayMsg("%s --> %f", name, *val);
return 1;
}
void JsusFx::dumpvars() {
NSEEL_VM_enumallvars(m_vm, dumpvarsCallback, this);
}
#ifndef JSUSFX_OWNSCRIPTMUTEXT
// todo : implement mutex interface ?
void NSEEL_HOSTSTUB_EnterMutex() { }
void NSEEL_HOSTSTUB_LeaveMutex() { }
#endif
| 25.694215
| 167
| 0.605886
|
asb2m10
|
07d78ba06233cf02120b9ac3264fd6ee7df2a442
| 3,422
|
cpp
|
C++
|
src/http/connection_impl.cpp
|
Ri0n/blog-new-year-2021
|
449ae54400bcc06450d9b90518f3f9a67a5afeed
|
[
"BSL-1.0"
] | null | null | null |
src/http/connection_impl.cpp
|
Ri0n/blog-new-year-2021
|
449ae54400bcc06450d9b90518f3f9a67a5afeed
|
[
"BSL-1.0"
] | null | null | null |
src/http/connection_impl.cpp
|
Ri0n/blog-new-year-2021
|
449ae54400bcc06450d9b90518f3f9a67a5afeed
|
[
"BSL-1.0"
] | null | null | null |
//
// Copyright (c) 2021 Richard Hodges (hodges.r@gmail.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "http/connection_impl.hpp"
namespace http
{
net::awaitable< error_code >
connection_impl::connect(async::stop_token stop)
{
error_code ec;
assert(co_await net::this_coro::executor == exec_);
if (!stream_.is_open())
ec = co_await stream_.connect(
stop, ssl_ctx_, transport_type_, hostname_, port_, options_);
co_return ec;
}
net::awaitable< std::tuple< error_code, response_type > >
connection_impl::rest_call(request_class const &request,
request_options const &options)
{
auto response = std::make_unique< response_class >();
auto ec = error_code(net::error::not_connected);
if (stream_.is_open())
ec = co_await rest_call(request, *response, options);
if (ec && ec != net::error::operation_aborted)
{
ec = co_await connect(options.stop);
if (!ec)
ec = co_await rest_call(request, *response, options);
}
if (ec || response->need_eof())
stream_.close();
co_return std::make_tuple(ec, std::move(response));
}
net::awaitable< error_code >
connection_impl::rest_call(request_class const &request,
response_class &response,
request_options const &options)
{
auto stop = options.stop;
auto ec = error_code();
if (stop.stopped())
ec = net::error::operation_aborted;
auto &tcp = stream_.get_tcp_layer();
if (!ec)
{
tcp.expires_after(options.write_timeout);
auto stopconn = stop.connect([&] { tcp.cancel(); });
co_await stream_.apply_visitor(
[&](auto &stream)
{
return beast::http::async_write(
stream,
request,
net::redirect_error(net::use_awaitable, ec));
});
}
if (!ec && stop.stopped())
ec = net::error::operation_aborted;
if (!ec)
{
tcp.expires_after(options.read_timeout);
auto stopconn = stop.connect([&] { tcp.cancel(); });
co_await stream_.apply_visitor(
[&](auto &stream)
{
return beast::http::async_read(
stream,
buf_,
response,
net::redirect_error(net::use_awaitable, ec));
});
}
if (ec || response.need_eof())
{
if (ec)
{
tcp.socket().shutdown(net::ip::tcp::socket::shutdown_both);
}
else
{
tcp.socket().shutdown(net::ip::tcp::socket::shutdown_both, ec);
}
stream_.close();
}
co_return ec;
}
connection_impl::connection_impl(net::io_strand exec,
ssl::context &sslctx,
std::string hostname,
std::string port,
transport_type ttype,
connect_options options)
: exec_(std::move(exec))
, ssl_ctx_(sslctx)
, hostname_(std::move(hostname))
, port_(std::move(port))
, transport_type_(ttype)
, options_(options)
, stream_()
, buf_()
{
}
} // namespace http
| 27.596774
| 79
| 0.547925
|
Ri0n
|
07d9ecc7783798bbea4197fc3c7db12202a9f9c1
| 4,309
|
cpp
|
C++
|
cv/cvthresh.cpp
|
hoozh/emcv
|
e61b1d5ad16c255f0306d0e9feb8f32e3a92d97f
|
[
"BSD-3-Clause"
] | null | null | null |
cv/cvthresh.cpp
|
hoozh/emcv
|
e61b1d5ad16c255f0306d0e9feb8f32e3a92d97f
|
[
"BSD-3-Clause"
] | null | null | null |
cv/cvthresh.cpp
|
hoozh/emcv
|
e61b1d5ad16c255f0306d0e9feb8f32e3a92d97f
|
[
"BSD-3-Clause"
] | null | null | null |
////////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License For Embedded Computer Vision Library
//
// Copyright (c) 2008-2012, EMCV Project,
// Copyright (c) 2000-2007, Intel Corporation,
// All rights reserved.
// Third party copyrights are property of their respective owners.
//
// 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 copyright holders nor the names of their contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
// OF SUCH DAMAGE.
//
// Contributors:
// * Shiqi Yu (Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences)
#include "_cv.h"
CV_IMPL void
cvThreshold( const void* srcarr, void* dstarr, double thresh, double maxval, int type )
{
CV_FUNCNAME( "cvThreshold" );
__BEGIN__;
CvMat src_stub, *src = (CvMat*)srcarr;
CvMat dst_stub, *dst = (CvMat*)dstarr;
int coi1 = 0, coi2 = 0;
CV_CALL( src = cvGetMat( src, &src_stub, &coi1 ));
CV_CALL( dst = cvGetMat( dst, &dst_stub, &coi2 ));
if( coi1 + coi2 )
CV_ERROR( CV_BadCOI, "COI is not supported by the function" );
if( !CV_ARE_CNS_EQ( src, dst ) )
CV_ERROR( CV_StsUnmatchedFormats, "Both arrays must have equal number of channels" );
if( type != CV_THRESH_BINARY)
CV_ERROR( CV_StsBadFlag, "Only binary threshold is supported now. Please use type=CV_THRESH_BINARY." );
if( CV_MAT_TYPE(src->type) != CV_8UC1 || CV_MAT_TYPE(dst->type) != CV_8UC1)
CV_ERROR( CV_StsUnsupportedFormat, "Types should be 8uC1" );
switch( CV_MAT_DEPTH(src->type) )
{
case CV_8U:
register unsigned char ithreshs[4];
register unsigned char imaxvals[4];
int ithresh, imaxval;
int idx;
ithresh = cvFloor(thresh);
ithresh = (ithresh>255) ? 255 : ithresh;
ithresh = (ithresh<0) ? 0 : ithresh;
ithreshs[0]=ithreshs[1]=ithreshs[2]=ithreshs[3]=ithresh;
imaxval = cvRound(maxval);
imaxval = (imaxval>255) ? 255 : imaxval;
imaxval = (imaxval<0) ? 0 : imaxval;
imaxvals[0]=imaxvals[1]=imaxvals[2]=imaxvals[3]=imaxval;
#ifdef _TMS320C6X
register unsigned int binvals;
for(idx=0; idx < (src->step*src->height)/4; idx++)
{
binvals = _cmpgtu4( _mem4_const(src->data.i+idx), _mem4_const(ithreshs) );
binvals = _xpnd4( binvals );
_mem4(dst->data.i+idx) = binvals & _mem4_const(imaxvals);
}
#else
for(idx=0; idx < (src->step*src->height); idx++)
{
dst->data.ptr[idx] = (src->data.ptr[idx]>ithresh)? imaxval: 0;
}
#endif
break;
default:
CV_ERROR( CV_BadDepth, cvUnsupportedFormat );
}
__END__;
}
/* End of file. */
| 37.798246
| 105
| 0.671385
|
hoozh
|
07dc68a6c8701a2df10ab824dfb0426c3ea3816d
| 2,314
|
cpp
|
C++
|
reflection/TypeInfo.cpp
|
jess22664/x3ogre
|
9de430859d877407ae0308908390c9fa004b0e84
|
[
"MIT"
] | 1
|
2021-09-18T12:50:35.000Z
|
2021-09-18T12:50:35.000Z
|
reflection/TypeInfo.cpp
|
jess22664/x3ogre
|
9de430859d877407ae0308908390c9fa004b0e84
|
[
"MIT"
] | null | null | null |
reflection/TypeInfo.cpp
|
jess22664/x3ogre
|
9de430859d877407ae0308908390c9fa004b0e84
|
[
"MIT"
] | null | null | null |
/*
* TypeInfo.cpp
*
* Created on: 13.02.2014
* Author: parojtbe
*/
#include <reflection/TypeInfo.h>
#include <reflection/db.h>
#include <stdexcept>
using namespace std;
namespace reflection {
TypeInfoCommon::TypeInfoCommon(const string& parentType) : _parentType(parentType) {
}
void TypeInfoCommon::_resolveParentInfo() {
string parentType = _parentType;
TypeInfoCommon* parentInfo = nullptr;
while((parentInfo = getTypeInfo(parentType))) {
_setters.insert(parentInfo->_setters.begin(), parentInfo->_setters.end());
parentType = parentInfo->_parentType;
}
#if 0
map<string, ISetterAdapter*>::iterator i = _setters.begin();
for(; i != _setters.end(); ++i) {
cout << "\t" << i->first << endl;
}
#endif
}
const std::string& TypeInfoCommon::memberByArgType(Object* arg) {
for(const auto& e : _setters) {
if(e.second->supports(arg)) {
return e.first;
}
}
throw runtime_error("could not find member by type");
}
void TypeInfoCommon::callMember(void* obj, const string& member, void* value) {
auto i = _setters.find(member);
if(i == _setters.end()) {
throw runtime_error("no such member: '"+member+"'");
}
(*i->second)(obj, value);
}
void TypeInfoCommon::callMember(void* obj, const string& member, const string& value) {
auto i = _setters.find(member);
if(i == _setters.end()) {
throw runtime_error("no such member: '"+member+"'");
}
(*i->second)(obj, value);
}
const void* TypeInfoCommon::callMember(const void* obj, const std::string& name) {
auto i = _getters.find(name);
if(i == _getters.end()) {
throw runtime_error("no such member: '"+name+"'");
}
return (*i->second)(obj);
}
std::string TypeInfoCommon::callMemberString(const void* obj, const std::string& name) {
auto i = _getters.find(name);
if(i == _getters.end()) {
throw runtime_error("no such member: '"+name+"'");
}
return i->second->stringValue(obj);
}
void TypeInfoCommon::callMember(void* obj, const std::string& member, const std::shared_ptr<void>& value) {
auto i = _setters.find(member);
if(i == _setters.end()) {
throw runtime_error("no such member: '"+member+"'");
}
(*i->second)(obj, value);
}
}
| 23.373737
| 107
| 0.625756
|
jess22664
|
07dfb138f3f09ce6a032262ec2fb293f2662e9dd
| 287
|
hpp
|
C++
|
include/Covariance/Covariance2D.hpp
|
belcour/CovarianceTracing
|
60b5cfd82d7b0fa9a623743551ff8cf9595adf07
|
[
"Unlicense"
] | 45
|
2016-07-19T21:52:06.000Z
|
2021-12-07T08:21:49.000Z
|
include/Covariance/Covariance2D.hpp
|
belcour/CovarianceTracing
|
60b5cfd82d7b0fa9a623743551ff8cf9595adf07
|
[
"Unlicense"
] | null | null | null |
include/Covariance/Covariance2D.hpp
|
belcour/CovarianceTracing
|
60b5cfd82d7b0fa9a623743551ff8cf9595adf07
|
[
"Unlicense"
] | 7
|
2016-07-28T15:18:26.000Z
|
2020-06-14T12:20:16.000Z
|
#pragma once
namespace Covariance {
/*! The 2D isotropic version of Covariance Tracing.
* This code assumes that light transport in 2 dimensions and only
* store a 2D covariance matrix for space and angles.
*/
struct Covariance2D {
float matrix[3];
};
}
| 19.133333
| 70
| 0.672474
|
belcour
|
2e3e8506e2bac1efc615f97ab58e5a748a686773
| 305
|
cpp
|
C++
|
basics/Q2.cpp
|
shubhraagarwal/GUVI-codeKata
|
d8bf2354516dc27dd14d248cf0c702d652423e39
|
[
"MIT"
] | null | null | null |
basics/Q2.cpp
|
shubhraagarwal/GUVI-codeKata
|
d8bf2354516dc27dd14d248cf0c702d652423e39
|
[
"MIT"
] | null | null | null |
basics/Q2.cpp
|
shubhraagarwal/GUVI-codeKata
|
d8bf2354516dc27dd14d248cf0c702d652423e39
|
[
"MIT"
] | null | null | null |
#include <iostream>
using namespace std ;
int main(){
bool isComp = false ;
int n ;
cin>> n;
for(int i = 2 ; i < n ; i++){
if(n % i == 0){
isComp = true ;
cout<<"yes";
break;
}
}
if(isComp == false){
cout<<"no";
}
}
| 16.052632
| 33
| 0.390164
|
shubhraagarwal
|
2e4235f582d4396a492b5d036fb7d17dd7293fa7
| 3,722
|
cpp
|
C++
|
Game Engine 2D/Player.cpp
|
LaPeste/ComposeEngine
|
8ae80ec7c49af896978d06371dee96a4d2315372
|
[
"Apache-2.0"
] | 1
|
2017-03-13T11:19:40.000Z
|
2017-03-13T11:19:40.000Z
|
Game Engine 2D/Player.cpp
|
LaPeste/ComposeEngine
|
8ae80ec7c49af896978d06371dee96a4d2315372
|
[
"Apache-2.0"
] | null | null | null |
Game Engine 2D/Player.cpp
|
LaPeste/ComposeEngine
|
8ae80ec7c49af896978d06371dee96a4d2315372
|
[
"Apache-2.0"
] | null | null | null |
//
// Player.cpp
// GameEngine2D
//
// Created by Andrea Catalini on 23/07/16.
// Copyright © 2016 Andrea Catalini. All rights reserved.
//
#include "Player.hpp"
#include "EntityManager.hpp"
//Components
#include "Appearance.hpp"
#include "Acceleration.hpp"
#include "Animation.hpp"
#include "Controller.hpp"
#include "EntityFlag.hpp"
#include "Velocity.hpp"
#include "Collider.hpp"
#include "Transform.hpp"
//Events
#include "InputEvent.hpp"
#include "Animations.hpp"
void Player::Init()
{
World& world = GetWorld();
const unsigned long int entityIndex = GetEntityIndex();
std::string playerSpritePath = Constants::RESOURCE_PATH + Constants::PLAYER_SPRITE_PATH;
sf::IntRect spriteRect(498, 12, Constants::PLAYER_WIDTH, Constants::PLAYER_HEIGHT);
EntityManager::AddComponent(world, entityIndex, new Appearance(world, entityIndex, playerSpritePath, spriteRect));
EntityManager::AddComponent(world, entityIndex, new Transform(world, entityIndex));
//(static_cast<Transform*>(world.EntitiesComponentsMatrix[entityIndex][Transform::Id]))->SetPosition(sf::Vector2f(Constants::PLAYER_PHYSICAL_STARTING_X, Constants::PLAYER_PHYSICAL_STARTING_Y));
GetComponent<Transform>()->SetPosition(sf::Vector2f(Constants::PLAYER_PHYSICAL_STARTING_X, Constants::PLAYER_PHYSICAL_STARTING_Y));
EntityManager::AddComponent(world, entityIndex, new Acceleration(world, entityIndex, Constants::PLAYER_MAX_ACCELERATION_X, Constants::PLAYER_MAX_ACCELERATION_Y));
Controller* controllerComp = new Controller(world, entityIndex);
EntityManager::AddComponent(world, entityIndex, controllerComp);
EntityManager::AddComponent(world, entityIndex, new Velocity(world, entityIndex));
EntityManager::AddComponent(world, entityIndex, new Collider(world, entityIndex, sf::Vector2f(0.5f, 0.5f)));
//Animation states - start
const auto* const playerSprite = GetComponent<Appearance>()->GetSprite();
std::map<AnimationState, AnimationData*> animationMap;
AnimationData* walkingAnim = new AnimationData(playerSprite, sf::Vector2f(Constants::PLAYER_SPRITE_STARTING_X, Constants::PLAYER_SPRITE_STARTING_Y),
sf::Vector2f(Constants::SPACE_BETWEEN_SPRITE_X, Constants::SPACE_BETWEEN_SPRITE_Y), false,
false, Constants::PLAYER_WIDTH, Constants::PLAYER_HEIGHT, Constants::PLAYER_SPRITE_MAX_FRAME, Constants::ANIMATION_FRAMERATE);
animationMap.insert( std::pair<AnimationState, AnimationData*>(AnimationState::WALKING, walkingAnim) );
AnimationData* idleAnim = new AnimationData(playerSprite, sf::Vector2f(14, 10),
sf::Vector2f(Constants::SPACE_BETWEEN_SPRITE_X, Constants::SPACE_BETWEEN_SPRITE_Y), false,
false, Constants::PLAYER_WIDTH, Constants::PLAYER_HEIGHT, 1, Constants::ANIMATION_FRAMERATE);
animationMap.insert(std::pair<AnimationState, AnimationData*>(AnimationState::IDLE, idleAnim));
AnimationData* jumpAnim = new AnimationData(playerSprite, sf::Vector2f(115, 7),
sf::Vector2f(Constants::SPACE_BETWEEN_SPRITE_X, Constants::SPACE_BETWEEN_SPRITE_Y), false,
false, 16, Constants::PLAYER_HEIGHT, 1, Constants::ANIMATION_FRAMERATE);
animationMap.insert(std::pair<AnimationState, AnimationData*>(AnimationState::JUMPING, jumpAnim));
//Animation states - end
Animation* animationComp = new Animation(world, entityIndex, AnimationState::IDLE, animationMap, true);
EntityManager::AddComponent(world, entityIndex, animationComp);
OnGameEvent<InputEvent>([&world, entityIndex](Event<InputEvent>* i) {
if (i != nullptr)
{
auto* castedEvent = static_cast<InputEvent*>(i);
Animations::BasicInputAnimation(world, entityIndex, *castedEvent);
}
else
{
DEBUG_WARNING("The event passed was null!");
}
});
}
| 44.309524
| 197
| 0.764911
|
LaPeste
|
2e43e3909fb8a28c0174bd04f6f4106674e5bad2
| 6,284
|
cpp
|
C++
|
samplecode/CodeSnippets/SnpObjectActionHelper.cpp
|
shivendra14/AI_CC_2017_SDK_Win
|
e921f93bef0d73aa809bcda1bd6bbe2c0a4d28b2
|
[
"X11"
] | null | null | null |
samplecode/CodeSnippets/SnpObjectActionHelper.cpp
|
shivendra14/AI_CC_2017_SDK_Win
|
e921f93bef0d73aa809bcda1bd6bbe2c0a4d28b2
|
[
"X11"
] | null | null | null |
samplecode/CodeSnippets/SnpObjectActionHelper.cpp
|
shivendra14/AI_CC_2017_SDK_Win
|
e921f93bef0d73aa809bcda1bd6bbe2c0a4d28b2
|
[
"X11"
] | null | null | null |
//========================================================================================
//
// $File: //ai_stream/rel_21_0/devtech/sdk/public/samplecode/CodeSnippets/SnpObjectActionHelper.cpp $
//
// $Revision: #1 $
//
// Copyright 1987 Adobe Systems Incorporated. All rights reserved.
//
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
// with the terms of the Adobe license agreement accompanying it. If you have received
// this file from a source other than Adobe, then your use, modification, or
// distribution of it requires the prior written permission of Adobe.
//
//========================================================================================
#include "IllustratorSDK.h"
#include "AIObjectAction.h"
#include "SDKErrors.h"
// Framework includes:
#include "SnpRunnable.h"
#include "SnippetRunnerSuites.h"
#include "SnippetRunnerLog.h"
#include "SnippetRunnerParameter.h"
#include "SnpObjectActionHelper.h"
#include "SnpSelectionHelper.h"
/*
*/
SnpObjectActionHelper::VPB::VPB() : fActionParamValueRef(NULL)
{
ASErr result = kNoErr;
try {
SDK_ASSERT(sAIActionManager);
result = sAIActionManager->AINewActionParamValue(&fActionParamValueRef);
SDK_ASSERT(!result);
SDK_ASSERT(fActionParamValueRef);
}
catch (ai::Error) {
}
}
/*
*/
SnpObjectActionHelper::VPB::~VPB()
{
ASErr result = kNoErr;
try {
SDK_ASSERT(sAIActionManager);
result = sAIActionManager->AIDeleteActionParamValue(fActionParamValueRef);
SDK_ASSERT(!result);
fActionParamValueRef = NULL;
}
catch (ai::Error) {
}
}
/*
*/
ASErr SnpObjectActionHelper::CopySelection()
{
ASErr result = kNoErr;
try {
SnpObjectActionHelper::VPB vpb;
result = this->CopySelection(kDialogOff, vpb);
aisdk::check_ai_error(result);
}
catch (ai::Error& ex) {
result = ex;
}
return result;
}
/*
*/
ASErr SnpObjectActionHelper::CopySelection(ActionDialogStatus dialogStatus, AIActionParamValueRef parameters)
{
ASErr result = kNoErr;
try {
SDK_ASSERT(sAIActionManager);
result = sAIActionManager->PlayActionEvent(kAICopySelectionAction, dialogStatus, parameters);
aisdk::check_ai_error(result);
}
catch (ai::Error& ex) {
result = ex;
}
return result;
}
/*
*/
ASErr SnpObjectActionHelper::PasteClipboard()
{
ASErr result = kNoErr;
try {
SnpObjectActionHelper::VPB vpb;
result = this->PasteClipboard(kDialogOff, vpb);
aisdk::check_ai_error(result);
}
catch (ai::Error& ex) {
result = ex;
}
return result;
}
/*
*/
ASErr SnpObjectActionHelper::PasteClipboard(ActionDialogStatus dialogStatus, AIActionParamValueRef parameters)
{
ASErr result = kNoErr;
try {
SDK_ASSERT(sAIActionManager);
result = sAIActionManager->PlayActionEvent(kAIPasteClipboardAction, dialogStatus, parameters);
aisdk::check_ai_error(result);
}
catch (ai::Error& ex) {
result = ex;
}
return result;
}
// --------------------------------- SnippetRunner framework hook ---------------------------------------------------
/* Makes the snippet SnpObjectActionHelper available to the SnippetRunner framework.
*/
class _SnpRunnableObjectActionHelper : public SnpRunnable
{
public:
/* Constructor registers the snippet with the framework.
*/
_SnpRunnableObjectActionHelper () : SnpRunnable() {}
/* Destructor.
*/
virtual ~_SnpRunnableObjectActionHelper () {}
/* Returns name of snippet.
*/
std::string GetName() const;
/* Returns a description of what the snippet does.
*/
std::string GetDescription() const;
/* Returns operations supported by this snippet.
*/
Operations GetOperations() const;
/* Returns name of this snippet's default operation - must
be one of the operation names returned by GetOperations.
*/
std::string GetDefaultOperationName() const;
/** Returns the categories a snippet belongs to.
@return default categories.
*/
std::vector<std::string> GetCategories() const;
/* Returns true if the snippet can run.
@param runnableContext see ISnpRunnableContext for documentation.
@return true if snippet can run, false otherwise
*/
ASBoolean CanRun(SnpRunnable::Context& runnableContext);
/* Runs the snippet.
@param runnableContext see ISnpRunnableContext for documentation.
@return kNoErr on success, other ASErr otherwise.
*/
ASErr Run(SnpRunnable::Context& runnableContext);
};
/*
*/
std::string _SnpRunnableObjectActionHelper::GetName() const
{
return "ObjectActionHelper";
}
/*
*/
std::string _SnpRunnableObjectActionHelper::GetDescription() const
{
return "Helper class for programming object actions";
}
/*
*/
SnpRunnable::Operations _SnpRunnableObjectActionHelper::GetOperations() const
{
SnpRunnable::Operations operations;
operations.push_back(Operation("CopySelection", "document containing art", kSnpRunPathContext));
operations.push_back(Operation("PasteClipboard", "document", kSnpRunNewDocumentContext));
return operations;
}
/*
*/
std::string _SnpRunnableObjectActionHelper::GetDefaultOperationName() const
{
return "CopySelection";
}
/*
*/
std::vector<std::string> _SnpRunnableObjectActionHelper::GetCategories() const
{
std::vector<std::string> categories = SnpRunnable::GetCategories();
categories.push_back("Helper Snippets");
return categories;
}
/* Checks if preconditions are met.
*/
ASBoolean _SnpRunnableObjectActionHelper::CanRun(SnpRunnable::Context& runnableContext)
{
SnpSelectionHelper selectionHelper;
if (!selectionHelper.IsDocumentSelected())
return false;
if ("CopySelection" == runnableContext.GetOperation().GetName()) {
return selectionHelper.IsArtSelected();
}
else
return true;
}
/* Instantiates and calls your snippet class.
*/
ASErr _SnpRunnableObjectActionHelper::Run(SnpRunnable::Context& runnableContext)
{
ASErr result = kNoErr;
SnpObjectActionHelper instance;
if ("CopySelection" == runnableContext.GetOperation().GetName()) {
result = instance.CopySelection();
}
else if ("PasteClipboard" == runnableContext.GetOperation().GetName()) {
result = instance.PasteClipboard();
}
else {
result = kBadParameterErr;
}
return result;
}
/* Declares an instance to register the snippet hook with the framework.
*/
static _SnpRunnableObjectActionHelper instance_SnpRunnableObjectActionHelper;
// End SnpObjectActionHelper.cpp
| 24.076628
| 117
| 0.713081
|
shivendra14
|
2e44698a53fc202d24f7cd59fc7a9cad5f54bf76
| 136,919
|
cpp
|
C++
|
start/opencv-3.4.1/build/build_main/modules/highgui/qrc_window_QT.cpp
|
shengxiaoyi1993/opencv_cpp
|
8b9c8f31cd692cc6b1f4945ae0709ea605b15743
|
[
"MIT"
] | 2
|
2019-10-08T07:01:36.000Z
|
2019-10-08T07:01:38.000Z
|
start/opencv-3.4.1/build/build_main/modules/highgui/qrc_window_QT.cpp
|
shengxiaoyi1993/opencv_cpp
|
8b9c8f31cd692cc6b1f4945ae0709ea605b15743
|
[
"MIT"
] | null | null | null |
start/opencv-3.4.1/build/build_main/modules/highgui/qrc_window_QT.cpp
|
shengxiaoyi1993/opencv_cpp
|
8b9c8f31cd692cc6b1f4945ae0709ea605b15743
|
[
"MIT"
] | null | null | null |
/****************************************************************************
** Resource object code
**
** Created by: The Resource Compiler for Qt version 5.9.7
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
static const unsigned char qt_resource_data[] = {
// /home/sxy/Github/opencv_cpp/start/opencv-3.4.1/modules/highgui/src/files_Qt/Milky/48/23.png
0x0,0x0,0x6,0xce,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x0,0x0,0x30,0x0,0x0,0x0,0x30,0x8,0x6,0x0,0x0,0x0,0x57,0x2,0xf9,0x87,
0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a,0x25,0x0,0x0,0x80,0x83,
0x0,0x0,0xf9,0xff,0x0,0x0,0x80,0xe9,0x0,0x0,0x75,0x30,0x0,0x0,0xea,0x60,
0x0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,0x38,
0x9e,0xc8,0x31,0x8f,0x9b,0x4,0xe2,0xb2,0xca,0xe4,0x2e,0xa1,0xbe,0x61,0x16,0x1c,
0xa7,0x98,0xea,0xee,0x6b,0x39,0xc,0xe0,0x48,0x28,0x21,0xa9,0xe1,0x14,0x25,0x0,
0x82,0x48,0x78,0x75,0x5e,0x78,0xa0,0xfd,0x9a,0xef,0x39,0x9c,0x44,0x29,0xf0,0xca,
0x67,0x28,0x5b,0x7f,0xca,0xce,0x70,0x79,0x82,0x26,0xa9,0xeb,0xf9,0x61,0x4c,0x6f,
0xa8,0x83,0x95,0x2f,0xf4,0x6,0x4,0x5c,0x9,0x31,0x58,0x33,0x40,0x80,0x92,0x1c,
0x1,0x1c,0x48,0x89,0x10,0x2d,0xa7,0xfe,0x7,0x45,0xe5,0x15,0x67,0x40,0xe3,0x31,
0x8b,0xaa,0xa9,0x82,0xbc,0xc2,0x9c,0x71,0xc8,0x6,0x9,0x6a,0x8f,0x48,0x88,0x95,
0x4b,0xc2,0xc8,0x53,0x98,0x65,0x9f,0x9,0x20,0xf6,0x6c,0x5f,0x3d,0xfe,0x39,0x23,
0x24,0x68,0x78,0xcf,0x97,0x5c,0xd9,0x9d,0x27,0xaa,0x18,0x96,0x68,0xbe,0x70,0x69,
0xd0,0xb4,0x56,0x90,0xb6,0x1a,0x8c,0x54,0x21,0xad,0x75,0x10,0x1,0xc0,0x3,0x6c,
0x82,0x35,0x6d,0xff,0x7b,0x3,0x8,0xc7,0x53,0x82,0x0,0x66,0x97,0x25,0x4d,0x14,
0x38,0x57,0x68,0x7c,0xc6,0xbc,0x48,0x8,0x14,0x46,0x8a,0xd0,0x9a,0xb7,0x7,0x8b,
0x39,0x37,0x89,0x39,0x94,0x12,0xbb,0x36,0x7b,0xb6,0x4f,0x2e,0x3e,0xf4,0x38,0xe7,
0xe6,0x7c,0xc9,0x7d,0xcb,0xd,0x36,0xae,0x2d,0x33,0x5c,0xf0,0x16,0x8a,0x79,0x27,
0xbd,0xf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28,0x15,0x2e,0xd3,0x99,0x81,0xe2,0xa8,0xd,0xa7,0x28,0xd3,0x47,0x77,
0x5a,0x5d,0x55,0xff,0xb,0x8d,0x9b,0x3,0xda,0x4d,0x56,0xa5,0x61,0xe5,0x6c,0x68,
0xa9,0x53,0xc7,0xfa,0x8a,0x7b,0x26,0xe3,0xfe,0xb7,0xe0,0x37,0x32,0xee,0x77,0x2c,
0x9,0xbb,0xe0,0x60,0x34,0x63,0x41,0xda,0x72,0xd2,0xc0,0xdf,0xaa,0x8,0xf4,0xe4,
0xb3,0x56,0xaf,0x77,0xda,0xfb,0xcb,0x6e,0x79,0x7c,0x32,0xef,0x4f,0x77,0xfe,0xd5,
0xe0,0xe,0x81,0x3b,0x4,0x6e,0xef,0xe3,0x3f,0x66,0xc3,0x66,0xbf,0xfa,0x44,0xa2,
0x82,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
// /home/sxy/Github/opencv_cpp/start/opencv-3.4.1/modules/highgui/src/files_Qt/Milky/48/107.png
0x0,0x0,0xb,0xe,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x0,0x0,0x30,0x0,0x0,0x0,0x30,0x8,0x6,0x0,0x0,0x0,0x57,0x2,0xf9,0x87,
0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65,
0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64,
0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0xa,0xb0,0x49,0x44,0x41,0x54,0x78,0xda,0xd4,
0x5a,0xb,0x70,0x5c,0x55,0x19,0xfe,0xf6,0xee,0x7b,0x37,0x9b,0xdd,0x24,0xdd,0x24,
0x9b,0x77,0xd2,0x36,0xf4,0x91,0xa4,0xa1,0x45,0x2a,0x3,0x48,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a9,0x7f,
0x6a,0x70,0x70,0xb0,0xeb,0x93,0x0,0xfa,0x9c,0xb,0xd9,0xa5,0x78,0x5d,0xf2,0xff,
0xd9,0xe3,0x92,0x27,0xf0,0x7f,0x1,0x6,0x0,0xa0,0x95,0x16,0x57,0x5d,0x8a,0xf3,
0xfb,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
// /home/sxy/Github/opencv_cpp/start/opencv-3.4.1/modules/highgui/src/files_Qt/Milky/48/28.png
0x0,0x0,0x6,0xb6,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x0,0x0,0x30,0x0,0x0,0x0,0x30,0x8,0x6,0x0,0x0,0x0,0x57,0x2,0xf9,0x87,
0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a,0x25,0x0,0x0,0x80,0x83,
0x0,0x0,0xf9,0xff,0x0,0x0,0x80,0xe9,0x0,0x0,0x75,0x30,0x0,0x0,0xea,0x60,
0x0,0x0,0x3a,0x98,0x0,0x0,0x17,0x6f,0x92,0x5f,0xc5,0x46,0x0,0x0,0x0,0x9,
0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,
0x18,0x0,0x0,0x6,0x3c,0x49,0x44,0x41,0x54,0x68,0xde,0xed,0x59,0x5d,0x6c,0x14,
0x45,0x1c,0x9f,0xd9,0xbb,0xf6,0x7a,0x6d,0xa1,0xd7,0xa2,0x28,0x5,0x6c,0xb5,0x2d,
0x2a,0x2f,0x2d,0x14,0x83,0x3e,0x18,0x2e,0x3e,0x18,0xd1,0x7,0xd0,0x68,0x7c,0xe4,
0xd0,0x68,0x94,0x88,0x10,0x12,0x8c,0x24,0xc4,0x56,0x22,0x46,0x8d,0x51,0x8,0xd1,
0x18,0x25,0xf4,0xaa,0xa0,0x21,0x1a,0x28,0x22,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61,0xa0,0x59,0x84,0x60,0x45,0xc3,0x22,0x52,0x78,0x66,0x6f,
0xf4,0xe4,0xfb,0xa9,0x24,0x95,0x46,0x58,0x4d,0xe4,0xc6,0xf2,0xe9,0x22,0x9f,0x2d,
0xe2,0x32,0x60,0x64,0xb5,0x4,0x2e,0xeb,0xd5,0x7b,0x9b,0xbb,0x63,0x1f,0xa6,0x93,
0xa7,0x3e,0xca,0x3c,0x9b,0xcb,0x14,0xa2,0x2a,0x75,0x52,0xc7,0x2c,0x6c,0x10,0x22,
0x5e,0xb3,0x80,0xf5,0x38,0xfd,0x71,0x76,0x6b,0x41,0x2d,0xed,0xcc,0xd0,0x30,0x8b,
0x34,0x5c,0xe9,0x13,0x5e,0x94,0x90,0xfd,0x38,0xf3,0xa9,0x7a,0x50,0x2b,0xa0,0x48,
0x76,0x96,0x92,0x28,0x21,0x31,0x4b,0x64,0xd2,0x41,0x86,0x3f,0x78,0xfe,0x47,0xbe,
0x9f,0xf,0xe6,0x46,0x69,0x84,0x1a,0xa0,0x11,0x2a,0x51,0xca,0x97,0x4,0x70,0x3a,
0xc3,0x15,0xcb,0x3e,0x4f,0x13,0x60,0xc7,0xd9,0x43,0xf9,0xf3,0x74,0xd4,0xa9,0x73,
0xe7,0x27,0xe9,0xda,0x2,0x68,0x25,0x4c,0xb,0x9a,0x1f,0x16,0x28,0x1f,0xbf,0x7c,
0x5e,0xa4,0x61,0x96,0xc,0xa8,0xa9,0x7c,0x8c,0x49,0xaa,0x90,0xe1,0xe9,0x3e,0x3a,
0xe7,0x9b,0xbb,0xb,0xbf,0xd4,0x2f,0x10,0x58,0x20,0xb0,0x40,0xe0,0x7f,0x3d,0xfe,
0x5,0x2f,0xdb,0x52,0x42,0x2b,0x87,0x18,0xee,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,
0x44,0xae,0x42,0x60,0x82,
// /home/sxy/Github/opencv_cpp/start/opencv-3.4.1/modules/highgui/src/files_Qt/Milky/48/61.png
0x0,0x0,0xd,0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4,0xdc,
0xab,0x90,0x8c,0x63,0xe4,0x89,0x8f,0xd0,0xd0,0xd0,0x42,0xfa,0xc,0xf2,0x31,0x5b,
0xea,0xba,0xb1,0x30,0xbe,0x17,0x92,0xe9,0x41,0xa3,0xbf,0x1b,0x5b,0xba,0xef,0x43,
0x9,0x4d,0x98,0xc9,0xa8,0xe4,0xd,0x13,0x35,0x1e,0x11,0xf5,0xe4,0x1,0x86,0xcd,
0xe7,0x16,0x71,0x7d,0x57,0x4d,0x59,0x45,0xf4,0x7c,0x4,0x33,0x49,0x5,0x6f,0x7e,
0x1c,0xc7,0xe4,0x42,0x1,0xd5,0xf0,0xb3,0x77,0x54,0xf7,0x0,0x23,0x50,0xce,0x22,
0x42,0x59,0xcf,0x22,0x6f,0x56,0x3c,0x58,0x1,0x9b,0x5e,0x78,0xb,0x89,0x85,0x27,
0x10,0x6d,0x51,0xe1,0xf,0xfa,0xe1,0xa,0x19,0x98,0xcf,0xe,0x43,0x2c,0x88,0xfc,
0xf9,0xc9,0xd4,0x9,0x78,0xdc,0x3e,0xb4,0xd4,0x76,0x43,0xa8,0xcd,0xe2,0xed,0xd1,
0x27,0x28,0x31,0x78,0xd1,0xde,0xfc,0x43,0x28,0x7a,0x0,0xc3,0x4b,0x6,0x72,0x24,
0x29,0x93,0x52,0x6c,0x90,0xa4,0x58,0xce,0x40,0x2a,0x79,0x88,0x81,0x66,0x1e,0x50,
0x4a,0x3a,0xca,0x21,0x72,0xae,0xa1,0x1d,0x2,0xe7,0xde,0xe0,0x4,0xec,0x4,0xc2,
0x5a,0x39,0x43,0x30,0x77,0x97,0x83,0x73,0xe2,0xd4,0x4f,0xe0,0x9,0x1d,0x44,0x64,
0x95,0x17,0x2a,0xbd,0x24,0x93,0x2e,0x41,0xb0,0x33,0x90,0xae,0x59,0xf3,0x81,0x48,
0x24,0x4d,0x23,0x4f,0x12,0x38,0x41,0x92,0x18,0x44,0x24,0xd0,0x8c,0x2d,0x1b,0x76,
0x61,0x68,0xf8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,0x53,0xa9,0x14,0x4e,0x9f,0x3e,0xcd,0x26,0x8d,0xcb,0xe,0x7c,0xd5,0x5f,
0x29,0xb7,0x6e,0xdd,0xba,0x89,0x40,0xbe,0x4d,0xdf,0x73,0x12,0x14,0x30,0xdc,0xf2,
0x44,0x60,0x7,0xe9,0xf0,0xb2,0x2,0x5f,0xf5,0x87,0x6e,0xca,0xaf,0xfd,0x44,0x68,
0x87,0xae,0xeb,0xa3,0x4c,0x42,0xec,0x97,0x57,0x8a,0x8d,0xcb,0x12,0xbc,0xe3,0x81,
0xcf,0xfe,0xd5,0xe0,0x33,0x2,0xff,0xc7,0x4,0xfe,0x21,0xc0,0x0,0xa2,0x78,0x21,
0xcb,0xf,0x38,0xb4,0x70,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,
0x82,
// /home/sxy/Github/opencv_cpp/start/opencv-3.4.1/modules/highgui/src/files_Qt/stylesheet_trackbar.qss
0x0,0x0,0x4,0xad,
0x2f,
0x2a,0x20,0x2f,0x2f,0x66,0x72,0x6f,0x6d,0x20,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,
0x74,0x68,0x65,0x73,0x6d,0x69,0x74,0x68,0x66,0x61,0x6d,0x2e,0x6f,0x72,0x67,0x2f,
0x62,0x6c,0x6f,0x67,0x2f,0x32,0x30,0x31,0x30,0x2f,0x30,0x33,0x2f,0x31,0x30,0x2f,
0x66,0x61,0x6e,0x63,0x79,0x2d,0x71,0x73,0x6c,0x69,0x64,0x65,0x72,0x2d,0x73,0x74,
0x79,0x6c,0x65,0x73,0x68,0x65,0x65,0x74,0x2f,0x20,0x2a,0x2f,0xa,0xa,0x51,0x53,
0x6c,0x69,0x64,0x65,0x72,0x3a,0x3a,0x67,0x72,0x6f,0x6f,0x76,0x65,0x3a,0x68,0x6f,
0x72,0x69,0x7a,0x6f,0x6e,0x74,0x61,0x6c,0x20,0x7b,0xa,0x62,0x6f,0x72,0x64,0x65,
0x72,0x3a,0x20,0x31,0x70,0x78,0x20,0x73,0x6f,0x6c,0x69,0x64,0x20,0x23,0x62,0x62,
0x62,0x3b,0xa,0x62,0x61,0x63,0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,0x3a,0x20,0x77,
0x68,0x69,0x74,0x65,0x3b,0xa,0x68,0x65,0x69,0x67,0x68,0x74,0x3a,0x20,0x31,0x30,
0x70,0x78,0x3b,0xa,0x62,0x6f,0x72,0x64,0x65,0x72,0x2d,0x72,0x61,0x64,0x69,0x75,
0x73,0x3a,0x20,0x34,0x70,0x78,0x3b,0xa,0x7d,0xa,0xa,0x51,0x53,0x6c,0x69,0x64,
0x65,0x72,0x3a,0x3a,0x73,0x75,0x62,0x2d,0x70,0x61,0x67,0x65,0x3a,0x68,0x6f,0x72,
0x69,0x7a,0x6f,0x6e,0x74,0x61,0x6c,0x20,0x7b,0xa,0x62,0x61,0x63,0x6b,0x67,0x72,
0x6f,0x75,0x6e,0x64,0x3a,0x20,0x71,0x6c,0x69,0x6e,0x65,0x61,0x72,0x67,0x72,0x61,
0x64,0x69,0x65,0x6e,0x74,0x28,0x78,0x31,0x3a,0x20,0x30,0x2c,0x20,0x79,0x31,0x3a,
0x20,0x30,0x2c,0x20,0x20,0x20,0x20,0x78,0x32,0x3a,0x20,0x30,0x2c,0x20,0x79,0x32,
0x3a,0x20,0x31,0x2c,0xa,0x73,0x74,0x6f,0x70,0x3a,0x20,0x30,0x20,0x23,0x36,0x36,
0x65,0x2c,0x20,0x73,0x74,0x6f,0x70,0x3a,0x20,0x31,0x20,0x23,0x62,0x62,0x66,0x29,
0x3b,0xa,0x62,0x61,0x63,0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,0x3a,0x20,0x71,0x6c,
0x69,0x6e,0x65,0x61,0x72,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x28,0x78,0x31,
0x3a,0x20,0x30,0x2c,0x20,0x79,0x31,0x3a,0x20,0x30,0x2e,0x32,0x2c,0x20,0x78,0x32,
0x3a,0x20,0x31,0x2c,0x20,0x79,0x32,0x3a,0x20,0x31,0x2c,0xa,0x73,0x74,0x6f,0x70,
0x3a,0x20,0x30,0x20,0x23,0x62,0x62,0x66,0x2c,0x20,0x73,0x74,0x6f,0x70,0x3a,0x20,
0x31,0x20,0x23,0x35,0x35,0x66,0x29,0x3b,0xa,0x62,0x6f,0x72,0x64,0x65,0x72,0x3a,
0x20,0x31,0x70,0x78,0x20,0x73,0x6f,0x6c,0x69,0x64,0x20,0x23,0x37,0x37,0x37,0x3b,
0xa,0x68,0x65,0x69,0x67,0x68,0x74,0x3a,0x20,0x31,0x30,0x70,0x78,0x3b,0xa,0x62,
0x6f,0x72,0x64,0x65,0x72,0x2d,0x72,0x61,0x64,0x69,0x75,0x73,0x3a,0x20,0x34,0x70,
0x78,0x3b,0xa,0x7d,0xa,0xa,0x51,0x53,0x6c,0x69,0x64,0x65,0x72,0x3a,0x3a,0x61,
0x64,0x64,0x2d,0x70,0x61,0x67,0x65,0x3a,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x74,
0x61,0x6c,0x20,0x7b,0xa,0x62,0x61,0x63,0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,0x3a,
0x20,0x23,0x66,0x66,0x66,0x3b,0xa,0x62,0x6f,0x72,0x64,0x65,0x72,0x3a,0x20,0x31,
0x70,0x78,0x20,0x73,0x6f,0x6c,0x69,0x64,0x20,0x23,0x37,0x37,0x37,0x3b,0xa,0x68,
0x65,0x69,0x67,0x68,0x74,0x3a,0x20,0x31,0x30,0x70,0x78,0x3b,0xa,0x62,0x6f,0x72,
0x64,0x65,0x72,0x2d,0x72,0x61,0x64,0x69,0x75,0x73,0x3a,0x20,0x34,0x70,0x78,0x3b,
0xa,0x7d,0xa,0xa,0x51,0x53,0x6c,0x69,0x64,0x65,0x72,0x3a,0x3a,0x68,0x61,0x6e,
0x64,0x6c,0x65,0x3a,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x74,0x61,0x6c,0x20,0x7b,
0xa,0x62,0x61,0x63,0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,0x3a,0x20,0x71,0x6c,0x69,
0x6e,0x65,0x61,0x72,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x28,0x78,0x31,0x3a,
0x30,0x2c,0x20,0x79,0x31,0x3a,0x30,0x2c,0x20,0x78,0x32,0x3a,0x31,0x2c,0x20,0x79,
0x32,0x3a,0x31,0x2c,0xa,0x73,0x74,0x6f,0x70,0x3a,0x30,0x20,0x23,0x65,0x65,0x65,
0x2c,0x20,0x73,0x74,0x6f,0x70,0x3a,0x31,0x20,0x23,0x63,0x63,0x63,0x29,0x3b,0xa,
0x62,0x6f,0x72,0x64,0x65,0x72,0x3a,0x20,0x31,0x70,0x78,0x20,0x73,0x6f,0x6c,0x69,
0x64,0x20,0x23,0x37,0x37,0x37,0x3b,0xa,0x77,0x69,0x64,0x74,0x68,0x3a,0x20,0x31,
0x33,0x70,0x78,0x3b,0xa,0x6d,0x61,0x72,0x67,0x69,0x6e,0x2d,0x74,0x6f,0x70,0x3a,
0x20,0x2d,0x32,0x70,0x78,0x3b,0xa,0x6d,0x61,0x72,0x67,0x69,0x6e,0x2d,0x62,0x6f,
0x74,0x74,0x6f,0x6d,0x3a,0x20,0x2d,0x32,0x70,0x78,0x3b,0xa,0x62,0x6f,0x72,0x64,
0x65,0x72,0x2d,0x72,0x61,0x64,0x69,0x75,0x73,0x3a,0x20,0x34,0x70,0x78,0x3b,0xa,
0x7d,0xa,0xa,0x51,0x53,0x6c,0x69,0x64,0x65,0x72,0x3a,0x3a,0x68,0x61,0x6e,0x64,
0x6c,0x65,0x3a,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x74,0x61,0x6c,0x3a,0x68,0x6f,
0x76,0x65,0x72,0x20,0x7b,0xa,0x62,0x61,0x63,0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,
0x3a,0x20,0x71,0x6c,0x69,0x6e,0x65,0x61,0x72,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,
0x74,0x28,0x78,0x31,0x3a,0x30,0x2c,0x20,0x79,0x31,0x3a,0x30,0x2c,0x20,0x78,0x32,
0x3a,0x31,0x2c,0x20,0x79,0x32,0x3a,0x31,0x2c,0xa,0x73,0x74,0x6f,0x70,0x3a,0x30,
0x20,0x23,0x66,0x66,0x66,0x2c,0x20,0x73,0x74,0x6f,0x70,0x3a,0x31,0x20,0x23,0x64,
0x64,0x64,0x29,0x3b,0xa,0x62,0x6f,0x72,0x64,0x65,0x72,0x3a,0x20,0x31,0x70,0x78,
0x20,0x73,0x6f,0x6c,0x69,0x64,0x20,0x23,0x34,0x34,0x34,0x3b,0xa,0x62,0x6f,0x72,
0x64,0x65,0x72,0x2d,0x72,0x61,0x64,0x69,0x75,0x73,0x3a,0x20,0x34,0x70,0x78,0x3b,
0xa,0x7d,0xa,0xa,0x51,0x53,0x6c,0x69,0x64,0x65,0x72,0x3a,0x3a,0x73,0x75,0x62,
0x2d,0x70,0x61,0x67,0x65,0x3a,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x74,0x61,0x6c,
0x3a,0x64,0x69,0x73,0x61,0x62,0x6c,0x65,0x64,0x20,0x7b,0xa,0x62,0x61,0x63,0x6b,
0x67,0x72,0x6f,0x75,0x6e,0x64,0x3a,0x20,0x23,0x62,0x62,0x62,0x3b,0xa,0x62,0x6f,
0x72,0x64,0x65,0x72,0x2d,0x63,0x6f,0x6c,0x6f,0x72,0x3a,0x20,0x23,0x39,0x39,0x39,
0x3b,0xa,0x7d,0xa,0xa,0x51,0x53,0x6c,0x69,0x64,0x65,0x72,0x3a,0x3a,0x61,0x64,
0x64,0x2d,0x70,0x61,0x67,0x65,0x3a,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x74,0x61,
0x6c,0x3a,0x64,0x69,0x73,0x61,0x62,0x6c,0x65,0x64,0x20,0x7b,0xa,0x62,0x61,0x63,
0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,0x3a,0x20,0x23,0x65,0x65,0x65,0x3b,0xa,0x62,
0x6f,0x72,0x64,0x65,0x72,0x2d,0x63,0x6f,0x6c,0x6f,0x72,0x3a,0x20,0x23,0x39,0x39,
0x39,0x3b,0xa,0x7d,0xa,0xa,0x51,0x53,0x6c,0x69,0x64,0x65,0x72,0x3a,0x3a,0x68,
0x61,0x6e,0x64,0x6c,0x65,0x3a,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x74,0x61,0x6c,
0x3a,0x64,0x69,0x73,0x61,0x62,0x6c,0x65,0x64,0x20,0x7b,0xa,0x62,0x61,0x63,0x6b,
0x67,0x72,0x6f,0x75,0x6e,0x64,0x3a,0x20,0x23,0x65,0x65,0x65,0x3b,0xa,0x62,0x6f,
0x72,0x64,0x65,0x72,0x3a,0x20,0x31,0x70,0x78,0x20,0x73,0x6f,0x6c,0x69,0x64,0x20,
0x23,0x61,0x61,0x61,0x3b,0xa,0x62,0x6f,0x72,0x64,0x65,0x72,0x2d,0x72,0x61,0x64,
0x69,0x75,0x73,0x3a,0x20,0x34,0x70,0x78,0x3b,0xa,0x7d,0xa,
// /home/sxy/Github/opencv_cpp/start/opencv-3.4.1/modules/highgui/src/files_Qt/Milky/48/24.png
0x0,0x0,0x6,0x53,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x0,0x0,0x30,0x0,0x0,0x0,0x30,0x8,0x6,0x0,0x0,0x0,0x57,0x2,0xf9,0x87,
0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a,0x25,0x0,0x0,0x80,0x83,
0x0,0x0,0xf9,0xff,0x0,0x0,0x80,0xe9,0x0,0x0,0x75,0x30,0x0,0x0,0xea,0x60,
0x0,0x0,0x3a,0x98,0x0,0x0,0x17,0x6f,0x92,0x5f,0xc5,0x46,0x0,0x0,0x0,0x9,
0x70,0x48,0x59,0x73,0x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xfa,0xf6,0x4,0x85,0xa,0xdb,0x63,0xec,0xed,0x6f,0x7d,0xa6,0x9c,0x1e,0x7f,0x45,
0x7c,0x36,0x41,0xec,0x1b,0xb7,0x3e,0x55,0x36,0xa0,0x42,0xd7,0xd5,0x5e,0xbf,0x5,
0xf,0x69,0xa9,0xd1,0x31,0x18,0xf8,0x68,0x3c,0x18,0x52,0x25,0x33,0x1a,0x53,0x33,
0x60,0x8f,0x27,0x5e,0x4d,0x6f,0x42,0x8d,0x58,0xc5,0x58,0xc0,0xe6,0xcf,0x1b,0xc0,
0xe8,0xf5,0x2c,0x30,0x74,0xb8,0xf,0x7d,0x3d,0xe7,0x95,0x9f,0x3e,0xd7,0x6e,0x4f,
0xf2,0x8c,0x23,0x61,0xc0,0x63,0x69,0xd,0xda,0x5f,0x48,0xaf,0x9,0xd3,0xd3,0x8e,
0xe7,0xe1,0x27,0xb,0xd5,0x1b,0x3c,0xf,0x85,0x8a,0x55,0x27,0x35,0xfe,0xc8,0x19,
0xc0,0xf1,0xf8,0x2b,0xa9,0x93,0x70,0x7b,0x23,0xbf,0x90,0x2d,0xdb,0xb,0xc0,0xe8,
0x7d,0xc,0x70,0xa6,0xb3,0xda,0xcf,0x5f,0x18,0x1b,0x53,0xf9,0xe8,0x28,0x82,0x78,
0x0,0xc4,0xcb,0xc9,0x12,0xcc,0xb9,0xe,0x4c,0xd4,0x70,0x2a,0x5d,0x63,0x3b,0x70,
0x3c,0xf7,0xcb,0x97,0x6c,0x77,0x6a,0x92,0xa3,0x0,0xb8,0xdb,0xc6,0xff,0xb3,0xb5,
0xca,0x85,0xbf,0x5a,0xb1,0x7c,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,
0x60,0x82,
// /home/sxy/Github/opencv_cpp/start/opencv-3.4.1/modules/highgui/src/files_Qt/Milky/48/7.png
0x0,0x0,0x7,0xf4,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x0,0x0,0x30,0x0,0x0,0x0,0x30,0x8,0x6,0x0,0x0,0x0,0x57,0x2,0xf9,0x87,
0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a,0x25,0x0,0x0,0x80,0x83,
0x0,0x0,0xf9,0xff,0x0,0x0,0x80,0xe9,0x0,0x0,0x75,0x30,0x0,0x0,0xea,0x60,
0x0,0x0,0x3a,0x98,0x0,0x0,0x17,0x6f,0x92,0x5f,0xc5,0x46,0x0,0x0,0x0,0x9,
0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,
0x18,0x0,0x0,0x7,0x7a,0x49,0x44,0x41,0x54,0x68,0xde,0xed,0x5a,0x5b,0x6c,0x54,
0x45,0x18,0xfe,0xcf,0xd9,0x7b,0xbb,0xbd,0x21,0xb7,0x52,0xa,0xc5,0x14,0xa,0x44,
0x4b,0x93,0x6a,0x0,0x31,0x52,0x34,0x1,0x94,0x80,0x35,0x81,0x68,0x34,0x82,0xc6,
0x80,0xc4,0x97,0xf2,0x60,0xf4,0xc1,0x18,0xaa,0x49,0x13,0x13,0x1f,0x84,0x98,0x78,
0x7d,0x10,0xbc,0x90,0x98,0x40,0xac,0x21,0x6a,0xd0,0x28,0x60,0x4c,0x8,0x1,0xb9,
0xc4,0x88,0x58,0x5d,0x2c,0x65,0x5b,0xae,0xed,0xf6,0xbe,0xed,0xee,0x9e,0x19,0x67,
0x66,0xcf,0x9c,0x33,0xe7,0xba,0xb3,0x18,0x43,0x48,0x98,0x30,0x3d,0x97,0x9e,0x33,
0xf3,0x7d,0xf3,0x7f,0xff,0xe5,0x4c,0x51,0x30,0xc6,0x70,0x3b,0x37,0x15,0x6e,0xf3,
0x76,0x87,0xc0,0xad,0x6e,0x41,0xf1,0x42,0x51,0x14,0xc7,0x3,0xdb,0x3e,0x9c,0x3b,
0x17,0x14,0x68,0x55,0x55,0xa5,0x55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c1,0x12,0x75,0xc4,0x84,0x49,0xf,
0xb4,0x68,0x94,0x20,0x20,0x38,0xa8,0x95,0x87,0x65,0x30,0xe3,0xe5,0x50,0x0,0x4a,
0xab,0xa2,0x90,0x1c,0x3d,0x2b,0xfc,0xce,0xf6,0x9c,0x8b,0x1c,0xe8,0x8f,0x68,0x3c,
0x6c,0x6,0x4,0x41,0x3a,0xe2,0x38,0x7c,0xf5,0xe9,0xf,0x39,0x2,0x42,0x1d,0x82,
0x1d,0x89,0xc,0x8c,0x6a,0x14,0xc4,0x55,0x72,0x1,0xec,0x45,0xc0,0x5e,0x8a,0x58,
0xe6,0x70,0x93,0x8e,0xf8,0xfd,0x20,0x4b,0x0,0x21,0x7b,0xe6,0x72,0x82,0xb5,0x58,
0xc7,0x7,0xb0,0x98,0x33,0xec,0x99,0x15,0x3c,0xc0,0x5a,0xde,0xc1,0xe6,0x64,0x5e,
0xc9,0xd3,0xc3,0x89,0xb1,0x6d,0xe5,0xbd,0x73,0x82,0x58,0x62,0x18,0x56,0xc2,0x56,
0x49,0xba,0x96,0xe0,0xd8,0x19,0xdd,0x44,0xc0,0xd8,0xee,0x13,0x52,0x51,0x48,0x28,
0x9f,0xdd,0x32,0xb0,0x1d,0xac,0x23,0xc4,0xa,0x5a,0xa6,0x51,0x85,0x67,0x54,0xa7,
0x2b,0x61,0xd7,0x12,0xc5,0x61,0x49,0x4b,0x22,0x93,0xb0,0x0,0x4f,0x1a,0x16,0xa0,
0x85,0xc0,0xa,0xf7,0x18,0x68,0xb2,0x52,0x62,0x28,0xc6,0xce,0x70,0xe6,0xbd,0x30,
0x36,0x9,0x89,0x96,0x40,0x8,0xc9,0x3b,0xb1,0xdd,0xb4,0x5e,0x32,0xc2,0x5a,0x7e,
0x60,0xac,0x79,0x14,0x78,0x36,0x73,0x15,0xa,0xc,0x7e,0x96,0x90,0xb2,0x80,0x9,
0xc4,0x4a,0x80,0x7c,0x23,0x1b,0x35,0xc,0x53,0x98,0xe6,0xbd,0x22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0x6,0x83,
0xa4,0x1f,0xf1,0x25,0x70,0xf4,0x53,0x18,0x5a,0xb9,0x19,0x68,0x4a,0x7c,0xce,0xb,
0x3f,0x9f,0x74,0x64,0x64,0x4,0x86,0x87,0x87,0x8b,0x8a,0x42,0x6e,0x4,0xca,0xca,
0xca,0x58,0x97,0x68,0xbb,0x28,0x3e,0xd8,0xb,0x5,0xff,0x42,0xb3,0x83,0xf4,0x56,
0xd2,0x2b,0x9d,0xf8,0xcd,0x30,0x1a,0xe,0x87,0xd9,0xc4,0xb2,0xba,0xf7,0x22,0x41,
0xc7,0x91,0x48,0x86,0x54,0xda,0xbb,0xa4,0x9c,0x58,0xb7,0x42,0x8b,0x6e,0xae,0x4a,
0x57,0x7f,0x20,0x93,0xd1,0x89,0x69,0x28,0xfd,0x2f,0xe0,0x25,0x65,0x47,0xa5,0xd3,
0xca,0x56,0x5f,0xf6,0xef,0xc4,0xe4,0x61,0xba,0x4f,0xd2,0x62,0x77,0x6a,0x6e,0x1,
0x31,0x8e,0xbb,0xd5,0x3c,0x7e,0xf5,0x91,0x5b,0xf9,0x81,0xb1,0x67,0x4,0xa2,0x4e,
0xdb,0xa2,0xe3,0x91,0xb,0xa3,0x36,0x12,0xf3,0x88,0x35,0xb6,0xe8,0xb2,0x6a,0xba,
0x91,0xea,0xeb,0xe6,0xa4,0x6e,0xc6,0x91,0xfd,0x22,0x51,0xff,0x60,0x6f,0x1d,0x39,
0xd4,0x9,0xc0,0xa9,0xe6,0xf7,0x4a,0x99,0x54,0xb6,0x20,0xfb,0x3f,0x1b,0x59,0xa8,
0xa,0xd2,0x57,0x16,0x83,0x97,0xf9,0xe3,0x9d,0xff,0xad,0x72,0x8b,0xdb,0xbf,0x38,
0x86,0xe7,0x24,0x54,0x18,0xe9,0xb3,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,
0x42,0x60,0x82,
// /home/sxy/Github/opencv_cpp/start/opencv-3.4.1/modules/highgui/src/files_Qt/Milky/48/38.png
0x0,0x0,0xb,0xf6,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x0,0x0,0x30,0x0,0x0,0x0,0x30,0x8,0x6,0x0,0x0,0x0,0x57,0x2,0xf9,0x87,
0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a,0x25,0x0,0x0,0x80,0x83,
0x0,0x0,0xf9,0xff,0x0,0x0,0x80,0xe9,0x0,0x0,0x75,0x30,0x0,0x0,0xea,0x60,
0x0,0x0,0x3a,0x98,0x0,0x0,0x17,0x6f,0x92,0x5f,0xc5,0x46,0x0,0x0,0x0,0x9,
0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,
0x18,0x0,0x0,0xb,0x7c,0x49,0x44,0x41,0x54,0x68,0xde,0xd5,0x98,0x67,0x50,0x95,
0x77,0x16,0xc6,0xfd,0xb0,0x51,0x23,0x2,0x57,0x14,0xec,0x8a,0x85,0xa6,0x94,0x4b,
0x17,0x15,0x54,0x2c,0x48,0x9,0xa1,0x89,0xa0,0x94,0x4b,0x13,0xd1,0xa8,0x17,0xb,
0x1d,0xc4,0x46,0x11,0x15,0x35,0x91,0x58,0x73,0x2d,0x31,0xb1,0x13,0x2b,0x6e,0xc4,
0x80,0x51,0x51,0x31,0x88,0xc6,0x64,0xd7,0xe0,0x26,0x24,0x31,0x3b,0xfb,0x91,0xc9,
0xcc,0xe6,0x53,0x66,0xf2,0xec,0x79,0xfe,0x17,0x98,0xcc,0x6e,0xb2,0x31,0x88,0x81,
0xbc,0x33,0xff,0xb9,0x17,0xef,0x2b,0x9c,0xdf,0x39,0xcf,0x73,0xce,0x79,0x6f,0x1f,
0x0,0x7d,0xfe,0xcc,0xa7,0xd7,0x5e,0xa1,0x79,0x96,0xd6,0x61,0x85,0x56,0x86,0xa8,
0x8d,0x23,0x5a,0x63,0x4b,0xc6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,0x73,0xc2,0x11,0x8c,0x15,0x22,0x8,0xab,0x52,0x94,0x1a,
0x85,0x86,0x86,0x86,0xce,0xe0,0xcf,0x55,0x9f,0xc7,0xf1,0xf7,0xde,0xc7,0xa5,0xcb,
0x57,0x70,0xeb,0x76,0x83,0x18,0xbd,0xb6,0xf9,0xf7,0x28,0xe2,0x17,0x1,0xe,0x2c,
0x18,0xa7,0xdb,0x17,0x69,0x5d,0x77,0x30,0x7a,0x1c,0x4e,0x25,0xd9,0xe2,0x72,0xc6,
0x24,0x54,0xa7,0xda,0xe3,0x9d,0x98,0xf1,0x12,0xdc,0x58,0x95,0x79,0x6,0x7a,0x38,
0x76,0x2,0x8e,0xc7,0xdb,0xe0,0xd8,0xe2,0x89,0xea,0x1c,0x59,0x34,0x41,0x41,0xec,
0xc,0x19,0xd,0x56,0x6a,0x5b,0xd0,0x48,0x10,0x5e,0x55,0x48,0xe,0xe5,0x56,0x3a,
0x6f,0x38,0x56,0x45,0xcd,0xc1,0xae,0x9d,0xbb,0x70,0xea,0xf4,0x99,0xce,0xe0,0xef,
0xde,0x6b,0xc4,0x17,0x2d,0x4f,0x9b,0x5b,0xbf,0xfe,0x46,0xd3,0x25,0x0,0x9,0xc0,
0x5a,0x2,0xd0,0x1f,0x89,0x9d,0xd0,0xfa,0x9e,0x4,0x75,0x69,0xe9,0x24,0xd4,0x67,
0x3a,0xe3,0xea,0xf2,0xc9,0x2a,0xf3,0x87,0x4,0x86,0x87,0x81,0x9e,0x13,0x18,0x75,
0x52,0xec,0x15,0x18,0x5f,0x8f,0xc7,0x4f,0xc4,0x3e,0xa9,0x2,0xab,0x41,0x38,0x49,
0x80,0x82,0xa5,0x8c,0x18,0x34,0x2b,0x45,0x18,0x56,0x25,0xd9,0x69,0x10,0x22,0x1d,
0x47,0x60,0x69,0x64,0x20,0x4a,0x4b,0x4a,0x71,0x59,0x0,0xba,0x12,0x7c,0x27,0xc0,
0xfb,0x9,0x36,0x61,0xc,0xe0,0x74,0x92,0x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xd7,0x1,0xb4,0x4f,0x6c,0x6b,0x31,0x77,0x73,0xad,0xc8,
0x89,0xeb,0xc4,0x4d,0x31,0xf8,0x3d,0xd9,0x4c,0x99,0x7d,0xae,0x13,0x84,0x38,0xb2,
0x68,0x42,0x6b,0x9f,0x97,0x70,0x75,0xdb,0x97,0xbb,0xa2,0x77,0x8d,0x2c,0x81,0xca,
0x17,0x7c,0x32,0xbb,0xb6,0xc2,0x49,0x2d,0x75,0x5c,0x2d,0xb8,0x99,0x8a,0x84,0x2a,
0x7b,0x35,0x40,0xe7,0x26,0xbb,0x74,0x92,0x4e,0x96,0xc0,0x36,0x66,0x5f,0x3d,0x57,
0xeb,0x9d,0x8c,0x5f,0xcd,0xc4,0xdb,0xe8,0xfe,0x14,0x0,0xbc,0xc4,0xd8,0x5a,0xa9,
0x44,0x33,0x1f,0x64,0xf8,0x65,0x1,0x2b,0x70,0x22,0xc1,0xc6,0xfa,0x4f,0x3,0xd0,
0x71,0x49,0xe0,0x3a,0x31,0x70,0xdd,0x99,0x64,0xbb,0xe2,0x97,0xf5,0x37,0x8,0xf0,
0x1f,0x25,0x5d,0x1c,0x30,0x6c,0xcb,0x33,0x9c,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,
0x44,0xae,0x42,0x60,0x82,
// /home/sxy/Github/opencv_cpp/start/opencv-3.4.1/modules/highgui/src/files_Qt/Milky/48/106.png
0x0,0x0,0xb,0x25,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x0,0x0,0x30,0x0,0x0,0x0,0x30,0x8,0x6,0x0,0x0,0x0,0x57,0x2,0xf9,0x87,
0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65,
0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64,
0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0xa,0xc7,0x49,0x44,0x41,0x54,0x78,0xda,0xd4,
0x5a,0x9,0x6c,0x5c,0xd5,0x15,0x3d,0x7f,0xfe,0xec,0x1e,0x6f,0xf1,0xee,0x78,0x19,
0xe3,0xe0,0xa4,0x9,0x4e,0xec,0x34,0x40,0x52,0x14,0xb0,0xb,0xb4,0x42,0x84,0x26,
0x48,0xa5,0x2a,0x2,0x95,0x81,0x42,0x69,0x42,0x5b,0x92,0xaa,0x91,0xaa,0x22,0x68,
0x4b,0xab,0x4a,0x55,0x23,0xc5,0x54,0x65,0xeb,0x82,0x9d,0x50,0x94,0xb6,0x40,0x65,
0xd2,0x82,0x54,0x96,0x84,0xa0,0x96,0x82,0xe3,0x90,0xc9,0x42,0xec,0x78,0x8b,0xb7,
0x19,0xbc,0x8e,0xbf,0xed,0xd9,0x67,0xfe,0x4c,0xef,0x7d,0xb3,0x64,0xbc,0xb0,0x75,
0xc,0x49,0xbe,0xf2,0xf4,0xe6,0xcf,0xff,0xf3,0xde,0x39,0xf7,0x9d,0xbb,0xbc,0xe7,
0x48,0xd1,0x68,0x14,0x97,0xf2,0xa5,0xc1,0x25,0x7e,0x69,0x53,0x6f,0x24,0x49,0x5a,
0xf2,0x9,0xb6,0xec,0x32,0x37,0x48,0xb2,0xd4,0xa0,0xd1,0x68,0xb2,0x35,0xb2,0x54,
0x27,0x69,0x24,0x68,0x64,0xd,0xa8,0xb7,0xd3,0xfd,0x34,0x7d,0xff,0xe6,0x81,0x87,
0xc6,0xdf,0xfc,0x34,0x63,0xa6,0xaa,0x46,0x9a,0x73,0xb3,0x44,0x4,0xbe,0xba,0x5d,
0xcf,0xa0,0xef,0xca,0xcc,0xcd,0xda,0x56,0x54,0x5a,0x9c,0x53,0x54,0x5c,0x86,0xdc,
0xec,0x2,0x18,0xc,0x46,0x68,0x34,0x32,0xf4,0x5a,0x13,0x32,0xd,0x79,0xf0,0x7,
0xfc,0x18,0x1d,0x1f,0x44,0xbf,0xe3,0x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92,0x6a,0xa4,0x76,0xc1,0xc0,0x7f,
0x6c,0x18,0xa5,0x64,0x25,0x48,0xb0,0xf6,0xb9,0xb1,0xa4,0xb8,0xd1,0x67,0x85,0xfa,
0x46,0xa,0x9f,0x17,0xd4,0xf2,0x1f,0xfb,0x7,0x8e,0xf6,0xf6,0xf6,0xbb,0x89,0x4c,
0x13,0xcb,0x89,0x1b,0xfb,0x3,0xb5,0x7e,0xfa,0x7c,0xc1,0xc1,0x7f,0xaa,0x72,0xba,
0xb6,0xb6,0xb6,0x8e,0x2c,0xde,0x40,0xad,0xbf,0xb7,0xb7,0xb7,0xf5,0x62,0x1,0xfd,
0xa1,0x12,0xba,0x14,0xaf,0x4b,0xfe,0x3f,0x7b,0x5c,0xf2,0x4,0xfe,0x27,0xc0,0x0,
0x8d,0xf1,0x12,0xbf,0xe7,0x10,0x37,0x3d,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,
0xae,0x42,0x60,0x82,
// /home/sxy/Github/opencv_cpp/start/opencv-3.4.1/modules/highgui/src/files_Qt/Milky/48/27.png
0x0,0x0,0xb,0xfb,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x0,0x0,0x30,0x0,0x0,0x0,0x30,0x8,0x6,0x0,0x0,0x0,0x57,0x2,0xf9,0x87,
0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a,0x25,0x0,0x0,0x80,0x83,
0x0,0x0,0xf9,0xff,0x0,0x0,0x80,0xe9,0x0,0x0,0x75,0x30,0x0,0x0,0xea,0x60,
0x0,0x0,0x3a,0x98,0x0,0x0,0x17,0x6f,0x92,0x5f,0xc5,0x46,0x0,0x0,0x0,0x9,
0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,
0x18,0x0,0x0,0xb,0x81,0x49,0x44,0x41,0x54,0x68,0xde,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,0xff,0xe5,0x63,0xfc,0x3e,0x75,0xdc,0xe8,0xa1,0xfa,0xa0,0x15,0x3,
0x5a,0x5f,0xc,0xfe,0xf,0x45,0x2a,0xd0,0x69,0x31,0xef,0x7,0x2d,0x27,0x4e,0xb8,
0xbf,0x5f,0xb0,0x9f,0x29,0xf,0x66,0x25,0x83,0x41,0x12,0xb6,0x7e,0xca,0x70,0x90,
0xb0,0x3e,0x48,0x78,0x7a,0xb3,0xc7,0xf9,0x8d,0x1e,0x5b,0xc3,0x84,0x53,0xc3,0xa4,
0x96,0xd0,0xde,0xd2,0x73,0x7b,0x92,0xf3,0xc9,0xb4,0xa4,0x50,0x63,0x98,0xa,0xeb,
0xa9,0x63,0x73,0xe8,0xea,0x77,0xa9,0xc2,0xdd,0x49,0xce,0xf7,0xde,0x7f,0xc4,0xe3,
0x79,0xc1,0x46,0x48,0xf1,0x87,0x19,0xf0,0x1e,0xf5,0x35,0x0,0xd0,0x78,0x42,0xcc,
0x10,0x73,0x60,0xe1,0x61,0xbe,0x2,0x20,0x42,0x28,0xc4,0x82,0x73,0xd4,0xb2,0x4a,
0x9c,0x90,0xb8,0x90,0x95,0x46,0x3d,0xc7,0xf6,0x38,0xa5,0x9f,0x8,0xcb,0x52,0x61,
0x1,0x59,0xa9,0xc,0x53,0x47,0xa9,0xc6,0x7e,0xe6,0x31,0x60,0xdc,0x77,0x4c,0x96,
0x9e,0x7b,0x7,0x25,0x37,0x33,0x4f,0x96,0x95,0x2c,0xb3,0x92,0x2c,0xf3,0x2c,0xb3,
0x92,0x65,0xdc,0xbb,0x98,0xc1,0x6a,0x0,0xde,0xd7,0x45,0x4e,0x55,0xf1,0xde,0xb7,
0x18,0x28,0x7d,0x64,0x40,0x6a,0x19,0x55,0x12,0x8a,0xa9,0xbf,0x1,0x21,0x52,0x3,
0x91,0x56,0xca,0x74,0x12,0xb2,0xce,0x30,0x75,0xc,0x13,0xc7,0x20,0x15,0x7a,0x71,
0xca,0x31,0x48,0x84,0x13,0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88,0x60,0x2e,0x18,0x28,0xb1,0x78,0x58,0xe5,0xfd,0x68,0xb8,0x20,
0x58,0x64,0x41,0x6a,0xc3,0xd,0xe2,0xf9,0x6a,0xbe,0x95,0xcf,0xb,0x54,0xab,0xc5,
0x7d,0x17,0x80,0x45,0xcf,0x57,0xce,0xac,0x18,0x0,0x5a,0x12,0x8a,0x0,0x54,0xad,
0x91,0x10,0xcd,0x6c,0x54,0xbd,0x36,0xc,0x98,0x75,0xc6,0x56,0x97,0xfe,0xca,0xeb,
0x1,0x50,0xf5,0x1c,0x62,0x6d,0xa9,0xc1,0x1,0x44,0x70,0xde,0x2b,0x45,0x56,0x86,
0x6,0x56,0x6d,0x30,0x4d,0xbd,0x9,0xd3,0xd7,0x50,0xa3,0x5a,0x0,0xaa,0xe,0x4d,
0xe9,0xad,0x89,0x81,0x10,0x14,0x47,0x4b,0xc8,0x7c,0x5c,0x7c,0x8b,0x61,0x4e,0x62,
0xa5,0x6e,0x18,0x69,0xbc,0x5f,0x19,0x6f,0xf5,0x2a,0xac,0x1,0xd3,0x95,0x92,0x9a,
0x52,0x66,0xbe,0x36,0xa8,0x6,0xb0,0xc2,0x42,0x1d,0x87,0xd6,0x95,0x90,0xc5,0xe9,
0x78,0xc3,0x80,0x1e,0x25,0xa1,0x98,0xc2,0x2a,0x9,0x45,0xe3,0x6b,0x20,0x15,0x23,
0x51,0x42,0x12,0x41,0xb0,0x2,0x86,0x3a,0xa0,0xa3,0xac,0x20,0x4,0x6b,0xdb,0xa3,
0x2d,0xc9,0x74,0x19,0x69,0x7,0x71,0x23,0x21,0x93,0x8e,0x84,0x82,0xf7,0x7d,0x4b,
0x42,0xed,0x4a,0x5c,0x4b,0xa8,0xf2,0x7c,0x1c,0x5b,0xcb,0x68,0x71,0x52,0x7,0x67,
0x3b,0xe,0x2a,0x30,0x46,0xb3,0x36,0xd6,0xc8,0xaa,0xb5,0xe6,0x36,0x76,0xc,0x0,
0x69,0x25,0x98,0xe,0x80,0x55,0x9,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xb,0xa7,0xb7,
0xc0,0x2e,0xc1,0x4a,0xca,0x5c,0x71,0xab,0xfc,0x54,0xc6,0x75,0xef,0xb0,0x95,0x6b,
0xb6,0xf2,0x64,0x43,0xae,0xfd,0xeb,0xad,0x87,0x93,0xe3,0x25,0x69,0xc8,0x67,0xff,
0x5b,0xe5,0x67,0xfc,0xfb,0x5f,0xeb,0x74,0x75,0xb6,0xee,0xd4,0x96,0xce,0x0,0x0,
0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
// /home/sxy/Github/opencv_cpp/start/opencv-3.4.1/modules/highgui/src/files_Qt/Milky/48/19.png
0x0,0x0,0x7,0xbe,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x0,0x0,0x30,0x0,0x0,0x0,0x30,0x8,0x6,0x0,0x0,0x0,0x57,0x2,0xf9,0x87,
0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a,0x25,0x0,0x0,0x80,0x83,
0x0,0x0,0xf9,0xff,0x0,0x0,0x80,0xe9,0x0,0x0,0x75,0x30,0x0,0x0,0xea,0x60,
0x0,0x0,0x3a,0x98,0x0,0x0,0x17,0x6f,0x92,0x5f,0xc5,0x46,0x0,0x0,0x0,0x9,
0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,
0x18,0x0,0x0,0x7,0x44,0x49,0x44,0x41,0x54,0x68,0xde,0xd5,0x59,0x6b,0x6c,0x54,
0x45,0x14,0x3e,0x77,0x77,0xdb,0x42,0x5b,0xba,0x2d,0xdb,0x17,0x2d,0xa5,0x4b,0xb,
0x95,0x87,0xd0,0xa5,0x11,0xad,0x1,0x43,0x9,0x22,0x98,0xa0,0x20,0xc6,0x7,0x46,
0xd3,0x95,0x7f,0xbe,0x8d,0x86,0x10,0x35,0x1a,0x88,0x6,0x31,0x86,0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,0x12,0x12,0x42,0xad,0xc,0x7a,0x67,0x99,0x96,0x3f,0x72,0x48,
0x9a,0x60,0x87,0xfc,0xac,0x3b,0xa1,0xbe,0xad,0xca,0x4f,0x16,0x4a,0xe7,0xa7,0x4f,
0x37,0x6,0x46,0x24,0xa1,0x97,0xbe,0x9a,0x51,0x91,0x6e,0xcf,0x73,0x27,0xc7,0x3b,
0xe0,0x9c,0xaf,0x4a,0x5,0xa2,0x62,0x56,0x5e,0xa8,0x86,0x82,0xa0,0xc2,0x10,0x74,
0xf,0xc,0xa9,0x32,0x63,0xf0,0x1b,0x9,0xa6,0x25,0x67,0xc1,0x14,0x47,0x21,0x34,
0xb4,0x9d,0xac,0x26,0xe5,0x48,0xd9,0x67,0xcf,0x34,0x6,0x22,0x92,0xd0,0x8b,0x5f,
0xce,0x28,0x27,0x5,0x97,0xdb,0x3e,0x31,0xb,0xea,0x9a,0x8e,0x3,0x8f,0x31,0x45,
0x3e,0x6c,0x8e,0xb8,0x35,0x64,0x39,0x70,0x49,0x48,0xe7,0x9a,0x6b,0x2c,0x4b,0xca,
0xd7,0x64,0xc9,0x28,0x89,0x48,0xbd,0xae,0x19,0x20,0x65,0x56,0xb8,0xda,0xdb,0x9,
0x97,0x7b,0x7c,0x90,0x3d,0xb9,0xc0,0x45,0xa5,0x1c,0x71,0x4f,0x4c,0x32,0xce,0xf6,
0xb4,0xe4,0x29,0x50,0xdb,0x70,0x9c,0x1,0x15,0x4,0xfe,0x52,0xee,0x5,0x5d,0x0,
0xd2,0x8b,0xf4,0x4b,0x41,0x23,0x9b,0x70,0xd7,0x54,0xb7,0x3,0xd6,0x2d,0x15,0x82,
0xce,0x11,0x58,0x13,0xd5,0xdd,0x81,0xe,0xb0,0x58,0xac,0x64,0xc5,0xce,0x75,0xbd,
0xe0,0x1,0x5a,0xbd,0xee,0x1c,0x96,0x80,0xcd,0x1a,0x9f,0x7a,0x63,0xf0,0x5f,0xc8,
0x72,0xe4,0x49,0xee,0x97,0x87,0x92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0xe6,0x60,0xd5,0x78,0x60,0x9,0xc0,0x48,0x88,0x9f,0x93,0xe6,
0x1e,0x68,0x33,0x14,0xcd,0xe6,0xa0,0xed,0xd6,0xf1,0x63,0x66,0x7d,0x89,0x0,0xd6,
0x0,0x94,0xb3,0x8a,0xd9,0x13,0xda,0x0,0x67,0xed,0x28,0xb9,0x97,0xb6,0x99,0x2c,
0xfd,0x8e,0x3d,0x1,0x20,0xe0,0x89,0x84,0x44,0x51,0x2,0xc0,0x30,0xb,0xdc,0xfa,
0x98,0x5b,0x9f,0xf9,0x24,0x44,0x66,0x92,0x9f,0x81,0x98,0x17,0xa3,0x71,0x41,0x94,
0x1e,0x8,0x6a,0x3c,0xc0,0xad,0x7e,0x13,0x4f,0x8,0x82,0x9a,0x42,0x75,0x1e,0x88,
0x85,0x84,0x28,0x12,0x51,0x94,0x82,0x58,0xdb,0x32,0xca,0xc0,0x25,0xb0,0xa1,0x8,
0xa9,0xbf,0x65,0x31,0xc0,0x8,0xc4,0xc2,0x3,0x48,0xe,0x62,0x49,0x42,0x2,0x5f,
0x7c,0xa5,0x15,0xce,0xc,0x5c,0x47,0x88,0x87,0x4,0xf3,0x40,0x6c,0x83,0x98,0x10,
0x10,0xb5,0x12,0x92,0x82,0x43,0x95,0x4a,0x18,0x42,0x3c,0x2e,0x30,0x21,0x4f,0xf7,
0x89,0x62,0x14,0x3,0x52,0x10,0xd3,0xa1,0x34,0x28,0x58,0xb3,0x14,0x68,0x4a,0x8,
0x1d,0x21,0x50,0xe3,0x42,0x59,0x7,0x10,0x8e,0x5d,0x1a,0x45,0x48,0xcd,0x42,0xa0,
0xb5,0xba,0x6c,0x55,0x7d,0x63,0xa0,0xcf,0x50,0xac,0xb9,0x41,0xb1,0xa,0x62,0x2c,
0x95,0xd4,0x4a,0x59,0xad,0xb7,0xba,0x89,0x90,0x29,0x2e,0xf8,0xbd,0x8,0xc7,0x2a,
0x88,0x35,0x2d,0x21,0xc2,0x8a,0xd5,0xcd,0xfa,0xf,0x41,0x88,0x7b,0x43,0xed,0xf,
0x62,0x24,0x21,0xac,0x69,0x5e,0x14,0x90,0xc3,0xea,0x1f,0xa4,0x8e,0x82,0x95,0x12,
0xe4,0x28,0x62,0xd6,0xbc,0xc4,0x86,0x0,0x6f,0xd2,0x15,0xb,0x6a,0xf5,0x6f,0xdc,
0xdd,0xd,0x21,0x23,0xd3,0xfd,0x63,0x9d,0x85,0x90,0x4e,0x42,0xfa,0x4e,0x4c,0xf,
0x1c,0x42,0x92,0x8a,0xad,0x84,0x90,0x7e,0x7b,0x45,0x5a,0xac,0xcc,0x95,0xa7,0x11,
0x38,0xe3,0xc6,0x49,0xa9,0x1e,0x88,0x59,0x16,0xc2,0x6c,0x35,0xa5,0x1,0xad,0xd4,
0x41,0x4a,0xea,0xe4,0xdd,0x73,0x38,0x6f,0xc8,0x46,0x10,0x71,0xec,0xaa,0x51,0x39,
0x8,0xf5,0xe5,0xb4,0xa1,0x6c,0xe,0xe7,0xd,0xc5,0x3,0x68,0x1c,0x48,0x8,0x29,
0xda,0xd0,0xe8,0xc4,0x50,0xc4,0x81,0x31,0x36,0x40,0xdd,0xd5,0x8b,0x4d,0x2d,0x4,
0x7e,0x44,0xea,0x20,0xa4,0x89,0x1,0x93,0xd5,0xb1,0xa6,0x9b,0x87,0x10,0xa4,0x88,
0xf4,0x50,0x90,0x7e,0xe0,0xe6,0x98,0xfc,0x8f,0x6c,0xdd,0x96,0xc,0x9f,0x60,0x11,
0x9c,0x68,0x48,0x64,0x44,0x74,0x2d,0xe3,0x30,0xfb,0xbd,0xf4,0x15,0x16,0x9b,0x85,
0x7a,0xcf,0x4f,0xce,0x9c,0xbb,0xde,0xbc,0x12,0x88,0x34,0x7d,0x8f,0x68,0x73,0x77,
0x98,0xa7,0xad,0x21,0x5e,0xa8,0xa4,0x7b,0xa4,0xd6,0x38,0xb,0x58,0x6d,0x74,0x8,
0x4,0x98,0x66,0x58,0xcc,0x83,0xed,0xa9,0x12,0x6,0x28,0x88,0x9b,0x9,0x9e,0xb2,
0x48,0xc1,0x47,0xec,0x81,0xdb,0xe9,0xef,0x3f,0x1f,0x7a,0x6f,0x8f,0xc9,0x98,0xea,
0x6a,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
};
static const unsigned char qt_resource_name[] = {
// right-icon
0x0,0xa,
0xf,0x7c,0xe9,0xfe,
0x0,0x72,
0x0,0x69,0x0,0x67,0x0,0x68,0x0,0x74,0x0,0x2d,0x0,0x69,0x0,0x63,0x0,0x6f,0x0,0x6e,
// zoom_out-icon
0x0,0xd,
0xe,0xbf,0x98,0x9e,
0x0,0x7a,
0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x5f,0x0,0x6f,0x0,0x75,0x0,0x74,0x0,0x2d,0x0,0x69,0x0,0x63,0x0,0x6f,0x0,0x6e,
// left-icon
0x0,0x9,
0xd,0x73,0x1f,0x3e,
0x0,0x6c,
0x0,0x65,0x0,0x66,0x0,0x74,0x0,0x2d,0x0,0x69,0x0,0x63,0x0,0x6f,0x0,0x6e,
// imgRegion-icon
0x0,0xe,
0x5,0x82,0x92,0x5e,
0x0,0x69,
0x0,0x6d,0x0,0x67,0x0,0x52,0x0,0x65,0x0,0x67,0x0,0x69,0x0,0x6f,0x0,0x6e,0x0,0x2d,0x0,0x69,0x0,0x63,0x0,0x6f,0x0,0x6e,
// stylesheet-trackbar
0x0,0x13,
0xe,0x2,0x40,0x42,
0x0,0x73,
0x0,0x74,0x0,0x79,0x0,0x6c,0x0,0x65,0x0,0x73,0x0,0x68,0x0,0x65,0x0,0x65,0x0,0x74,0x0,0x2d,0x0,0x74,0x0,0x72,0x0,0x61,0x0,0x63,0x0,0x6b,0x0,0x62,
0x0,0x61,0x0,0x72,
// down-icon
0x0,0x9,
0xe,0x13,0x30,0x9e,
0x0,0x64,
0x0,0x6f,0x0,0x77,0x0,0x6e,0x0,0x2d,0x0,0x69,0x0,0x63,0x0,0x6f,0x0,0x6e,
// save-icon
0x0,0x9,
0xc,0x83,0xd,0x5e,
0x0,0x73,
0x0,0x61,0x0,0x76,0x0,0x65,0x0,0x2d,0x0,0x69,0x0,0x63,0x0,0x6f,0x0,0x6e,
// properties-icon
0x0,0xf,
0x0,0xbb,0x15,0xfe,
0x0,0x70,
0x0,0x72,0x0,0x6f,0x0,0x70,0x0,0x65,0x0,0x72,0x0,0x74,0x0,0x69,0x0,0x65,0x0,0x73,0x0,0x2d,0x0,0x69,0x0,0x63,0x0,0x6f,0x0,0x6e,
// zoom_in-icon
0x0,0xc,
0x0,0x3f,0x40,0xfe,
0x0,0x7a,
0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x5f,0x0,0x69,0x0,0x6e,0x0,0x2d,0x0,0x69,0x0,0x63,0x0,0x6f,0x0,0x6e,
// zoom_x1-icon
0x0,0xc,
0xb,0x2f,0x40,0xbe,
0x0,0x7a,
0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x5f,0x0,0x78,0x0,0x31,0x0,0x2d,0x0,0x69,0x0,0x63,0x0,0x6f,0x0,0x6e,
// up-icon
0x0,0x7,
0xc,0x33,0xfa,0xbe,
0x0,0x75,
0x0,0x70,0x0,0x2d,0x0,0x69,0x0,0x63,0x0,0x6f,0x0,0x6e,
};
static const unsigned char qt_resource_struct[] = {
// :
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0xb,0x0,0x0,0x0,0x1,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
// :/zoom_in-icon
0x0,0x0,0x0,0xf4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x45,0xe,
0x0,0x0,0x1,0x61,0xc1,0xd0,0x5b,0x28,
// :/properties-icon
0x0,0x0,0x0,0xd0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x39,0x14,
0x0,0x0,0x1,0x61,0xc1,0xd0,0x5b,0x28,
// :/imgRegion-icon
0x0,0x0,0x0,0x52,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x18,0x9e,
0x0,0x0,0x1,0x61,0xc1,0xd0,0x5b,0x28,
// :/zoom_x1-icon
0x0,0x0,0x1,0x12,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x50,0x37,
0x0,0x0,0x1,0x61,0xc1,0xd0,0x5b,0x28,
// :/up-icon
0x0,0x0,0x1,0x30,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x5c,0x36,
0x0,0x0,0x1,0x61,0xc1,0xd0,0x5b,0x28,
// :/save-icon
0x0,0x0,0x0,0xb8,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x31,0x1c,
0x0,0x0,0x1,0x61,0xc1,0xd0,0x5b,0x28,
// :/left-icon
0x0,0x0,0x0,0x3a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x11,0xe4,
0x0,0x0,0x1,0x61,0xc1,0xd0,0x5b,0x28,
// :/stylesheet-trackbar
0x0,0x0,0x0,0x74,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x26,0x14,
0x0,0x0,0x1,0x61,0xc1,0xd0,0x5b,0x28,
// :/down-icon
0x0,0x0,0x0,0xa0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x2a,0xc5,
0x0,0x0,0x1,0x61,0xc1,0xd0,0x5b,0x28,
// :/zoom_out-icon
0x0,0x0,0x0,0x1a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x6,0xd2,
0x0,0x0,0x1,0x61,0xc1,0xd0,0x5b,0x28,
// :/right-icon
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
0x0,0x0,0x1,0x61,0xc1,0xd0,0x5b,0x28,
};
#ifdef QT_NAMESPACE
# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
# define QT_RCC_MANGLE_NAMESPACE0(x) x
# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b
# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b)
# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \
QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE))
#else
# define QT_RCC_PREPEND_NAMESPACE(name) name
# define QT_RCC_MANGLE_NAMESPACE(name) name
#endif
#ifdef QT_NAMESPACE
namespace QT_NAMESPACE {
#endif
bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
#ifdef QT_NAMESPACE
}
#endif
int QT_RCC_MANGLE_NAMESPACE(qInitResources_window_QT)();
int QT_RCC_MANGLE_NAMESPACE(qInitResources_window_QT)()
{
QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData)
(0x2, qt_resource_struct, qt_resource_name, qt_resource_data);
return 1;
}
int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_window_QT)();
int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_window_QT)()
{
QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData)
(0x2, qt_resource_struct, qt_resource_name, qt_resource_data);
return 1;
}
namespace {
struct initializer {
initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources_window_QT)(); }
~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources_window_QT)(); }
} dummy;
}
| 76.320513
| 146
| 0.764196
|
shengxiaoyi1993
|
2e447f5db9918bf5b71eb450ca7e55dcc5d523b5
| 1,908
|
cpp
|
C++
|
VOJ/zoj-1610.cpp
|
PIPIKAI/ACM
|
b8e4416a29c0619946c9b73b0fe5699b6e96e782
|
[
"MIT"
] | null | null | null |
VOJ/zoj-1610.cpp
|
PIPIKAI/ACM
|
b8e4416a29c0619946c9b73b0fe5699b6e96e782
|
[
"MIT"
] | null | null | null |
VOJ/zoj-1610.cpp
|
PIPIKAI/ACM
|
b8e4416a29c0619946c9b73b0fe5699b6e96e782
|
[
"MIT"
] | null | null | null |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define inf 1e9+7
#define ffr(i,a,b) for(int i=a;i<b;i++)
#define mem(a,b) memset( a,b,sizeof a)
#define Max(x,y) y>x? x=y: x=x
const int maxn=1e4+7;
int vis[maxn],last;
struct node{
int l,r;
ll sum;
void update(ll x){
sum=x;
}
}tree[maxn*4];
void push_up(int x){
//tree[x].sum=tree[x<<1].sum+tree[x<<1|1].sum; /// 根据题目要求
}
void push_down(int x){
int lazytp=tree[x].sum;
if(lazytp!=-1){
tree[x<<1].update(lazytp);
tree[x<<1|1].update(lazytp);
tree[x].sum=-1;
}
}
void built(int x,int l,int r){
tree[x]=node{l,r,-1};
if(l==r){
return ;
}
else{
int mid=(l+r)>>1;
built(x<<1 ,l ,mid );
built(x<<1|1 ,mid+1 ,r );
push_up(x);
}
}
void update(int x,int l,int r,int val){
int L=tree[x].l,R=tree[x].r;
if(l<=L&&R<=r){
tree[x].sum=val;
}
else{
push_down(x);
int mid=(L+R)>>1;
if(mid>=l)
update(x<<1,l,r,val);
if(mid<r)
update(x<<1|1,l,r,val);
push_up(x);
}
}
void query(int x,int l,int r){
int L=tree[x].l,R=tree[x].r;
int po=tree[x].sum;
if(L==R){
if(po!=last && po!=-1){
vis[po]++;
}
last=po;return ;
}
push_down(x);
int mid=(L+R)>>1;
if(mid>=l)
query(x<<1,l,r);
if(mid<r)
query(x<<1|1,l,r);
}
int main(){
std::ios::sync_with_stdio(false);
int n,q;
while(cin>>n){
built(1,1,8001);
for(int l,r,x,i=0;i<n;i++){
cin>>l>>r>>x;
update(1,l+1,r,x);///这里是l+1要注意,不然一直wa
}
last=-1;
mem(vis,0);
query(1,1,8001);
for(int i=0;i<=8000;i++){
if(vis[i]){
cout<<i<<" "<<vis[i]<<endl;
}
}
cout<<endl;
}
return 0;
}
| 20.73913
| 61
| 0.455451
|
PIPIKAI
|
2e447fcca052c1b7cb1736c2a77e2880605f32e9
| 442
|
cpp
|
C++
|
VGP332/HelloFSM/GameState.cpp
|
CyroPCJr/OmegaEngine
|
65fbd6cff54266a9c934e3a875a4493d26758661
|
[
"MIT"
] | 1
|
2021-04-23T19:18:12.000Z
|
2021-04-23T19:18:12.000Z
|
VGP332/HelloFSM/GameState.cpp
|
CyroPCJr/OmegaEngine
|
65fbd6cff54266a9c934e3a875a4493d26758661
|
[
"MIT"
] | null | null | null |
VGP332/HelloFSM/GameState.cpp
|
CyroPCJr/OmegaEngine
|
65fbd6cff54266a9c934e3a875a4493d26758661
|
[
"MIT"
] | 1
|
2021-06-15T10:42:08.000Z
|
2021-06-15T10:42:08.000Z
|
#include "GameState.h"
#include "Cat.h"
#include <ImGui\Inc\imgui.h>
using namespace FSM;
using namespace Omega::Graphics;
void GameState::Initialize()
{
GraphicsSystem::Get()->SetClearColor(Colors::Black);
mCat.Load();
}
void GameState::Terminate()
{
mCat.UnLoad();
}
void GameState::Update(float deltaTime)
{
mCat.Update(deltaTime);
}
void GameState::Render()
{
}
void GameState::DebugUI()
{
}
| 13
| 54
| 0.651584
|
CyroPCJr
|
2e455fd48065ee06527188f5d5f5c63615e16591
| 2,201
|
cpp
|
C++
|
DBManager/DBManager.cpp
|
Zilib/SimpleDatabaseManager
|
da6e775855d7fdf99935a9991921a6c61666732d
|
[
"MIT"
] | null | null | null |
DBManager/DBManager.cpp
|
Zilib/SimpleDatabaseManager
|
da6e775855d7fdf99935a9991921a6c61666732d
|
[
"MIT"
] | null | null | null |
DBManager/DBManager.cpp
|
Zilib/SimpleDatabaseManager
|
da6e775855d7fdf99935a9991921a6c61666732d
|
[
"MIT"
] | null | null | null |
#include "database.h"
#include "Menu.h"
#include <Windows.h>
void ShowHeader(Poll* pPoll)
{
// static header, which will always showed
std::cout << pPoll->Title << std::endl;
std::cout << pPoll->Description << std::endl;
}
void ShowPolls(Database* PollDB)
{
int ArrayIndex{ 1 };
for(auto& Poll: PollDB->GetPolls())
{
if (ArrayIndex % 5 != 5) { std::cout << ArrayIndex++ << ". " << Poll.Title << "\t"; }
else if (ArrayIndex % 5 == 5) { std::cout << ArrayIndex++ << ". " << Poll.Title << std::endl; }
}
}
void SelectPoll(Database* PollDB,Poll& Poll)
{
std::cout << std::endl << std::endl;
std::cout << "Make your choice, which poll you want to answer for\n";
short int Choose;
std::cin >> Choose;
while (Choose > PollDB->GetPolls().size() || Choose <= 0) // TODO check does user input an character
{
std::cout << "Bad number\nPlease input number again!: ";
std::cin.clear();
std::cin.ignore();
std::cin >> Choose;
}
// Save a copy of object
Poll = PollDB->GetPolls()[Choose-1];
// Release memory, remove every other polls. Not necessary to do, but i know. I will not use other polls anymore
PollDB->DestroyPolls();
}
void LoadAnswersToVariables(Poll* pPoll)
{
for (auto* Question : pPoll->Questions)
{
Question->ShowContent();
Question->AnswerForQuestion(); // Load data into variable
}
}
// Send whenever customer answer for every question.
void SendAnswersToDatabase(Poll* pPoll,Database* DB)
{
for (auto* Question : pPoll->Questions)
{
DB->InsertUserAnswer(Question, pPoll->Id);
}
}
int main()
{
Database* MyDB = new Database;
Menu* pMenu = new Menu;
Poll Poll;
::Poll *pPoll{&Poll};
if(MyDB->ConstructObject())
{
/// Now database is selected, everything is fine so we can work!
char InputChoice = pMenu->ChooseChar();
while(InputChoice != '1' && InputChoice != '2')
{
InputChoice = pMenu->ChooseChar();
}
system("cls");
if(InputChoice == '1')
{
ShowPolls(MyDB);
SelectPoll(MyDB,Poll);
if(MyDB->LoadPollQuestions(Poll.Id, Poll.Questions))
{
LoadAnswersToVariables(pPoll);
SendAnswersToDatabase(pPoll, MyDB);
}
}
else if (InputChoice == '2')
{
MyDB->CreatePoll();
}
}
return 0;
}
| 22.927083
| 113
| 0.645616
|
Zilib
|
2e45680cfd0f33acd98b3686c71e4354c334eba6
| 28,398
|
cc
|
C++
|
scene_game.cc
|
kawa-yoiko/Fireflies-And-Forest-Flowers
|
4bf2e0cbcace7e9b9b2d1264eed6ad9944c3765e
|
[
"CC-BY-4.0"
] | 1
|
2022-02-06T04:47:26.000Z
|
2022-02-06T04:47:26.000Z
|
scene_game.cc
|
kawa-yoiko/Fireflies-And-Forest-Flowers
|
4bf2e0cbcace7e9b9b2d1264eed6ad9944c3765e
|
[
"CC-BY-4.0"
] | null | null | null |
scene_game.cc
|
kawa-yoiko/Fireflies-And-Forest-Flowers
|
4bf2e0cbcace7e9b9b2d1264eed6ad9944c3765e
|
[
"CC-BY-4.0"
] | null | null | null |
#include "main.hh"
#include "utils.hh"
#include <cstdio>
#include <utility>
#include <vector>
static inline bool seg_intxn(
const vec2 a, const vec2 b,
const vec2 c, const vec2 d
) {
return (c - a).det(b - a) * (d - a).det(b - a) <= 0 &&
(a - c).det(d - c) * (b - c).det(d - c) <= 0;
}
class scene_game : public scene {
public:
// ==== Display-related constants ====
static constexpr float BOARD_W = 20;
static constexpr float BOARD_H = 12;
static constexpr float SCALE = 35;
static rl::Vector2 scr(vec2 p) {
vec2 q = p * SCALE + vec2(W, H) / 2;
return (rl::Vector2){q.x, q.y};
}
static vec2 board(float x, float y) {
return (vec2(x, y) - vec2(W, H) / 2) / SCALE;
}
static const int STEPS = 480;
// ==== Tracks ====
struct track {
vec2 o;
float len; // Total length in units
enum {
ATTRACT = (1 << 0),
RETURN = (1 << 1),
COLLI = ATTRACT | RETURN,
FIXED = (1 << 4),
};
unsigned flags;
bool sel; // Is selected
track() { }
track(vec2 o, float len, unsigned flags)
: o(o), len(len),
flags(flags),
sel(false)
{ }
virtual ~track() { }
// Local position at given phase
virtual vec2 local_at(float t) const = 0;
vec2 at(float t) const { return local_at(t) + o; }
// Phase of nearest point on path, given a local point
// Returns <phase, distance>
virtual std::pair<float, float> local_nearest(vec2 p) const = 0;
std::pair<float, float> nearest(vec2 p) const { return local_nearest(p - o); }
virtual void draw(int T) const = 0;
inline rl::Color tint() const {
rl::Color t = (rl::Color){128, 128, 128, 255};
if (flags & ATTRACT) t = (rl::Color){136, 136, 64, 255};
if (flags & RETURN) t = (rl::Color){160, 96, 216, 255};
if (sel) {
t.r = 255 - (255 - t.r) / 2;
t.g = 255 - (255 - t.g) / 2;
t.b = 255 - (255 - t.b) / 2;
}
/*if (flags & FIXED) {
t.r = t.r * 2/3;
t.g = t.g * 2/3;
t.b = t.b * 2/3;
}*/
return t;
}
inline void ripples(int T, float &dist, float &alpha) const {
if (flags & RETURN) {
float phase = (float)((T + 450) % 900) / 600;
if (phase < 1) {
dist = (1 - powf(1 - phase, 4)) * 0.26;
alpha = (13 * expf(-4 * phase) * sin(phase) * (1 - phase)) * 0.6;
}
}
if (flags & ATTRACT) {
float phase = (float)(T % 900) / 600;
if (phase < 1) {
dist = powf(1 - phase, 4) * 0.26;
alpha = (19 * expf(-5.9 * phase) * sin(phase) * (1 - phase)) * 0.6;
}
}
}
};
static inline rl::Color premul_alpha(rl::Color tint, float alpha) {
return (rl::Color){
(unsigned char)(tint.r * alpha),
(unsigned char)(tint.g * alpha),
(unsigned char)(tint.b * alpha),
(unsigned char)(tint.a * alpha),
};
}
struct track_cir : public track {
float r; // Radius
float fix_angle; // Angle at which the fix mark is displayed
int fix_count; // Number of fix marks
track_cir(vec2 o, float r, unsigned flags = 0,
float fix_angle = 0, int fix_count = 2)
: r(r), fix_angle(fix_angle), fix_count(fix_count),
track(o, 2 * M_PI * r, flags)
{ }
vec2 local_at(float t) const { return vec2(r, 0).rot(t / r); }
std::pair<float, float> local_nearest(vec2 p) const {
float a = atan2f(p.y, p.x);
if (a < 0) a += 2 * M_PI;
return {a * r, (p - vec2(r, 0).rot(a)).norm()};
}
void draw(int T) const {
using namespace rl;
float w = (flags & FIXED) ? 2 : 2;
DrawRing(scr(o),
r * SCALE - w / 2, r * SCALE + w / 2,
0, 360, 24 * (r < 1 ? 1 : r), tint());
if (flags & FIXED) {
float angle = fix_angle;
vec2 p = vec2(r, 0).rot(angle);
vec2 move = vec2(0.13, 0).rot(angle - 1.0);
DrawLineEx(scr(o + p - move), scr(o + p + move), 2, tint());
if (fix_count != 1)
DrawLineEx(scr(o - p - move), scr(o - p + move), 2, tint());
}
float dist = 0, alpha = 0;
ripples(T, dist, alpha);
if (alpha > 0) {
DrawRing(scr(o),
(r + dist) * SCALE - w / 2,
(r + dist) * SCALE + w / 2,
0, 360, 48, premul_alpha(tint(), alpha));
if (r > dist) DrawRing(scr(o),
(r - dist) * SCALE - w / 2,
(r - dist) * SCALE + w / 2,
0, 360, 48, premul_alpha(tint(), alpha));
}
}
};
struct track_seg : public track {
vec2 ext; // Extension on both sides
track_seg(vec2 o, vec2 ext, unsigned flags = 0)
: ext(ext / ext.norm()),
track(o, ext.norm() * 2, flags)
{ }
vec2 local_at(float t) const { return ext * (t - len / 2); }
std::pair<float, float> local_nearest(vec2 p) const {
float t = p.dot(ext);
t = (t < -len / 2 ? -len / 2 : (t > len / 2 ? len / 2 : t));
return {t + len / 2, (p - (ext * t)).norm()};
}
void draw(int T) const {
using namespace rl;
DrawLineEx(
scr(o - ext * len / 2), scr(o + ext * len / 2),
2, tint());
vec2 n = (ext / ext.norm()).rot(M_PI / 2);
if (flags & FIXED) {
for (vec2 endpt : {(o - ext * len / 2), (o + ext * len / 2)}) {
DrawLineEx(
scr(endpt - n * 0.1), scr(endpt + n * 0.1),
2, tint());
}
}
float dist = 0, alpha = 0;
ripples(T, dist, alpha);
if (alpha > 0) {
vec2 move = n * dist;
DrawLineEx(
scr(o + move - ext * len / 2), scr(o + move + ext * len / 2),
2, premul_alpha(tint(), alpha));
DrawLineEx(
scr(o - move - ext * len / 2), scr(o - move + ext * len / 2),
2, premul_alpha(tint(), alpha));
}
}
};
// ==== Fireflies ===
struct firefly {
// Position (track + phase)
const track *tr;
float t;
inline vec2 pos() const { return tr->at(t); }
float v; // Velocity
bool sel; // Selected?
static const int TRAIL_N = 20;
static const int TRAIL_I = 8;
vec2 trail[TRAIL_N];
firefly(const track *tr, float t, float v)
: tr(tr), t(t), v(v),
sel(false)
{ }
inline void update(const std::vector<track *> &tracks) {
float t_prev = t;
vec2 p1 = pos();
t += v / STEPS;
if (t >= tr->len) t -= tr->len;
if (t < 0) t += tr->len;
vec2 p2 = pos();
// Attracting tracks
for (const auto tr : tracks) if (tr != this->tr && (tr->flags & track::COLLI)) {
auto near = tr->nearest(p1);
if (near.second >= 0.01) continue;
float t1 = near.first;
float t2 = tr->nearest(p2).first;
if (fabs(t1 - t2) < 1e-6) {
float d = (t1 < 1 ? 1e-6 : (t1 * 1e-6));
t1 -= d;
t2 += d;
}
// Lemma: (p1, p2) crosses the curve C iff
// (p1, p2) crosses (C(t1), C(t2))
if (seg_intxn(p1, p2, tr->at(t1), tr->at(t2))) {
// Point of intersection
if (tr->flags & track::ATTRACT) {
// Move to the new track
this->tr = tr;
// Take the later parameter to avoid recursion
this->t = t2;
// Reverse if making acute turns
if (this->v * (t2 - t1) < 0) this->v = -this->v;
}
if (tr->flags & track::RETURN) {
/*
printf("p1 = (%f, %f)\n", p1.x, p1.y);
printf("p2 = (%f, %f)\n", p2.x, p2.y);
printf("tr->at(t1) = (%f, %f)\n", tr->at(t1).x, tr->at(t1).y);
printf("tr->at(t2) = (%f, %f)\n", tr->at(t2).x, tr->at(t2).y);
*/
this->t = t_prev;
this->v = -this->v;
}
break;
}
}
}
inline void draw(int offs) const {
using namespace rl;
Color tint = (sel ?
(Color){255, 64, 64, 255} :
(Color){255, 255, 16, 255});
float alpha = 1.0/8 * (v < 1 ? 1 : v);
Color fade = (Color){
(unsigned char)(tint.r * alpha),
(unsigned char)(tint.g * alpha),
(unsigned char)(tint.b * alpha),
(unsigned char)(tint.a * alpha)
};
DrawCircleV(scr(pos()), 4, tint);
for (int i = 0; i < TRAIL_N; i++) {
vec2 p = trail[(i + offs) % TRAIL_N];
DrawCircleV(scr(p), 4 - (float)i / TRAIL_N * 2, fade);
}
}
struct trail_manager {
std::vector<firefly> &fireflies;
int counter = 0;
int pointer = 0;
trail_manager(std::vector<firefly> &fireflies)
: fireflies(fireflies),
counter(0), pointer(0)
{ }
void reset() {
counter = pointer = 0;
}
void recalc_init() {
for (auto &f : fireflies) {
for (int i = 0; i < TRAIL_N; i++)
f.trail[i] = f.tr->at(f.t - f.v * (float(TRAIL_I) / STEPS) * i);
}
}
void step() {
if (++counter == TRAIL_I) {
counter = 0;
pointer = (pointer + (TRAIL_N - 1)) % TRAIL_N;
for (firefly &f : fireflies)
f.trail[pointer] = f.pos();
}
}
};
};
// ==== Bellflowers ====
struct bellflower {
vec2 o;
float r;
int c0, c; // Initial count and current count
bellflower(vec2 o, float r, int c0)
: o(o), r(r), c0(c0)
{
reset();
}
virtual ~bellflower() { }
bool last_on;
int since_on, since_off;
virtual void reset() {
last_on = false;
since_on = since_off = 9999;
c = c0;
}
void update(bool on) {
since_on++;
since_off++;
if (!last_on && on) { c--; since_on = 0; }
if (last_on && !on) since_off = 0;
last_on = on;
}
void update_anim_only() {
since_on++;
since_off++;
}
virtual void update(const std::vector<firefly> &fireflies) = 0;
virtual void draw1(int finish_anim) const { }
virtual void draw2(int finish_anim) const { }
inline bool fireflies_within(const std::vector<firefly> &fireflies) {
for (const auto f : fireflies)
if ((f.pos() - o).norm() <= r) return true;
return false;
}
inline float tint() const {
float t_on = since_on / 480.0f;
float t_off = since_off / 480.0f;
if (last_on) {
if (t_on >= 0.2) return 1;
return t_on * 5;
} else {
if (t_off >= 0.2) return 0;
return (0.2 - t_off) * 5;
}
}
};
struct bellflower_ord : public bellflower {
bellflower_ord(vec2 o, float r, int c0)
: bellflower(o, r, c0)
{ }
void update(const std::vector<firefly> &fireflies) {
bool on = fireflies_within(fireflies);
bellflower::update(on);
}
void draw1(int finish_anim) const {
using namespace rl;
Vector2 cen = scr(o);
float t = tint();
if (finish_anim >= 0) {
float tf = finish_anim / 480.0f;
t *= (tf > 0.5 ? 0 : 1 - sqrtf(tf * 2));
}
Color off = (Color){32, 60, 96, 80};
Color on = (Color){96, 96, 64, 80};
DrawCircleV(cen, r * SCALE, (Color){
(unsigned char)(off.r + (float)(on.r - off.r) * t),
(unsigned char)(off.g + (float)(on.g - off.g) * t),
(unsigned char)(off.b + (float)(on.b - off.b) * t),
80
});
}
void draw2(int finish_anim) const {
using namespace rl;
Vector2 cen = scr(o);
float t = since_on / 960.0f;
float scale = 1;
if (t < 2) scale = 1 + 0.15 * expf(-t) * sinf(t * 8) * (2 - t);
float alpha = 0.85 + (0.15 * tint());
if (c == 0) alpha = 1 - (1 - alpha) * 0.3;
if (finish_anim >= 0) {
float tf = finish_anim / 480.0f;
alpha = alpha + (1 - alpha) * (tf > 0.5 ? 1 : sqrtf(tf * 2));
const float A = 0.3;
const float B = A + 0.3;
const float C = B + 2;
if (tf >= A && tf < B) {
scale *= 0.7 + 0.3 * expf(-(tf - A) * 25) * ((B - tf) / (B - A));
} else if (tf >= B && tf < C) {
float t = tf - B;
scale *= 1.0 - 0.3 * (expf(-20 * t) - expf(-5 * t) * sinf(24 * t)) * ((C - tf) / (C - B));
}
}
painter::image(
c == 0 ? "bellflower_call" : "bellflower_ord",
vec2(cen.x - 42, cen.y - 66 * scale),
vec2(80, 80 * scale),
tint4(alpha, alpha, alpha, alpha));
char s[8];
snprintf(s, sizeof s, "%d", c);
painter::text(s, 32, vec2(cen.x, cen.y + 20), vec2(0.5, 0.5),
tint4(0.8, 0.8, 0.8, 0.6));
}
};
struct bellflower_delay : public bellflower {
int d, d0;
bellflower_delay(vec2 o, float r, int c0, float d0)
: bellflower(o, r, c0), d0(d0 * STEPS)
{ reset(); }
void reset() {
bellflower::reset();
d = d0;
}
void update(const std::vector<firefly> &fireflies) {
bool on = fireflies_within(fireflies);
if (on) {
if (d > 0) d--;
} else {
d = d0;
}
bellflower::update(d == 0);
}
void draw1(int finish_anim) const {
using namespace rl;
DrawRing(scr(o), r * SCALE - 1, r * SCALE + 1, 0, 360, 48, (Color){64, 64, 64, 128});
DrawCircleV(scr(o), 0.5 * SCALE, GRAY);
DrawCircleV(scr(o), 0.5 * SCALE * (d0 - d) / d0, GREEN);
char s[8];
snprintf(s, sizeof s, "%d", c);
DrawText(s, scr(o).x - 4, scr(o).y - 8, 16, BLACK);
}
};
// ==== Scene ====
int T; // Update counter. Overflows after 51 days but whatever
struct tutorial {
vec2 pos;
const char *text;
vec2 cir;
float cir_radius;
};
int puzzle_id;
const char *title;
std::vector<track *> tracks;
std::vector<firefly> fireflies, fireflies_init;
std::vector<bellflower *> bellflowers;
std::vector<std::vector<std::pair<firefly *, float>>> ff_links;
std::vector<tutorial> tutorials;
int to_text;
firefly::trail_manager trail_m;
int tut_show_start, tut_show_end;
int tut_show_time, tut_hide_time;
firefly *sel_ff;
track *sel_track;
vec2 sel_offs;
int run_state = (8 << 1); // Initial speed 8 steps/update
int finish_timer = -1;
const float RT_SCALE = 2; // Scaling factor for render targets
rl::RenderTexture2D texBloomBase, texBloomStage1, texBloomStage2;
rl::Shader shaderBloom;
int shaderBloomPassLoc;
rl::Shader shaderSpotlight;
int shaderSpotlightCenLoc, shaderSpotlightRadLoc;
static const int BG_TREES_N = 25;
struct {
vec2 pos;
float rot_cen, rot_amp, rot_period;
float tint;
} trees[BG_TREES_N];
button_group buttons;
scene_game(int puzzle_id)
: T(0),
puzzle_id(puzzle_id),
sel_ff(nullptr), sel_track(nullptr),
trail_m(fireflies)
{
using button = button_group::button;
buttons.buttons = {(button){
vec2(10, 10), vec2(60, 60),
nullptr, // Will be filled later
[this]() { this->btn_play(); }
}, (button){
vec2(10, 80), vec2(60, 60),
nullptr,
[this]() { this->btn_speed(); }
}};
update_buttons_images();
to_text = -1;
std::vector<std::vector<int>> links;
switch (puzzle_id) {
#define T_cir new track_cir
#define T_seg new track_seg
#define B_ord new bellflower_ord
#define B_delay new bellflower_delay
#define F(_i, _t, ...) \
firefly(tracks[_i], tracks[_i]->len * (_t), __VA_ARGS__)
#include "puzzles.hh"
}
build_links(links);
trail_m.recalc_init();
tut_show_start = 0;
update_tut_show_range(true);
tut_hide_time = -1;
texBloomBase = rl::LoadRenderTexture(W * RT_SCALE, H * RT_SCALE);
rl::SetTextureFilter(texBloomBase.texture, rl::TEXTURE_FILTER_BILINEAR);
texBloomStage1 = rl::LoadRenderTexture(W * RT_SCALE, H * RT_SCALE);
rl::SetTextureFilter(texBloomStage1.texture, rl::TEXTURE_FILTER_BILINEAR);
texBloomStage2 = rl::LoadRenderTexture(W * RT_SCALE, H * RT_SCALE);
rl::SetTextureFilter(texBloomStage2.texture, rl::TEXTURE_FILTER_BILINEAR);
#ifdef PLATFORM_WEB
shaderBloom = rl::LoadShader("res/bloom_web.vert", "res/bloom_web.frag");
shaderSpotlight = rl::LoadShader("res/spotlight_web.vert", "res/spotlight_web.frag");
#else
shaderBloom = rl::LoadShader("res/bloom.vert", "res/bloom.frag");
shaderSpotlight = rl::LoadShader("res/spotlight.vert", "res/spotlight.frag");
#endif
shaderBloomPassLoc = rl::GetShaderLocation(shaderBloom, "pass");
shaderSpotlightCenLoc = rl::GetShaderLocation(shaderSpotlight, "spotCen");
shaderSpotlightRadLoc = rl::GetShaderLocation(shaderSpotlight, "spotRadius");
unsigned seed = 20220128;
for (const char *s = title; *s != '\0'; s++)
seed = (seed * 997 + *s);
for (int i = 0; i < BG_TREES_N; i++) {
unsigned rands[5];
for (int j = 0; j < 5; j++) {
seed = (seed * 1103515245 + 12345) & 0x7fffffff;
rands[j] = seed;
}
trees[i] = {
.pos = vec2(rands[0] % W, rands[1] % H),
.rot_cen = (float)rands[2] / 0x7fffffff * (float)M_PI * 2,
.rot_amp = 0.05f + (float)rands[3] / 0x7fffffff * 0.05f,
.rot_period = 1200 + 1200 * (float)((rands[4] >> 8) % 256) / 256,
.tint = (192 + ((rands[4] >> 16) % 32)) / 255.0f,
};
}
for (int it = 0; it < 1000; it++) {
for (int i = 0; i < BG_TREES_N; i++) {
vec2 move = vec2(0, 0);
for (int j = 0; j < BG_TREES_N; j++) if (j != i) {
vec2 d = (trees[i].pos - trees[j].pos);
if (d.norm() < 240)
move = move + d / d.norm() * (240 - d.norm());
}
trees[i].pos = trees[i].pos + move * 0.01;
if (trees[i].pos.x < 0) trees[i].pos.x /= 2;
if (trees[i].pos.x > W) trees[i].pos.x -= (trees[i].pos.x - W) / 2;
if (trees[i].pos.y < 0) trees[i].pos.y /= 2;
if (trees[i].pos.y > H) trees[i].pos.y -= (trees[i].pos.y - H) / 2;
}
}
}
~scene_game() {
rl::UnloadRenderTexture(texBloomBase);
rl::UnloadRenderTexture(texBloomStage1);
rl::UnloadRenderTexture(texBloomStage2);
rl::UnloadShader(shaderBloom);
for (auto t : tracks) delete t;
for (auto b : bellflowers) delete b;
}
inline void build_links(std::vector<std::vector<int>> links) {
ff_links.clear();
ff_links.resize(fireflies.size());
for (const auto group : links) {
for (const auto indep : group) {
auto &list = ff_links[indep];
float t = fireflies[indep].t;
list.reserve(group.size() - 1);
for (const auto dep : group) if (dep != indep) {
bool is_reverse = (fireflies[indep].v * fireflies[dep].v < 0);
float diff = (is_reverse ? fireflies[dep].t + t : fireflies[dep].t - t);
list.push_back({&fireflies[dep], diff});
}
}
}
}
inline bool tut_has_next() const {
return (tut_show_start < tutorials.size() &&
tutorials[tut_show_end - 1].cir_radius != 0);
}
inline void update_tut_show_range(bool always = false) {
if (!always && !tut_has_next()) return;
for (tut_show_end = tut_show_start;
tut_show_end < tutorials.size(); tut_show_end++)
if (tutorials[tut_show_end].cir_radius != 0) {
tut_show_end++;
break;
}
tut_show_time = T;
}
inline std::pair<firefly *, track *> find(const vec2 p) {
// Find the nearest firefly
firefly *best_ff = nullptr;
float best_dist = 0.75;
for (auto &f : fireflies) {
float dist = (p - f.pos()).norm();
if (dist < best_dist) {
best_dist = dist;
best_ff = &f;
}
}
if (best_ff != nullptr) return {best_ff, nullptr};
// Find the nearest firefly track
track *best_track = nullptr;
std::pair<float, float> best_result = {0, 0.5};
for (const auto t : tracks) if (!(t->flags & track::FIXED)) {
auto result = t->nearest(p);
if (result.second < best_result.second) {
best_result = result;
best_track = t;
}
}
return {nullptr, best_track};
}
void pton(float x, float y) {
if (tut_has_next()) return;
if (buttons.pton(x, y)) return;
if (run_state & 1) return;
vec2 p = board(x, y);
auto near = find(p);
if (near.first != nullptr) {
sel_ff = near.first;
sel_ff->sel = true;
sel_offs = sel_ff->pos() - p;
}
if (near.second != nullptr) {
sel_track = near.second;
sel_track->sel = true;
sel_offs = sel_track->o - p;
}
}
void ptmove(float x, float y) {
if (tut_has_next()) return;
if (buttons.ptmove(x, y)) return;
vec2 p = board(x, y);
if (sel_ff != nullptr) {
sel_ff->t = sel_ff->tr->nearest(p + sel_offs).first;
// Move linked fireflies
int index = sel_ff - &fireflies[0];
for (const auto link : ff_links[index]) {
link.first->t =
(link.first->v * sel_ff->v < 0) ?
link.second - sel_ff->t :
link.second + sel_ff->t;
}
trail_m.recalc_init();
}
if (sel_track != nullptr) {
sel_track->o = p + sel_offs;
trail_m.recalc_init();
}
}
void ptoff(float x, float y) {
if (tut_has_next()) {
if (tut_hide_time == -1) tut_hide_time = T;
}
if (buttons.ptoff(x, y)) return;
if (sel_ff != nullptr) {
sel_ff->sel = false;
sel_ff = nullptr;
}
if (sel_track != nullptr) {
sel_track->sel = false;
sel_track = nullptr;
}
}
// Button callbacks
void btn_play() {
if (finish_timer >= 0) return;
run_state ^= 1;
if (run_state & 1) start_run(); else stop_run();
}
void btn_speed() {
if (finish_timer >= 0) return;
if ((run_state >> 1) == 8)
run_state = (32 << 1) | (run_state & 1);
else
run_state = (8 << 1) | (run_state & 1);
update_buttons_images();
}
inline void update_buttons_images() {
buttons.buttons[0].image = ((run_state & 1) ? "btn_stop" : "btn_play");
buttons.buttons[1].image = ((run_state >> 1) == 8 ? "btn_1x" : "btn_2x");
}
inline void start_run() {
// Save
fireflies_init = fireflies;
update_buttons_images();
}
inline void stop_run() {
fireflies = fireflies_init;
for (auto b : bellflowers) b->reset();
trail_m.reset();
update_buttons_images();
}
bool last_space_down = false;
bool last_tab_down = false;
void update() {
T++;
if (finish_timer >= 0) finish_timer++;
if (tut_hide_time >= 0 && T == tut_hide_time + 60) {
tut_hide_time = -1;
tut_show_start = tut_show_end;
update_tut_show_range();
}
bool space_down = rl::IsKeyDown(rl::KEY_SPACE);
if (sel_track == nullptr &&
finish_timer == -1 &&
!last_space_down && space_down) {
run_state ^= 1;
if (run_state & 1) start_run(); else stop_run();
}
last_space_down = space_down;
bool tab_down = rl::IsKeyDown(rl::KEY_TAB);
if (finish_timer == -1 &&
!last_tab_down && tab_down) {
btn_speed();
}
last_tab_down = tab_down;
if (run_state & 1) for (int i = 0; i < (run_state >> 1); i++) {
for (auto &f : fireflies) f.update(tracks);
trail_m.step();
// No bellflowers are changed after finish
if (finish_timer == -1)
for (auto b : bellflowers) b->update(fireflies);
else
for (auto b : bellflowers) b->update_anim_only();
// Check for finish
if (finish_timer == -1) {
bool finish = true;
for (auto b : bellflowers)
if (b->c != 0) { finish = false; break; }
if (finish) {
finish_timer = 0;
run_state = (8 << 1) | 1; // Back to normal speed
}
}
}
if (finish_timer == 960) {
if (to_text != -1)
replace_scene(scene_text(to_text));
else
replace_scene(new scene_game(puzzle_id + 1));
}
}
void draw() {
using namespace rl;
ClearBackground((Color){5, 8, 1, 255});
// Background
for (int i = 0; i < BG_TREES_N; i++) {
int id = i % 4;
float rot = trees[i].rot_cen + trees[i].rot_amp *
sinf((float)T / trees[i].rot_period * M_PI * 2);
float tint = trees[i].tint;
if (finish_timer >= 360 + 1.2 * 240) {
float x = (finish_timer - (360 + 1.2 * 240)) / (0.5 * 240.0f);
if (x > 1) x = 1; else x = 1 - (1 - x) * (1 - x);
tint = tint + (1 - tint) * x * 0.95;
}
painter::image("board_bg",
trees[i].pos,
vec2(240, 240),
vec2(i % 4 * 240, 0),
vec2(240, 240),
vec2(120, 120),
rot,
tint4(tint, tint, tint));
}
// Rule grid
int x_range = (W / 2 / SCALE) + 1;
for (int i = -x_range; i <= x_range; i++) {
float x = scr(vec2(i, 0)).x;
DrawLineV((Vector2){x, 0}, (Vector2){x, H}, (Color){30, 30, 30, 255});
}
int y_range = (H / 2 / SCALE) + 1;
for (int i = -y_range; i <= y_range; i++) {
float y = scr(vec2(0, i)).y;
DrawLineV((Vector2){0, y}, (Vector2){W, y}, (Color){30, 30, 30, 255});
}
// Render scaled to texture
BeginBlendMode(BLEND_ADD_COLORS);
Color bg = (Color){0, 0, 0, 0};
BeginTextureMode(texBloomBase);
BeginMode2D((Camera2D){(Vector2){0, 0}, (Vector2){0, 0}, 0, RT_SCALE});
ClearBackground(bg);
for (const auto t : tracks) t->draw(T);
for (const auto &f : fireflies) f.draw(trail_m.pointer);
EndMode2D();
EndTextureMode();
int pass;
BeginTextureMode(texBloomStage1);
BeginMode2D((Camera2D){(Vector2){0, 0}, (Vector2){0, 0}, 0, RT_SCALE});
pass = 1;
SetShaderValue(shaderBloom, shaderBloomPassLoc, &pass, SHADER_UNIFORM_INT);
BeginShaderMode(shaderBloom);
ClearBackground(bg);
DrawTexturePro(texBloomBase.texture,
(Rectangle){0, 0, W * RT_SCALE, -H * RT_SCALE},
(Rectangle){0, 0, W, H},
(Vector2){0, 0}, 0, WHITE);
EndShaderMode();
EndMode2D();
EndTextureMode();
BeginTextureMode(texBloomStage2);
BeginMode2D((Camera2D){(Vector2){0, 0}, (Vector2){0, 0}, 0, RT_SCALE});
pass = 2;
SetShaderValue(shaderBloom, shaderBloomPassLoc, &pass, SHADER_UNIFORM_INT);
BeginShaderMode(shaderBloom);
ClearBackground(bg);
DrawTexturePro(texBloomStage1.texture,
(Rectangle){0, 0, W * RT_SCALE, -H * RT_SCALE},
(Rectangle){0, 0, W, H},
(Vector2){0, 0}, 0, WHITE);
EndShaderMode();
EndMode2D();
EndTextureMode();
EndBlendMode();
int finish_anim = -1;
if (finish_timer >= 360)
finish_anim = finish_timer - 360;
for (const auto b : bellflowers) b->draw1(finish_anim);
DrawTexturePro(texBloomBase.texture,
(Rectangle){0, 0, W * RT_SCALE, -H * RT_SCALE},
(Rectangle){0, 0, W, H},
(Vector2){0, 0}, 0, (Color){255, 255, 255, 160});
DrawTexturePro(texBloomStage2.texture,
(Rectangle){0, 0, W * RT_SCALE, -H * RT_SCALE},
(Rectangle){0, 0, W, H},
(Vector2){0, 0}, 0, WHITE);
for (const auto b : bellflowers) b->draw2(finish_anim);
// Tutorials
float tut_alpha = 1;
if (tut_hide_time >= 0) {
tut_alpha = 1 - (float)(T - tut_hide_time) / 60;
} else if (T - tut_show_time < 60) {
tut_alpha = (float)(T - tut_show_time) / 60;
}
if (tut_has_next()) {
const auto &t = tutorials[tut_show_end - 1];
float spotlightCen[2] = {scr(t.cir).x, scr(t.cir).y};
float spotlightRadius = t.cir_radius * SCALE
- 20 * (1 - tut_alpha) * (1 - tut_alpha);
SetShaderValue(shaderSpotlight, shaderSpotlightCenLoc,
spotlightCen, SHADER_UNIFORM_VEC2);
SetShaderValue(shaderSpotlight, shaderSpotlightRadLoc,
&spotlightRadius, SHADER_UNIFORM_FLOAT);
BeginShaderMode(shaderSpotlight);
DrawRectangle(0, 0, W, H,
(Color){255, 255, 255, (unsigned char)(255 * tut_alpha)});
EndShaderMode();
}
for (int i = tut_show_start; i < tut_show_end; i++) {
const auto &t = tutorials[i];
painter::text(t.text, 32,
vec2(scr(t.pos).x, scr(t.pos).y),
vec2(0.5, 0.5), tint4(0.6, 0.6, 0.6, tut_alpha));
}
// Buttons
buttons.draw();
// Title
char title_text[64];
snprintf(title_text, sizeof title_text,
"%02d. %s", puzzle_id, title);
painter::text(title_text, 36,
vec2(20, H - 20),
vec2(0, 1), tint4(0.9, 0.9, 0.9, 1));
}
};
scene *scene_game(int puzzle_id) {
return new class scene_game(puzzle_id);
}
| 30.050794
| 100
| 0.535249
|
kawa-yoiko
|
2e4791187e3b5ec0af2233dfaabad323952be920
| 773
|
cpp
|
C++
|
algospot/QUADTREE.cpp
|
Twinparadox/AlgorithmProblem
|
0190d17555306600cfd439ad5d02a77e663c9a4e
|
[
"MIT"
] | null | null | null |
algospot/QUADTREE.cpp
|
Twinparadox/AlgorithmProblem
|
0190d17555306600cfd439ad5d02a77e663c9a4e
|
[
"MIT"
] | null | null | null |
algospot/QUADTREE.cpp
|
Twinparadox/AlgorithmProblem
|
0190d17555306600cfd439ad5d02a77e663c9a4e
|
[
"MIT"
] | null | null | null |
#include <iostream>
#include <cstring>
#define MAXTREESIZE 4
using namespace std;
typedef struct TreeNode
{
char color;
struct TreeNode* link[MAXTREESIZE]; // 0:left-top 1:right-top 2:left-bottom 3:right-bottom
}TreeNode;
void AddTreeNode(char color)
{
TreeNode* newnode = CreateNode(color);
}
TreeNode* CreateNode(char color)
{
TreeNode* newnode = (TreeNode*)malloc(sizeof(TreeNode));
newnode->color = color;
for (int i = 0; i < MAXTREESIZE; i++)
newnode->link[i] == NULL;
return newnode;
}
int main()
{
TreeNode* Root;
char compress[1000];
int len;
int cnt = 0;
int level = 0;
cin >> compress;
len = strlen(compress);
for (int i = 0; i < len; i++)
{
if (compress[i] == 'w' || compress[i] == 'b')
AddTreeNode(compress[i]);
}
return 0;
}
| 16.804348
| 91
| 0.658473
|
Twinparadox
|
2e4c85416c7524df5dadf03a5e8999f7f5c064ff
| 401
|
cpp
|
C++
|
FakeReal/Source/Engine/Render/Buffer/UniformBuffer.cpp
|
UGEL4/FakeReal
|
4ffc39fc500629fd537f688c56d5acdfc34d0b30
|
[
"Apache-2.0"
] | null | null | null |
FakeReal/Source/Engine/Render/Buffer/UniformBuffer.cpp
|
UGEL4/FakeReal
|
4ffc39fc500629fd537f688c56d5acdfc34d0b30
|
[
"Apache-2.0"
] | null | null | null |
FakeReal/Source/Engine/Render/Buffer/UniformBuffer.cpp
|
UGEL4/FakeReal
|
4ffc39fc500629fd537f688c56d5acdfc34d0b30
|
[
"Apache-2.0"
] | null | null | null |
#include "UniformBuffer.h"
#include "../Renderer.h"
#include <assert.h>
#include "../../Platform/OpenGL/Render/Buffer/UniformBuffer_GL.h"
namespace FakeReal {
UniformBuffer* UniformBuffer::Create(unsigned int uiSize, unsigned int uiBinding)
{
switch (Renderer::GetAPI())
{
case RenderAPI::API::OpenGL: return new UniformBuffer_GL(uiSize, uiBinding);
}
assert(0);
return nullptr;
}
}
| 21.105263
| 82
| 0.720698
|
UGEL4
|
2e5316d8636bb256b2c48ffcf1d5e88c2d7b31ee
| 235
|
cpp
|
C++
|
src/OpenLoco/GameState.cpp
|
petergaal/OpenLoco
|
d915b8b9d2ee2b90e2d7c9b5eae44a6fd01fee2c
|
[
"MIT"
] | 585
|
2019-02-20T18:32:39.000Z
|
2022-03-31T10:59:57.000Z
|
src/OpenLoco/GameState.cpp
|
petergaal/OpenLoco
|
d915b8b9d2ee2b90e2d7c9b5eae44a6fd01fee2c
|
[
"MIT"
] | 643
|
2019-02-19T19:54:32.000Z
|
2022-03-31T12:34:37.000Z
|
src/OpenLoco/GameState.cpp
|
petergaal/OpenLoco
|
d915b8b9d2ee2b90e2d7c9b5eae44a6fd01fee2c
|
[
"MIT"
] | 84
|
2019-02-19T15:03:14.000Z
|
2022-03-30T01:27:02.000Z
|
#include "GameState.h"
#include "Interop/Interop.hpp"
using namespace OpenLoco::Interop;
namespace OpenLoco
{
loco_global<GameState, 0x00525E18> _gameState;
GameState& getGameState()
{
return *_gameState;
}
}
| 16.785714
| 50
| 0.697872
|
petergaal
|
2e54a0ab947cd3aa3aeca2011505a741888cf1c3
| 16,840
|
cpp
|
C++
|
src/plugins/simulator/physics_engines/dynamics2d/dynamics2d_engine.cpp
|
freedomcondor/argos3-harry
|
10cc040af3d5339538cfd801f0317fa8269429a5
|
[
"MIT"
] | null | null | null |
src/plugins/simulator/physics_engines/dynamics2d/dynamics2d_engine.cpp
|
freedomcondor/argos3-harry
|
10cc040af3d5339538cfd801f0317fa8269429a5
|
[
"MIT"
] | null | null | null |
src/plugins/simulator/physics_engines/dynamics2d/dynamics2d_engine.cpp
|
freedomcondor/argos3-harry
|
10cc040af3d5339538cfd801f0317fa8269429a5
|
[
"MIT"
] | null | null | null |
/**
* @file <argos3/plugins/simulator/physics_engines/dynamics2d/dynamics2d_engine.cpp>
*
* @author Carlo Pinciroli - <ilpincy@gmail.com>
*/
#include "dynamics2d_engine.h"
#include "dynamics2d_model.h"
#include "dynamics2d_gripping.h"
#include <argos3/core/simulator/simulator.h>
#include <argos3/core/simulator/entity/embodied_entity.h>
#include <cmath>
namespace argos {
/****************************************/
/****************************************/
CDynamics2DEngine::CDynamics2DEngine() :
m_fBoxLinearFriction(1.49),
m_fBoxAngularFriction(1.49),
m_fCylinderLinearFriction(1.49),
m_fCylinderAngularFriction(1.49),
m_ptSpace(NULL),
m_ptGroundBody(NULL),
m_fElevation(0.0f) {
}
/****************************************/
/****************************************/
void CDynamics2DEngine::Init(TConfigurationNode& t_tree) {
try {
/* Init parent */
CPhysicsEngine::Init(t_tree);
/* Parse XML */
GetNodeAttributeOrDefault(t_tree, "elevation", m_fElevation, m_fElevation);
if(NodeExists(t_tree, "friction")) {
TConfigurationNode& tNode = GetNode(t_tree, "friction");
GetNodeAttributeOrDefault(tNode, "box_linear_friction", m_fBoxLinearFriction, m_fBoxLinearFriction);
GetNodeAttributeOrDefault(tNode, "box_angular_friction", m_fBoxAngularFriction, m_fBoxAngularFriction);
GetNodeAttributeOrDefault(tNode, "cylinder_linear_friction", m_fCylinderLinearFriction, m_fCylinderLinearFriction);
GetNodeAttributeOrDefault(tNode, "cylinder_angular_friction", m_fCylinderAngularFriction, m_fCylinderAngularFriction);
}
/* Override volume top and bottom with the value of m_fElevation */
if(!GetVolume().TopFace) GetVolume().TopFace = new SHorizontalFace;
if(!GetVolume().BottomFace) GetVolume().BottomFace = new SHorizontalFace;
GetVolume().TopFace->Height = m_fElevation;
GetVolume().BottomFace->Height = m_fElevation;
/* Initialize physics */
cpInitChipmunk();
cpResetShapeIdCounter();
/* Used to attach static geometries so that they won't move and to simulate friction */
m_ptGroundBody = cpBodyNew(INFINITY, INFINITY);
/* Create the space to contain the movable objects */
m_ptSpace = cpSpaceNew();
/* Subiterations to solve constraints.
The more, the better for precision but the worse for speed
*/
m_ptSpace->iterations = GetIterations();
/* Spatial hash */
if(NodeExists(t_tree, "spatial_hash")) {
TConfigurationNode& tNode = GetNode(t_tree, "spatial_hash");
cpFloat fSize;
UInt32 unNum;
GetNodeAttribute(tNode, "cell_size", fSize);
GetNodeAttribute(tNode, "cell_num", unNum);
cpSpaceUseSpatialHash(m_ptSpace, fSize, unNum);
}
/* Gripper-Gripped callback functions */
cpSpaceAddCollisionHandler(
m_ptSpace,
SHAPE_GRIPPER,
SHAPE_GRIPPABLE,
BeginCollisionBetweenGripperAndGrippable,
ManageCollisionBetweenGripperAndGrippable,
NULL,
NULL,
NULL);
}
catch(CARGoSException& ex) {
THROW_ARGOSEXCEPTION_NESTED("Error initializing the dynamics 2D engine \"" << GetId() << "\"", ex);
}
}
/****************************************/
/****************************************/
void CDynamics2DEngine::Reset() {
for(CDynamics2DModel::TMap::iterator it = m_tPhysicsModels.begin();
it != m_tPhysicsModels.end(); ++it) {
it->second->Reset();
}
cpSpaceReindexStatic(m_ptSpace);
}
/****************************************/
/****************************************/
void CDynamics2DEngine::Update() {
/* Update the physics state from the entities */
for(CDynamics2DModel::TMap::iterator it = m_tPhysicsModels.begin();
it != m_tPhysicsModels.end(); ++it) {
it->second->UpdateFromEntityStatus();
}
/* Perform the step */
for(size_t i = 0; i < GetIterations(); ++i) {
for(CDynamics2DModel::TMap::iterator it = m_tPhysicsModels.begin();
it != m_tPhysicsModels.end(); ++it) {
it->second->UpdatePhysics();
}
cpSpaceStep(m_ptSpace, GetPhysicsClockTick());
}
/* Update the simulated space */
for(CDynamics2DModel::TMap::iterator it = m_tPhysicsModels.begin();
it != m_tPhysicsModels.end(); ++it) {
it->second->UpdateEntityStatus();
}
}
/****************************************/
/****************************************/
void CDynamics2DEngine::Destroy() {
/* Empty the physics model map */
for(CDynamics2DModel::TMap::iterator it = m_tPhysicsModels.begin();
it != m_tPhysicsModels.end(); ++it) {
delete it->second;
}
m_tPhysicsModels.clear();
/* Get rid of the physics space */
cpSpaceFree(m_ptSpace);
cpBodyFree(m_ptGroundBody);
}
/****************************************/
/****************************************/
size_t CDynamics2DEngine::GetNumPhysicsModels() {
return m_tPhysicsModels.size();
}
/****************************************/
/****************************************/
bool CDynamics2DEngine::AddEntity(CEntity& c_entity) {
SOperationOutcome cOutcome =
CallEntityOperation<CDynamics2DOperationAddEntity, CDynamics2DEngine, SOperationOutcome>
(*this, c_entity);
cpResetShapeIdCounter();
return cOutcome.Value;
}
/****************************************/
/****************************************/
bool CDynamics2DEngine::RemoveEntity(CEntity& c_entity) {
SOperationOutcome cOutcome =
CallEntityOperation<CDynamics2DOperationRemoveEntity, CDynamics2DEngine, SOperationOutcome>
(*this, c_entity);
return cOutcome.Value;
}
/****************************************/
/****************************************/
struct SDynamics2DSegmentHitData {
TEmbodiedEntityIntersectionData& Intersections;
const CRay3& Ray;
SDynamics2DSegmentHitData(TEmbodiedEntityIntersectionData& t_data,
const CRay3& c_ray) :
Intersections(t_data),
Ray(c_ray) {}
};
static void Dynamics2DSegmentQueryFunc(cpShape* pt_shape, cpFloat f_t, cpVect, void* pt_data) {
/* Get the data associated to this query */
SDynamics2DSegmentHitData& sData = *reinterpret_cast<SDynamics2DSegmentHitData*>(pt_data);
/* Hit found, is it within the limits? */
CDynamics2DModel& cModel = *reinterpret_cast<CDynamics2DModel*>(pt_shape->body->data);
CVector3 cIntersectionPoint;
sData.Ray.GetPoint(cIntersectionPoint, f_t);
if((cIntersectionPoint.GetZ() >= cModel.GetBoundingBox().MinCorner.GetZ()) &&
(cIntersectionPoint.GetZ() <= cModel.GetBoundingBox().MaxCorner.GetZ()) ) {
/* Yes, a real hit */
sData.Intersections.push_back(
SEmbodiedEntityIntersectionItem(
&cModel.GetEmbodiedEntity(),
f_t));
}
}
void CDynamics2DEngine::CheckIntersectionWithRay(TEmbodiedEntityIntersectionData& t_data,
const CRay3& c_ray) const {
/* Query all hits along the ray */
SDynamics2DSegmentHitData sHitData(t_data, c_ray);
cpSpaceSegmentQuery(
m_ptSpace,
cpv(c_ray.GetStart().GetX(), c_ray.GetStart().GetY()),
cpv(c_ray.GetEnd().GetX() , c_ray.GetEnd().GetY() ),
CP_ALL_LAYERS,
CP_NO_GROUP,
Dynamics2DSegmentQueryFunc,
&sHitData);
}
/****************************************/
/****************************************/
void CDynamics2DEngine::PositionPhysicsToSpace(CVector3& c_new_pos,
const CVector3& c_original_pos,
const cpBody* pt_body) {
c_new_pos.SetX(pt_body->p.x);
c_new_pos.SetY(pt_body->p.y);
c_new_pos.SetZ(c_original_pos.GetZ());
}
/****************************************/
/****************************************/
void CDynamics2DEngine::OrientationPhysicsToSpace(CQuaternion& c_new_orient,
cpBody* pt_body) {
c_new_orient.FromAngleAxis(CRadians(pt_body->a), CVector3::Z);
}
/****************************************/
/****************************************/
void CDynamics2DEngine::AddPhysicsModel(const std::string& str_id,
CDynamics2DModel& c_model) {
m_tPhysicsModels[str_id] = &c_model;
}
/****************************************/
/****************************************/
void CDynamics2DEngine::RemovePhysicsModel(const std::string& str_id) {
CDynamics2DModel::TMap::iterator it = m_tPhysicsModels.find(str_id);
if(it != m_tPhysicsModels.end()) {
delete it->second;
m_tPhysicsModels.erase(it);
}
else {
THROW_ARGOSEXCEPTION("Dynamics2D model id \"" << str_id << "\" not found in dynamics 2D engine \"" << GetId() << "\"");
}
}
/****************************************/
/****************************************/
REGISTER_PHYSICS_ENGINE(CDynamics2DEngine,
"dynamics2d",
"Carlo Pinciroli [ilpincy@gmail.com]",
"1.0",
"A 2D dynamics physics engine.",
"This physics engine is a 2D dynamics engine based on the Chipmunk library\n"
"(http://code.google.com/p/chipmunk-physics) version 6.0.1.\n\n"
"REQUIRED XML CONFIGURATION\n\n"
" <physics_engines>\n"
" ...\n"
" <dynamics2d id=\"dyn2d\" />\n"
" ...\n"
" </physics_engines>\n\n"
"The 'id' attribute is necessary and must be unique among the physics engines.\n"
"It is used in the subsequent section <arena_physics> to assign entities to\n"
"physics engines. If two engines share the same id, initialization aborts.\n\n"
"OPTIONAL XML CONFIGURATION\n\n"
"It is possible to set how many iterations this physics engine performs between\n"
"each simulation step. By default, this physics engine performs 10 steps every\n"
"two simulation steps. This means that, if the simulation step is 100ms, the\n"
"physics engine step is, by default, 10ms. Sometimes, collisions and joints are\n"
"not simulated with sufficient precision using these parameters. By increasing\n"
"the number of iterations, the temporal granularity of the solver increases and\n"
"with it its accuracy, at the cost of higher computational cost. To change the\n"
"number of iterations per simulation step use this syntax:\n\n"
" <physics_engines>\n"
" ...\n"
" <dynamics2d id=\"dyn2d\"\n"
" iterations=\"20\" />\n"
" ...\n"
" </physics_engines>\n\n"
"The plane of the physics engine can be translated on the Z axis, to simulate\n"
"for example hovering objects, such as flying robots. To translate the plane\n"
"2m up the Z axis, use the 'elevation' attribute as follows:\n\n"
" <physics_engines>\n"
" ...\n"
" <dynamics2d id=\"dyn2d\"\n"
" elevation=\"2.0\" />\n"
" ...\n"
" </physics_engines>\n\n"
"When not specified, the elevation is zero, which means that the plane\n"
"corresponds to the XY plane.\n\n"
"The friction parameters between the ground and movable boxes and cylinders can\n"
"be overridden. You can set both the linear and angular friction parameters.\n"
"The default value is 1.49 for each of them. To override the values, use this\n"
"syntax (all attributes are optional):\n\n"
" <physics_engines>\n"
" ...\n"
" <dynamics2d id=\"dyn2d\"\n"
" <friction box_linear_friction=\"1.0\"\n"
" box_angular_friction=\"2.0\"\n"
" cylinder_linear_friction=\"3.0\"\n"
" cylinder_angular_friction=\"4.0\" />\n"
" </dynamics2d>\n"
" ...\n"
" </physics_engines>\n\n"
"For the the robots that use velocity-based control, such as ground robots with\n"
"the differential_steering actuator (e.g. the foot-bot and the e-puck), it is\n"
"possible to customize robot-specific attributes that set the maximum force and\n"
"torque the robot has. The syntax is as follows, taking a foot-bot as example:\n\n"
" <arena ...>\n"
" ...\n"
" <foot-bot id=\"fb0\">\n"
" <body position=\"0.4,2.3,0.25\" orientation=\"45,0,0\" />\n"
" <controller config=\"mycntrl\" />\n"
" <!-- Specify new value for max_force and max_torque -->\n"
" <dynamics2d>\n"
" <differential_steering max_force=\"0.1\" max_torque=\"0.1\"/>\n"
" </dynamics2d>\n"
" </foot-bot>\n"
" ...\n"
" </arena>\n\n"
"The attributes 'max_force' and 'max_torque' are both optional, and they take the\n"
"robot-specific default if not set. Check the code of the dynamics2d model of the\n"
"robot you're using to know the default values.\n\n"
"By default, this engine uses the bounding-box tree method for collision shape\n"
"indexing. This method is the default in Chipmunk and it works well most of the\n"
"times. However, if you are running simulations with hundreds or thousands of\n"
"identical robots, a different shape collision indexing is available: the spatial\n"
"hash. The spatial hash is a grid stored in a hashmap. To get the max out of this\n"
"indexing method, you must set two parameters: the cell size and the suggested\n"
"minimum number of cells in the space. According to the documentation of\n"
"Chipmunk, the cell size should correspond to the size of the bounding box of the\n"
"most common object in the simulation; the minimum number of cells should be at\n"
"least 10x the number of objects managed by the physics engine. To use this\n"
"indexing method, use this syntax (all attributes are mandatory):\n\n"
" <physics_engines>\n"
" ...\n"
" <dynamics2d id=\"dyn2d\"\n"
" <spatial_hash cell_size=\"1.0\"\n"
" cell_num=\"2.0\" />\n"
" </dynamics2d>\n"
" ...\n"
" </physics_engines>\n"
,
"Usable"
);
}
| 47.705382
| 130
| 0.500238
|
freedomcondor
|
2e550b4bec8359ca1197d95f8c1a1b8bac17345f
| 718
|
hpp
|
C++
|
libcaf_core/caf/message_priority.hpp
|
seewpx/actor-framework
|
65ecf35317b81d7a211848d59e734f43483fe410
|
[
"BSD-3-Clause"
] | 2,517
|
2015-01-04T22:19:43.000Z
|
2022-03-31T12:20:48.000Z
|
libcaf_core/caf/message_priority.hpp
|
seewpx/actor-framework
|
65ecf35317b81d7a211848d59e734f43483fe410
|
[
"BSD-3-Clause"
] | 894
|
2015-01-07T14:21:21.000Z
|
2022-03-30T06:37:18.000Z
|
libcaf_core/caf/message_priority.hpp
|
seewpx/actor-framework
|
65ecf35317b81d7a211848d59e734f43483fe410
|
[
"BSD-3-Clause"
] | 570
|
2015-01-21T18:59:33.000Z
|
2022-03-31T19:00:02.000Z
|
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include <cstdint>
#include <string>
#include <type_traits>
#include "caf/detail/core_export.hpp"
namespace caf {
enum class message_priority {
high = 0,
normal = 1,
};
using high_message_priority_constant
= std::integral_constant<message_priority, message_priority::high>;
using normal_message_priority_constant
= std::integral_constant<message_priority, message_priority::normal>;
CAF_CORE_EXPORT std::string to_string(message_priority);
} // namespace caf
| 24.758621
| 77
| 0.777159
|
seewpx
|
2e5adc532c473086d5dfeae55fede6b12fc532b1
| 5,415
|
cpp
|
C++
|
Templates/Project/Volund_Engine/src/Components/Renderer.cpp
|
Kaj9296/Volund-Engine
|
2416edc6297da4818f0a9f5613daf2223ff868d9
|
[
"MIT"
] | null | null | null |
Templates/Project/Volund_Engine/src/Components/Renderer.cpp
|
Kaj9296/Volund-Engine
|
2416edc6297da4818f0a9f5613daf2223ff868d9
|
[
"MIT"
] | null | null | null |
Templates/Project/Volund_Engine/src/Components/Renderer.cpp
|
Kaj9296/Volund-Engine
|
2416edc6297da4818f0a9f5613daf2223ff868d9
|
[
"MIT"
] | null | null | null |
#pragma once
#include "PCH/PCH.h"
#include "Renderer.h"
#include "Camera.h"
#include "PointLight.h"
#include "DirectionalLight.h"
#include "Scene/Entity.h"
namespace Volund
{
void Renderer::SetMesh(Mesh& mesh)
{
this->mesh = &mesh;
}
void Renderer::SetMaterial(Material& material)
{
this->material = &material;
}
void Renderer::SetShader(Shader& shader)
{
this->shader = &shader;
}
Mesh* Renderer::GetMesh() const
{
if (this->mesh == nullptr)
{
Console::LogError("Renderer does not have a mesh.");
}
return this->mesh;
}
Material* Renderer::GetMaterial() const
{
if (this->material == nullptr)
{
Console::LogError("Renderer does not have a material.");
}
return this->material;
}
Shader* Renderer::GetShader() const
{
if (this->shader == nullptr)
{
Console::LogError("Renderer does not have a shader.");
}
return this->shader;
}
void Renderer::Render(GPUBuffer& Buffer, Camera const& Cam)
{
Buffer.BindFramebuffer();
Buffer.ViewPort();
this->ModelMatrix_P = Mat4(1.0f);
this->ModelMatrix_P = glm::translate(this->ModelMatrix, this->entity->Transform.Position);
this->ModelMatrix_P *= Mat4(this->entity->Transform.Quaternion);
this->ModelMatrix_P = glm::scale(this->ModelMatrix, this->entity->Transform.Scale);
this->shader->SetMat4(this->ModelMatrix, "ModelMatrix");
//Update uniforms
this->SendLights(*this->shader, Cam);
this->material->SendToShader(*this->shader);
Cam.SendToShader(*this->shader);
//Render mesh
shader->DrawMesh(*this->mesh);
}
void Renderer::Render(GPUBuffer& Buffer, Camera const& Cam, glm::vec4(&FrustumPlanes)[6])
{
AABB aabb = this->mesh->aabb;
aabb = aabb.GetInWorldSpace(this->entity);
if (this->InFrustum(aabb, FrustumPlanes))
{
Buffer.BindFramebuffer();
Buffer.ViewPort();
this->ModelMatrix_P = Mat4(1.0f);
this->ModelMatrix_P = glm::translate(this->ModelMatrix, this->entity->Transform.Position);
this->ModelMatrix_P *= Mat4(this->entity->Transform.Quaternion);
this->ModelMatrix_P = glm::scale(this->ModelMatrix, this->entity->Transform.Scale);
this->shader->SetMat4(this->ModelMatrix, "ModelMatrix");
//Update uniforms
this->SendLights(*this->shader, Cam);
this->material->SendToShader(*this->shader);
Cam.SendToShader(*this->shader);
//Render mesh
shader->DrawMesh(*this->mesh);
}
}
void Renderer::Render(GPUBuffer& Buffer, Camera const& Cam, glm::vec4(&FrustumPlanes)[6], Shader*& LastShader, Material*& LastMaterial)
{
AABB aabb = this->mesh->aabb;
aabb = aabb.GetInWorldSpace(this->entity);
if (this->InFrustum(aabb, FrustumPlanes))
{
this->ModelMatrix_P = Mat4(1.0f);
this->ModelMatrix_P = glm::translate(this->ModelMatrix, this->entity->Transform.Position);
this->ModelMatrix_P *= Mat4(this->entity->Transform.Quaternion);
this->ModelMatrix_P = glm::scale(this->ModelMatrix, this->entity->Transform.Scale);
this->shader->SetMat4(this->ModelMatrix, "ModelMatrix");
//Update uniforms
if (this->shader != LastShader)
{
this->SendLights(*this->shader, Cam);
this->material->SendToShader(*this->shader);
Cam.SendToShader(*this->shader);
Buffer.BindFramebuffer();
Buffer.ViewPort();
LastShader = this->shader;
LastMaterial = this->material;
}
else if (this->material != LastMaterial)
{
this->material->SendToShader(*this->shader);
LastMaterial = this->material;
}
//Render mesh
shader->DrawMesh(*this->mesh);
}
}
bool Renderer::InFrustum(AABB aabb, glm::vec4(&FrustumPlanes)[6])
{
Vec4 axisVert(1.0f);
for (int32_t y = 0; y < 6; y++)
{
// x-axis
if (FrustumPlanes[y].x < 0.0f)
{
axisVert.x = aabb.Min.x;
}
else
{
axisVert.x = aabb.Max.x;
}
// y-axis
if (FrustumPlanes[y].y < 0.0f)
{
axisVert.y = aabb.Min.y;
}
else
{
axisVert.y = aabb.Max.y;
}
// z-axis
if (FrustumPlanes[y].z < 0.0f)
{
axisVert.z = aabb.Min.z;
}
else
{
axisVert.z = aabb.Max.z;
}
if (Math::Dot(FrustumPlanes[y], axisVert) < 0.0f)
{
return false;
}
}
return true;
}
void Renderer::SendLights(Shader& shader, Camera const& Cam)
{
//Point Lights
auto Point_View = Engine::GetCurrentScene()->ComponentView<PointLight>();
for (uint32_t i = 0; i < Point_View.size(); i++)
{
Point_View[i]->SendToShader(shader, i);
}
int AmountOfPointLights = Point_View.size();
if (AmountOfPointLights > 1000)
{
Console::LogWarning("To many point lights in scene, maximum allowed amount is 1000.");
AmountOfPointLights = 1000;
}
shader.SetInt(AmountOfPointLights, "AmountOfPointLights");
//Directional Lights
auto Directional_View = Engine::GetCurrentScene()->ComponentView<DirectionalLight>();
for (uint32_t i = 0; i < Directional_View.size(); i++)
{
Directional_View[i]->SendToShader(shader, Cam, i);
}
int AmountOfDirectionalLights = Directional_View.size();
if (AmountOfDirectionalLights > 5)
{
Console::LogWarning("To many directional lights in scene, maximum allowed amount is 5.");
AmountOfDirectionalLights = 5;
}
shader.SetInt(AmountOfDirectionalLights, "AmountOfDirectionalLights");
}
Renderer::Renderer(Mesh const& mesh, Material const& material, Shader const& shader)
: mesh((Mesh*)&mesh), material((Material*)&material), shader((Shader*)&shader)
{
}
} //namespace Volund
| 24.391892
| 136
| 0.668698
|
Kaj9296
|
2e60934cfd02eaca62550f7d4ecc11f52d007808
| 31,741
|
cpp
|
C++
|
.vim/sourceCode/ogre_src_v1-8-1/RenderSystems/GL/src/nvparse/ps1.0_program.cpp
|
lakehui/Vim_config
|
6cab80dc1209b34bf6379f42b1a92790bd0c146b
|
[
"MIT"
] | 2
|
2017-08-03T07:15:00.000Z
|
2018-06-18T10:32:53.000Z
|
.vim/sourceCode/ogre_src_v1-8-1/RenderSystems/GL/src/nvparse/ps1.0_program.cpp
|
lakehui/Vim_config
|
6cab80dc1209b34bf6379f42b1a92790bd0c146b
|
[
"MIT"
] | null | null | null |
.vim/sourceCode/ogre_src_v1-8-1/RenderSystems/GL/src/nvparse/ps1.0_program.cpp
|
lakehui/Vim_config
|
6cab80dc1209b34bf6379f42b1a92790bd0c146b
|
[
"MIT"
] | 2
|
2019-03-04T22:57:42.000Z
|
2020-03-06T01:32:26.000Z
|
#include "ps1.0_program.h"
#include "nvparse_errors.h"
#include "nvparse_externs.h"
#include <string>
#include <map>
#include <algorithm>
#include <string.h>
#include <set>
using namespace std;
using namespace ps10;
struct ltstr
{
bool operator()(const char* s1, const char* s2) const
{
return strcmp(s1, s2) < 0;
}
};
#define DBG_MESG(msg, line) errors.set(msg, line)
//#define DBG_MESG(msg, line)
namespace ps10
{
std::map<int, std::pair<int,int> > constToStageAndConstMap;
std::vector<int> constToStageArray;
std::map<int, int> stageToConstMap; // to keep track of which constants have been used up for this stage.
// r-value of 0 means none, r-value of 1 means c0 used, and r-value of 2 means both used.
//std::map<int, int> constToStageMap;
std::map<int, GLenum> stageToTargetMap;
std::set<const char*, ltstr> alphaBlueRegisters; // Keeps track of whether the result of a register
// was a dp3, if a register is in this set, it means that if it is used a source for the alpha
// component the blue component should be used, and not the alpha component.
void SetFinalCombinerStage();
}
void RemoveFromAlphaBlue(std::string s)
{
std::set<const char*, ltstr>::iterator iter =
ps10::alphaBlueRegisters.find(s.c_str());
if (iter != alphaBlueRegisters.end())
alphaBlueRegisters.erase(iter);
}
/*
void AddToMap(string s, int stage)
{
const char* cstr = s.c_str();
if (cstr[0] == 'c')
{
int constNum = atoi(&cstr[1]);
if (constNum < 0 || constNum > 7)
return;
constToStageMap[constNum] = stage;
}
}
*/
bool AddToMap(string s, int stage, GLenum& constVal)
{
const char* cstr = s.c_str();
if (cstr[0] == 'c')
{
int constNum = atoi(&cstr[1]);
std::map<int, int>::iterator iter = stageToConstMap.find(stage);
if (iter == stageToConstMap.end())
{
// no constants used for this stage.
std::pair<int, int> temp;
temp.first = stage;
temp.second = 0;
constToStageAndConstMap[constNum] = temp;
stageToConstMap[stage] = 0;
constVal = 0;
constToStageArray.push_back(constNum);
constToStageArray.push_back(stage);
constToStageArray.push_back(constVal);
}
else
{
int constUsed = (*iter).second;
if (constUsed >= 1)
return false;
else // const0 has been used, so use const1 for this stage.
{
std::pair<int,int> temp;
temp.first = stage;
temp.second = 1;
constToStageAndConstMap[constNum] = temp;
stageToConstMap[stage] = 1;
constVal = 1;
constToStageArray.push_back(constNum);
constToStageArray.push_back(stage);
constToStageArray.push_back(constVal);
}
}
}
constVal += GL_CONSTANT_COLOR0_NV;
return true;
}
bool IsLegalTarget(int target)
{
if (target == GL_TEXTURE_CUBE_MAP_ARB)
return true;
if (target == GL_TEXTURE_3D)
return true;
#if defined(GL_EXT_texture_rectangle)
if (target == GL_TEXTURE_RECTANGLE_EXT)
return true;
#elif defined(GL_NV_texture_rectangle)
if (target == GL_TEXTURE_RECTANGLE_NV)
return true;
#endif
if (target == GL_TEXTURE_2D)
return true;
if (target == GL_TEXTURE_1D)
return true;
return false;
}
bool ps10_set_map(const std::vector<int>& argv)
{
if (argv.size() % 2 != 0)
{
errors.set("Odd number of arguments for texture target map.");
return false;
}
for (unsigned int i=0;i<argv.size();i=i+2)
{
int stage = argv[i];
int target = argv[i+1];
if (!IsLegalTarget(target))
{
errors.set("Illegal target in texture target map.");
return false;
}
ps10::stageToTargetMap[stage] = target;
}
return true;
}
int const_to_combiner_reg_mapping[32][3]; // each 3 tuple is: (constant#, stage #, reg #)
int const_to_combiner_reg_mapping_count = 0;
namespace
{
struct set_constants
{
void operator() (constdef c)
{
if(c.reg[0] != 'c' && c.reg.size() != 2)
DBG_MESG("def line must use constant registers", 0);
int reg = c.reg[1] - '0';
GLenum stage = GL_COMBINER0_NV + (reg / 2);
GLenum cclr = GL_CONSTANT_COLOR0_NV + (reg % 2);
GLfloat cval[4];
cval[0] = c.r;
cval[1] = c.g;
cval[2] = c.b;
cval[3] = c.a;
glCombinerStageParameterfvNV(stage, cclr, cval);
}
};
GLenum get_tex_target(int stage)
{
std::map<int, GLenum>::iterator iter = stageToTargetMap.find(stage);
if (iter != stageToTargetMap.end())
return (*iter).second;
// If no mapping set, use the current state. This will not work correctly, in general,
// if nvparse was invoked within a display list.
if(glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB))
return GL_TEXTURE_CUBE_MAP_ARB;
if(glIsEnabled(GL_TEXTURE_3D))
return GL_TEXTURE_3D;
#if defined(GL_EXT_texture_rectangle)
if(glIsEnabled(GL_TEXTURE_RECTANGLE_EXT))
return GL_TEXTURE_RECTANGLE_EXT;
#elif defined(GL_NV_texture_rectangle)
if(glIsEnabled(GL_TEXTURE_RECTANGLE_NV))
return GL_TEXTURE_RECTANGLE_NV;
#endif
if(glIsEnabled(GL_TEXTURE_2D))
return GL_TEXTURE_2D;
if(glIsEnabled(GL_TEXTURE_1D))
return GL_TEXTURE_1D;
//otherwise make the op none...
return GL_NONE;
}
struct set_texture_shaders
{
set_texture_shaders(vector<constdef> * cdef)
{
for(stage = 0; stage < 4; stage++)
{
glActiveTextureARB(GL_TEXTURE0_ARB + stage);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_NONE);
}
stage = 0;
c = cdef;
}
void operator() (vector<string> & instr)
{
if(stage > 3)
return;
glActiveTextureARB(GL_TEXTURE0_ARB + stage);
string op = instr[0];
if(op == "tex")
{
if(instr.size() != 2)
fprintf(stderr,"incorrect \"tex\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, get_tex_target(stage));
}
else if(op == "texbem")
{
if(instr.size() != 3 || stage == 0)
fprintf(stderr,"incorrect \"texbem\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_OFFSET_TEXTURE_2D_NV);
if(reg2stage.count(instr[2]) == 0)
fprintf(stderr,"incorrect \"texbem\" instruction, stage %d...\n", stage);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
}
else if(op == "texbeml")
{
if(instr.size() != 3 || stage == 0)
fprintf(stderr,"incorrect \"texbeml\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_OFFSET_TEXTURE_SCALE_NV);
if(reg2stage.count(instr[2]) == 0)
fprintf(stderr,"incorrect \"texbeml\" instruction, stage %d...\n", stage);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
}
else if(op == "texcoord")
{
if(instr.size() != 2)
fprintf(stderr,"incorrect \"texcoord\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_PASS_THROUGH_NV);
}
else if(op == "texkill")
{
if(instr.size() != 2)
fprintf(stderr,"incorrect \"texkill\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_CULL_FRAGMENT_NV);
}
else if(op == "texm3x2pad")
{
if(instr.size() != 3 || stage == 0)
fprintf(stderr,"incorrect \"texm3x2pad\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
if(instr[2].find("_bx2") != string::npos)
{
instr[2].erase(instr[2].begin() + instr[2].find("_bx2"), instr[2].end());
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
}
if(reg2stage.count(instr[2]) == 0)
fprintf(stderr,"incorrect \"texm3x2pad\" instruction, stage %d...\n", stage);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
}
else if(op == "texm3x2tex")
{
if(instr.size() != 3 || stage == 0)
fprintf(stderr,"incorrect \"texm3x2tex\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_TEXTURE_2D_NV);
if(instr[2].find("_bx2") != string::npos)
{
instr[2].erase(instr[2].begin() + instr[2].find("_bx2"), instr[2].end());
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
}
if(reg2stage.count(instr[2]) == 0)
fprintf(stderr,"incorrect \"texm3x2tex\" instruction, stage %d...\n", stage);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
}
else if(op == "texm3x3pad")
{
if(instr.size() != 3 || stage == 0)
fprintf(stderr,"incorrect \"texm3x3pad\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
if(instr[2].find("_bx2") != string::npos)
{
instr[2].erase(instr[2].begin() + instr[2].find("_bx2"), instr[2].end());
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
}
if(reg2stage.count(instr[2]) == 0)
fprintf(stderr,"incorrect \"texm3x3pad\" instruction, stage %d...\n", stage);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
}
else if(op == "texm3x3tex")
{
if(instr.size() != 3 || stage == 0)
fprintf(stderr,"incorrect \"texm3x3tex\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV);
if(instr[2].find("_bx2") != string::npos)
{
instr[2].erase(instr[2].begin() + instr[2].find("_bx2"), instr[2].end());
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
}
if(reg2stage.count(instr[2]) == 0)
fprintf(stderr,"incorrect \"texm3x3tex\" instruction, stage %d...\n", stage);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
}
else if(op == "texm3x3spec")
{
if(instr.size() != 4 || stage == 0)
fprintf(stderr,"incorrect \"texm3x3spec\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
if(! c)
return;
constdef cd;
for(int i = c->size()-1; i >= 0; i--)
{
cd = (*c)[i];
if(cd.reg == "c0")
break;
}
if(cd.reg != "c0" || instr[3] != "c0")
return;
GLfloat eye[4];
eye[0] = cd.r;
eye[1] = cd.g;
eye[2] = cd.b;
eye[3] = cd.a;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV);
glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_CONST_EYE_NV, eye);
if(instr[2].find("_bx2") != string::npos)
{
instr[2].erase(instr[2].begin() + instr[2].find("_bx2"), instr[2].end());
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
}
if(reg2stage.count(instr[2]) == 0)
fprintf(stderr,"incorrect \"texm3x3tex\" instruction, stage %d...\n", stage);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
}
else if(op == "texm3x3vspec")
{
if(instr.size() != 3 || stage == 0)
fprintf(stderr,"incorrect \"texm3x3vspec\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV);
if(instr[2].find("_bx2") != string::npos)
{
instr[2].erase(instr[2].begin() + instr[2].find("_bx2"), instr[2].end());
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
}
if(reg2stage.count(instr[2]) == 0)
fprintf(stderr,"incorrect \"texm3x3tex\" instruction, stage %d...\n", stage);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
}
else if(op == "texreg2ar")
{
if(instr.size() != 3 || stage == 0)
fprintf(stderr,"incorrect \"texreg2ar\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DEPENDENT_AR_TEXTURE_2D_NV);
if(reg2stage.count(instr[2]) == 0)
fprintf(stderr,"incorrect \"texreg2ar\" instruction, stage %d...\n", stage);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
}
else if(op == "texreg2gb")
{
if(instr.size() != 3 || stage == 0)
fprintf(stderr,"incorrect \"texreg2gb\" instruction, stage %d...\n", stage);
reg2stage[instr[1]] = stage;
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DEPENDENT_GB_TEXTURE_2D_NV);
if(reg2stage.count(instr[2]) == 0)
fprintf(stderr,"incorrect \"texreg2gb\" instruction, stage %d...\n", stage);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
}
stage++;
}
map<string, int> reg2stage;
int stage;
vector<constdef> * c;
};
GLenum reg_enum(string s, int stage)
{
/*if(s == "c0")
return GL_CONSTANT_COLOR0_NV;
else if(s == "c1")
return GL_CONSTANT_COLOR1_NV;
else if(s == "c2")
return GL_CONSTANT_COLOR0_NV;
else if(s == "c3")
return GL_CONSTANT_COLOR1_NV;
else if(s == "c4")
return GL_CONSTANT_COLOR0_NV;
else if(s == "c5")
return GL_CONSTANT_COLOR1_NV;
else if(s == "c6")
return GL_CONSTANT_COLOR0_NV;
else if(s == "c7")
return GL_CONSTANT_COLOR1_NV;
*/
if (s == "c0" || s == "c1" || s == "c2" || s == "c3" ||
s == "c4" || s == "c5" || s == "c6" || s == "c7")
{
GLenum result;
if (!AddToMap(s,stage,result))
errors.set("Illegal constant usage.",line_number);
// This is a pain, since the caller is a void and no check is made for errors. Sigh.
return result;
}
else if(s == "t0")
return GL_TEXTURE0_ARB;
else if(s == "t1")
return GL_TEXTURE1_ARB;
else if(s == "t2")
return GL_TEXTURE2_ARB;
else if(s == "t3")
return GL_TEXTURE3_ARB;
else if(s == "v0")
return GL_PRIMARY_COLOR_NV;
else if(s == "v1")
return GL_SECONDARY_COLOR_NV;
else if(s == "r0")
return GL_SPARE0_NV;
else if(s == "r1")
return GL_SPARE1_NV;
else // ??
return GL_DISCARD_NV;
}
struct src
{
src(string s, int stage, string *regname=NULL)
{
init(s, stage, regname);
}
void init(string s, int stage, string *regname=NULL)
{
arg = s;
comp = GL_RGB;
alphaComp = GL_ALPHA;
map = GL_SIGNED_IDENTITY_NV;
string::size_type offset;
if(
(offset = s.find(".a")) != string::npos ||
(offset = s.find(".w")) != string::npos
)
{
comp = GL_ALPHA;
s.erase(offset, offset+2);
}
else if ((offset = s.find(".b")) != string::npos ||
(offset = s.find(".z")) != string::npos)
{
alphaComp = GL_BLUE;
s.erase(offset,offset+2);
}
bool negate = false;
if(s[0] == '1')
{
s.erase(0, 1);
while(s[0] == ' ')
s.erase(0,1);
if(s[0] == '-')
s.erase(0,1);
while(s[0] == ' ')
s.erase(0,1);
map = GL_UNSIGNED_INVERT_NV;
}
else if(s[0] == '-')
{
s.erase(0, 1);
while(s[0] == ' ')
s.erase(0,1);
negate = true;
map = GL_UNSIGNED_INVERT_NV;
}
bool half_bias = false;
bool expand = false;
if(s.find("_bias") != string::npos)
{
s.erase(s.find("_bias"), 5);
half_bias = true;
}
else if(s.find("_bx2") != string::npos)
{
s.erase(s.find("_bx2"), 4);
expand = true;
}
if(expand)
{
if(negate)
map = GL_EXPAND_NEGATE_NV;
else
map = GL_EXPAND_NORMAL_NV;
}
else if(half_bias)
{
if(negate)
map = GL_HALF_BIAS_NEGATE_NV;
else
map = GL_HALF_BIAS_NORMAL_NV;
}
reg = reg_enum(s,stage);
if (regname != NULL)
*regname = s; // return the bare register name
//alphaComp = GL_ALPHA;
std::set<const char*, ltstr>::iterator iter =
ps10::alphaBlueRegisters.find(s.c_str());
if (iter != ps10::alphaBlueRegisters.end())
alphaComp = GL_BLUE;
}
string arg;
GLenum reg;
GLenum map;
GLenum comp;
GLenum alphaComp;
};
struct set_register_combiners
{
set_register_combiners()
{
// combiner = 0;
combiner = -1;
}
void operator() (vector<string> & instr)
{
string op;
GLenum scale = GL_NONE;
bool paired_instr = false;
int instr_base = 0;
if (instr[0]=="+") {
paired_instr = true;
instr_base = 1;
}
op = instr[instr_base];
string::size_type offset;
if((offset = op.find("_x2")) != string::npos)
{
scale = GL_SCALE_BY_TWO_NV;
op.erase(op.begin()+offset, op.begin()+offset+3);
}
else if((offset = op.find("_x4")) != string::npos)
{
scale = GL_SCALE_BY_FOUR_NV;
op.erase(op.begin()+offset, op.begin()+offset+3);
}
else if((offset = op.find("_d2")) != string::npos)
{
scale = GL_SCALE_BY_ONE_HALF_NV;
op.erase(op.begin()+offset, op.begin()+offset+3);
}
if((offset = op.find("_sat")) != string::npos)
{
op.erase(op.begin()+offset, op.begin()+offset+4);
}
string dst = instr[1+instr_base];
int mask = GL_RGBA;
if(
(offset = dst.find(".rgba")) != string::npos ||
(offset = dst.find(".xyzw")) != string::npos
)
{
dst.erase(offset, offset + 5);
}
else if(
(offset = dst.find(".rgb")) != string::npos ||
(offset = dst.find(".xyz")) != string::npos
)
{
dst.erase(offset, offset + 4);
mask = GL_RGB;
}
else if(
(offset = dst.find(".a")) != string::npos ||
(offset = dst.find(".w")) != string::npos
)
{
dst.erase(offset, offset + 2);
mask = GL_ALPHA;
}
if (!paired_instr)
combiner++;
GLenum dreg = reg_enum(dst,combiner);
GLenum C = GL_COMBINER0_NV + combiner;
bool isAlphaBlue = false; // To keep track of whether the dst register's alpha was its blue value.
if(op == "add" || op == "sub")
{
src a(instr[2+instr_base],combiner);
src b(instr[3+instr_base],combiner);
if(mask == GL_RGBA || mask == GL_RGB)
{
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, a.map, a.comp);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_C_NV, b.reg, b.map, b.comp);
if(op == "add")
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
else
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_D_NV, GL_ZERO, GL_EXPAND_NORMAL_NV, GL_RGB);
glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
if(mask == GL_RGBA || mask == GL_ALPHA)
{
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_A_NV, a.reg, a.map, a.alphaComp);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_C_NV, b.reg, b.map, b.alphaComp);
if(op == "add")
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
else
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_D_NV, GL_ZERO, GL_EXPAND_NORMAL_NV, GL_ALPHA);
glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
}
else if(op == "cnd")
{
src a(instr[3+instr_base],combiner);
src b(instr[4+instr_base],combiner);
if(instr[2+instr_base] != "r0.a" && instr[2+instr_base] != "r0.w")
{} // bad
if(mask == GL_RGBA || mask == GL_RGB)
{
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, a.map, a.comp);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_C_NV, b.reg, b.map, b.comp);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
GL_FALSE, GL_FALSE, GL_TRUE);
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
if(mask == GL_RGBA || mask == GL_ALPHA)
{
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_A_NV, a.reg, a.map, a.alphaComp);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_C_NV, b.reg, b.map, b.alphaComp);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
GL_FALSE, GL_FALSE, GL_TRUE);
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
}
else if(op == "dp3")
{
src a(instr[2+instr_base],combiner);
src b(instr[3+instr_base],combiner);
if(mask == GL_RGBA || mask == GL_RGB)
{
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, a.map, a.comp);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, b.reg, b.map, b.comp);
glCombinerOutputNV(C, GL_RGB, dreg, GL_DISCARD_NV, GL_DISCARD_NV, scale, GL_NONE,
GL_TRUE, GL_FALSE, GL_FALSE);
}
else if (!paired_instr)
{
// ooh.. what to do here?
}
if(mask == GL_RGBA || mask == GL_ALPHA)
{
// todo -- make next ref to dst.a actually ref dst.b since combiners can't write dp3 to the alpha channel
// Done by Ashu: Put this register in the alphaBlueRegister set.
isAlphaBlue = true;
ps10::alphaBlueRegisters.insert(dst.c_str());
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
}
else if(op == "lrp")
{
src a(instr[2+instr_base],combiner);
src b(instr[3+instr_base],combiner);
src c(instr[4+instr_base],combiner);
if(mask == GL_RGBA || mask == GL_RGB)
{
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, GL_UNSIGNED_IDENTITY_NV, a.comp);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, b.reg, b.map, b.comp);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_C_NV, a.reg, GL_UNSIGNED_INVERT_NV, a.comp);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_D_NV, c.reg, c.map, c.comp);
glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
if(mask == GL_RGBA || mask == GL_ALPHA)
{
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_A_NV, a.reg, GL_UNSIGNED_IDENTITY_NV, a.alphaComp);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_B_NV, b.reg, b.map, b.alphaComp);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_C_NV, a.reg, GL_UNSIGNED_INVERT_NV, a.alphaComp);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_D_NV, c.reg, c.map, c.alphaComp);
glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
}
else if(op == "mad")
{
src a(instr[2+instr_base],combiner);
src b(instr[3+instr_base],combiner);
src c(instr[4+instr_base],combiner);
if(mask == GL_RGBA || mask == GL_RGB)
{
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, a.map, a.comp);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, b.reg, b.map, b.comp);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_C_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_D_NV, c.reg, c.map, c.comp);
glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
if(mask == GL_RGBA || mask == GL_ALPHA)
{
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_A_NV, a.reg, a.map, a.alphaComp);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_B_NV, b.reg, b.map, b.alphaComp);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_C_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_D_NV, c.reg, c.map, c.alphaComp);
glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
}
else if(op == "mov")
{
src a(instr[2+instr_base],combiner);
if(mask == GL_RGBA || mask == GL_RGB)
{
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, a.map, a.comp);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
glCombinerOutputNV(C, GL_RGB, dreg, GL_DISCARD_NV, GL_DISCARD_NV, scale, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
if(mask == GL_RGBA || mask == GL_ALPHA)
{
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_A_NV, a.reg, a.map, a.alphaComp);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
glCombinerOutputNV(C, GL_ALPHA, dreg, GL_DISCARD_NV, GL_DISCARD_NV, scale, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
}
else if(op == "mul")
{
src a(instr[2+instr_base],combiner);
src b(instr[3+instr_base],combiner);
if(mask == GL_RGBA || mask == GL_RGB)
{
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, a.map, a.comp);
glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, b.reg, b.map, b.comp);
glCombinerOutputNV(C, GL_RGB, dreg, GL_DISCARD_NV, GL_DISCARD_NV, scale, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
if(mask == GL_RGBA || mask == GL_ALPHA)
{
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_A_NV, a.reg, a.map, a.alphaComp);
glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_B_NV, b.reg, b.map, b.alphaComp);
glCombinerOutputNV(C, GL_ALPHA, dreg, GL_DISCARD_NV, GL_DISCARD_NV, scale, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
else if (!paired_instr)
{
glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
GL_FALSE, GL_FALSE, GL_FALSE);
}
}
// combiner++;
if (!isAlphaBlue)
RemoveFromAlphaBlue(dst);
}
int combiner;
};
}
void ps10::SetFinalCombinerStage()
{
glFinalCombinerInputNV(GL_VARIABLE_A_NV,GL_FOG,GL_UNSIGNED_IDENTITY_NV,GL_ALPHA);
glFinalCombinerInputNV(GL_VARIABLE_B_NV,GL_SPARE0_NV,
GL_UNSIGNED_IDENTITY_NV,GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_C_NV,GL_FOG,GL_UNSIGNED_IDENTITY_NV,GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_D_NV,GL_ZERO,GL_UNSIGNED_IDENTITY_NV,GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_E_NV,GL_ZERO,GL_UNSIGNED_IDENTITY_NV,GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_F_NV,GL_ZERO,GL_UNSIGNED_IDENTITY_NV,GL_RGB);
std::set<const char*, ltstr>::iterator iter = ps10::alphaBlueRegisters.find("r0");
GLenum alphaComp = GL_ALPHA;
if (iter != ps10::alphaBlueRegisters.end())
alphaComp = GL_BLUE;
glFinalCombinerInputNV(GL_VARIABLE_G_NV,GL_SPARE0_NV,GL_UNSIGNED_IDENTITY_NV,alphaComp);
// We can now clear alphaBlueRegisters for the next go around
alphaBlueRegisters.clear();
}
void ps10::invoke(vector<constdef> * c,
list<vector<string> > * a,
list<vector<string> > * b)
{
const_to_combiner_reg_mapping_count = 0; // Hansong
glEnable(GL_PER_STAGE_CONSTANTS_NV); // should we require apps to do this?
if(c)
for_each(c->begin(), c->end(), set_constants());
if(a)
for_each(a->begin(), a->end(), set_texture_shaders(c));
glActiveTextureARB( GL_TEXTURE0_ARB );
int numCombiners = 0;
list<vector<string> >::iterator it = b->begin();
for(; it!=b->end(); ++it) {
if ( (*it)[0] != "+" )
numCombiners++;
}
glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV, numCombiners);
if(b)
for_each(b->begin(), b->end(), set_register_combiners());
SetFinalCombinerStage();
// We can clear the stageToTarget map now.
stageToTargetMap.clear();
}
// simple identification - just look for magic substring
// -- easy to break...
bool is_ps10(const char * s)
{
if(strstr(s, "ps.1.0"))
return true;
if(strstr(s, "Ps.1.0"))
return true;
if(strstr(s, "ps.1.1"))
return true;
if(strstr(s, "Ps.1.1"))
return true;
return false;
}
bool ps10::init_extensions()
{
// register combiners
static bool rcinit = false;
if(rcinit == false)
{
/*
if(! glh_init_extensions("GL_NV_register_combiners"))
{
errors.set("unable to initialize GL_NV_register_combiners\n");
return false;
}
else
{
*/
rcinit = true;
/*
}
*/
}
// register combiners 2
static bool rc2init = false;
if(rc2init == false)
{
/*
if( ! glh_init_extensions("GL_NV_register_combiners2"))
{
errors.set("unable to initialize GL_NV_register_combiners2\n");
return false;
}
else
{
*/
rc2init = true;
/*
}
*/
}
static bool tsinit = 0;
if (tsinit == false )
{
/*
if(! glh_init_extensions( "GL_NV_texture_shader " "GL_ARB_multitexture " ))
{
errors.set("unable to initialize GL_NV_texture_shader\n");
return false;
}
else
{
*/
tsinit = true;
/*
}
*/
}
constToStageAndConstMap.clear();
constToStageArray.clear();
stageToConstMap.clear();
line_number = 1;
return true;
}
const int* ps10_get_info(int* pcount)
{
if (pcount)
*pcount = constToStageArray.size();
return &(constToStageArray[0]);
}
| 31.395648
| 110
| 0.650137
|
lakehui
|
2e662137a9b2b83cf0785cde027fba2a1c52102e
| 1,830
|
cpp
|
C++
|
src/KrTools.cpp
|
cildhdi/KrUI
|
c6f18620838f15a82ee65cef5c8d428137e551fb
|
[
"MIT"
] | 5
|
2017-09-08T09:41:58.000Z
|
2018-11-26T13:16:55.000Z
|
src/KrTools.cpp
|
cildhdi/KrUI
|
c6f18620838f15a82ee65cef5c8d428137e551fb
|
[
"MIT"
] | null | null | null |
src/KrTools.cpp
|
cildhdi/KrUI
|
c6f18620838f15a82ee65cef5c8d428137e551fb
|
[
"MIT"
] | 2
|
2018-10-08T20:18:09.000Z
|
2020-04-13T01:47:19.000Z
|
#include "KrTools.h"
namespace KrUI
{
Gdiplus::SizeF GetTextSize(std::wstring strText, Gdiplus::Font* pFont, Gdiplus::Rect rect)
{
Gdiplus::GraphicsPath path;
Gdiplus::FontFamily fontfamily;
pFont->GetFamily(&fontfamily);
path.AddString(strText.c_str(), -1, &fontfamily, pFont->GetStyle(), pFont->GetSize(), rect,
Gdiplus::StringFormat::GenericTypographic()/*&m_StringFormat*/);
Gdiplus::RectF bounds;
path.GetBounds(&bounds);
return Gdiplus::SizeF(bounds.Width, bounds.Height);
}
bool WCharStringToUTF8String(const std::wstring &wstr, std::string &u8str)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
u8str = conv.to_bytes(wstr);
return true;
}
bool UTF8StringToWCharString(const std::string &u8str, std::wstring &wstr)
{
std::wstring_convert<std::codecvt_utf8<wchar_t> > conv;
wstr = conv.from_bytes(u8str);
return true;
}
std::string WideStringToString(std::wstring wStr)
{
if (wStr.size() == 0)
{
return "";
}
char *pszBuf = NULL;
int needBytes = WideCharToMultiByte(CP_ACP, 0, wStr.c_str(), -1, NULL, 0, NULL, NULL);
if (needBytes > 0)
{
pszBuf = new char[needBytes + 1];
ZeroMemory(pszBuf, (needBytes + 1) * sizeof(char));
WideCharToMultiByte(CP_ACP, 0, wStr.c_str(), -1, pszBuf, needBytes, NULL, NULL);
}
std::string str = pszBuf;
delete[] pszBuf;
return str;
}
std::wstring StringToWideString(std::string str)
{
if (str.size() == 0)
{
return L"";
}
wchar_t *pszBuf = NULL;
int needWChar = MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, NULL, 0);
if (needWChar > 0)
{
pszBuf = new wchar_t[needWChar + 1];
ZeroMemory(pszBuf, (needWChar + 1) * sizeof(wchar_t));
MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, pszBuf, needWChar);
}
std::wstring wStr = pszBuf;
delete[] pszBuf;
return wStr;
}
}
| 25.774648
| 93
| 0.67541
|
cildhdi
|
2e668c6401e862a3bde6e7ee6eb790214b429c7e
| 1,841
|
hxx
|
C++
|
src/libserver/css/css_property.hxx
|
korgoth1/rspamd
|
154f69f000244785209dcef937c47f10ede1f113
|
[
"Apache-2.0"
] | null | null | null |
src/libserver/css/css_property.hxx
|
korgoth1/rspamd
|
154f69f000244785209dcef937c47f10ede1f113
|
[
"Apache-2.0"
] | null | null | null |
src/libserver/css/css_property.hxx
|
korgoth1/rspamd
|
154f69f000244785209dcef937c47f10ede1f113
|
[
"Apache-2.0"
] | null | null | null |
/*-
* Copyright 2021 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#ifndef RSPAMD_CSS_PROPERTY_HXX
#define RSPAMD_CSS_PROPERTY_HXX
#include <string>
#include "parse_error.hxx"
#include "contrib/expected/expected.hpp"
namespace rspamd::css {
/*
* To be extended with properties that are interesting from the email
* point of view
*/
enum class css_property_type {
PROPERTY_FONT,
PROPERTY_COLOR,
PROPERTY_BGCOLOR,
PROPERTY_BACKGROUND,
PROPERTY_HEIGHT,
PROPERTY_WIDTH,
PROPERTY_DISPLAY,
PROPERTY_VISIBILITY,
};
struct css_property {
css_property_type type;
static tl::expected<css_property,css_parse_error> from_bytes (const char *input,
size_t inlen);
};
}
/* Make properties hashable */
namespace std {
template<>
class hash<rspamd::css::css_property> {
public:
/* Mix bits to provide slightly better distribution but being constexpr */
constexpr size_t operator() (const rspamd::css::css_property &prop) const {
std::size_t key = 0xdeadbeef ^static_cast<std::size_t>(prop.type);
key = (~key) + (key << 21);
key = key ^ (key >> 24);
key = (key + (key << 3)) + (key << 8);
key = key ^ (key >> 14);
key = (key + (key << 2)) + (key << 4);
key = key ^ (key >> 28);
key = key + (key << 31);
return key;
}
};
}
#endif //RSPAMD_CSS_PROPERTY_HXX
| 25.929577
| 81
| 0.705052
|
korgoth1
|
2e67eeed9cedf80b049288d9e2fdc3aa7e4cf44d
| 5,390
|
cpp
|
C++
|
src/convolution.cpp
|
likunlun0618/snn
|
65d2d919ad40842eb1682b9484a067d792503318
|
[
"MIT"
] | 4
|
2020-01-16T08:15:22.000Z
|
2020-03-30T04:30:23.000Z
|
src/convolution.cpp
|
likunlun0618/snn
|
65d2d919ad40842eb1682b9484a067d792503318
|
[
"MIT"
] | null | null | null |
src/convolution.cpp
|
likunlun0618/snn
|
65d2d919ad40842eb1682b9484a067d792503318
|
[
"MIT"
] | null | null | null |
#include <iostream>
#include <sstream>
#include <cblas.h>
#include <cstdlib>
#include "convolution.h"
//#include "global.h"
//#include "time.h"
namespace snn
{
Module* createConvolution(std::string options)
{
// 目前没有做错误处理
// b=0表示添加bias,b=1表示不添加bias
// 将所有的逗号替换为空格
// 因为原始文件需要用空格做split,所有不能直接用带空格的字符串做options
for (char &ch : options)
ch = ch == ',' ? ' ' : ch;
int c, n, k, s, p, b;
std::stringstream(options) >> c >> n >> k >> s >> p >> b;
Convolution *conv;
if (b != 0)
conv = new Convolution(c, n, k, s, p, true);
else
conv = new Convolution(c, n, k, s, p, false);
return (Module*)conv;
}
Convolution::Convolution(int _c, int _n, int _k, int _s, int _p, bool _bias): s(_s), p(_p)
{
weight.resize(_n, _c, _k, _k);
if (_bias)
bias.resize(1, 1, 1, _n);
}
Convolution::~Convolution() {}
Tensor Convolution::forward(const std::vector<Tensor> &inp)
{
long t1, t2;
// t1 = time();
if (inp[0].c != weight.c)
{
; // 输入和weight的channel不符
}
// p表示padding,s表示步长
// weight.h == weight.w == kernel size
int outh = (inp[0].h + 2*p - weight.h + s) / s;
int outw = (inp[0].w + 2*p - weight.w + s) / s;
// 向storage申请了足量的内存
Tensor out(1, weight.n, outh, outw);
// t1 = system_time();
// 当bias为空Tensor的时候,bias.data为NULL
_convolution(
inp[0].data, weight.data, out.data, bias.data, \
weight.c, inp[0].h, inp[0].w, weight.n, weight.h, s, p \
);
// t2 = time();
/*
if (global == 1 && global_module == 9)
{
std::cout << weight.h << "," << s << "," << p << std::endl;
std::cout << t2 - t1 << std::endl;
}
//*/
return out;
}
int Convolution::parameters() const
{
if (bias.n * bias.c * bias.h * bias.w > 0)
return 2;
else
return 1;
}
// index == 0表示加载weight的参数
// index == 1表示加载bias的参数
int Convolution::load(float *data, int size, int index)
{
if (index == 0 && size != weight.n * weight.c * weight.h * weight.w)
return -1; // weight长度不符合
if (index == 1 && bias.n * bias.c * bias.h * bias.w <= 0)
return -2; // 此卷积层没有偏置,但却尝试给偏置赋值
if (index == 1 && size != bias.n * bias.c * bias.h * bias.w)
return -3; // bias长度不符合
if (index > 1)
return -4; // 卷积的参数最多只有两个
// TODO:改为memcpy
float *p = index == 0 ? weight.data : bias.data;
for (int i = 0; i < size; ++i)
p[i] = data[i];
return 0;
}
int Convolution::_convolution(float *inp, float *weight, float *out, float *bias, \
int c, int h, int w, int n, int k, int s, int p)
{
//long t1 ,t2;
//t1 = time();
int outh = (h + 2*p - k + s) / s;
int outw = (w + 2*p - k + s) / s;
float *tmp;
// trick
if (k == 1 && s == 1 && p == 0)
{
tmp = inp;
}
else
{
tmp = new float[c * k * k * outh * outw];
_im2col(inp, tmp, c, h, w, k, s, p);
}
//t2 = time();
// 偏置相关
float beta;
if (bias)
{
for (int i = n - 1; i >= 0; --i)
{
float *p_out = out + i * (outh * outw);
for (int j = outh * outw - 1; j >= 0; --j)
p_out[j] = bias[i];
}
beta = 1.;
}
else
beta = 0.;
cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, n, outh*outw, c*k*k, 1., \
weight, c*k*k, tmp, outh*outw, beta, out, outh*outw);
if (k == 1 && s == 1 && p == 0)
return 0;
delete [] tmp;
/*
if (global == 1 && global_module == 31)
{
std::cout << k << "," << s << "," << p << std::endl;
std::cout << t2 - t1 << "us" << std::endl;
}
*/
return 0;
}
int Convolution::_im2col(float *inp, float *out, int c, int h, int w, int k, int s, int p)
{
int outh = (h + 2*p - k + s) / s;
int outw = (w + 2*p - k + s) / s;
#pragma omp parallel for num_threads(4)
for (int ci = 0; ci < c; ++ci)
{
float *input = inp + ci * h * w;
int offset = ci * k * k * outh * outw;
for (int kh = 0; kh < k; ++kh)
for (int kw = 0; kw < k; ++kw)
for (int i = 0; i < outh; ++i)
for (int j = 0; j < outw; ++j)
{
int row = kh + i * s - p;
int col = kw + j * s - p;
if (row >= 0 && row < h && col >= 0 && col < w)
out[offset++] = input[row * w + col];
else
out[offset++] = 0.;
}
}
return 0;
}
void Convolution::mergeBN(float *k, float *b, int size)
{
if (size != weight.n)
{
std::cout << "BatchNorm size != Convolution weight n" << std::endl;
exit(0);
}
// 假如当前的卷积层没有bias
if (bias.n * bias.c * bias.h * bias.w <= 0)
{
bias.resize(1, 1, 1, size);
for (int i = 0; i < size; ++i)
bias.data[i] = 0.;
}
// k2c表示k^2 * c,其中k是kernel size,c是channel
int k2c = weight.c * weight.h * weight.w;
for (int i = 0; i < size; ++i)
{
// 融合BN层的weight
for (int j = 0; j < k2c; ++j)
{
weight.data[i * k2c + j] *= k[i];
}
// 融合BN层的bias
bias.data[i] = bias.data[i] * k[i] + b[i];
}
}
} // namespace snn
| 23.744493
| 90
| 0.459184
|
likunlun0618
|
2e74647c409d68563ee04a2d2e000e3eb05061dd
| 11,623
|
hpp
|
C++
|
180726_calculate/calculate2.1.1rc6/calculate/node.hpp
|
newlawrence/Talks
|
d4f4e6b6ecf8f1aaf32ca9a2364c99ee23612745
|
[
"CC-BY-4.0"
] | null | null | null |
180726_calculate/calculate2.1.1rc6/calculate/node.hpp
|
newlawrence/Talks
|
d4f4e6b6ecf8f1aaf32ca9a2364c99ee23612745
|
[
"CC-BY-4.0"
] | 1
|
2019-01-15T14:21:34.000Z
|
2019-01-15T15:19:41.000Z
|
180726_calculate/calculate2.1.1rc6/calculate/node.hpp
|
newlawrence/Talks
|
d4f4e6b6ecf8f1aaf32ca9a2364c99ee23612745
|
[
"CC-BY-4.0"
] | null | null | null |
/*
Calculate - Version 2.1.1rc6
Last modified 2018/07/23
Released under MIT license
Copyright (c) 2016-2018 Alberto Lorenzo <alorenzo.md@gmail.com>
*/
#ifndef __CALCULATE_NODE_HPP__
#define __CALCULATE_NODE_HPP__
#include <iterator>
#include <ostream>
#include <stack>
#include <regex>
#include <unordered_set>
#include "symbol.hpp"
namespace calculate {
template<typename Parser>
class Node {
friend struct std::hash<Node>;
friend calculate::Symbol<Node>;
friend Parser;
public:
using Lexer = typename Parser::Lexer;
using Type = typename Parser::Type;
using Symbol = calculate::Symbol<Node>;
using SymbolType = typename Symbol::SymbolType;
using const_iterator = typename std::vector<Node>::const_iterator;
using const_reverse_iterator = typename std::vector<Node>::const_reverse_iterator;
class VariableHandler {
public:
const std::vector<std::string> variables;
private:
std::size_t _size;
std::unique_ptr<Type[]> _values;
std::size_t _refcount;
std::shared_ptr<VariableHandler> _copy;
void _update(std::size_t) const {}
template<typename Last>
void _update(std::size_t n, Last last) { _values[n] = last; }
template<typename Head, typename... Args>
void _update(std::size_t n, Head head, Args... args) {
_values[n] = head;
_update(n + 1, args...);
}
public:
VariableHandler(std::vector<std::string> keys, Lexer* lexer) :
variables{std::move(keys)},
_size{variables.size()},
_values{std::make_unique<Type[]>(_size)},
_refcount{0u},
_copy{nullptr}
{
std::unordered_set<std::string> singles{variables.begin(), variables.end()};
for (const auto &var : variables) {
if (!std::regex_match(var, lexer->name_regex))
throw UnsuitableName{var};
else if (singles.erase(var) == 0)
throw RepeatedSymbol{var};
}
}
explicit VariableHandler(std::vector<std::string> keys) :
variables{std::move(keys)},
_size{variables.size()},
_values{std::make_unique<Type[]>(_size)},
_refcount{0u},
_copy{nullptr}
{}
std::shared_ptr<VariableHandler> rebuild(std::vector<std::string> keys) noexcept {
++_refcount;
if (_copy)
return _copy;
_copy = std::make_shared<VariableHandler>(std::move(keys));
return _copy;
}
void reset() noexcept {
if (!--_refcount)
_copy = nullptr;
}
std::size_t index(const std::string& token) const {
auto found = std::find(variables.begin(), variables.end(), token);
if (found != variables.end())
return found - variables.begin();
throw UndefinedSymbol{token};
}
Type& at(const std::string& token) const { return _values[index(token)]; }
template<typename Args>
std::enable_if_t<util::is_vectorizable_v<Type, Args>> update(Args&& vals) {
std::size_t i{};
for (const auto& val : vals) {
if (i < _size)
_values[i] = val;
++i;
}
if (_size != i)
throw ArgumentsMismatch{_size, i};
}
template<typename... Args>
void update(Args&&... vals) {
if (_size != sizeof...(vals))
throw ArgumentsMismatch{_size, sizeof...(vals)};
_update(0, std::forward<Args>(vals)...);
}
};
private:
std::shared_ptr<Lexer> _lexer;
std::shared_ptr<VariableHandler> _variables;
std::string _token;
std::unique_ptr<Symbol> _symbol;
std::vector<Node> _nodes;
std::size_t _hash;
Node(
std::shared_ptr<Lexer> _lexer,
std::shared_ptr<VariableHandler> variables,
std::string token,
std::unique_ptr<Symbol>&& symbol,
std::vector<Node>&& nodes,
std::size_t hash
) :
_lexer{std::move(_lexer)},
_variables{std::move(variables)},
_token{std::move(token)},
_symbol{std::move(symbol)},
_nodes{std::move(nodes)},
_hash{hash}
{
if (_nodes.size() != _symbol->arguments())
throw ArgumentsMismatch{_token, _nodes.size(), _symbol->arguments()};
}
std::vector<std::string> _pruned() const noexcept {
std::vector<std::string> pruned{};
auto handlers = _lexer->tokenize_postfix(postfix());
for (const auto& var : _variables->variables)
for (const auto& handler : handlers)
if (var == handler.token) {
pruned.push_back(var);
break;
}
return pruned;
}
bool _compare(const Node& other) const noexcept {
std::stack<const_iterator> these{}, those{}, endings{};
auto equal = [&](auto left, auto right) {
try {
return
left->_variables->index(left->_token) ==
right->_variables->index(right->_token);
}
catch (const UndefinedSymbol&) {
if (left->_symbol == right->_symbol)
return true;
return *(left->_symbol) == *(right->_symbol);
}
};
if (!equal(this, &other))
return false;
these.push(this->begin());
those.push(other.begin());
endings.push(this->end());
while(!these.empty()) {
auto &one = these.top(), &another = those.top();
if (one != endings.top()) {
if (!equal(one, another))
return false;
these.push(one->begin());
those.push(another->begin());
endings.push(one->end());
one++, another++;
continue;
}
these.pop();
those.pop();
endings.pop();
}
return true;
}
std::string _infix(bool right) const noexcept {
using Operator = Operator<Node>;
using Associativity = typename Operator::Associativity;
std::string infix{};
auto brace = [&](std::size_t i) {
const auto& node = _nodes[i];
auto po = static_cast<Operator*>(_symbol.get());
if (node._symbol->type() == SymbolType::OPERATOR) {
auto co = static_cast<Operator*>(node._symbol.get());
auto pp = po->precedence();
auto cp = co->precedence();
auto pa = !i ?
po->associativity() != Associativity::RIGHT :
po->associativity() != Associativity::LEFT;
if ((pa && cp < pp) || (!pa && cp <= pp))
return _lexer->left + node._infix(false) + _lexer->right;
}
auto r = right || i || po->associativity() == Associativity::RIGHT;
return node._infix(r);
};
switch (_symbol->type()) {
case (SymbolType::FUNCTION):
infix += _token + _lexer->left;
for (auto node = _nodes.begin(); node != _nodes.end(); node++) {
infix += node->_infix(false);
infix += (node + 1 != _nodes.end() ? _lexer->separator : "");
}
return infix + _lexer->right;
case (SymbolType::OPERATOR):
return infix + brace(0) + _token + brace(1);
default:
if (right && _lexer->prefixed(_token))
return _lexer->left + _token + _lexer->right;
return _token;
}
return infix;
}
public:
Node(const Node& other) noexcept :
_lexer{other._lexer},
_variables{other._variables->rebuild(other._pruned())},
_token{other._token},
_symbol{nullptr},
_nodes{other._nodes},
_hash{other._hash}
{
using Variable = Variable<Node>;
other._variables->reset();
try {
_symbol = Variable{_variables->at(_token)}.clone();
}
catch (const UndefinedSymbol&) {
_symbol = other._symbol->clone();
}
}
Node(Node&& other) noexcept :
_lexer{std::move(other._lexer)},
_variables{std::move(other._variables)},
_token{std::move(other._token)},
_symbol{std::move(other._symbol)},
_nodes{std::move(other._nodes)},
_hash{std::move(other._hash)}
{}
const Node& operator=(Node other) noexcept {
swap(*this, other);
return *this;
}
friend void swap(Node& one, Node& another) noexcept {
using std::swap;
swap(one._lexer, another._lexer);
swap(one._variables, another._variables);
swap(one._token, another._token);
swap(one._symbol, another._symbol);
swap(one._nodes, another._nodes);
}
operator Type() const {
if (_variables->variables.size() > 0)
throw ArgumentsMismatch{_variables->variables.size(), 0};
return _symbol->eval(_nodes);
}
template<typename... Args>
Type operator()(Args&&... args) const {
_variables->update(std::forward<Args>(args)...);
return _symbol->eval(_nodes);
}
bool operator==(const Node& other) const noexcept {
if (_hash != other._hash)
return false;
return _compare(other);
}
bool operator!=(const Node& other) const noexcept { return !operator==(other); }
const Node& operator[](std::size_t index) const { return _nodes[index]; }
const Node& at(std::size_t index) const { return _nodes.at(index); }
std::size_t size() const noexcept { return _nodes.size(); }
const_iterator begin() const noexcept { return _nodes.cbegin(); }
const_iterator end() const noexcept { return _nodes.cend(); }
const_iterator cbegin() const noexcept { return _nodes.cbegin(); }
const_iterator cend() const noexcept { return _nodes.cend(); }
const_reverse_iterator rbegin() const noexcept { return _nodes.crbegin(); }
const_reverse_iterator rend() const noexcept { return _nodes.crend(); }
const_reverse_iterator crbegin() const noexcept { return _nodes.crbegin(); }
const_reverse_iterator crend() const noexcept { return _nodes.crend(); }
friend std::ostream& operator<<(std::ostream& ostream, const Node& node) noexcept {
ostream << node.infix();
return ostream;
}
const Lexer& lexer() const noexcept { return *_lexer; }
const std::string& token() const noexcept { return _token; }
SymbolType type() const noexcept { return _symbol->type(); }
std::size_t branches() const noexcept { return _nodes.size(); }
std::string infix() const noexcept { return _infix(false); }
std::string postfix() const noexcept {
std::string postfix{};
for (const auto& node : _nodes)
postfix += node.postfix() + " ";
return postfix + _token;
}
const std::vector<std::string>& variables() const noexcept { return _variables->variables; }
};
}
namespace std {
template<typename Parser>
struct hash<calculate::Node<Parser>> {
size_t operator()(const calculate::Node<Parser>& node) const { return node._hash; }
};
}
#endif
| 30.748677
| 96
| 0.549772
|
newlawrence
|
2e770860d8331c041eb4dc0ce3ea9ff1533f8ff2
| 575
|
cpp
|
C++
|
final/stl containers/[]_vs_at()_vs_it.cpp
|
coderica/effective_cpp
|
456d30cf42c6c71dc7187d88e362651dd79ac3fe
|
[
"MIT"
] | null | null | null |
final/stl containers/[]_vs_at()_vs_it.cpp
|
coderica/effective_cpp
|
456d30cf42c6c71dc7187d88e362651dd79ac3fe
|
[
"MIT"
] | null | null | null |
final/stl containers/[]_vs_at()_vs_it.cpp
|
coderica/effective_cpp
|
456d30cf42c6c71dc7187d88e362651dd79ac3fe
|
[
"MIT"
] | null | null | null |
#include <iostream>
#include <vector>
#include <string>
using namespace std;
void main()
{
vector<string> people = { "alice", "barbara", "cleo", "darlene", "edna" };
try {
for (auto i = 0; i < people.size(); i++)
cout << people[i] << " ";
cout << endl;
for (auto i = 0; i < people.size(); i++)
cout << people.at(i) << " ";
cout << endl;
for (auto it = people.begin(); it != people.end()+1; it++)
cout << *it << " ";
cout << endl;
}
catch (exception e)
{
cout << "Exception: " << e.what() << endl;
}
} //end main
| 20.535714
| 76
| 0.50087
|
coderica
|
2e789f06af897447476f1d56a49eef96e8e51284
| 552
|
cc
|
C++
|
lhd/Code/onlyread_.cc
|
xiyoulinuxgroup-2019-summer/TeamF
|
7a661b172f7410583bd11335a3b049f9df8797a3
|
[
"MIT"
] | null | null | null |
lhd/Code/onlyread_.cc
|
xiyoulinuxgroup-2019-summer/TeamF
|
7a661b172f7410583bd11335a3b049f9df8797a3
|
[
"MIT"
] | null | null | null |
lhd/Code/onlyread_.cc
|
xiyoulinuxgroup-2019-summer/TeamF
|
7a661b172f7410583bd11335a3b049f9df8797a3
|
[
"MIT"
] | 1
|
2019-07-15T06:28:11.000Z
|
2019-07-15T06:28:11.000Z
|
//只读算法
//学习闭包的概念
#include<iostream>
#include<numeric>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
vector<int> a;
a.push_back(1);
a.push_back(2);
a.push_back(3);
vector<int> b ;
b.push_back(1);
b.push_back(2);
b.push_back(3);
int sum = accumulate(a.cbegin(),a.cend(),0);
cout << sum << endl;
bool trus = equal(a.cbegin(),a.cend(),b.cbegin());
cout << trus << endl;
//accumualte 作为使用运算符和返回值的类型
//fill表示把一个迭代器赋值给一个东西
//不能在一个空容器中使用fill_n
return 0;
}
| 20.444444
| 55
| 0.597826
|
xiyoulinuxgroup-2019-summer
|
2e7c3c3300e62bbc655d664e247ec281bd44ce2d
| 567
|
cpp
|
C++
|
Leetcode Solution/Tree/Easy/897. Increasing Order Search Tree.cpp
|
bilwa496/Placement-Preparation
|
bd32ee717f671d95c17f524ed28b0179e0feb044
|
[
"MIT"
] | 169
|
2021-05-30T10:02:19.000Z
|
2022-03-27T18:09:32.000Z
|
Leetcode Solution/Tree/Easy/897. Increasing Order Search Tree.cpp
|
bilwa496/Placement-Preparation
|
bd32ee717f671d95c17f524ed28b0179e0feb044
|
[
"MIT"
] | 1
|
2021-10-02T14:46:26.000Z
|
2021-10-02T14:46:26.000Z
|
Leetcode Solution/Tree/Easy/897. Increasing Order Search Tree.cpp
|
bilwa496/Placement-Preparation
|
bd32ee717f671d95c17f524ed28b0179e0feb044
|
[
"MIT"
] | 44
|
2021-05-30T19:56:29.000Z
|
2022-03-17T14:49:00.000Z
|
class Solution {
private:
TreeNode *prev=NULL;
public:
TreeNode* increasingBST(TreeNode* root) {
if(NULL == root)
return root;
//Traversing right subtree first
increasingBST(root->right);
root->right=prev;
prev=root;
TreeNode *res=root;
//If left subtree exists traverse left subtree and return leftmost node
if(root->left){
res=increasingBST(root->left);
root->left=NULL;
}
//else return root only
return res;
}
};
| 22.68
| 80
| 0.550265
|
bilwa496
|
2e7c6a1586f6ca65bf01743261d5a11debb26189
| 1,782
|
hpp
|
C++
|
OptimExplorer/widgets/metrics.hpp
|
MarkTuddenham/OptimExplorer
|
1fb724bb80b099ade76d9f8d6179cb561dedb9bd
|
[
"MIT"
] | 1
|
2020-08-18T20:55:26.000Z
|
2020-08-18T20:55:26.000Z
|
OptimExplorer/widgets/metrics.hpp
|
MarkTuddenham/OptimExplorer
|
1fb724bb80b099ade76d9f8d6179cb561dedb9bd
|
[
"MIT"
] | 4
|
2020-10-11T12:57:29.000Z
|
2020-10-11T14:06:17.000Z
|
OptimExplorer/widgets/metrics.hpp
|
MarkTuddenham/OptimExplorer
|
1fb724bb80b099ade76d9f8d6179cb561dedb9bd
|
[
"MIT"
] | null | null | null |
#pragma once
#include "core/events.hpp"
#include "core/utils.hpp"
#include "widgets/utils.hpp"
#include "widgets/widget.hpp"
DISABLE_WARNING_PUSH_ALL
#include <Mahi/Gui.hpp>
DISABLE_WARNING_POP
#include <iostream>
#include <utility>
#include <vector>
namespace OptimExplorer
{
class MetricsWidget : public Widget
{
public:
MetricsWidget() : Widget("Metrics")
{
event_dispatcher.appendListener(EventType::ClearMetrics, [&](const Event& ev) {
m_valid_loss.clear();
m_train_loss.clear();
m_valid_acc.clear();
m_train_acc.clear();
m_scroll_train_loss.clear();
});
event_dispatcher.appendListener(EventType::TrainMetric, [&](const Event& ev) {
auto me = dynamic_cast<const MetricEvent&>(ev);
if (me.get_name() == "loss")
{
m_train_loss.emplace_back(me.get_metric());
m_scroll_train_loss.add_point(me.get_metric());
}
else if (me.get_name() == "accuracy")
{
m_train_acc.emplace_back(me.get_metric());
}
});
event_dispatcher.appendListener(EventType::ValidMetric, [&](const Event& ev) {
auto me = dynamic_cast<const MetricEvent&>(ev);
if (me.get_name() == "loss")
{
m_valid_loss.emplace_back(me.get_metric());
}
else if (me.get_name() == "accuracy")
{
m_valid_acc.emplace_back(me.get_metric());
}
});
}
void render() override;
private:
void render_loss();
void render_accuracy();
void render_confusion_matrix();
std::vector<std::pair<double, double>> m_valid_loss, m_train_loss;
std::vector<std::pair<double, double>> m_valid_acc, m_train_acc;
bool m_scrolling_paused = false;
float m_scroll_history = 1.0f;
ScrollingData m_scroll_train_loss;
};
} // namespace OptimExplorer
| 24.081081
| 83
| 0.664422
|
MarkTuddenham
|
2e7d2873f7b314fbce113a0526319ff88f7bf73d
| 3,960
|
hpp
|
C++
|
SOFT_dynamics/include/SOFT/TROTTER_prop.hpp
|
deba-cyber/SOFT_dynamics
|
7ccad22a01f2e2782bf829aa670acb8c90e83b68
|
[
"MIT"
] | null | null | null |
SOFT_dynamics/include/SOFT/TROTTER_prop.hpp
|
deba-cyber/SOFT_dynamics
|
7ccad22a01f2e2782bf829aa670acb8c90e83b68
|
[
"MIT"
] | null | null | null |
SOFT_dynamics/include/SOFT/TROTTER_prop.hpp
|
deba-cyber/SOFT_dynamics
|
7ccad22a01f2e2782bf829aa670acb8c90e83b68
|
[
"MIT"
] | null | null | null |
# if !defined (TROTTER)
# define TROTTER
# include <SOFT/constants.hpp>
# include <iosfwd>
# include <vector>
# include <string>
# include <fftw3.h>
/* function to generate potential part of Trotter product
* of type fftw_complex */
std::vector<fftw_complex> get_pot_trotter_part(const std::vector<double>& V_vect);
/*------------------------------------------------------------*/
/* function to generate ke part of Trotter product of type
* fftw_complex */
std::vector<fftw_complex> get_ke_trotter_part(std::vector<std::vector<double>>& p_grid_vect,
const std::vector<double>& freq_vect);
/*-------------------------------------------------------------*/
/*-------------------------------------------------------------*/
/** Throughout the propagation, wave function will be modified
* in place ..
* In each step of propagation ..
* first real space wave function will be acted on by potential
* part of the Trotter product .. in place
* then it would be Fourier Transformed .. in place
* momentum space wave function will be acted on by momentum part
* of the Trotter product .. in place
* then it would be back Fourier Transformed to real space .. in place **/
/*-------------------------------------------------------------*/
/* function for multiplying two fftw_complex vectors
* psi_cur_vect is to be modified in place
* after multiplying with the first vector */
void generate_fftw_complex_product(std::vector<fftw_complex>& trotter_act,
std::vector<fftw_complex>& psi_cur_vect);
/*-------------------------------------------------------------*/
/* function for generating momentum grid from real space grid
* size & real space grid spacing **/
void onedim_momentum_grid(std::vector<double>& p_grid,int N_pts,
double delta);
/*-------------------------------------------------------------*/
/* function for shifting DC component to the center for plotting
* purpose in Fourier domain ..**/
void fftwshift_4_plot(std::vector<fftw_complex>& inplotvect,
std::vector<fftw_complex>& invect);
/*-------------------------------------------------------------*/
/** function for shifting DC component of momentum grid to
* the center for plotting purpose **/
void fftwshift_momentum_grid_4_plot(std::vector<double>& p_grid,
std::vector<double>& p_grid_4_plot);
/*-------------------------------------------------------------*/
/* complex multidimensional transform using basic interface */
/***************** plan forward ***********************/
void plan_Multidim_ForwardFFT(fftw_plan& plan, int N_pts,
const int* sizevect,int rank, const std::string& type);
/***************** plan backward ***********************/
void plan_Multidim_BackwardFFT(fftw_plan& plan, int N_pts,
const int* sizevect,int rank, const std::string& type);
/*-------------------------------------------------------------*/
/* complex one dimensional FFT using basic interface */
/***************** plan forward ***********************/
void plan_ForwardFFT_1d(fftw_plan& plan,int N_pts,
const std::string& type);
/***************** plan backward ***********************/
void plan_BackwardFFT_1d(fftw_plan& plan,int N_pts,
const std::string& type);
/****************** Execute FFT **********************/
void execute_inplaceFFT(std::vector<fftw_complex>& in,
const std::string& direction,fftw_plan plan);
void execute_outofplaceFFT(std::vector<fftw_complex>& in,
std::vector<fftw_complex>& out,
const std::string& direction,fftw_plan plan);
/*-------------------------------------------------------------*/
/*-------------------------------------------------------------*/
/* function to return real,imaginary parts & absolute value of
* the wave function from <fftw_complex> type */
void rtrn_real_imag_norm(std::vector<double>& rtrn_real_imag_nrm_vect,
const std::vector<fftw_complex>& psi_cur_vect);
/*--------------------------------------------------------------*/
# endif
| 33.277311
| 92
| 0.558838
|
deba-cyber
|
2e858331884578dde4fd38bc96a3199e87f64bc4
| 135
|
cpp
|
C++
|
BOJ_CPP/14490.cpp
|
tnsgh9603/BOJ_CPP
|
432b1350f6c67cce83aec3e723e30a3c6b5dbfda
|
[
"MIT"
] | null | null | null |
BOJ_CPP/14490.cpp
|
tnsgh9603/BOJ_CPP
|
432b1350f6c67cce83aec3e723e30a3c6b5dbfda
|
[
"MIT"
] | null | null | null |
BOJ_CPP/14490.cpp
|
tnsgh9603/BOJ_CPP
|
432b1350f6c67cce83aec3e723e30a3c6b5dbfda
|
[
"MIT"
] | null | null | null |
#include<bits/stdc++.h>
int main(){int a,b,g;scanf("%is_prime:%is_prime",&a,&b);g=std::gcd(a,b);printf("%is_prime:%is_prime",a/g,b/g);}
| 67.5
| 111
| 0.644444
|
tnsgh9603
|
2e8875fe1d9e64bc928c3b7f179c5be93507012b
| 7,877
|
cpp
|
C++
|
addons/ofxPostProcessing/src/NoiseWarpPass.cpp
|
creatologist/openFrameworks0084
|
aa74f188f105b62fbcecb7baf2b41d56d97cf7bc
|
[
"MIT"
] | null | null | null |
addons/ofxPostProcessing/src/NoiseWarpPass.cpp
|
creatologist/openFrameworks0084
|
aa74f188f105b62fbcecb7baf2b41d56d97cf7bc
|
[
"MIT"
] | null | null | null |
addons/ofxPostProcessing/src/NoiseWarpPass.cpp
|
creatologist/openFrameworks0084
|
aa74f188f105b62fbcecb7baf2b41d56d97cf7bc
|
[
"MIT"
] | null | null | null |
/*
* NoiseWarpPass.cpp
*
* Copyright (c) 2013, Neil Mendoza, http://www.neilmendoza.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Neil Mendoza nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "NoiseWarpPass.h"
namespace itg
{
NoiseWarpPass::NoiseWarpPass(const ofVec2f& aspect, bool arb, float frequency, float amplitude, float speed) :
frequency(frequency), amplitude(amplitude), speed(speed), RenderPass(aspect, arb, "noisewarp")
{
string fragShaderSrc = STRINGIFY(
uniform sampler2D tex;
uniform float frequency;
uniform float amplitude;
uniform float time;
uniform float speed;
//
// Description : Array and textureless GLSL 2D/3D/4D simplex
// noise functions.
// Author : Ian McEwan, Ashima Arts.
// Maintainer : ijm
// Lastmod : 20110822 (ijm)
// License : Copyright (C) 2011 Ashima Arts. All rights reserved.
// Distributed under the MIT License. See LICENSE file.
// https://github.com/ashima/webgl-noise
//
vec3 mod289(vec3 x) {
return x - floor(x * (1.0 / 289.0)) * 289.0;
}
vec4 mod289(vec4 x) {
return x - floor(x * (1.0 / 289.0)) * 289.0;
}
vec4 permute(vec4 x) {
return mod289(((x*34.0)+1.0)*x);
}
vec4 taylorInvSqrt(vec4 r)
{
return 1.79284291400159 - 0.85373472095314 * r;
}
float snoise(vec3 v)
{
const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;
const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);
// First corner
vec3 i = floor(v + dot(v, C.yyy) );
vec3 x0 = v - i + dot(i, C.xxx) ;
// Other corners
vec3 g = step(x0.yzx, x0.xyz);
vec3 l = 1.0 - g;
vec3 i1 = min( g.xyz, l.zxy );
vec3 i2 = max( g.xyz, l.zxy );
// x0 = x0 - 0.0 + 0.0 * C.xxx;
// x1 = x0 - i1 + 1.0 * C.xxx;
// x2 = x0 - i2 + 2.0 * C.xxx;
// x3 = x0 - 1.0 + 3.0 * C.xxx;
vec3 x1 = x0 - i1 + C.xxx;
vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y
vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y
// Permutations
i = mod289(i);
vec4 p = permute( permute( permute(
i.z + vec4(0.0, i1.z, i2.z, 1.0 ))
+ i.y + vec4(0.0, i1.y, i2.y, 1.0 ))
+ i.x + vec4(0.0, i1.x, i2.x, 1.0 ));
// Gradients: 7x7 points over a square, mapped onto an octahedron.
// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)
float n_ = 0.142857142857; // 1.0/7.0
vec3 ns = n_ * D.wyz - D.xzx;
vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)
vec4 x_ = floor(j * ns.z);
vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)
vec4 x = x_ *ns.x + ns.yyyy;
vec4 y = y_ *ns.x + ns.yyyy;
vec4 h = 1.0 - abs(x) - abs(y);
vec4 b0 = vec4( x.xy, y.xy );
vec4 b1 = vec4( x.zw, y.zw );
//vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;
//vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;
vec4 s0 = floor(b0)*2.0 + 1.0;
vec4 s1 = floor(b1)*2.0 + 1.0;
vec4 sh = -step(h, vec4(0.0));
vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;
vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;
vec3 p0 = vec3(a0.xy,h.x);
vec3 p1 = vec3(a0.zw,h.y);
vec3 p2 = vec3(a1.xy,h.z);
vec3 p3 = vec3(a1.zw,h.w);
//Normalise gradients
vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));
p0 *= norm.x;
p1 *= norm.y;
p2 *= norm.z;
p3 *= norm.w;
// Mix final noise value
vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);
m = m * m;
return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),
dot(p2,x2), dot(p3,x3) ) );
}
// end of noise functions
void main()
{
vec2 texCoords = gl_TexCoord[0].st + vec2(
amplitude * (snoise(vec3(frequency * gl_TexCoord[0].s, frequency * gl_TexCoord[0].t, speed * time))),
amplitude * (snoise(vec3(frequency * gl_TexCoord[0].s + 17.0, frequency * gl_TexCoord[0].t, speed * time)))
);
gl_FragColor = texture2D(tex, texCoords);
}
);
shader.setupShaderFromSource(GL_FRAGMENT_SHADER, fragShaderSrc);
shader.linkProgram();
#ifdef _ITG_TWEAKABLE
addParameter("amplitude", this->amplitude, "min=0 max=10");
addParameter("frequency", this->frequency, "min=0 max=20");
addParameter("speed", this->speed, "min=0 max=10");
#endif
}
void NoiseWarpPass::render(ofFbo& readFbo, ofFbo& writeFbo, ofTexture& depth)
{
writeFbo.begin();
shader.begin();
shader.setUniform1f("time", ofGetElapsedTimef());
shader.setUniformTexture("tex", readFbo.getTextureReference(), 0);
shader.setUniform1f("frequency", frequency);
shader.setUniform1f("amplitude", amplitude);
shader.setUniform1f("speed", speed);
texturedQuad(0, 0, writeFbo.getWidth(), writeFbo.getHeight());
shader.end();
writeFbo.end();
}
}
| 42.578378
| 127
| 0.488765
|
creatologist
|
2e8a46e74dc16ecd02c750626c56df64ccf1c24d
| 2,487
|
cpp
|
C++
|
TameParse/Dfa/character_lexer.cpp
|
Logicalshift/TameParse
|
59512fc5c098046922099a59328ca82f174d8f68
|
[
"MIT"
] | 6
|
2018-01-10T22:37:32.000Z
|
2019-06-19T04:44:32.000Z
|
TameParse/Dfa/character_lexer.cpp
|
Logicalshift/TameParse
|
59512fc5c098046922099a59328ca82f174d8f68
|
[
"MIT"
] | null | null | null |
TameParse/Dfa/character_lexer.cpp
|
Logicalshift/TameParse
|
59512fc5c098046922099a59328ca82f174d8f68
|
[
"MIT"
] | null | null | null |
//
// character_lexer.cpp
// Parse
//
// Created by Andrew Hunter on 14/05/2011.
//
// Copyright (c) 2011-2012 Andrew Hunter
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the \"Software\"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
#include "TameParse/Dfa/character_lexer.h"
using namespace std;
using namespace dfa;
character_lexer::lstream::lstream(lexer_symbol_stream* stream)
: m_Stream(stream) {
}
character_lexer::lstream::~lstream() {
delete m_Stream;
}
/// \brief Fills in the contents of the specified pointer with the next lexeme (or NULL if the end of input has been reached)
lexeme_stream& character_lexer::lstream::operator>>(lexeme*& result) {
int next;
(*m_Stream) >> next;
if (next != symbol_set::end_of_input) {
lexeme::symbols syms;
syms.push_back(next);
result = new lexeme(syms, m_Position.current_position(), next);
m_Position.update_position(next);
} else {
result = NULL;
}
return *this;
}
///
/// \brief Creates a new lexer to process the specified symbol stream
///
/// The lexeme_stream should take ownership of the supplied lexer_symbol_stream and delete it once it has finished with it
///
lexeme_stream* character_lexer::create_stream(lexer_symbol_stream* stream) const {
return new lstream(stream);
}
///
/// \brief The number of bytes used by this lexer
///
size_t character_lexer::size() const {
return sizeof(character_lexer);
}
| 33.16
| 125
| 0.70969
|
Logicalshift
|
2e8de52c7b8eba8b6384f4e172062063721a5859
| 2,491
|
cpp
|
C++
|
atcoder/arc016/C/main.cpp
|
Johniel/contests
|
b692eff913c20e2c1eb4ff0ce3cd4c57900594e0
|
[
"Unlicense"
] | null | null | null |
atcoder/arc016/C/main.cpp
|
Johniel/contests
|
b692eff913c20e2c1eb4ff0ce3cd4c57900594e0
|
[
"Unlicense"
] | 19
|
2016-05-04T02:46:31.000Z
|
2021-11-27T06:18:33.000Z
|
atcoder/arc016/C/main.cpp
|
Johniel/contests
|
b692eff913c20e2c1eb4ff0ce3cd4c57900594e0
|
[
"Unlicense"
] | null | null | null |
// atcoder/arc016/C/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/
#include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
using namespace std;
template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; for (auto& i: v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { for (auto& i: v) is >> i; return is; }
template<typename T> ostream& operator << (ostream& os, set<T> s) { os << "#{"; for (auto& i: s) os << i << ","; os << "}"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; for (auto& i: m) os << i << ","; os << "}"; return os; }
template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }
using lli = long long int;
using ull = unsigned long long;
using point = complex<double>;
using str = string;
template<typename T> using vec = vector<T>;
constexpr array<int, 8> di({0, 1, -1, 0, 1, -1, 1, -1});
constexpr array<int, 8> dj({1, 0, 0, -1, 1, -1, -1, 1});
constexpr lli mod = 1e9 + 7;
int main(int argc, char *argv[])
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.setf(ios_base::fixed);
cout.precision(15);
int n, m;
while (cin >> n >> m) {
int c[m];
vec<pair<int, double>> p[m];
for (int i = 0; i < m; ++i) {
int x;
cin >> x >> c[i];
p[i].resize(x);
cin >> p[i];
each (j, p[i]) {
--j.first;
j.second /= 100.0;
}
}
const int BIT = 1 << 11;
double dp[BIT];
fill(dp, dp + BIT, 1e128);
dp[0] = 0;
for (int bit = 0; bit < (1 << n); ++bit) {
for (int i = 0; i < m; ++i) {
double x = c[i];
double y = 0;
for (int j = 0; j < p[i].size(); ++j) {
const int k = p[i][j].first;
if (bit & (1 << k)) {
x += dp[bit ^ (1 << k)] * p[i][j].second;
} else {
y += p[i][j].second;
}
}
if (y < 1.0) setmin(dp[bit], x / (1.0 - y));
}
}
cout << dp[(1 << n) - 1] << endl;
}
return 0;
}
| 31.531646
| 150
| 0.507828
|
Johniel
|
2e919489f2f6981ce86b9ea5e0702489e79a572a
| 396
|
hpp
|
C++
|
NWNXLib/API/Mac/API/xGetGeometryReply.hpp
|
acaos/nwnxee-unified
|
0e4c318ede64028c1825319f39c012e168e0482c
|
[
"MIT"
] | 1
|
2019-06-04T04:30:24.000Z
|
2019-06-04T04:30:24.000Z
|
NWNXLib/API/Mac/API/xGetGeometryReply.hpp
|
presscad/nwnee
|
0f36b281524e0b7e9796bcf30f924792bf9b8a38
|
[
"MIT"
] | null | null | null |
NWNXLib/API/Mac/API/xGetGeometryReply.hpp
|
presscad/nwnee
|
0f36b281524e0b7e9796bcf30f924792bf9b8a38
|
[
"MIT"
] | 1
|
2019-10-20T07:54:45.000Z
|
2019-10-20T07:54:45.000Z
|
#pragma once
#include <cstdint>
#include "unknown_CARD8.hpp"
namespace NWNXLib {
namespace API {
struct xGetGeometryReply
{
CARD8 type;
uint8_t depth;
uint16_t sequenceNumber;
uint32_t length;
uint32_t root;
int16_t x;
int16_t y;
uint16_t width;
uint16_t height;
uint16_t borderWidth;
uint16_t pad1;
uint32_t pad2;
uint32_t pad3;
};
}
}
| 12.774194
| 28
| 0.669192
|
acaos
|
2e91b3017863e7a26c289f6e5e11953ea38c12bf
| 274
|
hpp
|
C++
|
cvmat2qimage/include/cvmat2qimage.hpp
|
majorx234/qt_videocam_hough
|
bb8c5ac8045a1d312e3428705967960496688846
|
[
"BSD-2-Clause"
] | null | null | null |
cvmat2qimage/include/cvmat2qimage.hpp
|
majorx234/qt_videocam_hough
|
bb8c5ac8045a1d312e3428705967960496688846
|
[
"BSD-2-Clause"
] | null | null | null |
cvmat2qimage/include/cvmat2qimage.hpp
|
majorx234/qt_videocam_hough
|
bb8c5ac8045a1d312e3428705967960496688846
|
[
"BSD-2-Clause"
] | null | null | null |
#ifndef CVMAT2QIMAGE_HPP
#define CVMAT2QIMAGE_HPP
#include <QImage>
#include <opencv2/core/core.hpp>
#include <string>
cv::Mat qimage2cvmat( const QImage &inImage);
QImage cvmat2qimage( const cv::Mat &inMat );
std::string type2str(int type);
#endif // QT_OPENCV_CONV_HPP
| 22.833333
| 45
| 0.766423
|
majorx234
|
2e9220c365030107a4e71da79f7781e3ff3a865f
| 1,519
|
cpp
|
C++
|
src/tools.cpp
|
andrestoga/CarND-Extended-Kalman-Filter-Project
|
b387f9282258cfe92db654c50478cf3d1c1f5a9a
|
[
"MIT"
] | null | null | null |
src/tools.cpp
|
andrestoga/CarND-Extended-Kalman-Filter-Project
|
b387f9282258cfe92db654c50478cf3d1c1f5a9a
|
[
"MIT"
] | null | null | null |
src/tools.cpp
|
andrestoga/CarND-Extended-Kalman-Filter-Project
|
b387f9282258cfe92db654c50478cf3d1c1f5a9a
|
[
"MIT"
] | null | null | null |
#include "tools.h"
#include <iostream>
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
/**
* Calculate the RMSE here.
*/
VectorXd res(4);
res << 0, 0, 0, 0;
if (estimations.size() != ground_truth.size())
{
return res;
}
for (int i = 0; i < estimations.size(); ++i)
{
VectorXd tmp = estimations[i].array() - ground_truth[i].array();
tmp = tmp.array() * tmp.array();
res += tmp;
}
res = res / estimations.size();
res = res.array().sqrt();
return res;
}
MatrixXd Tools::CalculateJacobian(const VectorXd& x_state) {
/**
* Calculate a Jacobian here.
*/
double px = x_state(0);
double py = x_state(1);
double vx = x_state(2);
double vy = x_state(3);
MatrixXd jaco = MatrixXd(3,4);
jaco << 0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0;
double px2 = px * px;
double py2 = py * py;
double px2_py2 = px2 + py2;
double c1 = sqrt(px2_py2);
double c2 = pow(px2_py2, 3/2);
// TODO: I don't know what value to assign to the jacobian
// when there is division by 0
if (px2_py2 > 0.0001)
{
jaco << px/c1, py/c1, 0, 0,
-py/px2_py2, px/px2_py2, 0, 0,
py*(vx*py - vy*px)/c2, px*(vy*px - vx*py)/c2, px/c1, py/c2;
}
else
{
throw std::invalid_argument("Jacobian division by 0");
}
return jaco;
}
| 19.986842
| 71
| 0.57077
|
andrestoga
|
2e9699a79cf8fed4f81696cf4b3380f9b63a9143
| 423
|
cpp
|
C++
|
ch10/ex10_13.cpp
|
sanerror/sanerror-s-Cpp-Primer-Answers
|
1e14c4789cacf03050c0aec93eb2e3a12010a77a
|
[
"MIT"
] | null | null | null |
ch10/ex10_13.cpp
|
sanerror/sanerror-s-Cpp-Primer-Answers
|
1e14c4789cacf03050c0aec93eb2e3a12010a77a
|
[
"MIT"
] | null | null | null |
ch10/ex10_13.cpp
|
sanerror/sanerror-s-Cpp-Primer-Answers
|
1e14c4789cacf03050c0aec93eb2e3a12010a77a
|
[
"MIT"
] | null | null | null |
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
bool judge(const string & s1) {
return s1.size() < 5;
}
int main() {
vector<string> str{ "pen","pineapple","apple","pen" };
auto judge_begin = partition(str.begin(), str.end(), judge);
while (judge_begin != str.end()) {
cout << *judge_begin << " ";
++judge_begin;
}
cout << endl;
return 0;
}
| 20.142857
| 62
| 0.607565
|
sanerror
|
2e989ae4e8f30f505d462831ba4ecec648258fb3
| 1,217
|
cpp
|
C++
|
src/allegro_flare/random.cpp
|
MarkOates/allegro_flare
|
b454cb85eb5e43d19c23c0c6fd2dc11b96666ce7
|
[
"MIT"
] | 25
|
2015-03-30T02:02:43.000Z
|
2019-03-04T22:29:12.000Z
|
src/allegro_flare/random.cpp
|
MarkOates/allegro_flare
|
b454cb85eb5e43d19c23c0c6fd2dc11b96666ce7
|
[
"MIT"
] | 122
|
2015-04-01T08:15:26.000Z
|
2019-10-16T20:31:22.000Z
|
src/allegro_flare/random.cpp
|
allegroflare/allegro_flare
|
21d6fe2a5a5323102285598c8a8c75b393ce0322
|
[
"MIT"
] | 4
|
2020-02-25T18:17:31.000Z
|
2021-04-17T05:06:52.000Z
|
#include <allegro_flare/random.h>
namespace allegro_flare
{
Random::Random(unsigned int seed)
: seed(seed)
{
set_seed(seed);
}
void Random::set_seed(unsigned int new_seed)
{
seed = new_seed;
random_number_generator.seed(seed);
}
unsigned int Random::get_seed()
{
return seed;
}
int Random::get_random_int(int min, int max)
{
std::uniform_int_distribution<int> dist(min, max);
return dist(random_number_generator);
}
float Random::get_random_float(float min, float max)
{
std::uniform_real_distribution<float> dist(min, max);
return dist(random_number_generator);
}
double Random::get_random_double(double min, double max)
{
std::uniform_real_distribution<double> dist(min, max);
return dist(random_number_generator);
}
bool Random::get_one_in_chance(int chance)
{
if (get_random_int(0, chance - 1) == 0)
return true;
return false;
}
int Random::roll_dice(int number_of_die, int sides)
{
int result = 0;
for (int i = 0; i < number_of_die; i++)
result += get_random_int(sides, 1);
return result;
}
}
| 15.2125
| 60
| 0.622021
|
MarkOates
|
2e9d43df63c223a59a3b2d72792c53251da00d21
| 791
|
cpp
|
C++
|
unit/goto-programs/goto_trace_output.cpp
|
jeannielynnmoulton/cbmc
|
1d4af6d88ec960677170049a8a89a9166b952996
|
[
"BSD-4-Clause"
] | null | null | null |
unit/goto-programs/goto_trace_output.cpp
|
jeannielynnmoulton/cbmc
|
1d4af6d88ec960677170049a8a89a9166b952996
|
[
"BSD-4-Clause"
] | 1
|
2019-02-05T16:18:25.000Z
|
2019-02-05T16:18:25.000Z
|
unit/goto-programs/goto_trace_output.cpp
|
jeannielynnmoulton/cbmc
|
1d4af6d88ec960677170049a8a89a9166b952996
|
[
"BSD-4-Clause"
] | null | null | null |
/*******************************************************************\
Module: Unit tests for goto_trace_stept::output
Author: Diffblue Limited. All rights reserved.
\*******************************************************************/
#include <testing-utils/catch.hpp>
#include <goto-programs/goto_program_template.h>
#include <goto-programs/goto_trace.h>
#include <iostream>
SCENARIO(
"Output trace with nil lhs object",
"[core][goto-programs][goto_trace]")
{
symbol_tablet symbol_table;
namespacet ns(symbol_table);
goto_programt::instructionst instructions;
instructions.emplace_back(goto_program_instruction_typet::OTHER);
goto_trace_stept step;
step.pc = instructions.begin();
step.type = goto_trace_stept::typet::ATOMIC_BEGIN;
step.output(ns, std::cout);
}
| 29.296296
| 69
| 0.633375
|
jeannielynnmoulton
|
2e9db5bb7662098821c5b9b89ae2b0c376e7ef56
| 14,618
|
hpp
|
C++
|
src/Discretization/Basis/Intrepid_HGRAD_QUAD_Cn_FEMDef.hpp
|
Sandia2014/intrepid
|
9a310ddc033da1dda162a09bf80cca6c2dde2d6b
|
[
"MIT"
] | null | null | null |
src/Discretization/Basis/Intrepid_HGRAD_QUAD_Cn_FEMDef.hpp
|
Sandia2014/intrepid
|
9a310ddc033da1dda162a09bf80cca6c2dde2d6b
|
[
"MIT"
] | null | null | null |
src/Discretization/Basis/Intrepid_HGRAD_QUAD_Cn_FEMDef.hpp
|
Sandia2014/intrepid
|
9a310ddc033da1dda162a09bf80cca6c2dde2d6b
|
[
"MIT"
] | null | null | null |
#ifndef INTREPID_HGRAD_QUAD_CN_FEMDEF_HPP
#define INTREPID_HGRAD_QUAD_CN_FEMDEF_HPP
// @HEADER
// ************************************************************************
//
// Intrepid Package
// Copyright (2007) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or on behalf of the U.S. Government.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "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 SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact Pavel Bochev (pbboche@sandia.gov)
// Denis Ridzal (dridzal@sandia.gov), or
// Kara Peterson (kjpeter@sandia.gov)
//
// ************************************************************************
// @HEADER
/** \file Intrepid_HGRAD_QUAD_Cn_FEMDef.hpp
\brief Definition file for the Intrepid::HGRAD_QUAD_Cn_FEM class.
\author Created by R. Kirby.
*/
using Teuchos::Array;
using Teuchos::RCP;
namespace Intrepid {
template<class Scalar, class ArrayScalar>
Basis_HGRAD_QUAD_Cn_FEM<Scalar,ArrayScalar>::Basis_HGRAD_QUAD_Cn_FEM( const int orderx , const int ordery,
const ArrayScalar &pts_x ,
const ArrayScalar &pts_y ):
ptsx_( pts_x.dimension(0) , 1 ) ,
ptsy_( pts_y.dimension(0) , 1 )
{
Array<Array<RCP<Basis<Scalar,ArrayScalar> > > > bases(1);
bases[0].resize(2);
bases[0][0] = Teuchos::rcp( new Basis_HGRAD_LINE_Cn_FEM<Scalar,ArrayScalar>( orderx , pts_x ) );
bases[0][1] = Teuchos::rcp( new Basis_HGRAD_LINE_Cn_FEM<Scalar,ArrayScalar>( ordery , pts_y ) );
this->setBases( bases );
this->basisCardinality_ = (orderx+1)*(ordery+1);
if (orderx > ordery) {
this->basisDegree_ = orderx;
}
else {
this->basisDegree_ = ordery;
}
this -> basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Quadrilateral<4> >() );
this -> basisType_ = BASIS_FEM_FIAT;
this -> basisCoordinates_ = COORDINATES_CARTESIAN;
this -> basisTagsAreSet_ = false;
for (int i=0;i<pts_x.dimension(0);i++)
{
ptsx_(i,0) = pts_x(i,0);
}
for (int i=0;i<pts_y.dimension(0);i++)
{
ptsy_(i,0) = pts_y(i,0);
}
}
template<class Scalar, class ArrayScalar>
Basis_HGRAD_QUAD_Cn_FEM<Scalar,ArrayScalar>::Basis_HGRAD_QUAD_Cn_FEM( const int order,
const EPointType &pointType ):
ptsx_( order+1 , 1 ) ,
ptsy_( order+1 , 1 )
{
Array<Array<RCP<Basis<Scalar,ArrayScalar> > > > bases(1);
bases[0].resize(2);
bases[0][0] = Teuchos::rcp( new Basis_HGRAD_LINE_Cn_FEM<Scalar,ArrayScalar>( order , pointType ) );
bases[0][1] = Teuchos::rcp( new Basis_HGRAD_LINE_Cn_FEM<Scalar,ArrayScalar>( order , pointType ) );
this->setBases( bases );
this->basisCardinality_ = (order+1)*(order+1);
this->basisDegree_ = order;
this -> basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Quadrilateral<4> >() );
this -> basisType_ = BASIS_FEM_FIAT;
this -> basisCoordinates_ = COORDINATES_CARTESIAN;
this -> basisTagsAreSet_ = false;
// fill up the pt arrays with calls to the lattice
EPointType pt = (pointType==POINTTYPE_EQUISPACED)?pointType:POINTTYPE_WARPBLEND;
PointTools::getLattice<Scalar,FieldContainer<Scalar> >( ptsx_ ,
shards::CellTopology(shards::getCellTopologyData<shards::Line<2> >()) ,
order ,
0 ,
pt );
for (int i=0;i<order+1;i++)
{
ptsy_(i,0) = ptsx_(i,0);
}
}
template<class Scalar, class ArrayScalar>
void Basis_HGRAD_QUAD_Cn_FEM<Scalar,ArrayScalar>::initializeTags()
{
// Basis-dependent initializations
int tagSize = 4; // size of DoF tag, i.e., number of fields in the tag
int posScDim = 0; // position in the tag, counting from 0, of the subcell dim
int posScOrd = 1; // position in the tag, counting from 0, of the subcell ordinal
int posDfOrd = 2; // position in the tag, counting from 0, of DoF ordinal relative to the subcell
// An array with local DoF tags assigned to the basis functions, in the order of their local enumeration
std::vector<int> tags( tagSize * this->getCardinality() );
// temporarily just put everything on the cell itself
for (int i=0;i<this->getCardinality();i++) {
tags[tagSize*i] = 2;
tags[tagSize*i+1] = 0;
tags[tagSize*i+2] = i;
tags[tagSize*i+3] = this->getCardinality();
}
Basis<Scalar,ArrayScalar> &xBasis_ = *this->getBases()[0][0];
Basis<Scalar,ArrayScalar> &yBasis_ = *this->getBases()[0][1];
// now let's try to do it "right"
// let's get the x and y bases and their dof
const std::vector<std::vector<int> >& xdoftags = xBasis_.getAllDofTags();
const std::vector<std::vector<int> >& ydoftags = yBasis_.getAllDofTags();
std::map<int,std::map<int,int> > total_dof_per_entity;
std::map<int,std::map<int,int> > current_dof_per_entity;
for (int i=0;i<4;i++) {
total_dof_per_entity[0][i] = 0;
current_dof_per_entity[0][i] = 0;
}
for (int i=0;i<4;i++) {
total_dof_per_entity[1][i] = 0;
current_dof_per_entity[1][i] = 0;
}
total_dof_per_entity[2][0] = 0;
current_dof_per_entity[2][0] = 0;
// let's tally the total degrees of freedom on each entity
for (int j=0;j<yBasis_.getCardinality();j++) {
const int ydim = ydoftags[j][0];
const int yent = ydoftags[j][1];
for (int i=0;i<xBasis_.getCardinality();i++) {
const int xdim = xdoftags[i][0];
const int xent = xdoftags[i][1];
int dofdim;
int dofent;
ProductTopology::lineProduct2d( xdim , xent , ydim , yent , dofdim , dofent );
total_dof_per_entity[dofdim][dofent] += 1;
}
}
int tagcur = 0;
for (int j=0;j<yBasis_.getCardinality();j++) {
const int ydim = ydoftags[j][0];
const int yent = ydoftags[j][1];
for (int i=0;i<xBasis_.getCardinality();i++) {
const int xdim = xdoftags[i][0];
const int xent = xdoftags[i][1];
int dofdim;
int dofent;
ProductTopology::lineProduct2d( xdim , xent , ydim , yent , dofdim , dofent );
tags[4*tagcur] = dofdim;
tags[4*tagcur+1] = dofent;
tags[4*tagcur+2] = current_dof_per_entity[dofdim][dofent];
current_dof_per_entity[dofdim][dofent]++;
tags[4*tagcur+3] = total_dof_per_entity[dofdim][dofent];
tagcur++;
}
}
setOrdinalTagData(this -> tagToOrdinal_,
this -> ordinalToTag_,
&(tags[0]),
this -> basisCardinality_,
tagSize,
posScDim,
posScOrd,
posDfOrd);
}
template<class Scalar, class ArrayScalar>
void Basis_HGRAD_QUAD_Cn_FEM<Scalar,ArrayScalar>::getValues( ArrayScalar &outputValues ,
const ArrayScalar &inputPoints ,
const EOperator operatorType ) const
{
#ifdef HAVE_INTREPID_DEBUG
getValues_HGRAD_Args<Scalar, ArrayScalar>(outputValues,
inputPoints,
operatorType,
this -> getBaseCellTopology(),
this -> getCardinality() );
#endif
FieldContainer<Scalar> xInputPoints(inputPoints.dimension(0),1);
FieldContainer<Scalar> yInputPoints(inputPoints.dimension(0),1);
const Basis<Scalar,ArrayScalar> &xBasis_ = *this->bases_[0][0];
const Basis<Scalar,ArrayScalar> &yBasis_ = *this->bases_[0][1];
for (int i=0;i<inputPoints.dimension(0);i++) {
xInputPoints(i,0) = inputPoints(i,0);
yInputPoints(i,0) = inputPoints(i,1);
}
switch (operatorType) {
case OPERATOR_VALUE:
{
FieldContainer<Scalar> xBasisValues(xBasis_.getCardinality(),xInputPoints.dimension(0));
FieldContainer<Scalar> yBasisValues(yBasis_.getCardinality(),yInputPoints.dimension(0));
xBasis_.getValues(xBasisValues,xInputPoints,OPERATOR_VALUE);
yBasis_.getValues(yBasisValues,yInputPoints,OPERATOR_VALUE);
int bfcur = 0;
for (int j=0;j<yBasis_.getCardinality();j++) {
for (int i=0;i<xBasis_.getCardinality();i++) {
for (int k=0;k<inputPoints.dimension(0);k++) {
outputValues(bfcur,k) = xBasisValues(i,k) * yBasisValues(j,k);
}
bfcur++;
}
}
}
break;
case OPERATOR_GRAD:
case OPERATOR_D1:
{
FieldContainer<Scalar> xBasisValues(xBasis_.getCardinality(),xInputPoints.dimension(0));
FieldContainer<Scalar> yBasisValues(yBasis_.getCardinality(),yInputPoints.dimension(0));
FieldContainer<Scalar> xBasisDerivs(xBasis_.getCardinality(),xInputPoints.dimension(0),1);
FieldContainer<Scalar> yBasisDerivs(yBasis_.getCardinality(),yInputPoints.dimension(0),1);
xBasis_.getValues(xBasisValues,xInputPoints,OPERATOR_VALUE);
yBasis_.getValues(yBasisValues,yInputPoints,OPERATOR_VALUE);
xBasis_.getValues(xBasisDerivs,xInputPoints,OPERATOR_D1);
yBasis_.getValues(yBasisDerivs,yInputPoints,OPERATOR_D1);
// there are two multiindices: I need the (1,0) and (0,1) derivatives
int bfcur = 0;
for (int j=0;j<yBasis_.getCardinality();j++) {
for (int i=0;i<xBasis_.getCardinality();i++) {
for (int k=0;k<inputPoints.dimension(0);k++) {
outputValues(bfcur,k,0) = xBasisDerivs(i,k,0) * yBasisValues(j,k);
outputValues(bfcur,k,1) = xBasisValues(i,k) * yBasisDerivs(j,k,0);
}
bfcur++;
}
}
}
break;
case OPERATOR_D2:
case OPERATOR_D3:
case OPERATOR_D4:
case OPERATOR_D5:
case OPERATOR_D6:
case OPERATOR_D7:
case OPERATOR_D8:
case OPERATOR_D9:
case OPERATOR_D10:
{
FieldContainer<Scalar> xBasisValues(xBasis_.getCardinality(),xInputPoints.dimension(0));
FieldContainer<Scalar> yBasisValues(yBasis_.getCardinality(),yInputPoints.dimension(0));
Teuchos::Array<int> partialMult;
for (int d=0;d<getDkCardinality(operatorType,2);d++) {
getDkMultiplicities( partialMult , d , operatorType , 2 );
if (partialMult[0] == 0) {
xBasisValues.resize(xBasis_.getCardinality(),xInputPoints.dimension(0));
xBasis_.getValues( xBasisValues , xInputPoints, OPERATOR_VALUE );
}
else {
xBasisValues.resize(xBasis_.getCardinality(),xInputPoints.dimension(0),1);
EOperator xop = (EOperator) ( (int) OPERATOR_D1 + partialMult[0] - 1 );
xBasis_.getValues( xBasisValues , xInputPoints, xop );
xBasisValues.resize(xBasis_.getCardinality(),xInputPoints.dimension(0));
}
if (partialMult[1] == 0) {
yBasisValues.resize(yBasis_.getCardinality(),yInputPoints.dimension(0));
yBasis_.getValues( yBasisValues , yInputPoints, OPERATOR_VALUE );
}
else {
yBasisValues.resize(yBasis_.getCardinality(),yInputPoints.dimension(0),1);
EOperator yop = (EOperator) ( (int) OPERATOR_D1 + partialMult[1] - 1 );
yBasis_.getValues( yBasisValues , yInputPoints, yop );
yBasisValues.resize(yBasis_.getCardinality(),yInputPoints.dimension(0));
}
int bfcur = 0;
for (int j=0;j<yBasis_.getCardinality();j++) {
for (int i=0;i<xBasis_.getCardinality();i++) {
for (int k=0;k<inputPoints.dimension(0);k++) {
outputValues(bfcur,k,d) = xBasisValues(i,k) * yBasisValues(j,k);
}
bfcur++;
}
}
}
}
break;
case OPERATOR_CURL:
{
FieldContainer<Scalar> xBasisValues(xBasis_.getCardinality(),xInputPoints.dimension(0));
FieldContainer<Scalar> yBasisValues(yBasis_.getCardinality(),yInputPoints.dimension(0));
FieldContainer<Scalar> xBasisDerivs(xBasis_.getCardinality(),xInputPoints.dimension(0),1);
FieldContainer<Scalar> yBasisDerivs(yBasis_.getCardinality(),yInputPoints.dimension(0),1);
xBasis_.getValues(xBasisValues,xInputPoints,OPERATOR_VALUE);
yBasis_.getValues(yBasisValues,yInputPoints,OPERATOR_VALUE);
xBasis_.getValues(xBasisDerivs,xInputPoints,OPERATOR_D1);
yBasis_.getValues(yBasisDerivs,yInputPoints,OPERATOR_D1);
// there are two multiindices: I need the (1,0) and (0,1) derivatives
int bfcur = 0;
for (int j=0;j<yBasis_.getCardinality();j++) {
for (int i=0;i<xBasis_.getCardinality();i++) {
for (int k=0;k<inputPoints.dimension(0);k++) {
outputValues(bfcur,k,0) = xBasisValues(i,k) * yBasisDerivs(j,k,0);
outputValues(bfcur,k,1) = -xBasisDerivs(i,k,0) * yBasisValues(j,k);
}
bfcur++;
}
}
}
break;
default:
TEUCHOS_TEST_FOR_EXCEPTION( true , std::invalid_argument,
">>> ERROR (Basis_HGRAD_QUAD_Cn_FEM): Operator type not implemented");
break;
}
}
template<class Scalar,class ArrayScalar>
void Basis_HGRAD_QUAD_Cn_FEM<Scalar, ArrayScalar>::getValues(ArrayScalar& outputValues,
const ArrayScalar & inputPoints,
const ArrayScalar & cellVertices,
const EOperator operatorType) const {
TEUCHOS_TEST_FOR_EXCEPTION( (true), std::logic_error,
">>> ERROR (Basis_HGRAD_QUAD_Cn_FEM): FEM Basis calling an FVD member function");
}
template<class Scalar,class ArrayScalar>
void Basis_HGRAD_QUAD_Cn_FEM<Scalar, ArrayScalar>::getDofCoords( ArrayScalar & dofCoords ) const
{
int cur = 0;
for (int j=0;j<ptsy_.dimension(0);j++)
{
for (int i=0;i<ptsx_.dimension(0);i++)
{
dofCoords(cur,0) = ptsx_(i,0);
dofCoords(cur,1) = ptsy_(j,0);
cur++;
}
}
}
}// namespace Intrepid
#endif
| 37.007595
| 113
| 0.668012
|
Sandia2014
|
2ea00050e999b07f5da7e6dc0320ed81eca8c19e
| 1,112
|
cpp
|
C++
|
mythread.cpp
|
xiaoxiaozhu5/videotrans
|
3c33a4cfdf42ad9578183c3dfcc0670cc51a6139
|
[
"MIT"
] | 2
|
2020-04-13T10:00:48.000Z
|
2020-05-13T09:44:56.000Z
|
mythread.cpp
|
xiaoxiaozhu5/videotrans
|
3c33a4cfdf42ad9578183c3dfcc0670cc51a6139
|
[
"MIT"
] | null | null | null |
mythread.cpp
|
xiaoxiaozhu5/videotrans
|
3c33a4cfdf42ad9578183c3dfcc0670cc51a6139
|
[
"MIT"
] | 2
|
2016-05-02T11:58:39.000Z
|
2018-09-03T16:32:28.000Z
|
#include "mythread.h"
MyThread::MyThread()
{
runing_ = 1;
#ifdef OK6410
vd = new VideoDevice(tr("/dev/video2"));
#else
vd_ = new VideoDevice(tr("/dev/video0"));
#endif
if(-1 == vd_->open_device())
{
exit(EXIT_FAILURE);
}
if(-1 == vd_->init_device())
{
exit(EXIT_FAILURE);
}
if(-1 == vd_->start_capturing())
{
exit(EXIT_FAILURE);
}
}
MyThread::~MyThread()
{
if(-1 == vd_->stop_capturing())
{
exit(EXIT_FAILURE);
}
if(-1 == vd_->uninit_device())
{
exit(EXIT_FAILURE);
}
if(-1 == vd_->close_device())
{
exit(EXIT_FAILURE);
}
}
void MyThread::run()
{
udp_ = new Udp();
char* frame;
size_t frame_len;
while(runing_)
{
if(-1 == vd_->get_frame((void**)&frame, &frame_len))
{
exit(EXIT_FAILURE);
}
udp_->sendData((char *)frame, frame_len);
if(-1 == vd_->unget_frame())
{
exit(EXIT_FAILURE);
}
}
}
void MyThread::stop()
{
runing_ = 0;
}
| 15.444444
| 60
| 0.482014
|
xiaoxiaozhu5
|
2ea10d0c6a184afa432a92c8b548c83c9b818c2a
| 5,504
|
cc
|
C++
|
src/tests/pmempools/pmempool_create/valid_arguments_tests.cc
|
muttleyxd/pmdk-tests
|
17e66a5a9d825be385ab2824c4a754f1b8a839d4
|
[
"BSD-3-Clause"
] | null | null | null |
src/tests/pmempools/pmempool_create/valid_arguments_tests.cc
|
muttleyxd/pmdk-tests
|
17e66a5a9d825be385ab2824c4a754f1b8a839d4
|
[
"BSD-3-Clause"
] | null | null | null |
src/tests/pmempools/pmempool_create/valid_arguments_tests.cc
|
muttleyxd/pmdk-tests
|
17e66a5a9d825be385ab2824c4a754f1b8a839d4
|
[
"BSD-3-Clause"
] | null | null | null |
/*
* Copyright 2017, Intel Corporation
*
* 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 copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "valid_arguments.h"
/**
* PmempoolCreateValidTests.PMEMPOOL_CREATE
* Creating pools of different type with following arguments:
* - blk pool with size (long and short option) and write layout (long and short
* option)
* - bsize and mode options specified for blk pool
* - log pool
* - obj pool
* \test
* \li \c Step1. Create pool with specified arguments / SUCCESS
* \li \c Step2. Make sure that pool exists and validate it's size and
* mode
*/
TEST_P(ValidTests, PMEMPOOL_CREATE) {
/* Step 1 */
EXPECT_EQ(0, CreatePool(pool_args, pool_path_)) << GetOutputContent();
/* Step 2 */
EXPECT_EQ(0, file_utils::ValidateFile(pool_path_,
struct_utils::GetPoolSize(pool_args),
struct_utils::GetPoolMode(pool_args)));
}
INSTANTIATE_TEST_CASE_P(
PmempoolCreateParam, ValidTests,
::testing::Values(PoolArgs{PoolType::Blk,
{{Option::BSize, OptionType::Short, "512"},
{Option::Size, OptionType::Long, "20M"},
{Option::Mode, OptionType::Short, "777"}}},
PoolArgs{PoolType::Blk,
{{Option::BSize, OptionType::Short, "8"},
{Option::Mode, OptionType::Short, "444"}}},
PoolArgs{PoolType::Log}, PoolArgs{PoolType::Obj}));
/**
* PmempoolCreateValidInheritTests.PMEMPOOL_INHERIT_PROPERTIES
* Inheriting settings from existing pool file:
* - obj pool described by blk pool
* - log pool described by obj pool
* \test
* \li \c Step1. Creating pool by inheriting settings from existing
* pool / SUCCESS
* \li \c Step2. Make sure that pool exists and validate it's size and
* mode
*/
TEST_P(ValidInheritTests, PMEMPOOL_INHERIT_PROPERTIES) {
/* Step 1 */
EXPECT_EQ(0, CreatePool(pool_inherit.pool_inherited, inherit_file_path_))
<< GetOutputContent();
/* Step 2 */
EXPECT_EQ(0, file_utils::ValidateFile(
inherit_file_path_,
struct_utils::GetPoolSize(pool_inherit.pool_base),
struct_utils::GetPoolMode(pool_inherit.pool_inherited)));
}
INSTANTIATE_TEST_CASE_P(
PmempoolCreateParam, ValidInheritTests,
::testing::Values(
PoolInherit{
{PoolType::Blk, {{Option::BSize, OptionType::Short, "512"}}},
{PoolType::Obj,
{{Option::Inherit, OptionType::Long,
local_config->GetTestDir() + "pool.file"}}}},
PoolInherit{{PoolType::Obj},
{PoolType::Log,
{{Option::Inherit, OptionType::Long,
local_config->GetTestDir() + "pool.file"}}}}));
/**
* PmempoolCreateValidPoolsetTests.PMEMPOOL_POOLSET
* Creating pool described by poolset file
* \test
* \li \c Step1: Create pool described by poolset file / SUCCESS
* \li \c Step2: Make sure that pool described by poolset exists and
* validate it's size and mode
*/
TEST_P(ValidPoolsetTests, PMEMPOOL_POOLSET) {
/* Step 1 */
EXPECT_EQ(0,
CreatePool(poolset_args.args, poolset_args.poolset.GetFullPath()))
<< GetOutputContent();
/* Step 2 */
EXPECT_EQ(0, file_utils::ValidatePoolset(
poolset_args.poolset,
struct_utils::GetPoolMode(poolset_args.args)));
}
INSTANTIATE_TEST_CASE_P(
PmempoolCreatePoolset, ValidPoolsetTests,
::testing::Values(
PoolsetArgs{{PoolType::Blk, {{Option::BSize, OptionType::Short, "8"}}},
Poolset{{"PMEMPOOLSET", "20M"}}},
PoolsetArgs{{PoolType::Obj}, Poolset{{"PMEMPOOLSET", "20M"}}},
PoolsetArgs{{PoolType::Log}, Poolset{{"PMEMPOOLSET", "20M"}}},
PoolsetArgs{{PoolType::Obj},
Poolset{{"PMEMPOOLSET", "20M"}, {"REPLICA", "20M"}}}));
| 42.015267
| 80
| 0.646076
|
muttleyxd
|
2ea3aa3f4fffe038e284106b6d3cb5bec3731cfe
| 86
|
hpp
|
C++
|
components/downtime/ui/titles.hpp
|
Bubbus/F3_CA_BUB
|
cd7a725d65afa56a3a7f24288c839333f03b5454
|
[
"Unlicense"
] | 1
|
2020-10-30T16:10:23.000Z
|
2020-10-30T16:10:23.000Z
|
components/downtime/ui/titles.hpp
|
Bubbus/F3_CA_BUB
|
cd7a725d65afa56a3a7f24288c839333f03b5454
|
[
"Unlicense"
] | 41
|
2020-11-20T18:24:19.000Z
|
2021-12-14T15:51:50.000Z
|
components/downtime/ui/titles.hpp
|
Bubbus/F3_CA_BUB
|
cd7a725d65afa56a3a7f24288c839333f03b5454
|
[
"Unlicense"
] | 2
|
2020-11-08T16:59:28.000Z
|
2021-11-30T11:41:10.000Z
|
#include "unconsciousTitle.hpp"
#include "deadTitle.hpp"
#include "respawnTitle.hpp"
| 17.2
| 31
| 0.77907
|
Bubbus
|
2ea52adfcbea312af45334ea2f71e021d3df8fbd
| 1,110
|
cc
|
C++
|
src/util/file_system.cc
|
FlyAlCode/PLBGHashing
|
289d0a66c9091602abedf2860c2b3ae9d763fed0
|
[
"MIT"
] | 1
|
2021-02-13T01:45:20.000Z
|
2021-02-13T01:45:20.000Z
|
src/util/file_system.cc
|
FlyAlCode/PLBGHashing
|
289d0a66c9091602abedf2860c2b3ae9d763fed0
|
[
"MIT"
] | null | null | null |
src/util/file_system.cc
|
FlyAlCode/PLBGHashing
|
289d0a66c9091602abedf2860c2b3ae9d763fed0
|
[
"MIT"
] | null | null | null |
#include "file_system.h"
#include <iostream>
#include <fstream>
#include <string.h> //包含strcmp的头文件,也可用: #include <ctring>
#include <dirent.h>
#include <algorithm>
void getFileNames(const std::string path, std::vector<std::string>& filenames, const std::string &suffix){
DIR *pDir;
struct dirent* ptr;
if (!(pDir = opendir(path.c_str())))
return;
while ((ptr = readdir(pDir))!=0) {
if (strcmp(ptr->d_name, ".") != 0 && strcmp(ptr->d_name, "..") != 0){
std::string file = path + "/" + ptr->d_name;
if (opendir(file.c_str())) {
getFileNames(file, filenames, suffix);
}
else {
if (suffix == file.substr(file.size() - suffix.size())){
filenames.push_back(file);
}
}
}
}
closedir(pDir);
std::sort(filenames.begin(), filenames.end());
}
| 35.806452
| 110
| 0.438739
|
FlyAlCode
|
2ea71c71965f6741fb29367feec2678da8eae6ba
| 16,072
|
cpp
|
C++
|
src/number.cpp
|
Ixhel/Algebra
|
a42a9a2d48237ab00febddbffc4a35b7e7e5fee8
|
[
"MIT"
] | null | null | null |
src/number.cpp
|
Ixhel/Algebra
|
a42a9a2d48237ab00febddbffc4a35b7e7e5fee8
|
[
"MIT"
] | null | null | null |
src/number.cpp
|
Ixhel/Algebra
|
a42a9a2d48237ab00febddbffc4a35b7e7e5fee8
|
[
"MIT"
] | null | null | null |
/*
SymbolicC++ : An object oriented computer algebra system written in C++
Copyright (C) 2008 Yorick Hardy and Willi-Hans Steeb
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "symbolic/symbolicc++.h"
#ifdef SYMBOLIC_DEFINE
#ifndef SYMBOLIC_CPLUSPLUS_NUMBER_DEFINE
#define SYMBOLIC_CPLUSPLUS_NUMBER_DEFINE
#define SYMBOLIC_CPLUSPLUS_NUMBER
Numeric::Numeric() : CloningSymbolicInterface() {}
Numeric::Numeric(const Numeric &n) : CloningSymbolicInterface(n) {}
// Template specialization for Rational<Number<void> >
template <> Rational<Number<void> >::operator double() const
{
pair<Number<void>,Number<void> > pr = p.match(p,q);
if(pr.first.numerictype() == typeid(int))
{
CastPtr<const Number<int> > i1 = pr.first;
CastPtr<const Number<int> > i2 = pr.second;
return double(Rational<int>(i1->n,i2->n));
}
if(pr.first.numerictype() == typeid(Verylong))
{
CastPtr<const Number<Verylong> > v1 = pr.first;
CastPtr<const Number<Verylong> > v2 = pr.second;
return double(Rational<Verylong>(v1->n,v2->n));
}
cerr << "convert to double : "
<< pr.first.numerictype().name() << endl;
throw SymbolicError(SymbolicError::NotDouble);
return 0.0;
}
////////////////////////////////////
// Implementation of Numeric //
////////////////////////////////////
pair<Number<void>,Number<void> >
Numeric::match(const Numeric &n1,const Numeric &n2)
{
const type_info &t1 = n1.numerictype();
const type_info &t2 = n2.numerictype();
const type_info &type_int = typeid(int);
const type_info &type_double = typeid(double);
const type_info &type_verylong = typeid(Verylong);
const type_info &type_rational = typeid(Rational<Number<void> >);
if(t1 == type_int)
{
CastPtr<const Number<int> > i1 = n1;
if(t2 == type_int)
return pair<Number<void>,Number<void> >(n1,n2);
if(t2 == type_double)
return pair<Number<void>,Number<void> >(Number<double>(i1->n),n2);
if(t2 == type_verylong)
return pair<Number<void>,Number<void> >(Number<Verylong>(i1->n),n2);
if(t2 == type_rational)
return pair<Number<void>,Number<void> >
(Number<Rational<Number<void> > >
(Rational<Number<void> >(Number<void>(*i1)))
,n2);
cerr << "Numeric cannot use " << t2.name() << endl;
throw SymbolicError(SymbolicError::UnsupportedNumeric);
}
if(t1 == type_double)
{
CastPtr<const Number<double> > d1 = n1;
if(t2 == type_int)
{
CastPtr<const Number<int> > i2 = n2;
return pair<Number<void>,Number<void> >(n1,Number<double>(i2->n));
}
if(t2 == type_double)
return pair<Number<void>,Number<void> >(n1,n2);
if(t2 == type_verylong)
{
CastPtr<const Number<Verylong> > v2 = n2;
return pair<Number<void>,Number<void> >(n1,Number<double>(v2->n));
}
if(t2 == type_rational)
{
CastPtr<const Number<Rational<Number<void> > > > r2 = n2;
return pair<Number<void>,Number<void> >
(n1,Number<double>(double(r2->n)));
}
cerr << "Numeric cannot use " << t2.name() << endl;
throw SymbolicError(SymbolicError::UnsupportedNumeric);
}
if(t1 == type_verylong)
{
CastPtr<const Number<Verylong> > v1 = n1;
if(t2 == type_int)
{
CastPtr<const Number<int> > i2 = n2;
return pair<Number<void>,Number<void> >(n1,Number<Verylong>(i2->n));
}
if(t2 == type_double)
return pair<Number<void>,Number<void> >(Number<double>(v1->n),n2);
if(t2 == type_verylong)
return pair<Number<void>,Number<void> >(n1,n2);
if(t2 == type_rational)
return pair<Number<void>,Number<void> >
(Number<Rational<Number<void> > >
(Rational<Number<void> >(Number<void>(*v1))),n2);
cerr << "Numeric cannot use " << t2.name() << endl;
throw SymbolicError(SymbolicError::UnsupportedNumeric);
}
if(t1 == type_rational)
{
CastPtr<const Number<Rational<Number<void> > > > r1 = n1;
if(t2 == type_int)
{
CastPtr<const Number<int> > i2 = n2;
return pair<Number<void>,Number<void> >
(n1,
Number<Rational<Number<void> > >
(Rational<Number<void> >(Number<void>(*i2))));
}
if(t2 == type_double)
return pair<Number<void>,Number<void> >
(Number<double>(double(r1->n)),n2);
if(t2 == type_verylong)
{
CastPtr<const Number<Verylong> > v2 = n2;
return pair<Number<void>,Number<void> >
(n1,
Number<Rational<Number<void> > >
(Rational<Number<void> >(Number<void>(*v2))));
}
if(t2 == type_rational)
return pair<Number<void>,Number<void> >(n1,n2);
cerr << "Numeric cannot use " << t2.name() << endl;
throw SymbolicError(SymbolicError::UnsupportedNumeric);
}
cerr << "Numeric cannot use " << t1.name() << endl;
throw SymbolicError(SymbolicError::UnsupportedNumeric);
return pair<Number<void>,Number<void> >(n1,n2);
}
Symbolic Numeric::subst(const Symbolic &x,const Symbolic &y,int &n) const
{
if(*this == x) { ++n; return y; }
return *this;
}
int Numeric::compare(const Symbolic &s) const
{
if(s.type() != type()) return 0;
pair<Number<void>,Number<void> >
p = Number<void>::match(*this,*Number<void>(s));
return p.first->cmp(*(p.second));
}
Symbolic Numeric::df(const Symbolic &s) const
{ return Number<int>(0); }
Symbolic Numeric::integrate(const Symbolic &s) const
{ return Symbolic(*this) * s; }
Symbolic Numeric::coeff(const Symbolic &s) const
{
if(s.type() == typeid(Numeric)) return *this / Number<void>(s);
return Number<int>(0);
}
Expanded Numeric::expand() const
{ return *this; }
int Numeric::commute(const Symbolic &s) const
{ return 1; }
PatternMatches
Numeric::match(const Symbolic &s, const list<Symbolic> &p) const
{
PatternMatches l;
if(*this == s) pattern_match_TRUE(l);
else pattern_match_FALSE(l);
return l;
}
PatternMatches
Numeric::match_parts(const Symbolic &s, const list<Symbolic> &p) const
{ return s.match(*this, p); }
////////////////////////////////////
// Implementation of Number //
////////////////////////////////////
template <class T> Number<T>::Number() : n()
{ simplified = expanded = 1; }
template <class T> Number<T>::Number(const Number &n)
: Numeric(n), n(n.n) {}
template <class T> Number<T>::Number(const T &t) : n(t)
{ simplified = 0; expanded = 1; }
template <class T> Number<T>::~Number() {}
template <class T> Number<T> &Number<T>::operator=(const Number &n)
{
if(this != &n) n = n.n;
return *this;
}
template <class T> Number<T> &Number<T>::operator=(const T &t)
{ n = t; return *this; }
template <class T> void Number<T>::print(ostream &o) const
{ o << n; }
template <class T> const type_info &Number<T>::type() const
{ return typeid(Numeric); }
template <class T> const type_info &Number<T>::numerictype() const
{ return typeid(T); }
template <class T>
Simplified Number<T>::simplify() const
{ return *this; }
template <>
Simplified Number<Verylong>::simplify() const
{
if(n <= Verylong(numeric_limits<int>::max())
&& n > Verylong(numeric_limits<int>::min()))
return Number<int>(n);
return *this;
}
template <>
Simplified Number<Rational<Number<void> > >::simplify() const
{
if(n.den().isOne()) return *(n.num());
return *this;
}
template <class T> Number<void> Number<T>::add(const Numeric &x) const
{
if(numerictype() != x.numerictype())
throw SymbolicError(SymbolicError::IncompatibleNumeric);
CastPtr<const Number<T> > p = x;
return Number<T>(n + p->n);
}
template <class T> Number<void> Number<T>::mul(const Numeric &x) const
{
if(numerictype() != x.numerictype())
throw SymbolicError(SymbolicError::IncompatibleNumeric);
CastPtr<const Number<T> > p = x;
return Number<T>(n * p->n);
}
template <class T> Number<void> Number<T>::div(const Numeric &x) const
{
if(numerictype() != x.numerictype())
throw SymbolicError(SymbolicError::IncompatibleNumeric);
CastPtr<const Number<T> > p = x;
return Number<T>(n / p->n);
}
template <class T> Number<void> Number<T>::mod(const Numeric &x) const
{
if(numerictype() != x.numerictype())
throw SymbolicError(SymbolicError::IncompatibleNumeric);
CastPtr<const Number<T> > p = x;
return Number<T>(n - p->n * (n / p->n));
}
template <> Number<void> Number<int>::add(const Numeric &x) const
{
if(numerictype() != x.numerictype())
throw SymbolicError(SymbolicError::IncompatibleNumeric);
CastPtr<const Number<int> > p = x;
int sum = n + p->n;
if((n < 0 && p->n < 0 && sum >= 0) ||
(n > 0 && p->n > 0 && sum <= 0))
return Number<Verylong>(Verylong(n) + Verylong(p->n));
return Number<int>(n + p->n);
}
template <> Number<void> Number<int>::mul(const Numeric &x) const
{
if(numerictype() != x.numerictype())
throw SymbolicError(SymbolicError::IncompatibleNumeric);
CastPtr<const Number<int> > p = x;
int product = n * p->n;
if(n != 0 && product / n != p->n)
return Number<Verylong>(Verylong(n) * Verylong(p->n));
return Number<int>(product);
}
template <> Number<void> Number<int>::div(const Numeric &x) const
{
if(numerictype() != x.numerictype())
throw SymbolicError(SymbolicError::IncompatibleNumeric);
CastPtr<const Number<int> > p = x;
if(n % p->n != 0)
return Number<Rational<Number<void> > >
(Rational<Number<void> >(Number<void>(*this),Number<void>(x)));
return Number<int>(n / p->n);
}
template <> Number<void> Number<int>::mod(const Numeric &x) const
{
if(numerictype() != x.numerictype())
throw SymbolicError(SymbolicError::IncompatibleNumeric);
return Number<int>(n % CastPtr<const Number<int> >(x)->n);
}
template <> Number<void> Number<double>::mod(const Numeric &x) const
{
if(numerictype() != x.numerictype())
throw SymbolicError(SymbolicError::IncompatibleNumeric);
return Number<double>(fmod(n,CastPtr<const Number<double> >(x)->n));
}
template <> Number<void> Number<Verylong>::div(const Numeric &x) const
{
if(numerictype() != x.numerictype())
throw SymbolicError(SymbolicError::IncompatibleNumeric);
CastPtr<const Number<Verylong> > p = x;
if(n % p->n != Verylong(0))
return Number<Rational<Number<void> > >
(Rational<Number<void> >(Number<void>(*this),Number<void>(x)));
return Number<Verylong>(n / p->n);
}
template <class T> int Number<T>::isZero() const
{ return (n == zero(T())); }
template <class T> int Number<T>::isOne() const
{ return (n == one(T())); }
template <class T> int Number<T>::isNegative() const
{ return (n < zero(T())); }
template <class T> int Number<T>::cmp(const Numeric &x) const
{
if(numerictype() != x.numerictype())
throw SymbolicError(SymbolicError::IncompatibleNumeric);
return (numerictype() == x.numerictype()) &&
(n == CastPtr<const Number<T> >(x)->n);
}
////////////////////////////////////
// Implementation of Number<void> //
////////////////////////////////////
Number<void>::Number() : CastPtr<Numeric>(Number<int>(0)) {}
Number<void>::Number(const Number &n) : CastPtr<Numeric>(n) {}
Number<void>::Number(const Numeric &n) : CastPtr<Numeric>(n) {}
Number<void>::Number(const Symbolic &n) : CastPtr<Numeric>(Number<int>(0))
{
if(n.type() != typeid(Numeric))
throw SymbolicError(SymbolicError::NotNumeric);
CastPtr<Numeric>::operator=(n);
}
Number<void>::~Number() {}
const type_info &Number<void>::numerictype() const
{ return (*this)->numerictype(); }
int Number<void>::isZero() const
{ return (*this)->isZero(); }
int Number<void>::isOne() const
{ return (*this)->isOne(); }
int Number<void>::isNegative() const
{ return (*this)->isNegative(); }
pair<Number<void>,Number<void> >
Number<void>::match(const Numeric &n1,const Numeric &n2)
{ return Numeric::match(n1,n2); }
pair<Number<void>,Number<void> >
Number<void>::match(const Number<void> &n1,const Number<void> &n2)
{ return Numeric::match(*n1,*n2); }
Number<void> Number<void>::operator+(const Numeric &n) const
{
pair<Number<void>,Number<void> > p = Number<void>::match(*this,n);
return p.first->add(*(p.second));
}
Number<void> Number<void>::operator-(const Numeric &n) const
{
pair<Number<void>,Number<void> > p = Number<void>::match(*this,n);
return p.first->add(*(p.second));
}
Number<void> Number<void>::operator*(const Numeric &n) const
{
pair<Number<void>,Number<void> > p = Number<void>::match(*this,n);
return p.first->mul(*(p.second));
}
Number<void> Number<void>::operator/(const Numeric &n) const
{
pair<Number<void>,Number<void> > p = Number<void>::match(*this,n);
return p.first->div(*(p.second));
}
Number<void> Number<void>::operator%(const Numeric &n) const
{
pair<Number<void>,Number<void> > p = Number<void>::match(*this,n);
return p.first->mod(*(p.second));
}
Number<void> &Number<void>::operator+=(const Numeric &n)
{ return *this = *this + n; }
Number<void> &Number<void>::operator*=(const Numeric &n)
{ return *this = *this * n; }
Number<void> &Number<void>::operator/=(const Numeric &n)
{ return *this = *this / n; }
Number<void> &Number<void>::operator%=(const Numeric &n)
{ return *this = *this % n; }
int Number<void>::operator==(const Numeric &n) const
{
pair<Number<void>,Number<void> > p = Number<void>::match(*(*this),n);
return p.first->compare(*(p.second));
}
int Number<void>::operator<(const Numeric &n) const
{
pair<Number<void>,Number<void> > p = Number<void>::match(*(*this),n);
return (p.first - p.second).isNegative();
}
int Number<void>::operator>(const Numeric &n) const
{ return !(*this < n) && !(*this == n); }
int Number<void>::operator<=(const Numeric &n) const
{ return (*this < n) || (*this == n); }
int Number<void>::operator>=(const Numeric &n) const
{ return !(*this < n); }
Number<void> Number<void>::operator+(const Number<void> &n) const
{ return operator+(*n); }
Number<void> Number<void>::operator-(const Number<void> &n) const
{ return operator-(*n); }
Number<void> Number<void>::operator*(const Number<void> &n) const
{ return operator*(*n); }
Number<void> Number<void>::operator/(const Number<void> &n) const
{ return operator/(*n); }
Number<void> Number<void>::operator%(const Number<void> &n) const
{ return operator%(*n); }
Number<void> &Number<void>::operator+=(const Number<void> &n)
{ return *this = *this + n; }
Number<void> &Number<void>::operator*=(const Number<void> &n)
{ return *this = *this * n; }
Number<void> &Number<void>::operator/=(const Number<void> &n)
{ return *this = *this / n; }
Number<void> &Number<void>::operator%=(const Number<void> &n)
{ return *this = *this % n; }
int Number<void>::operator==(const Number<void> &n) const
{ return operator==(*n); }
int Number<void>::operator<(const Number<void> &n) const
{ return operator<(*n); }
int Number<void>::operator>(const Number<void> &n) const
{ return operator>(*n); }
int Number<void>::operator<=(const Number<void> &n) const
{ return operator<=(*n); }
int Number<void>::operator>=(const Number<void> &n) const
{ return operator>=(*n); }
Numeric &Number<void>::operator*() const
{ return CastPtr<Numeric>::operator*(); }
template <> Number<void> zero(Number<void>)
{ return Number<int>(0); }
template <> Number<void> one(Number<void>)
{ return Number<int>(1); }
Number<void> operator+(const Numeric &n1,const Number<void> &n2)
{ return Number<void>(n1) + n2; }
Number<void> operator-(const Numeric &n1,const Number<void> &n2)
{ return Number<void>(n1) - n2; }
Number<void> operator*(const Numeric &n1,const Number<void> &n2)
{ return Number<void>(n1) * n2; }
Number<void> operator/(const Numeric &n1,const Number<void> &n2)
{ return Number<void>(n1) / n2; }
Number<void> operator%(const Numeric &n1,const Number<void> &n2)
{ return Number<void>(n1) % n2; }
#endif
#endif
| 29.653137
| 75
| 0.655799
|
Ixhel
|
2ead27899aae79778df001bee634beaa251bb99e
| 1,576
|
cpp
|
C++
|
source/V2E/C_plant.cpp
|
CleoBeldia/CalmWood-CPP
|
c8b6b15593f9ba371390e3c426310941297138cb
|
[
"Apache-2.0"
] | 2
|
2020-10-11T20:10:30.000Z
|
2021-01-18T21:29:25.000Z
|
source/V2E/C_plant.cpp
|
CleoBeldia/CalmWood-CPP
|
c8b6b15593f9ba371390e3c426310941297138cb
|
[
"Apache-2.0"
] | null | null | null |
source/V2E/C_plant.cpp
|
CleoBeldia/CalmWood-CPP
|
c8b6b15593f9ba371390e3c426310941297138cb
|
[
"Apache-2.0"
] | 1
|
2020-10-21T09:20:36.000Z
|
2020-10-21T09:20:36.000Z
|
/*
* Copyright 2020 Axel Polin, univ_apolin@protonmail.com
*
* 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 <unistd.h>
#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
#include "C_plant.hpp"
#include "C_environment.hpp"
Plant::Plant ( int newId, std::string newName )
{
id = newId;
name = newName;
};
Plant::~Plant () {};
int Plant::getID()
{
return id;
}
std::string Plant::getName()
{
return name;
}
int Plant::growth ( int targetState )
{
return 0;
}
int Plant::damage()
{
return 0;
}
int Plant::setLocation ( std::vector<int> newLocation )
{
if ( newLocation.size() != 3 )
return -1;
location = newLocation;
return 0;
}
std::vector<int> Plant::getLocation()
{
return location;
}
int Plant::dead ( Environment* environment )
{
environment->getCell ( location[0], location[1] )->removePlant ( id, this );
death = true;
return 0;
}
bool Plant::isDead()
{
return death;
}
| 18.987952
| 84
| 0.641497
|
CleoBeldia
|
2eae9c5fffd6c6f40f4fe2413bc3cbe2b19060e1
| 5,577
|
cpp
|
C++
|
Tests/dspBufferTest.cpp
|
ngwese/madronalib
|
4e9221532bb250f0c034cc9091b4be1fb4f5a572
|
[
"MIT"
] | null | null | null |
Tests/dspBufferTest.cpp
|
ngwese/madronalib
|
4e9221532bb250f0c034cc9091b4be1fb4f5a572
|
[
"MIT"
] | null | null | null |
Tests/dspBufferTest.cpp
|
ngwese/madronalib
|
4e9221532bb250f0c034cc9091b4be1fb4f5a572
|
[
"MIT"
] | null | null | null |
//
// dspBufferTest.cpp
// madronalib
//
#include <chrono>
using namespace std::chrono;
#include <thread>
#include "MLDSPBuffer.h"
#include "catch.hpp"
#include "mldsp.h"
using namespace ml;
namespace dspBufferTest
{
TEST_CASE("madronalib/core/dspbuffer", "[dspbuffer]")
{
std::cout << "\nDSPBUFFER\n";
// buffer should be next larger power-of-two size
DSPBuffer buf;
buf.resize(197);
REQUIRE(buf.getWriteAvailable() == 256);
// write to near end
std::vector<float> nines;
nines.resize(256);
std::fill(nines.begin(), nines.end(), 9.f);
buf.write(nines.data(), 250);
buf.read(nines.data(), 250);
// write indices with wrap
DSPVector v1(columnIndex());
buf.write(v1.getConstBuffer(), kFloatsPerDSPVector);
DSPVector v2{};
buf.read(v2.getBuffer(), kFloatsPerDSPVector);
std::cout << v2 << "\n";
REQUIRE(buf.getReadAvailable() == 0);
REQUIRE(v2 == v1);
}
const int kTestBufferSize = 256;
const int kTestWrites = 200;
float transmitSum = 0;
float receiveSum = 0;
// buffer shared between threads
DSPBuffer testBuf;
size_t samplesTransmitted = 0;
size_t maxSamplesInBuffer = 0;
size_t samplesReceived = 0;
float kEndFlag = 99;
RandomScalarSource rr;
const int kMaxReadWriteSize = 16;
auto randToLength = projections::linear({-1, 1}, {1, kMaxReadWriteSize});
void transmitTest()
{
testBuf.resize(kTestBufferSize);
float data[kMaxReadWriteSize];
for (int i = 0; i < kTestWrites; ++i)
{
size_t writeLen = randToLength(rr.getFloat());
for (int j = 0; j < writeLen; ++j)
{
float f = rr.getFloat();
data[j] = f;
transmitSum += f;
}
testBuf.write(data, writeLen);
std::cout << "+"; // show write
samplesTransmitted += writeLen;
std::this_thread::sleep_for(milliseconds(2));
}
data[0] = kEndFlag;
testBuf.write(data, 1);
}
void receiveTest()
{
bool done = false;
float data[kMaxReadWriteSize];
while (!done)
{
if (size_t k = testBuf.getReadAvailable())
{
if (k > maxSamplesInBuffer)
{
maxSamplesInBuffer = k;
}
size_t readLen = randToLength(rr.getFloat());
readLen = std::min(readLen, k);
testBuf.read(data, std::min(readLen, k));
std::cout << "-"; // show read
for (int i = 0; i < readLen; ++i)
{
float f = data[i];
if (f == kEndFlag)
{
done = true;
break;
}
else
{
samplesReceived++;
receiveSum += f;
}
}
}
else
{
std::cout << "."; // show wait
}
std::this_thread::sleep_for(milliseconds(1));
}
}
TEST_CASE("madronalib/core/dspbuffer/threads", "[dspbuffer][threads]")
{
// start threads
std::thread transmit(transmitTest);
std::thread receive(receiveTest);
// wait for threads to finish
transmit.join();
receive.join();
std::cout << "\ntransmit sum: " << transmitSum
<< "\nreceive sum: " << receiveSum << "\n";
std::cout << "total samples transmitted: " << samplesTransmitted << "\n";
std::cout << "total samples received: " << samplesReceived << "\n";
std::cout << "buffer size: " << kTestBufferSize << "\n";
std::cout << "max samples in buffer: " << maxSamplesInBuffer << "\n";
REQUIRE(testBuf.getReadAvailable() == 0);
REQUIRE(transmitSum == receiveSum);
REQUIRE(samplesTransmitted == samplesReceived);
}
TEST_CASE("madronalib/core/dspbuffer/overlap", "[dspbuffer][overlap]")
{
DSPBuffer buf;
buf.resize(256);
DSPVector outputVec, outputVec2;
int overlap = kFloatsPerDSPVector / 2;
// write constant window buffer
DSPVector windowVec;
makeWindow(windowVec.getBuffer(), kFloatsPerDSPVector, windows::triangle);
// TODO ConstDSPVector windowVec(windows::triangle);
// - would require constexpr-capable reimplementation of Projections, not
// using std::function
// write overlapping triangle windows
for (int i = 0; i < 8; ++i)
{
buf.writeWithOverlapAdd(windowVec.getBuffer(), kFloatsPerDSPVector,
overlap);
}
// read past startup
buf.read(outputVec);
// after startup, sums of windows should be constant
buf.read(outputVec);
buf.read(outputVec2);
REQUIRE(outputVec == outputVec2);
}
TEST_CASE("madronalib/core/dspbuffer/vectors", "[dspbuffer][vectors]")
{
DSPBuffer buf;
buf.resize(256);
constexpr size_t kRows = 3;
DSPVectorArray<kRows> inputVec, outputVec;
// make a DSPVectorArray with a unique int at each sample
inputVec =
map([](DSPVector v,
int row) { return v + DSPVector(kFloatsPerDSPVector * row); },
repeatRows<kRows>(columnIndex()));
// write long enough that we will wrap
for (int i = 0; i < 4; ++i)
{
buf.write(inputVec);
buf.read(outputVec);
}
REQUIRE(inputVec == outputVec);
}
TEST_CASE("madronalib/core/dspbuffer/peek", "[dspbuffer][peek]")
{
// buffer should be next larger power-of-two size
DSPBuffer buf;
buf.resize(256);
// write to near end
std::vector<float> nines;
nines.resize(256);
std::fill(nines.begin(), nines.end(), 9.f);
buf.write(nines.data(), 203);
buf.read(nines.data(), 203);
// write DSPVectors with wrap
DSPVector v1(columnIndex());
buf.write(v1);
v1 += DSPVector(kFloatsPerDSPVector);
buf.write(v1);
// write one more sample
float f{128};
buf.write(&f, 1);
// peek data regions to buffer
std::vector<float> floatVec;
floatVec.resize(200);
buf.peekMostRecent(floatVec.data(), 20);
REQUIRE(floatVec[0] == 109);
REQUIRE(floatVec[19] == 128);
}
} // namespace dspBufferTest
| 22.950617
| 76
| 0.638874
|
ngwese
|
2eb7f267c876c3813c6cb42be19f3691815fe0e6
| 37,685
|
cpp
|
C++
|
mysqlparser/base/unit-tests/string_utilities_test.cpp
|
aasthakm/qapla
|
f98ca92adbca75fee28587e540b8c851809c7a62
|
[
"BSD-4-Clause"
] | 4
|
2020-12-13T15:02:40.000Z
|
2021-07-16T06:23:38.000Z
|
mysqlparser/base/unit-tests/string_utilities_test.cpp
|
aasthakm/qapla
|
f98ca92adbca75fee28587e540b8c851809c7a62
|
[
"BSD-4-Clause"
] | null | null | null |
mysqlparser/base/unit-tests/string_utilities_test.cpp
|
aasthakm/qapla
|
f98ca92adbca75fee28587e540b8c851809c7a62
|
[
"BSD-4-Clause"
] | null | null | null |
/*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of the
* License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#include "base/string_utilities.h"
#include "grtpp.h"
#include "wb_helpers.h"
#include <algorithm>
using namespace base;
// updated as of 5.7
static const char *reserved_keywords[] = {
"ACCESSIBLE",
"ADD",
"ALL",
"ALTER",
"ANALYZE",
"AND",
"AS",
"ASC",
"ASENSITIVE",
"BEFORE",
"BETWEEN",
"BIGINT",
"BINARY",
"BLOB",
"BOTH",
"BY",
"CALL",
"CASCADE",
"CASE",
"CHANGE",
"CHAR",
"CHARACTER",
"CHECK",
"COLLATE",
"COLUMN",
"CONDITION",
"CONSTRAINT",
"CONTINUE",
"CONVERT",
"CREATE",
"CROSS",
"CURRENT_DATE",
"CURRENT_TIME",
"CURRENT_TIMESTAMP",
"CURRENT_USER",
"CURSOR",
"DATABASE",
"DATABASES",
"DAY_HOUR",
"DAY_MICROSECOND",
"DAY_MINUTE",
"DAY_SECOND",
"DEC",
"DECIMAL",
"DECLARE",
"DEFAULT",
"DELAYED",
"DELETE",
"DESC",
"DESCRIBE",
"DETERMINISTIC",
"DISTINCT",
"DISTINCTROW",
"DIV",
"DOUBLE",
"DROP",
"DUAL",
"EACH",
"ELSE",
"ELSEIF",
"ENCLOSED",
"ESCAPED",
"EXISTS",
"EXIT",
"EXPLAIN",
"FALSE",
"FETCH",
"FLOAT",
"FLOAT4",
"FLOAT8",
"FOR",
"FORCE",
"FOREIGN",
"FROM",
"FULLTEXT",
"GET",
"GRANT",
"GROUP",
"HAVING",
"HIGH_PRIORITY",
"HOUR_MICROSECOND",
"HOUR_MINUTE",
"HOUR_SECOND",
"IF",
"IGNORE",
"IN",
"INDEX",
"INFILE",
"INNER",
"INOUT",
"INSENSITIVE",
"INSERT",
"INT",
"INT1",
"INT2",
"INT3",
"INT4",
"INT8",
"INTEGER",
"INTERVAL",
"INTO",
"IO_AFTER_GTIDS",
"IO_BEFORE_GTIDS",
"IS",
"ITERATE",
"JOIN",
"KEY",
"KEYS",
"KILL",
"LEADING",
"LEAVE",
"LEFT",
"LIKE",
"LIMIT",
"LINEAR",
"LINES",
"LOAD",
"LOCALTIME",
"LOCALTIMESTAMP",
"LOCK",
"LONG",
"LONGBLOB",
"LONGTEXT",
"LOOP",
"LOW_PRIORITY",
"MASTER_BIND",
"MASTER_SSL_VERIFY_SERVER_CERT",
"MATCH",
"MAXVALUE",
"MEDIUMBLOB",
"MEDIUMINT",
"MEDIUMTEXT",
"MIDDLEINT",
"MINUTE_MICROSECOND",
"MINUTE_SECOND",
"MOD",
"MODIFIES",
"NATURAL",
"NONBLOCKING",
"NOT",
"NO_WRITE_TO_BINLOG",
"NULL",
"NUMERIC",
"ON",
"OPTIMIZE",
"OPTION",
"OPTIONALLY",
"OR",
"ORDER",
"OUT",
"OUTER",
"OUTFILE",
"PARTITION",
"PRECISION",
"PRIMARY",
"PROCEDURE",
"PURGE",
"RANGE",
"READ",
"READS",
"READ_WRITE",
"REAL",
"REFERENCES",
"REGEXP",
"RELEASE",
"RENAME",
"REPEAT",
"REPLACE",
"REQUIRE",
"RESIGNAL",
"RESTRICT",
"RETURN",
"REVOKE",
"RIGHT",
"RLIKE",
"SCHEMA",
"SCHEMAS",
"SECOND_MICROSECOND",
"SELECT",
"SENSITIVE",
"SEPARATOR",
"SET",
"SHOW",
"SIGNAL",
"SMALLINT",
"SPATIAL",
"SPECIFIC",
"SQL",
"SQLEXCEPTION",
"SQLSTATE",
"SQLWARNING",
"SQL_BIG_RESULT",
"SQL_CALC_FOUND_ROWS",
"SQL_SMALL_RESULT",
"SSL",
"STARTING",
"STRAIGHT_JOIN",
"TABLE",
"TERMINATED",
"THEN",
"TINYBLOB",
"TINYINT",
"TINYTEXT",
"TO",
"TRAILING",
"TRIGGER",
"TRUE",
"UNDO",
"UNION",
"UNIQUE",
"UNLOCK",
"UNSIGNED",
"UPDATE",
"USAGE",
"USE",
"USING",
"UTC_DATE",
"UTC_TIME",
"UTC_TIMESTAMP",
"VALUES",
"VARBINARY",
"VARCHAR",
"VARCHARACTER",
"VARYING",
"WHEN",
"WHERE",
"WHILE",
"WITH",
"WRITE",
"XOR",
"YEAR_MONTH",
"ZEROFILL",
NULL
};
BEGIN_TEST_DATA_CLASS(string_utilities_test)
protected:
std::string long_random_string; // Content doesn't matter. There must be no crash using it.
TEST_DATA_CONSTRUCTOR(string_utilities_test)
{
for (int i = 0; i < 1000; i++)
{
long_random_string += ' ' + rand() % 94; // Visible characters after space
if (rand() > RAND_MAX / 2)
long_random_string += "\xE3\x8A\xA8"; // Valid Unicode character.
if (i == 500)
long_random_string += "\xE3\x8A\xA8"; // Ensure it is there at least once.
}
long_random_string.erase(std::remove(long_random_string.begin(), long_random_string.end(), 0x7f), long_random_string.end()); // 0x7F is a special character that we use for tests
}
END_TEST_DATA_CLASS;
TEST_MODULE(string_utilities_test, "string utilities");
/* Testing base::quote_identifier */
TEST_FUNCTION(5)
{
std::string test = "first_test";
std::string test_result = base::quote_identifier(test, '`');
ensure_equals("Unexpected result quoting string", test_result, "`first_test`");
test = "second_test";
test_result = base::quote_identifier(test, '\"');
ensure_equals("Unexpected result quoting string", test_result, "\"second_test\"");
test = "";
test_result = base::quote_identifier(test, '\"');
ensure_equals("Unexpected result quoting string", test_result, "\"\"");
test = "Unicode \xE3\x8A\xA8"; // UTF-8 encoded: CIRCLED IDEOGRAPH RIGHT
test_result = base::quote_identifier(test, '%');
ensure_equals("Unexpected result quoting string", test_result, "%Unicode \xE3\x8A\xA8%");
}
/* Testing base::quote_identifier_if_needed */
TEST_FUNCTION(10)
{
std::string test = "first_test";
std::string test_result = base::quote_identifier_if_needed(test, '`');
ensure_equals("Unexpected result quoting string", test_result, "first_test");
test = "second_test";
test_result = base::quote_identifier_if_needed(test, '\"');
ensure_equals("Unexpected result quoting string", test_result, "second_test");
test = "Unicode\xE3\x8A\xA8"; // UTF-8 encoded: CIRCLED IDEOGRAPH RIGHT
test_result = base::quote_identifier_if_needed(test, '%');
ensure_equals("Unexpected result quoting string", test_result, "Unicode\xE3\x8A\xA8");
test = "test.case";
test_result = base::quote_identifier_if_needed(test, '$');
ensure_equals("Unexpected result quoting string", test_result, "$test.case$");
// Note: currently there is no support to check if the given string contains the quote char already.
test = "test$case";
test_result = base::quote_identifier_if_needed(test, '$');
ensure_equals("Unexpected result quoting string", test_result, "test$case");
test = ".test$case";
test_result = base::quote_identifier_if_needed(test, '$');
ensure_equals("Unexpected result quoting string", test_result, "$.test$case$");
test = "test-case";
test_result = base::quote_identifier_if_needed(test, '`');
ensure_equals("Unexpected result quoting string", test_result, "`test-case`");
// Identifiers consisting only of digits cannot be distinguished from normal numbers
// so they must be quoted.
test = "12345";
test_result = base::quote_identifier_if_needed(test, '`');
ensure_equals("Unexpected result quoting string", test_result, "`12345`");
}
/**
* Testing base::unquote_identifier
*/
TEST_FUNCTION(15)
{
std::string test = "\"first_test\"";
std::string test_result = base::unquote_identifier(test);
ensure_equals("Unexpected result unquoting string", test_result, "first_test");
test = "`second_test`";
test_result = base::unquote_identifier(test);
ensure_equals("Unexpected result unquoting string", test_result, "second_test");
}
static bool compare_string_lists(const std::vector<std::string> &slist,
const char *check[])
{
size_t i;
for (i = 0; i < slist.size(); i++)
{
if (check[i] == NULL)
{
g_message("result has more items than expected\n");
return false;
}
if (slist[i] != check[i])
{
g_message("token comparison mismatch");
for (size_t j= 0; j < slist.size(); j++)
g_message("%s", slist[j].c_str());
return false;
}
}
if (check[i])
{
g_message("result has fewer items than expeced\n");
return false;
}
return true;
}
TEST_FUNCTION(20)
{
const char* empty[] = {"", NULL};
const char* empty2[] = {"", "", NULL};
const char* empty3[] = {"", "", "", NULL};
const char* null_empty[] = {"NULL", "", NULL};
const char* a[] = {"a", NULL};
const char* a_empty1[] = {"a", "", NULL};
const char *a_empty2[] = {"a", "", "", NULL};
const char *ab_empty1[] = {"a", "b", "", NULL};
const char *ab_empty2[] = {"a", "", "b", NULL};
const char *ab_empty3[] = {"", "a", "b", NULL};
const char* null_null[] = {"NULL", "NULL", NULL};
const char* emptys_null[] = {"''", "NULL", NULL};
const char* ab_null[] = {"'a,b'", "NULL", NULL};
const char* ab_xxx[] = {"'a,b'", "\"x\\xx\"", "'fo''bar'", NULL};
ensure("split tokens empty1", compare_string_lists(base::split_token_list("", ','), empty));
ensure("split tokens empty2", compare_string_lists(base::split_token_list(",", ','), empty2));
ensure("split tokens empty2a", compare_string_lists(base::split_token_list(" ,", ','), empty2));
ensure("split tokens empty2b", compare_string_lists(base::split_token_list(", ", ','), empty2));
ensure("split tokens empty3", compare_string_lists(base::split_token_list(",,", ','), empty3));
ensure("split tokens empty4", compare_string_lists(base::split_token_list("NULL,", ','), null_empty));
ensure("split tokens a", compare_string_lists(base::split_token_list("a", ','), a));
ensure("split tokens a_empty1", compare_string_lists(base::split_token_list("a,", ','), a_empty1));
ensure("split tokens a_empty2", compare_string_lists(base::split_token_list("a,,", ','), a_empty2));
ensure("split tokens ab_empty1", compare_string_lists(base::split_token_list("a,b,", ','), ab_empty1));
ensure("split tokens ab_empty2", compare_string_lists(base::split_token_list("a,,b", ','), ab_empty2));
ensure("split tokens ab_empty3", compare_string_lists(base::split_token_list(",a,b", ','), ab_empty3));
ensure("split tokens null,", compare_string_lists(base::split_token_list("NULL,", ','), null_empty));
ensure("split tokens null,null", compare_string_lists(base::split_token_list("NULL,NULL", ','), null_null));
ensure("split tokens '',null", compare_string_lists(base::split_token_list("'',NULL", ','), emptys_null));
ensure("split tokens 'a,b',null", compare_string_lists(base::split_token_list("'a,b',NULL", ','), ab_null));
ensure("split tokens 'a,b' , \"x\\xx\",'fo''bar'",
compare_string_lists(base::split_token_list("'a,b' , \"x\\xx\",'fo''bar' ", ','), ab_xxx));
}
// Testing split_by_set.
TEST_FUNCTION(25)
{
const char *input[] = {NULL};
ensure("Split by set 1", compare_string_lists(base::split_by_set("", ""), input));
ensure("Split by set 2", compare_string_lists(base::split_by_set("", " "), input));
ensure("Split by set 3", compare_string_lists(base::split_by_set("", long_random_string), input));
const char *input2[] = {long_random_string.c_str(), NULL};
ensure("Split by set 4", compare_string_lists(base::split_by_set(long_random_string, ""), input2));
ensure("Split by set 5", base::split_by_set(long_random_string, "\xA8").size() > 1); // Works only because our implementation is not utf-8 aware.
const char *input3[] = {"Lorem", "ipsum", "dolor", "sit", "amet.", NULL};
ensure("Split by set 6", compare_string_lists(base::split_by_set("Lorem ipsum dolor sit amet.", " "), input3));
const char *input4[] = {"Lorem", "ipsum", "dolor sit amet.", NULL};
ensure("Split by set 7", compare_string_lists(base::split_by_set("Lorem ipsum dolor sit amet.", " ", 2), input4));
const char *input5[] = {"\"Lorem\"", "\"ipsum\"", "\"dolor\"", "\"sit\"", "\"amet\"", NULL};
ensure("Split by set 8", compare_string_lists(base::split_by_set("\"Lorem\"\t\"ipsum\"\t\"dolor\"\t\"sit\"\t\"amet\"", "\t"), input5));
const char *input6[] = {"\"Lorem\"", "\"ipsum\"", "\"dolor\"", "\"sit\"", "\"amet\"", NULL};
ensure("Split by set 9", compare_string_lists(base::split_by_set("\"Lorem\"\t\"ipsum\"\n\"dolor\"\t\"sit\"\n\"amet\"", " \t\n"), input6));
const char *input7[] = {"\"Lorem\"", "\"ip", "sum\"", "\"dolor\"", "\"sit\"", "\"amet\"", NULL};
ensure("Split by set 10", compare_string_lists(base::split_by_set("\"Lorem\"\t\"ip sum\"\n\"dolor\"\t\"sit\"\n\"amet\"", " \t\n"), input7));
const char *input8[] = {"", "Lorem", "", " ", "ipsum", "", " ", "dolor", "", " ", "sit", "", " ", "amet", "", NULL};
ensure("Split by set 11", compare_string_lists(base::split_by_set("\"Lorem\", \"ipsum\", \"dolor\", \"sit\", \"amet\"", ",\""), input8));
ensure("Split by set 12", compare_string_lists(base::split_by_set("\"Lorem\", \"ipsum\", \"dolor\", \"sit\", \"amet\"", ",\"", 100), input8));
const char *input9[] = {"", "Lorem", "", " ", "ipsum", "", " ", "dolor\", \"sit\", \"amet\"", NULL};
ensure("Split by set 13", compare_string_lists(base::split_by_set("\"Lorem\", \"ipsum\", \"dolor\", \"sit\", \"amet\"", ",\"", 7), input9));
}
// Testing trim_right, trim_left, trim.
TEST_FUNCTION(30)
{
ensure_equals("Trim left 1", base::trim_left(""), "");
ensure_equals("Trim left 2", base::trim_left(" "), "");
ensure_equals("Trim left 3", base::trim_left(" \n\t\t\t\t a"), "a");
ensure_equals("Trim left 4", base::trim_left("a \n\t\t\t\t "), "a \n\t\t\t\t ");
ensure_equals("Trim left 5", base::trim_left("", long_random_string), "");
ensure_equals("Trim left 6", base::trim_left("\xE3\x8A\xA8\xE3\x8A\xA8\x7F", long_random_string), "\x7F");
ensure_equals("Trim left 7", base::trim_left("\t\t\tLorem ipsum dolor sit amet\n\n\n"), "Lorem ipsum dolor sit amet\n\n\n");
ensure_equals("Trim left 8", base::trim_left("\t\t\tLorem ipsum dolor sit amet\n\n\n", "L"), "\t\t\tLorem ipsum dolor sit amet\n\n\n");
ensure_equals("Trim left 9", base::trim_left("\t\t\tLorem ipsum dolor sit amet\n\n\n", "\t\t\tL"), "orem ipsum dolor sit amet\n\n\n");
ensure_equals("Trim right 1", base::trim_right(""), "");
ensure_equals("Trim right 2", base::trim_right(" "), "");
ensure_equals("Trim right 3", base::trim_right(" \n\t\t\t\t a"), " \n\t\t\t\t a");
ensure_equals("Trim right 4", base::trim_right("a \n\t\t\t\t "), "a");
ensure_equals("Trim right 5", base::trim_right("", long_random_string), "");
ensure_equals("Trim right 6", base::trim_right("\x7F\xE3\x8A\xA8\xE3\x8A\xA8", long_random_string), "\x7F");
ensure_equals("Trim right 7", base::trim_right("\t\t\tLorem ipsum dolor sit amet\n\n\n"), "\t\t\tLorem ipsum dolor sit amet");
ensure_equals("Trim right 8", base::trim_right("\t\t\tLorem ipsum dolor sit amet\n\n\n", "L"), "\t\t\tLorem ipsum dolor sit amet\n\n\n");
ensure_equals("Trim right 9", base::trim_right("\t\t\tLorem ipsum dolor sit amet\n\n\n", "\n\n\nt"), "\t\t\tLorem ipsum dolor sit ame");
ensure_equals("Trim 1", base::trim(""), "");
ensure_equals("Trim 2", base::trim(" "), "");
ensure_equals("Trim 3", base::trim(" \n\t\t\t\t a"), "a");
ensure_equals("Trim 4", base::trim("a \n\t\t\t\t "), "a");
ensure_equals("Trim 5", base::trim("", long_random_string), "");
ensure_equals("Trim 6", base::trim("\xE3\x8A\xA8\xE3\x8A\xA8\x7F\xE3\x8A\xA8\xE3\x8A\xA8", long_random_string), "\x7F");
ensure_equals("Trim 7", base::trim("\t\t\tLorem ipsum dolor sit amet\n\n\n"), "Lorem ipsum dolor sit amet");
ensure_equals("Trim 8", base::trim("\t\t\tLorem ipsum dolor sit amet\n\n\n", "L"), "\t\t\tLorem ipsum dolor sit amet\n\n\n");
ensure_equals("Trim 9", base::trim("\t\t\tLorem ipsum dolor sit amet\n\n\n", "\n\n\t\t\ttL"), "orem ipsum dolor sit ame");
}
/**
* Testing base::unescape_sql_string, which also includes escape sequence handling.
*/
TEST_FUNCTION(35)
{
std::string test_result = base::unescape_sql_string("", '`');
ensure_equals("Unquoting 35.1", test_result, "");
test_result = base::unescape_sql_string("lorem ipsum dolor sit amet", '"');
ensure_equals("Unquoting 35.2", test_result, "lorem ipsum dolor sit amet");
test_result = base::unescape_sql_string("lorem ipsum dolor`` sit amet", '"');
ensure_equals("Unquoting 35.3", test_result, "lorem ipsum dolor`` sit amet");
test_result = base::unescape_sql_string("lorem ipsum \"\"dolor sit amet", '"');
ensure_equals("Unquoting 35.4", test_result, "lorem ipsum \"dolor sit amet");
test_result = base::unescape_sql_string("lorem \"\"\"\"ipsum \"\"dolor\"\" sit amet", '"');
ensure_equals("Unquoting 35.5", test_result, "lorem \"\"ipsum \"dolor\" sit amet");
test_result = base::unescape_sql_string("lorem \\\"\\\"ipsum\"\" \\\\dolor sit amet", '"');
ensure_equals("Unquoting 35.6", test_result, "lorem \"\"ipsum\" \\dolor sit amet");
test_result = base::unescape_sql_string("lorem \\\"\\\"ipsum\"\" \\\\dolor sit amet", '\'');
ensure_equals("Unquoting 35.7", test_result, "lorem \"\"ipsum\"\" \\dolor sit amet");
// Embedded 0 is more difficult to test due to limitations when comparing strings. So we do this
// in a separate test.
test_result = base::unescape_sql_string("lorem\\n ip\\t\\rsum dolor\\b sit \\Zamet", '"');
ensure_equals("Unquoting 35.8", test_result, "lorem\n ip\t\rsum dolor\b sit \032amet");
test_result = base::unescape_sql_string("lorem ipsum \\zd\\a\\olor sit amet", '"');
ensure_equals("Unquoting 35.9", test_result, "lorem ipsum zdaolor sit amet");
test_result = base::unescape_sql_string("\\0\\n\\t\\r\\b\\Z", '"');
ensure("Unquoting 35.10",
test_result[0] == 0 && test_result[1] == 10 && test_result[2] == 9 && test_result[3] == 13 &&
test_result[4] == '\b' && test_result[5] == 26
);
std::string long_string;
long_string.resize(2000);
std::fill(long_string.begin(), long_string.end(), '`');
test_result = base::unescape_sql_string(long_string, '`');
ensure_equals("Unquoting 35.11", test_result, long_string.substr(0, 1000));
}
TEST_FUNCTION(36)
{
std::string content1 = "11111111 22222 3333 444444 555555555 666666 77777777 88888 999999999 00000000";
std::string content2 = "\xC3\x81\xC3\x81\xC3\x81\xC3\x81\xC3\x81\xC3\x81\xC3\x81\xC3\x81 \xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89 \xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D \xC3\x93\xC3\x93\xC3\x93\xC3\x93\xC3\x93\xC3\x93\xC3\x93\xC3\x93 \xC3\x9A\xC3\x9A\xC3\x9A\xC3\x9A\xC3\x9A\xC3\x9A\xC3\x9A\xC3\x9A";
std::string content3 = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
std::string content4 = "aaaaa bbbbb cccc dddd \xAA\xBB\xCC\xDD";
std::string content5 = "aaaa bbbb cccc dddd eeee";
// 模板名,使用英文,保证唯一性。格式建议:“类型_动作”,如“blog_add”或“credit_blog_add”
// Template name, in English, to ensure uniqueness. Format advice: "type _ action," such as "blog_add" or "credit_blog_add"
unsigned char content6[] =
{ 0x20
, 0x20
, 0x6e
, 0x61
, 0x6d
, 0x65
, 0x3a
, 0x20
, 0xe6, 0xa8, 0xa1
, 0xe6, 0x9d, 0xbf // 10
, 0xe5, 0x90, 0x8d
, 0xef, 0xbc, 0x8c
, 0xe4, 0xbd, 0xbf
, 0xe7, 0x94, 0xa8
, 0xe8, 0x8b, 0xb1
, 0xe6, 0x96, 0x87
, 0xef, 0xbc, 0x8c
, 0xe4, 0xbf, 0x9d
, 0xe8, 0xaf, 0x81
, 0xe5, 0x94, 0xaf // 20
, 0xe4, 0xb8, 0x80
, 0xe6, 0x80, 0xa7
, 0xe3, 0x80, 0x82
, 0xe6, 0xa0, 0xbc
, 0xe5, 0xbc, 0x8f
, 0xe5, 0xbb, 0xba
, 0xe8, 0xae, 0xae
, 0xef, 0xbc, 0x9a
, 0xe2, 0x80, 0x9c
, 0xe7, 0xb1, 0xbb // 30
, 0xe5, 0x9e, 0x8b
, 0x5f
, 0xe5, 0x8a, 0xa8
, 0xe4, 0xbd, 0x9c
, 0xe2, 0x80, 0x9d
, 0xef, 0xbc, 0x8c
, 0xe5, 0xa6, 0x82
, 0xe2, 0x80, 0x9c
, 0x62
, 0x6c // 40
, 0x6f
, 0x67
, 0x5f
, 0x61
, 0x64
, 0x64
, 0xe2, 0x80, 0x9d
, 0xe6, 0x88, 0x96
, 0xe2, 0x80, 0x9c
, 0x63 // 50
, 0x72
, 0x65
, 0x64
, 0x69
, 0x74
, 0x5f
, 0x62
, 0x6c
, 0x6f
, 0x67 // 60
, 0x5f
, 0x61
, 0x64
, 0x64
, 0xe2, 0x80, 0x9d // 65
, 0x00
};
std::string expected1 = " 11111111 22222 \n 3333 444444 \n 555555555 666666 \n 77777777 88888 \n 999999999 \n 00000000";
std::string expected2 = "11111111 22222 \n 3333 444444 \n 555555555 666666 \n 77777777 88888 \n 999999999 \n 00000000";
std::string expected3 = " \xC3\x81\xC3\x81\xC3\x81\xC3\x81\xC3\x81\xC3\x81\xC3\x81\xC3\x81 \xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89 \n \xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D\xC3\x8D \n \xC3\x93\xC3\x93\xC3\x93\xC3\x93\xC3\x93\xC3\x93\xC3\x93\xC3\x93 \xC3\x9A\xC3\x9A\xC3\x9A\xC3\x9A\xC3\x9A\xC3\x9A\xC3\x9A\xC3\x9A";
std::string expected4 = " 11111111 22222 \n 3333 444444 \n(...)";
std::string expected5 = " 111111111111111111\n 111111111111111111\n 111111111111111111\n 111111111111111111\n 111111111111111111\n 111111111111111111\n 111111111111111111\n 11111111111111";
std::string expected6 = "";
std::string expected7 = "aaaa \nbbbb \ncccc \ndddd \neeee";
std::string result;
try
{
base::reflow_text(content4, 20, " ");
fail("TEST 36.1: Didn't throw an exception");
}
catch(std::invalid_argument)
{
// Exception was expected
}
try
{
result = base::reflow_text(content1, 20, " ", true, 10); // Indentation
}
catch(std::logic_error &e)
{
fail(std::string("TEST 36.2: Unexpected exception: ") + e.what());
}
ensure_equals("Comparing word wrap with indentation", result, expected1);
try
{
result = base::reflow_text(content1, 20, " ", false, 10); // Do not indent first line
}
catch(std::logic_error &e)
{
fail(std::string("TEST 36.3: Unexpected exception: ") + e.what());
}
ensure_equals("Comparing word wrap without indentation", result, expected2);
try
{
result = base::reflow_text(content2, 20, " ", true, 10); // String with multi-byte characters
}
catch(std::logic_error &e)
{
fail(std::string("TEST 36.4: Unexpected exception: ") + e.what());
}
ensure_equals("Comparing word wrap with multi-byte", result, expected3);
try
{
result = base::reflow_text(content1, 20, " ", true, 2); // Line limit reached
}
catch(std::logic_error &e)
{
fail(std::string("TEST 36.5: Unexpected exception: ") + e.what());
}
ensure_equals("Comparing word wrap line limit", result, expected4);
try
{
result = base::reflow_text(content3, 20, " ", true, 10); // Big word
}
catch(std::logic_error &e)
{
fail(std::string("TEST 36.6: Unexpected exception: ") + e.what());
}
ensure_equals("Test with very big word", result, expected5);
try
{
result = base::reflow_text("", 20, " ", true, 10); // Empty string
}
catch(std::logic_error &e)
{
fail(std::string("TEST 36.7: Unexpected exception: ") + e.what());
}
ensure_equals("Test with empty string", result, expected6);
try
{
result = base::reflow_text(content5, 6, " ", true, 10); // Left fill automatic removal
}
catch(std::logic_error &e)
{
fail(std::string("TEST 36.8: Unexpected exception: ") + e.what());
}
ensure_equals("Left fill automatic removal", result, expected7);
try
{
result = base::reflow_text(content5, 4, " ", true, 10); // Invalid line length
}
catch(std::logic_error &e)
{
fail(std::string("TEST 36.9: Unexpected exception: ") + e.what());
}
ensure_equals("Invalid line length", result, "");
// This test is to ensure that a big string won't mess up algorithm
std::string dictionary[] = { "one", "big", "speech", "made", "words", "a", "of", "out" };
std::string long_text;
while (long_text.size() < SHRT_MAX)
{
int index = rand() % 8; // 8 is the size of the dictionary
long_text += dictionary[index] + " ";
}
try
{
result = base::reflow_text(long_text, 100, " ", true, 1000); // Short string, long line
}
catch(std::logic_error &e)
{
fail(std::string("TEST 36.9: Unexpected exception: ") + e.what());
}
try
{
result = base::reflow_text(std::string((char*)content6), 10, " ", false); // Short string, long line
}
catch(std::logic_error &e)
{
fail(std::string("TEST 36.10: Unexpected exception: ") + e.what());
}
// Remove the line feed and fill to verify coherence
std::size_t position = 0;
while((position = result.find("\n ", position)) != std::string::npos)
result.replace(position, 3, "");
ensure_equals("Removing separators test", result, std::string((char*)content6));
// This test was a specific case of a bug
try
{
result = base::reflow_text(std::string((char*)content6), 60, " "); // Short string, long line
}
catch(std::logic_error &e)
{
fail(std::string("TEST 36.10: Unexpected exception: ") + e.what());
}
}
TEST_FUNCTION(37)
{
ensure_equals("TEST 37.1: unable to extract and convert number from string", base::atoi<int>("10G", 0), 10);
ensure_equals("TEST 37.2: unable to convert string to number", base::atoi<int>("10", 0), 10);
ensure_equals("TEST 37.3: default return value mismatch ", base::atoi<int>("G", -1), -1);
bool test_exception = false;
try
{
base::atoi<int>("G");
test_exception = true;
} catch (std::exception &)
{
}
ensure_equals("TEST 37.4: missed exception on mismatched string", test_exception, false);
}
TEST_FUNCTION(40)
{
std::string test_string = "This is a test string...to test.";
std::string test_string_unicode = "\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89...Now that is a unicode string...\xE3\x8A\xA8";
// Base tests
ensure_equals("TEST 40.1: Starts with (success test)", base::starts_with(test_string, "This"), true);
ensure_equals("TEST 40.2: Starts with (exists somwehere in the middle)", base::starts_with(test_string, "is"), false);
ensure_equals("TEST 40.3: Starts with (exists in the end)", base::starts_with(test_string, "test."), false);
ensure_equals("TEST 40.4: Starts with (search text don't exist)", base::starts_with(test_string, "blablabla"), false);
ensure_equals("TEST 40.5: Starts with (search an empty string)", base::starts_with(test_string, ""), true);
ensure_equals("TEST 40.6: Starts with (starting on the second character)", base::starts_with(test_string, "his"), false);
ensure_equals("TEST 40.7: Starts with (whole string)", base::starts_with(test_string, test_string), true);
ensure_equals("TEST 40.8: Starts with (more then the original string)", base::starts_with(test_string, test_string + " Second part..."), false);
ensure_equals("TEST 40.9: Starts with (empty source)", base::starts_with("", "blablabla"), false);
ensure_equals("TEST 40.10: Starts with (empty source, empty search)", base::starts_with("", ""), true);
ensure_equals("TEST 40.11: Ends with (success test)", base::ends_with(test_string, "test."), true);
ensure_equals("TEST 40.12: Ends with (exists somwehere in the middle)", base::ends_with(test_string, "to "), false);
ensure_equals("TEST 40.13: Ends with (exists at the beginning)", base::ends_with(test_string, "This"), false);
ensure_equals("TEST 40.14: Ends with (search text don't exist)", base::ends_with(test_string, "blablabla"), false);
ensure_equals("TEST 40.15: Ends with (search an empty string)", base::ends_with(test_string, ""), true);
ensure_equals("TEST 40.16: Ends with (starting on the second last character)", base::ends_with(test_string, "test"), false);
ensure_equals("TEST 40.17: Ends with (whole string)", base::ends_with(test_string, test_string), true);
ensure_equals("TEST 40.18: Ends with (more then the original string)", base::ends_with(test_string, test_string + " Second part..."), false);
ensure_equals("TEST 40.19: Ends with (empty source)", base::ends_with("", "blablabla"), false);
ensure_equals("TEST 40.20: Ends with (empty source, empty search)", base::ends_with("", ""), true);
// Unicode tests
ensure_equals("TEST 40.21: [Unicode]Starts with (success test)", base::starts_with(test_string_unicode, "\xC3\x89\xC3\x89"), true);
ensure_equals("TEST 40.22: [Unicode]Starts with (exists somwehere in the middle)", base::starts_with(test_string_unicode, "is"), false);
ensure_equals("TEST 40.23: [Unicode]Starts with (exists in the end)", base::starts_with(test_string_unicode, "\xE3\x8A\xA8"), false);
ensure_equals("TEST 40.24: [Unicode]Starts with (search text don't exist)", base::starts_with(test_string_unicode, "blablabla"), false);
ensure_equals("TEST 40.25: [Unicode]Starts with (search an empty string)", base::starts_with(test_string_unicode, ""), true);
ensure_equals("TEST 40.26: [Unicode]Starts with (starting on the second character)", base::starts_with(test_string_unicode, "\x89\xC3\x89\xC3"), false);
ensure_equals("TEST 40.27: [Unicode]Starts with (whole string)", base::starts_with(test_string_unicode, test_string_unicode), true);
ensure_equals("TEST 40.28: [Unicode]Starts with (more then the original string)", base::starts_with(test_string_unicode, test_string_unicode + ". Second part..."), false);
ensure_equals("TEST 40.29: [Unicode]Ends with (success test)", base::ends_with(test_string_unicode, ".\xE3\x8A\xA8"), true);
ensure_equals("TEST 40.30: [Unicode]Ends with (exists somwehere in the middle)", base::ends_with(test_string_unicode, "to "), false);
ensure_equals("TEST 40.31: [Unicode]Ends with (exists at the beginning)", base::ends_with(test_string_unicode, "\xC3\x89\xC3\x89"), false);
ensure_equals("TEST 40.32: [Unicode]Ends with (search text don't exist)", base::ends_with(test_string_unicode, "blablabla"), false);
ensure_equals("TEST 40.33: [Unicode]Ends with (search an empty string)", base::ends_with(test_string_unicode, ""), true);
ensure_equals("TEST 40.34: [Unicode]Ends with (starting on the second last character)", base::ends_with(test_string_unicode, ".\xE3\x8A"), false);
ensure_equals("TEST 40.35: [Unicode]Ends with (whole string)", base::ends_with(test_string_unicode, test_string_unicode), true);
ensure_equals("TEST 40.36: [Unicode]Ends with (more then the original string)", base::ends_with(test_string_unicode, test_string_unicode + ". Second part..."), false);
}
TEST_FUNCTION(41)
{
std::string test_string = "This is a test string...to test.";
std::string test_string_unicode = "\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89\xC3\x89...Now that is a unicode string...\xE3\x8A\xA8";
// Base tests
ensure_equals("TEST 40.1: String left (regular testing)", base::left(test_string, 5), "This ");
ensure_equals("TEST 40.2: String left (last character", base::left(test_string, 1), "T");
ensure_equals("TEST 40.3: String left (zero characters)", base::left(test_string, 0), "");
ensure_equals("TEST 40.4: String left (with empty string)", base::left("", 5), "");
ensure_equals("TEST 40.5: String left (whole string)", base::left(test_string, test_string.length()), test_string);
ensure_equals("TEST 40.6: String left (more chars then the original string)", base::left(test_string, 50), test_string);
ensure_equals("TEST 40.7: String right (regular testing)", base::right(test_string, 5), "test.");
ensure_equals("TEST 40.8: String right (last character", base::right(test_string, 1), ".");
ensure_equals("TEST 40.9: String right (zero characters)", base::right(test_string, 0), "");
ensure_equals("TEST 40.10: String right (with empty string)", base::right("", 5), "");
ensure_equals("TEST 40.11: String right (whole string)", base::right(test_string, test_string.length()), test_string);
ensure_equals("TEST 40.12: String right (more chars then the original string)", base::right(test_string, 50), test_string);
// Unicode tests
ensure_equals("TEST 40.13: [Unicode]String left (regular testing)", base::left(test_string_unicode, 5), "\xC3\x89\xC3\x89\xC3");
ensure_equals("TEST 40.14: [Unicode]String left (last character", base::left(test_string_unicode, 1), "\xC3");
ensure_equals("TEST 40.15: [Unicode]String left (zero characters)", base::left(test_string_unicode, 0), "");
ensure_equals("TEST 40.16: [Unicode]String left (with empty string)", base::left("", 5), "");
ensure_equals("TEST 40.17: [Unicode]String left (whole string)", base::left(test_string_unicode, test_string_unicode.length()), test_string_unicode);
ensure_equals("TEST 40.18: [Unicode]String left (more chars then the original string)", base::left(test_string_unicode, 500), test_string_unicode);
ensure_equals("TEST 40.19: [Unicode]String right (regular testing)", base::right(test_string_unicode, 5), "..\xE3\x8A\xA8");
ensure_equals("TEST 40.20: [Unicode]String right (last character", base::right(test_string_unicode, 1), "\xA8");
ensure_equals("TEST 40.21: [Unicode]String right (zero characters)", base::right(test_string_unicode, 0), "");
ensure_equals("TEST 40.22: [Unicode]String right (with empty string)", base::right("", 5), "");
ensure_equals("TEST 40.23: [Unicode]String right (whole string)", base::right(test_string_unicode, test_string_unicode.length()), test_string_unicode);
ensure_equals("TEST 40.24: [Unicode]String right (more chars then the original string)", base::right(test_string_unicode, 500), test_string_unicode);
}
TEST_FUNCTION(42)
{
for (const char **kw = reserved_keywords; *kw != NULL; ++kw)
ensure("TEST 42.1: Testing keywords", base::is_reserved_word(*kw) == true);
ensure("TEST 42.2: Testing no keyword", base::is_reserved_word("some_word") == false);
ensure("TEST 42.3: Testing unicode keywords", base::is_reserved_word("\xC3\x89\xC3\x89\xC3") == false);
ensure("TEST 42.4: Testing empty string", base::is_reserved_word("") == false);
ensure("TEST 42.5: Testing similar string", base::is_reserved_word("COLUMNA") == false);
ensure("TEST 42.6: Testing similar string", base::is_reserved_word("ACOLUMN") == false);
ensure("TEST 42.7: Testing similar string", base::is_reserved_word("COLUM") == false);
ensure("TEST 42.7: Testing duplicated string", base::is_reserved_word("COLUMNCOLUMN") == false);
}
TEST_FUNCTION(43)
{
std::string font_description;
std::string font;
float size = 0;
bool bold = false;
bool italic = false;
font_description = "Sans 10";
ensure_true(base::strfmt("TEST 43.1: Parsing for \"%s\"", font_description.c_str()), base::parse_font_description(font_description, font, size, bold, italic));
ensure_equals("", font, "Sans");
ensure_equals("", size, 10);
assure_false(bold);
assure_false(italic);
font_description = "Sans 12";
ensure_true(base::strfmt("TEST 43.2: Parsing for \"%s\"", font_description.c_str()), base::parse_font_description(font_description, font, size, bold, italic));
ensure_equals("", font, "Sans");
ensure_equals("", size, 12);
assure_false(bold);
assure_false(italic);
font_description = "Sans 10 bold";
ensure_true(base::strfmt("TEST 43.3: Parsing for \"%s\"", font_description.c_str()), base::parse_font_description(font_description, font, size, bold, italic));
ensure_equals("", font, "Sans");
ensure_equals("", size, 10);
assure_true(bold);
assure_false(italic);
font_description = "Sans 10 BOLD";
ensure_true(base::strfmt("TEST 43.4: Parsing for \"%s\"", font_description.c_str()), base::parse_font_description(font_description, font, size, bold, italic));
ensure_equals("", font, "Sans");
ensure_equals("", size, 10);
assure_true(bold);
assure_false(italic);
font_description = "Sans 10 italic";
ensure_true(base::strfmt("TEST 43.5: Parsing for \"%s\"", font_description.c_str()), base::parse_font_description(font_description, font, size, bold, italic));
ensure_equals("", font, "Sans");
ensure_equals("", size, 10);
assure_false(bold);
assure_true(italic);
font_description = "Sans 10 ITALIC";
ensure_true(base::strfmt("TEST 43.6: Parsing for \"%s\"", font_description.c_str()), base::parse_font_description(font_description, font, size, bold, italic));
ensure_equals("", font, "Sans");
ensure_equals("", size, 10);
assure_false(bold);
assure_true(italic);
font_description = "Sans 10 bold italic";
ensure_true(base::strfmt("TEST 43.7: Parsing for \"%s\"", font_description.c_str()), base::parse_font_description(font_description, font, size, bold, italic));
ensure_equals("", font, "Sans");
ensure_equals("", size, 10);
assure_true(bold);
assure_true(italic);
font_description = "Sans 10 BOLD ITALIC";
ensure_true(base::strfmt("TEST 43.8: Parsing for \"%s\"", font_description.c_str()), base::parse_font_description(font_description, font, size, bold, italic));
ensure_equals("", font, "Sans");
ensure_equals("", size, 10);
assure_true(bold);
assure_true(italic);
font_description = "My Font 10 BOLD ITALIC";
ensure_true(base::strfmt("TEST 43.8: Parsing for \"%s\"", font_description.c_str()), base::parse_font_description(font_description, font, size, bold, italic));
ensure_equals("", font, "My Font");
ensure_equals("", size, 10);
assure_true(bold);
assure_true(italic);
font_description = "Helvetica Bold 12";
ensure_true(base::strfmt("TEST 43.8: Parsing for \"%s\"", font_description.c_str()), base::parse_font_description(font_description, font, size, bold, italic));
ensure_equals("", font, "Helvetica");
ensure_equals("", size, 12);
assure_true(bold);
assure_false(italic);
}
END_TESTS
| 38.770576
| 379
| 0.657105
|
aasthakm
|
e4831c658db1347b687e50b3143b0efaba2d5b43
| 4,623
|
cpp
|
C++
|
tests/boss/test_rpc.cpp
|
3nprob/clboss
|
0435b6c074347ce82e490a5988534054e9d7348d
|
[
"MIT"
] | null | null | null |
tests/boss/test_rpc.cpp
|
3nprob/clboss
|
0435b6c074347ce82e490a5988534054e9d7348d
|
[
"MIT"
] | null | null | null |
tests/boss/test_rpc.cpp
|
3nprob/clboss
|
0435b6c074347ce82e490a5988534054e9d7348d
|
[
"MIT"
] | null | null | null |
#undef NDEBUG
#include"Boss/Mod/Rpc.hpp"
#include"Boss/Shutdown.hpp"
#include"Ev/Io.hpp"
#include"Ev/concurrent.hpp"
#include"Ev/start.hpp"
#include"Ev/yield.hpp"
#include"Jsmn/Object.hpp"
#include"Json/Out.hpp"
#include"Net/Fd.hpp"
#include"S/Bus.hpp"
#include<assert.h>
#include<cstdint>
#include<fcntl.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<unistd.h>
namespace {
/* Simple server. */
class SimpleServer {
private:
Net::Fd socket;
Ev::Io<void> writeloop(std::string to_write) {
/* Yield to let other greenthreads run, then
* keep trying to write. */
return Ev::yield().then([this, to_write]() {
auto res = write( socket.get()
, to_write.c_str(), to_write.size()
);
if (res < 0 && ( errno == EWOULDBLOCK
|| errno == EAGAIN
))
/* Loop. */
return writeloop(to_write);
assert(size_t(res) == to_write.size());
return Ev::yield();
});
}
/* Slurp any incoming data. */
Ev::Io<void> slurp() {
return Ev::yield().then([this]() {
char buf[256];
auto first = true;
for (;;) {
auto res = read( socket.get()
, buf, sizeof(buf)
);
if (res < 0 && ( errno == EWOULDBLOCK
|| errno == EAGAIN
)) {
if (first)
/* No data from client yet. */
return slurp();
else
break;
}
assert(res >= 0);
first = false;
}
return Ev::yield();
});
}
public:
explicit
SimpleServer(Net::Fd socket_) : socket(std::move(socket_)) {
auto flags = fcntl(socket.get(), F_GETFL);
flags |= O_NONBLOCK;
fcntl(socket.get(), F_SETFL, flags);
}
SimpleServer(SimpleServer&& o) : socket(std::move(o.socket)) { }
Ev::Io<void> respond(std::uint64_t id) {
return Ev::yield().then([this]() {
/* Slurp any data. */
return slurp();
}).then([this, id]() {
/* Build response. */
auto js = Json::Out()
.start_object()
.field("jsonrpc", std::string("2.0"))
.field("id", double(id))
.field("result", Json::Out().start_object().end_object())
.end_object()
.output()
;
return writeloop(js);
});
}
Ev::Io<void> error( std::uint64_t id
, int code
, std::string message
) {
return Ev::yield().then([this]() {
/* Slurp any data. */
return slurp();
}).then([this, id, code, message]() {
/* Build response. */
auto err = Json::Out()
.start_object()
.field("code", double(code))
.field("message", message)
.end_object()
;
auto js = Json::Out()
.start_object()
.field("jsonrpc", std::string("2.0"))
.field("id", double(id))
.field("error", err)
.end_object()
.output()
;
return writeloop(js);
});
}
};
}
int main() {
auto bus = S::Bus();
int sockets[2];
auto res = socketpair(AF_UNIX, SOCK_STREAM, 0, sockets);
assert(res >= 0);
auto server_socket = Net::Fd(sockets[0]);
auto client_socket = Net::Fd(sockets[1]);
auto server = SimpleServer(std::move(server_socket));
auto client = Boss::Mod::Rpc(bus, std::move(client_socket));
auto succeed_flag = false;
auto errored_flag = false;
auto shutdown_flag = false;
/* Server responds with success, then failure, then shuts down. */
auto server_code = Ev::lift().then([&]() {
return server.respond(0);
}).then([&]() {
return server.error(1, -32600, "Some error");
}).then([&]() {
return bus.raise(Boss::Shutdown());
});
/* Client makes three attempts, the first succeeds, the second
* fails, the third with a cancellation of commands. */
auto client_code = Ev::lift().then([&]() {
auto params = Json::Out();
auto arr = params
.start_object()
.start_array("arr")
;
for (auto i = size_t(0); i < 10000; ++i)
arr.entry((double)i);
arr
.end_array()
.end_object()
;
return client.command("c1", params);
}).then([&](Jsmn::Object ignored_result) {
succeed_flag = true;
return client.command("c2", Json::Out::empty_object())
.catching<Boss::Mod::RpcError>([&](Boss::Mod::RpcError const& e) {
errored_flag = true;
return Ev::lift(Jsmn::Object());
});
}).then([&](Jsmn::Object ignored_result) {
return client.command("c3", Json::Out::empty_object())
.catching<Boss::Shutdown>([&](Boss::Shutdown const& e) {
shutdown_flag = true;
return Ev::lift(Jsmn::Object());
});
}).then([](Jsmn::Object ignored_result) {
return Ev::lift(0);
});
/* Launch code. */
auto code = Ev::lift().then([&]() {
return Ev::concurrent(server_code);
}).then([&]() {
return client_code;
});
auto ec = Ev::start(code);
assert(succeed_flag);
assert(errored_flag);
assert(shutdown_flag);
return ec;
}
| 23.707692
| 70
| 0.594636
|
3nprob
|
e4839ba7ebd51b4d8bb191fa34ab317446643bea
| 12,605
|
cpp
|
C++
|
minesweeper/Board.cpp
|
elipwns/Data-Structures
|
6c9d6da1254aefd31dfed5edad5987a70c4423a9
|
[
"MIT"
] | null | null | null |
minesweeper/Board.cpp
|
elipwns/Data-Structures
|
6c9d6da1254aefd31dfed5edad5987a70c4423a9
|
[
"MIT"
] | null | null | null |
minesweeper/Board.cpp
|
elipwns/Data-Structures
|
6c9d6da1254aefd31dfed5edad5987a70c4423a9
|
[
"MIT"
] | null | null | null |
#include "board.h"
#include "Node.h"
#include "LinkedList.h"
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <stdlib.h>
#include <time.h>
/**********************************************************************
* Purpose: Board no arg Ctor
*
* Entry:
*
* Exit: defaults the done flag to false, mines to 0
*
************************************************************************/
Board::Board()
:m_done(false), m_mines(0)
{
}
/**********************************************************************
* Purpose: board dtor
*
* Entry:
*
* Exit:
*
************************************************************************/
Board::~Board()
{
}
/**********************************************************************
* Purpose: board copy ctor
*
* Entry: passed a const board by ref
*
* Exit: copys the data memebers
*
************************************************************************/
Board::Board(const Board & copy)
{
m_mines = copy.m_mines;
m_done = copy.m_done;
m_field = copy.m_field;
}
/**********************************************************************
* Purpose: overloaded op =
*
* Entry: passed a const board by refrence
*
* Exit: if its not self assignment then copy data over
*
************************************************************************/
Board & Board::operator=(const Board & rhs)
{
if (this != &rhs)
{
m_mines = rhs.m_mines;
m_field = rhs.m_field;
m_done = rhs.m_done;
}
return * this;
}
/**********************************************************************
* Purpose: to clear the screen then display the board with coords shown
*
* Entry: the board should be setup with X,Y
*
* Exit: couts text that looks like a playing field
*
************************************************************************/
void Board::DisplayBoard()
{
system("cls");
cout << " ";
for(int k = 0; k < m_field.getColumn(); k++)
{
if (k > 9)
cout << k;
else
cout << k << " ";
}
cout << endl;
cout << " ";
for(int k = 0; k < m_field.getColumn(); k++)
cout << "__";
cout << endl;
for (int i = 0; i < m_field.getRow(); i++)
{
if ( i < 10)
cout << i << " |";
else
cout << i << "|";
for(int j = 0; j < m_field.getColumn(); j++)
cout << m_field[i][j] << " ";
cout << endl;
}
}
/**********************************************************************
* Purpose: setter for row
*
* Entry: passed an int
*
* Exit: passes the int to the setter for array2d
*
************************************************************************/
void Board::setRow(int rows)
{
m_field.setRow(rows);
}
/**********************************************************************
* Purpose: getter for row
*
* Entry:
*
* Exit: returns the int returned by the getter for array2d
*
************************************************************************/
int Board::getRow()
{
return m_field.getRow();
}
/**********************************************************************
* Purpose: getter for col
*
* Entry:
*
* Exit: returns the int returned by the getter for array2d
*
************************************************************************/
int Board::getCol()
{
return m_field.getColumn();
}
/**********************************************************************
* Purpose: getter for mines
*
* Entry:
*
* Exit: returns m_mines
*
************************************************************************/
int Board::getMines()
{
return m_mines;
}
/**********************************************************************
* Purpose: setter for columns
*
* Entry: passed an int
*
* Exit: passes the int to the setter for array2d
*
************************************************************************/
void Board::setCol(int cols)
{
m_field.setColumn(cols);
}
/**********************************************************************
* Purpose: setter for mines
*
* Entry: passed an int
*
* Exit: sets mines to the int
*
************************************************************************/
void Board::setMines(int mines)
{
m_mines = mines;
}
/**********************************************************************
* Purpose: randomly lays the mines
*
* Entry:
*
* Exit: creates 2 random numbers and sets a mine at that coord
* then calls set numbers to place numbers in relevant cells
* then calls players turn
*
************************************************************************/
void Board::Lay_Mines()
{
srand (time(NULL));
int randomX, randomY;
for(int i = m_mines; i > 0; i--)
{
randomY = rand() % getRow();
randomX = rand() % getCol();
if (m_field[randomY][randomX].m_isBomb)
i++;
else
{
m_field[randomY][randomX].m_isBomb = true;
m_field[randomY][randomX].m_symbol = 'X';
}
}
Set_Numbers();
Player_turn();
}
/**********************************************************************
* Purpose: sets the numbers
*
* Entry: assumes bombs already been placed
*
* Exit: checks each cells 8 nieghbors and adds one to a counter if bomb
*
************************************************************************/
void Board::Set_Numbers()
{
int bombs_nearby = 0;
for(int i = 0; i < m_field.getRow(); i++)
{
for(int j = 0; j < m_field.getColumn(); j++)
{
if (!m_field[i][j].m_isBomb)
{
if(i-1 >= 0)
{
if(m_field[i - 1][j].m_isBomb)
bombs_nearby++;
if(j-1 >= 0)
if(m_field[i-1][j - 1].m_isBomb)
bombs_nearby++;
if(j+1 < m_field.getColumn())
if(m_field[i-1][j + 1].m_isBomb)
bombs_nearby++;
}
if(i+1 < m_field.getRow())
{
if(m_field[i + 1][j].m_isBomb)
bombs_nearby++;
if(j-1 >= 0)
if(m_field[i + 1][j-1].m_isBomb)
bombs_nearby++;
if(j+1 < m_field.getColumn())
if(m_field[i + 1][j+1].m_isBomb)
bombs_nearby++;
}
if(j-1 >= 0)
if(m_field[i][j - 1].m_isBomb)
bombs_nearby++;
if(j+1 < m_field.getColumn())
if(m_field[i][j + 1].m_isBomb)
bombs_nearby++;
m_field[i][j].m_number = bombs_nearby;
bombs_nearby = 0;
}
}
}
}
/**********************************************************************
* Purpose: deals with user input for coord and choices dealing with that
* coord
*
* Entry: needs a board with bombs and numbers built
*
* Exit: asks user for a square and then asks if they want to toggle the
* flag or uncover it
*
************************************************************************/
void Board::Player_turn()
{
while(!m_done)
{
Check_Win();
DisplayBoard();
int x, y, choice = 0;
cout << "Enter coord (Ex ~ 2 3) : ";
cin >> x >> y;
while (x < 0 || x > m_field.getColumn() || y < 0 ||
y > m_field.getRow() ||
(!m_field[y][x].m_covered && m_field[y][x].m_symbol != 'M'))
{
cout << "Enter coord (Ex ~ 2 3) : ";
cin >> x >> y;
}
cout << "1) Uncover\n2) Mark for possible bomb\n";
cin >> choice;
while(choice > 2 || choice < 1)
{
cout << "1) Uncover\n2) Mark for possible bomb\n";
cin >> choice;
}
if(choice == 1)
Uncover(x, y);
else if (choice == 2)
{
m_field[y][x].m_covered = false;
if(m_field[y][x].m_symbol == 'M')
{
if(m_field[y][x].m_isBomb)
m_field[y][x].m_symbol = 'X';
else
m_field[y][x].m_symbol = ' ';
m_field[y][x].m_covered = true;
}
else
m_field[y][x].m_symbol = 'M';
}
}
}
/**********************************************************************
* Purpose: the uncover function
*
* Entry: passed an X,Y coord to uncover
*
* Exit: checks if bomb first, you lose
* then checks if its a number, just display it
* if its blank start up the uncover loop
*
************************************************************************/
void Board::Uncover(int xStart, int yStart)
{
if (m_field[yStart][xStart].m_isBomb)
{
m_field[yStart][xStart].m_covered = false;
DisplayBoard();
cout << "you lose\n";
m_done = true;
}
else if (m_field[yStart][xStart].m_number)
{
m_field[yStart][xStart].m_covered = false;
}
else
{
LinkedList start(xStart, yStart);
Uncover_Loop(xStart, yStart, &start);
while(start.m_head->GetNext() != nullptr)
{
start.Next();
Uncover_Loop(start.GetX(), start.GetY(), &start);
}
}
}
/**********************************************************************
* Purpose: used to uncover cells and add them to a que to be checked
*
* Entry: is passed the X,Y coord to start at and a pointer to the linked list
*
* Exit: checks the 4 diagnals for a number to uncover and checks the 4
* sides for a blank spot to add to the que and to uncover
*
************************************************************************/
void Board::Uncover_Loop(int xStart, int yStart, LinkedList * start)
{
m_field[yStart][xStart].m_covered = false;
if(yStart - 1 >= 0)
{
if(!m_field[yStart - 1][xStart].m_isBomb)
if(m_field[yStart - 1][xStart].m_covered)
if(m_field[yStart - 1][xStart].m_symbol != 'M')
if(!m_field[yStart - 1][xStart].m_number)
{
m_field[yStart - 1][xStart].m_covered = false;
start->Add(xStart, yStart - 1);
}
else
m_field[yStart - 1][xStart].m_covered = false;
if (xStart - 1 >= 0)
if(!m_field[yStart - 1][xStart - 1].m_isBomb)
if(m_field[yStart - 1][xStart - 1].m_covered)
if(m_field[yStart - 1][xStart - 1].m_symbol != 'M')
if(!m_field[yStart - 1][xStart - 1].m_number)
{
m_field[yStart - 1][xStart - 1].m_covered = false;
start->Add(xStart - 1, yStart - 1);
}
else
m_field[yStart - 1][xStart - 1].m_covered = false;
if (xStart + 1 < m_field.getColumn())
if(!m_field[yStart - 1][xStart + 1].m_isBomb)
if(m_field[yStart - 1][xStart + 1].m_covered)
if(m_field[yStart - 1][xStart + 1].m_symbol != 'M')
if(!m_field[yStart - 1][xStart + 1].m_number)
{
m_field[yStart - 1][xStart + 1].m_covered = false;
start->Add(xStart + 1, yStart - 1);
}
else
m_field[yStart - 1][xStart + 1].m_covered = false;
}
if(yStart + 1 < m_field.getRow())
{
if(!m_field[yStart + 1][xStart].m_isBomb)
if(m_field[yStart + 1][xStart].m_covered)
if(m_field[yStart + 1][xStart].m_symbol != 'M')
if(!m_field[yStart + 1][xStart].m_number)
{
m_field[yStart + 1][xStart].m_covered = false;
start->Add(xStart, yStart + 1);
}
else
m_field[yStart + 1][xStart].m_covered = false;
if (xStart - 1 >= 0)
if(!m_field[yStart + 1][xStart - 1].m_isBomb)
if(m_field[yStart + 1][xStart - 1].m_covered)
if(m_field[yStart + 1][xStart - 1].m_symbol != 'M')
if(!m_field[yStart + 1][xStart - 1].m_number)
{
m_field[yStart + 1][xStart - 1].m_covered = false;
start->Add(xStart - 1, yStart + 1);
}
else
m_field[yStart + 1][xStart - 1].m_covered = false;
if(xStart + 1 < m_field.getColumn())
if(!m_field[yStart + 1][xStart + 1].m_isBomb)
if(m_field[yStart + 1][xStart + 1].m_covered)
if(m_field[yStart + 1][xStart + 1].m_symbol != 'M')
if(!m_field[yStart + 1][xStart + 1].m_number)
{
m_field[yStart + 1][xStart + 1].m_covered = false;
start->Add(xStart + 1, yStart + 1);
}
else
m_field[yStart + 1][xStart + 1].m_covered = false;
}
if(xStart-1 >= 0)
if(!m_field[yStart][xStart - 1].m_isBomb)
if(m_field[yStart][xStart - 1].m_covered)
if(m_field[yStart][xStart - 1].m_symbol != 'M')
if(!m_field[yStart][xStart - 1].m_number)
{
m_field[yStart][xStart - 1].m_covered = false;
start->Add(xStart - 1, yStart);
}
else
m_field[yStart][xStart - 1].m_covered = false;
if(xStart+1 < m_field.getColumn())
if(!m_field[yStart][xStart + 1].m_isBomb)
if(m_field[yStart][xStart + 1].m_covered)
if(m_field[yStart][xStart + 1].m_symbol != 'M')
if(!m_field[yStart][xStart + 1].m_number)
{
m_field[yStart][xStart + 1].m_covered = false;
start->Add(xStart + 1, yStart);
}
else
m_field[yStart][xStart + 1].m_covered = false;
DisplayBoard();
}
/**********************************************************************
* Purpose: this function checks to see if the player has won
*
* Entry:
*
* Exit: sets done to true and then checks every cell until it finds
* a cell that fails the check, and then updates the done to false
*
************************************************************************/
void Board::Check_Win()
{
m_done = true;
for (int i = 0; i < m_field.getRow() && m_done; i++)
for (int j = 0; j < m_field.getColumn() && m_done; j++)
if(m_field[i][j].m_covered && !m_field[i][j].m_isBomb)
m_done = false;
}
| 25.464646
| 77
| 0.485442
|
elipwns
|
e483fc40b0f003010d558d9b203c73e3f3e9435b
| 973
|
cc
|
C++
|
src/leetcode/leetcode204_count_primes.cc
|
zhaozigu/algs-multi-langs
|
65ef5fc6df6236064a5c81e5bb7e99c4bae044a7
|
[
"CNRI-Python"
] | null | null | null |
src/leetcode/leetcode204_count_primes.cc
|
zhaozigu/algs-multi-langs
|
65ef5fc6df6236064a5c81e5bb7e99c4bae044a7
|
[
"CNRI-Python"
] | null | null | null |
src/leetcode/leetcode204_count_primes.cc
|
zhaozigu/algs-multi-langs
|
65ef5fc6df6236064a5c81e5bb7e99c4bae044a7
|
[
"CNRI-Python"
] | null | null | null |
// https://leetcode-cn.com/problems/count-primes/
#include <vector>
using namespace std;
class Solution
{
public:
int countPrimes(int n)
{
// 0ms 秘诀
// if (n == 10000)
// return 1229;
// if (n == 499979)
// return 41537;
// if (n == 999983)
// return 78497;
// if (n == 1500000)
// return 114155;
vector<bool> isprime(n + 1, true);
int count = 0;
for (int i = 2; i < n; ++i)
{
if (isprime[i])
{
++count;
for (int j = 2; i * j < n; ++j)
{
isprime[i * j] = false;
}
}
}
return count;
}
};
#include "gtest/gtest.h"
TEST(leetcode204, sampleInputByProblem1)
{
Solution solution;
ASSERT_EQ(4, solution.countPrimes(10));
}
TEST(leetcode204, sampleInputByProblem2)
{
Solution solution;
ASSERT_EQ(0, solution.countPrimes(0));
}
TEST(leetcode204, sampleInputByProblem3)
{
Solution solution;
ASSERT_EQ(0, solution.countPrimes(1));
}
| 17.690909
| 49
| 0.564234
|
zhaozigu
|
e4844cfa4f75fff58facfe7c11088de866535a88
| 3,110
|
hpp
|
C++
|
modules/scene_manager/include/map_msgs/srv/save_map__rosidl_typesupport_connext_cpp.hpp
|
Omnirobotic/godot
|
d50b5d047bbf6c68fc458c1ad097321ca627185d
|
[
"CC-BY-3.0",
"Apache-2.0",
"MIT"
] | null | null | null |
modules/scene_manager/include/map_msgs/srv/save_map__rosidl_typesupport_connext_cpp.hpp
|
Omnirobotic/godot
|
d50b5d047bbf6c68fc458c1ad097321ca627185d
|
[
"CC-BY-3.0",
"Apache-2.0",
"MIT"
] | 3
|
2019-11-14T12:20:06.000Z
|
2020-08-07T13:51:10.000Z
|
modules/scene_manager/include/map_msgs/srv/save_map__rosidl_typesupport_connext_cpp.hpp
|
Omnirobotic/godot
|
d50b5d047bbf6c68fc458c1ad097321ca627185d
|
[
"CC-BY-3.0",
"Apache-2.0",
"MIT"
] | null | null | null |
// generated from
// rosidl_typesupport_connext_cpp/resource/srv__rosidl_typesupport_connext_cpp.hpp.em
// generated code does not contain a copyright notice
#ifndef MAP_MSGS__SRV__SAVE_MAP__ROSIDL_TYPESUPPORT_CONNEXT_CPP_HPP_
#define MAP_MSGS__SRV__SAVE_MAP__ROSIDL_TYPESUPPORT_CONNEXT_CPP_HPP_
#include <rmw/types.h>
#include "rosidl_typesupport_cpp/service_type_support.hpp"
#include "rosidl_typesupport_interface/macros.h"
#include "map_msgs/msg/rosidl_typesupport_connext_cpp__visibility_control.h"
namespace map_msgs
{
namespace srv
{
namespace typesupport_connext_cpp
{
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
void *
create_requester__SaveMap(
void * untyped_participant,
const char * request_topic_str,
const char * response_topic_str,
const void * untyped_datareader_qos,
const void * untyped_datawriter_qos,
void ** untyped_reader,
void ** untyped_writer,
void * (*allocator)(size_t));
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
const char *
destroy_requester__SaveMap(
void * untyped_requester,
void (* deallocator)(void *));
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
int64_t
send_request__SaveMap(
void * untyped_requester,
const void * untyped_ros_request);
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
void *
create_replier__SaveMap(
void * untyped_participant,
const char * request_topic_str,
const char * response_topic_str,
const void * untyped_datareader_qos,
const void * untyped_datawriter_qos,
void ** untyped_reader,
void ** untyped_writer,
void * (*allocator)(size_t));
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
const char *
destroy_replier__SaveMap(
void * untyped_replier,
void (* deallocator)(void *));
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
bool
take_request__SaveMap(
void * untyped_replier,
rmw_request_id_t * request_header,
void * untyped_ros_request);
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
bool
take_response__SaveMap(
void * untyped_requester,
rmw_request_id_t * request_header,
void * untyped_ros_response);
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
bool
send_response__SaveMap(
void * untyped_replier,
const rmw_request_id_t * request_header,
const void * untyped_ros_response);
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
void *
get_request_datawriter__SaveMap(void * untyped_requester);
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
void *
get_reply_datareader__SaveMap(void * untyped_requester);
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
void *
get_request_datareader__SaveMap(void * untyped_replier);
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
void *
get_reply_datawriter__SaveMap(void * untyped_replier);
} // namespace typesupport_connext_cpp
} // namespace srv
} // namespace map_msgs
#ifdef __cplusplus
extern "C"
{
#endif
ROSIDL_TYPESUPPORT_CONNEXT_CPP_PUBLIC_map_msgs
const rosidl_service_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__SERVICE_SYMBOL_NAME(rosidl_typesupport_connext_cpp, map_msgs, srv, SaveMap)();
#ifdef __cplusplus
}
#endif
#endif // MAP_MSGS__SRV__SAVE_MAP__ROSIDL_TYPESUPPORT_CONNEXT_CPP_HPP_
| 25.491803
| 110
| 0.83537
|
Omnirobotic
|
e48749019a377c8ad9980398a2ae66700a95920a
| 6,610
|
cpp
|
C++
|
source/parallel_free_suitor.cpp
|
alanmazankiewicz/Cpp_Suitor_and_Local_Dominant_Matching
|
2fba808998cc58bd6c1a792b7c8d835e487bf3f5
|
[
"MIT"
] | null | null | null |
source/parallel_free_suitor.cpp
|
alanmazankiewicz/Cpp_Suitor_and_Local_Dominant_Matching
|
2fba808998cc58bd6c1a792b7c8d835e487bf3f5
|
[
"MIT"
] | null | null | null |
source/parallel_free_suitor.cpp
|
alanmazankiewicz/Cpp_Suitor_and_Local_Dominant_Matching
|
2fba808998cc58bd6c1a792b7c8d835e487bf3f5
|
[
"MIT"
] | null | null | null |
#include "implementation/parallel_free_suitor.hpp"
ParallelLocklessSuitor::ParallelLocklessSuitor(Input edgeLst) : G(edgeLst.second, edgeLst.first),
suitor(std::make_unique<std::atomic<EdgeIterator>[]>(G.numNodes()))
{
for (auto iter = suitor.get(); iter != suitor.get() + G.numNodes(); ++iter)
{
iter->store(G.null_edge());
}
}
void ParallelLocklessSuitor::process(NodeHandle start, NodeHandle finish)
{
for (NodeHandle u = start; u != finish; ++u)
{
NodeHandle current = u;
bool done = false;
while (!done)
{
EdgeIterator partner = G.null_edge();
double heaviest = 0;
for (EdgeIterator v = G.beginEdges(current); v != G.endEdges(current); ++v)
{
double weight_v = v->second; // to only load the array once
if (weight_v > heaviest && weight_v > suitor[v->first].load()->second)
{
partner = v;
heaviest = weight_v;
}
}
done = true;
if (heaviest > 0)
{
size_t partnerId = partner->first; // to only load the array once
EdgeIterator current_suitor = suitor[partnerId];
if (current_suitor->second < heaviest)
{
if (suitor[partnerId].compare_exchange_strong(current_suitor, partner)) // here they swap (partner instead of counteredge to partner)
{
NodeHandle y = G.edgeHead(current_suitor); // therefore here 0 instead of 1 (edgehead -> instead of *current_suitor) -> only relevant at this point here
if (y != G.null_node())
{
current = y;
done = false;
}
} else
done = false;
} else
done = false;
}
}
}
}
void ParallelLocklessSuitor::print_matching() const
{
for (auto iter = suitor.get(); iter != suitor.get() + G.numNodes(); ++iter)
{
EdgeIterator output = *iter;
if (output != G.null_edge())
{
std::cout << iter - suitor.get() << " " << G.nodeId(G.edgeHead(output)) << std::endl;
}
}
}
const double ParallelLocklessSuitor::matching_quality() const
{
double counter = 0;
for (auto iter = suitor.get(); iter != suitor.get() + G.numNodes(); ++iter)
{
counter += iter->load()->second;
}
return counter / 2;
}
void ParallelLocklessSuitor::simple_procedure(size_t num_threads)
{
std::vector<std::thread> threads;
threads.reserve(num_threads);
size_t nodes_per_thread = G.numNodes() / num_threads;
if(!nodes_per_thread)
{
for (size_t thread = 0; thread < G.numNodes(); ++thread)
{
threads.emplace_back(
std::thread(&ParallelLocklessSuitor::process, this, G.begin() + thread, G.begin() + (thread + 1)));
}
} else
{
for (size_t thread = 0; thread < num_threads; ++thread)
{
if (thread != num_threads - 1)
{
threads.emplace_back(
std::thread(&ParallelLocklessSuitor::process, this, G.begin() + thread * nodes_per_thread,
G.begin() + (thread + 1) * nodes_per_thread));
} else
{
threads.emplace_back(
std::thread(&ParallelLocklessSuitor::process, this, G.begin() + thread * nodes_per_thread,
G.end()));
}
}
}
for (auto iter = threads.begin(); iter != threads.end(); ++iter)
{
iter->join();
}
}
void ParallelLocklessSuitor::clear_mate()
{
for (auto iter = suitor.get(); iter != suitor.get() + G.numNodes(); ++iter)
{
iter->store(G.null_edge());
}
}
void ParallelLocklessSuitor::test_matching()
{
for (NodeHandle u = G.begin(); u != G.end(); ++u)
{
if (suitor[G.nodeId(u)].load() != G.null_edge())
{
EdgeIterator suit1 = suitor[G.nodeId(u)];
EdgeIterator suit2 = suitor[suit1->first];
assert(G.node(suit2->first) == u);
}
else
assert(suitor[G.nodeId(u)].load() == G.null_edge());
}
}
int main(int argc, char *argv[])
{
if(argc < 3 || argc > 3)
{
std::cout << "Invalid number of arguments" << std::endl;
return 1;
}
int test_time = std::atoi(argv[1]);
if(test_time < 0 || test_time > 1)
{
std::cout << "Invalid first argument" << std::endl;
return 2;
}
if (test_time < 1)
{
std::string str = argv[2];
Input edgeLst = readEdges(str);
ParallelLocklessSuitor test_1(edgeLst);
for (size_t i = 0; i < 20; ++i)
{
test_1.simple_procedure(20);
test_1.test_matching();
test_1.clear_mate();
}
std::cout << "matching successfull" << std::endl;
} else
{
std::string str = argv[2];
Input edgeLst = readEdges(str);
ParallelLocklessSuitor test_1(edgeLst);
ofstream myfile;
std::size_t found = str.find_last_of("/\\");
std::string out = "../evaluation/ParFreeSuitor" + str.substr(found + 1) + ".txt";
myfile.open(out);
std::stringstream header;
header << "Algorithm Runtime Quality Threads" << std::endl;
myfile << header.str();
cout << header.str();
size_t max_threads = std::thread::hardware_concurrency() > 32 ? 32 : std::thread::hardware_concurrency();
size_t rounds = 5;
for (size_t threads = 2; threads <= max_threads; threads += 2)
{
for (size_t i = 0; i < rounds; ++i)
{
auto start = chrono::high_resolution_clock::now();
test_1.simple_procedure(threads);
auto finish = chrono::high_resolution_clock::now();
chrono::duration<double> elapsed = finish - start;
std::stringstream line;
line << "ParFreeSuitorSimp " << elapsed.count() << " " << test_1.matching_quality() << " " << threads
<< std::endl;
myfile << line.str();
cout << line.str();
test_1.clear_mate();
}
}
}
return 0;
}
| 31.47619
| 176
| 0.506505
|
alanmazankiewicz
|
e487edc57ca47f265618b70b409b2af3da2845ea
| 643
|
hpp
|
C++
|
libs/parsejson/include/sge/parse/json/get_return_type.hpp
|
cpreh/spacegameengine
|
313a1c34160b42a5135f8223ffaa3a31bc075a01
|
[
"BSL-1.0"
] | 2
|
2016-01-27T13:18:14.000Z
|
2018-05-11T01:11:32.000Z
|
libs/parsejson/include/sge/parse/json/get_return_type.hpp
|
cpreh/spacegameengine
|
313a1c34160b42a5135f8223ffaa3a31bc075a01
|
[
"BSL-1.0"
] | null | null | null |
libs/parsejson/include/sge/parse/json/get_return_type.hpp
|
cpreh/spacegameengine
|
313a1c34160b42a5135f8223ffaa3a31bc075a01
|
[
"BSL-1.0"
] | 3
|
2018-05-11T01:11:34.000Z
|
2021-04-24T19:47:45.000Z
|
// Copyright Carl Philipp Reh 2006 - 2019.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef SGE_PARSE_JSON_GET_RETURN_TYPE_HPP_INCLUDED
#define SGE_PARSE_JSON_GET_RETURN_TYPE_HPP_INCLUDED
#include <fcppt/reference_impl.hpp>
#include <fcppt/config/external_begin.hpp>
#include <type_traits>
#include <fcppt/config/external_end.hpp>
namespace sge::parse::json
{
template <typename T, typename Arg>
using get_return_type = fcppt::reference<std::conditional_t<std::is_const_v<Arg>, T const, T>>;
}
#endif
| 27.956522
| 95
| 0.760498
|
cpreh
|
e487f596b569c234a2294b45d1e9eb5b738888b4
| 1,062
|
cc
|
C++
|
algo/searching/search_matrix.cc
|
liuheng/recipes
|
6f3759ab4e4fa64d9fd83a60ee6b6846510d910b
|
[
"MIT"
] | null | null | null |
algo/searching/search_matrix.cc
|
liuheng/recipes
|
6f3759ab4e4fa64d9fd83a60ee6b6846510d910b
|
[
"MIT"
] | null | null | null |
algo/searching/search_matrix.cc
|
liuheng/recipes
|
6f3759ab4e4fa64d9fd83a60ee6b6846510d910b
|
[
"MIT"
] | null | null | null |
#include <cstdio>
#include <cassert>
#include <vector>
using namespace std;
bool binarySearch(vector<vector<int> > &matrix, int begin, int end, int target) {
int M = matrix.size();
int N = matrix[0].size();
if (begin == end) {
return false;
} else {
int mid = begin + (end - begin) / 2;
int row = mid / N;
int col = mid - row * N;
printf("%d - %d - %d\n", mid, row, col);
if (target == matrix[row][col]) {
return true;
} else if (target > matrix[row][col]) {
return binarySearch(matrix, mid+1, end, target);
} else {
return binarySearch(matrix, begin, mid, target);
}
}
}
bool searchMatrix(vector<vector<int> > &matrix, int target) {
int M = matrix.size();
if (M == 0) {
return false;
}
int N = matrix[0].size();
return binarySearch(matrix, 0, M * N, target);
}
int main() {
vector<int> v1 = {1, 1};
vector<vector<int> > v;
v.push_back(v1);
assert(!searchMatrix(v, 0));
return 0;
}
| 24.697674
| 81
| 0.531073
|
liuheng
|
e48b9cb53e6ea2dbb31824c28d09eed3dd26b213
| 3,645
|
cpp
|
C++
|
main.cpp
|
HadesD/GoogleSearchCPP
|
f065e4c25d6192e1707566b4d03da337afe1041a
|
[
"MIT"
] | null | null | null |
main.cpp
|
HadesD/GoogleSearchCPP
|
f065e4c25d6192e1707566b4d03da337afe1041a
|
[
"MIT"
] | null | null | null |
main.cpp
|
HadesD/GoogleSearchCPP
|
f065e4c25d6192e1707566b4d03da337afe1041a
|
[
"MIT"
] | null | null | null |
#include <stdio.h>
#include <iostream>
#include <string>
#include <regex>
#include <curl/curl.h>
// using namespace std;
std::string url = "http://www.google.com.vn/search?q=";
std::string query;
std::string data;
bool input();
std::string encode_query(std::string &q);
size_t writeCallback(char* buf, size_t size, size_t nmemb, void* up);
bool curl(std::string url);
int main(int argc, char* argv[])
{
if (argc == 2)
{
query = argv[1];
}
else
{
if (input() == false)
{
return 0;
}
}
url += encode_query(query);
std::cout << url << std::endl;
curl(url);
// Regex
const std::regex r("<a.*?href=\"(.*?)\".*?>(.*?)</a>");
std::match_results<std::string::const_iterator> m;
std::string::const_iterator searchStart = data.begin();
int i = 0;
std::string uri[30];
while (std::regex_search(searchStart, data.cend(), m, r))
{
searchStart = m[0].second;
if (std::string(m[1]).find("/url?q=") == std::string::npos)
{
continue;
}
i++;
uri[i] = std::string(m[1]);
std::cout << "-[" << i << "]- " << m[2] << std::endl;
if (std::string(m[1]).find("webcache.googleusercontent.com") == std::string::npos)
{
std::cout << "\tDirect: " << m[1] << std::endl;
}
else
{
std::cout << "\tCache: " << m[1] << std::endl;
}
}
if (i > 0)
{
std::string choose;
std::cout << "Choose a number: ";
while (
!(std::cin >> choose) ||
choose > std::to_string(i) ||
choose <= std::to_string(0) ||
choose == "\n"
)
{
std::cout << "Number must be > 0 and < " << (i+1) << ": ";
}
curl("http://google.com.vn" + uri[std::stoi(choose)]);
std::cout << data << std::endl;
}
return 0;
}
bool input()
{
while (query.empty())
{
std::cout << "Type search query: ";
getline(std::cin, query);
}
if (query == "q")
{
std::cout << "Exit..." << std::endl;
return false;
}
return true;
}
std::string encode_query(std::string &s)
{
std::size_t pos = 0;
// Replace all space
std::string r(" ");
while (pos < s.size())
{
pos = s.find(r, pos);
if (pos != std::string::npos)
{
s.replace(pos, r.length(), "+");
}
}
return s;
}
bool curl(std::string url)
{
std::cout << "Please wait..." << std::endl;
// https://curl.haxx.se/libcurl/c/simple.html
CURL *curl;
curl_global_init(CURL_GLOBAL_ALL);
curl = curl_easy_init();
if (curl)
{
CURLcode res;
long http_code = 0;
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &writeCallback);
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
// Header
struct curl_slist *list = NULL;
//list = curl_slist_append(list, "User-Agent: Mozilla/5.001 (windows; U; NT4.0; en-US; rv:1.0) Gecko/25250101");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list);
res = curl_easy_perform(curl);
if (res != CURLE_OK)
{
std::cerr << "curl_easy_perform() error: " << std::endl
<< curl_easy_strerror(res) << std::endl;
return false;
}
else
{
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
if (http_code != 200)
{
std::cerr << "HTTP Code error: " << http_code << std::endl;
return false;
}
}
curl_easy_cleanup(curl);
curl_global_cleanup();
return true;
}
return false;
}
size_t writeCallback(char* buf, size_t size, size_t nmemb, void* up)
{
for (int c = 0; c<size*nmemb; c++)
{
data += buf[c];
}
return size*nmemb;
}
| 21.315789
| 116
| 0.561317
|
HadesD
|
e491087200cacb15f13418bd088d298feac0ab03
| 2,611
|
cpp
|
C++
|
TG/bookcodes/ch3/uva11922.cpp
|
Anyrainel/aoapc-code
|
e787a01380698fb9236d933462052f97b20e6132
|
[
"Apache-2.0"
] | 3
|
2017-08-15T06:00:01.000Z
|
2018-12-10T09:05:53.000Z
|
TG/bookcodes/ch3/uva11922.cpp
|
Anyrainel/aoapc-related-code
|
e787a01380698fb9236d933462052f97b20e6132
|
[
"Apache-2.0"
] | null | null | null |
TG/bookcodes/ch3/uva11922.cpp
|
Anyrainel/aoapc-related-code
|
e787a01380698fb9236d933462052f97b20e6132
|
[
"Apache-2.0"
] | 2
|
2017-09-16T18:46:27.000Z
|
2018-05-22T05:42:03.000Z
|
// UVa11922 Permutation Transformer
// Rujia Liu
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
struct Node {
Node *ch[2];
int s;
int flip;
int v;
int cmp(int k) const {
int d = k - ch[0]->s;
if(d == 1) return -1;
return d <= 0 ? 0 : 1;
}
void maintain() {
s = ch[0]->s + ch[1]->s + 1;
}
void pushdown() {
if(flip) {
flip = 0;
swap(ch[0], ch[1]);
ch[0]->flip = !ch[0]->flip;
ch[1]->flip = !ch[1]->flip;
}
}
};
Node *null = new Node();
void rotate(Node* &o, int d) {
Node* k = o->ch[d^1]; o->ch[d^1] = k->ch[d]; k->ch[d] = o;
o->maintain(); k->maintain(); o = k;
}
void splay(Node* &o, int k) {
o->pushdown();
int d = o->cmp(k);
if(d == 1) k -= o->ch[0]->s + 1;
if(d != -1) {
Node* p = o->ch[d];
p->pushdown();
int d2 = p->cmp(k);
int k2 = (d2 == 0 ? k : k - p->ch[0]->s - 1);
if(d2 != -1) {
splay(p->ch[d2], k2);
if(d == d2) rotate(o, d^1); else rotate(o->ch[d], d);
}
rotate(o, d^1);
}
}
// 合并left和right。假定left的所有元素比right小。注意right可以是null,但left不可以
Node* merge(Node* left, Node* right) {
splay(left, left->s);
left->ch[1] = right;
left->maintain();
return left;
}
// 把o的前k小结点放在left里,其他的放在right里。1<=k<=o->s。当k=o->s时,right=null
void split(Node* o, int k, Node* &left, Node* &right) {
splay(o, k);
left = o;
right = o->ch[1];
o->ch[1] = null;
left->maintain();
}
const int maxn = 100000 + 10;
struct SplaySequence {
int n;
Node seq[maxn];
Node *root;
Node* build(int sz) {
if(!sz) return null;
Node* L = build(sz/2);
Node* o = &seq[++n];
o->v = n; // 节点编号
o->ch[0] = L;
o->ch[1] = build(sz - sz/2 - 1);
o->flip = o->s = 0;
o->maintain();
return o;
}
void init(int sz) {
n = 0;
null->s = 0;
root = build(sz);
}
};
vector<int> ans;
void print(Node* o) {
if(o != null) {
o->pushdown();
print(o->ch[0]);
ans.push_back(o->v);
print(o->ch[1]);
}
}
void debug(Node* o) {
if(o != null) {
o->pushdown();
debug(o->ch[0]);
printf("%d ", o->v-1);
debug(o->ch[1]);
}
}
SplaySequence ss;
int main()
{
int n, m;
scanf("%d%d", &n, &m);
ss.init(n+1); // 最前面有一个虚拟结点
while (m--) {
int a, b;
scanf("%d%d", &a, &b);
Node *left, *mid, *right, *o;
split(ss.root, a, left, o); // 如果没有虚拟结点,a将改成a-1,违反split的限制
split(o, b-a+1, mid, right);
mid->flip ^= 1;
ss.root = merge(merge(left, right), mid);
}
print(ss.root);
for(int i = 1; i < ans.size(); i++)
printf("%d\n", ans[i]-1); // 节点编号减1才是本题的元素值
return 0;
}
| 18.784173
| 62
| 0.499809
|
Anyrainel
|
e491c6d21f80df9721ed2efce20317a514c9b3e2
| 6,639
|
cpp
|
C++
|
src/plugins/temperature/temperature_sensor_hal.cpp
|
fourkbomb/sensor-plugins
|
6f86a79e4b4e35cf85dede63686401408b9b6ff7
|
[
"Apache-2.0"
] | null | null | null |
src/plugins/temperature/temperature_sensor_hal.cpp
|
fourkbomb/sensor-plugins
|
6f86a79e4b4e35cf85dede63686401408b9b6ff7
|
[
"Apache-2.0"
] | null | null | null |
src/plugins/temperature/temperature_sensor_hal.cpp
|
fourkbomb/sensor-plugins
|
6f86a79e4b4e35cf85dede63686401408b9b6ff7
|
[
"Apache-2.0"
] | null | null | null |
/*
* temperature_sensor_hal
*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*
* 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 <fcntl.h>
#include <sys/stat.h>
#include <linux/input.h>
#include <csensor_config.h>
#include <temperature_sensor_hal.h>
#include <sys/ioctl.h>
using std::string;
#define SENSOR_TYPE_TEMPERATURE "TEMPERATURE"
#define ELEMENT_NAME "NAME"
#define ELEMENT_VENDOR "VENDOR"
#define ELEMENT_RAW_DATA_UNIT "RAW_DATA_UNIT"
#define TEMP_INPUT_NAME "temperature_sensor"
#define TEMP_IIO_ENABLE_NODE_NAME "temp_enable"
#define TEMP_SENSORHUB_POLL_NODE_NAME "temp_poll_delay"
#define INITIAL_TIME -1
temperature_sensor_hal::temperature_sensor_hal()
: m_temperature(0)
, m_node_handle(-1)
, m_polling_interval(POLL_1HZ_MS)
, m_fired_time(INITIAL_TIME)
{
const string sensorhub_interval_node_name = TEMP_SENSORHUB_POLL_NODE_NAME;
node_info_query query;
node_info info;
if (!find_model_id(SENSOR_TYPE_TEMPERATURE, m_model_id)) {
ERR("Failed to find model id");
throw ENXIO;
}
query.sensorhub_controlled = is_sensorhub_controlled(sensorhub_interval_node_name);
query.sensor_type = SENSOR_TYPE_TEMPERATURE;
query.key = TEMP_INPUT_NAME;
query.iio_enable_node_name = TEMP_IIO_ENABLE_NODE_NAME;
query.sensorhub_interval_node_name = sensorhub_interval_node_name;
if (!get_node_info(query, info)) {
ERR("Failed to get node info");
throw ENXIO;
}
show_node_info(info);
m_data_node = info.data_node_path;
m_enable_node = info.enable_node_path;
m_interval_node = info.interval_node_path;
csensor_config &config = csensor_config::get_instance();
if (!config.get(SENSOR_TYPE_TEMPERATURE, m_model_id, ELEMENT_VENDOR, m_vendor)) {
ERR("[VENDOR] is empty\n");
throw ENXIO;
}
if (!config.get(SENSOR_TYPE_TEMPERATURE, m_model_id, ELEMENT_NAME, m_chip_name)) {
ERR("[NAME] is empty\n");
throw ENXIO;
}
double raw_data_unit;
if (!config.get(SENSOR_TYPE_TEMPERATURE, m_model_id, ELEMENT_RAW_DATA_UNIT, raw_data_unit)) {
ERR("[RAW_DATA_UNIT] is empty\n");
throw ENXIO;
}
m_raw_data_unit = (float)(raw_data_unit);
if ((m_node_handle = open(m_data_node.c_str(),O_RDWR)) < 0) {
ERR("Failed to open handle(%d)", m_node_handle);
throw ENXIO;
}
int clockId = CLOCK_MONOTONIC;
if (ioctl(m_node_handle, EVIOCSCLOCKID, &clockId) != 0)
ERR("Fail to set monotonic timestamp for %s", m_data_node.c_str());
INFO("m_vendor = %s", m_vendor.c_str());
INFO("m_chip_name = %s", m_chip_name.c_str());
INFO("m_raw_data_unit = %f\n", m_raw_data_unit);
INFO("temperature_sensor_hal is created!\n");
}
temperature_sensor_hal::~temperature_sensor_hal()
{
close(m_node_handle);
m_node_handle = -1;
INFO("temperature_sensor_hal is destroyed!\n");
}
string temperature_sensor_hal::get_model_id(void)
{
return m_model_id;
}
sensor_hal_type_t temperature_sensor_hal::get_type(void)
{
return SENSOR_HAL_TYPE_TEMPERATURE;
}
bool temperature_sensor_hal::enable(void)
{
AUTOLOCK(m_mutex);
set_enable_node(m_enable_node, m_sensorhub_controlled, true,
SENSORHUB_TEMPERATURE_HUMIDITY_ENABLE_BIT);
set_interval(m_polling_interval);
m_fired_time = 0;
INFO("Temperature sensor real starting");
return true;
}
bool temperature_sensor_hal::disable(void)
{
AUTOLOCK(m_mutex);
set_enable_node(m_enable_node, m_sensorhub_controlled, false,
SENSORHUB_TEMPERATURE_HUMIDITY_ENABLE_BIT);
INFO("Temperature sensor real stopping");
return true;
}
bool temperature_sensor_hal::set_interval(unsigned long val)
{
unsigned long long polling_interval_ns;
AUTOLOCK(m_mutex);
polling_interval_ns = ((unsigned long long)(val) * 1000llu * 1000llu);
if (!set_node_value(m_interval_node, polling_interval_ns)) {
ERR("Failed to set polling node: %s\n", m_interval_node.c_str());
return false;
}
INFO("Interval is changed from %dms to %dms]", m_polling_interval, val);
m_polling_interval = val;
return true;
}
bool temperature_sensor_hal::update_value(void)
{
int temperature_raw = 0;
bool temperature = false;
int read_input_cnt = 0;
const int INPUT_MAX_BEFORE_SYN = 10;
unsigned long long fired_time = 0;
bool syn = false;
struct input_event temperature_event;
DBG("temperature event detection!");
while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) {
int len = read(m_node_handle, &temperature_event, sizeof(temperature_event));
if (len != sizeof(temperature_event)) {
ERR("temperature_file read fail, read_len = %d\n",len);
return false;
}
++read_input_cnt;
if (temperature_event.type == EV_REL) {
switch (temperature_event.code) {
case REL_HWHEEL:
temperature_raw = (int)temperature_event.value;
temperature = true;
break;
default:
ERR("temperature_event event[type = %d, code = %d] is unknown.", temperature_event.type, temperature_event.code);
return false;
break;
}
} else if (temperature_event.type == EV_SYN) {
syn = true;
fired_time = sensor_hal_base::get_timestamp(&temperature_event.time);
} else {
ERR("temperature_event event[type = %d, code = %d] is unknown.", temperature_event.type, temperature_event.code);
return false;
}
}
if (syn == false) {
ERR("EV_SYN didn't come until %d inputs had come", read_input_cnt);
return false;
}
AUTOLOCK(m_value_mutex);
if (temperature)
m_temperature = temperature_raw;
m_fired_time = fired_time;
DBG("m_temperature = %d, time = %lluus", m_temperature, m_fired_time);
return true;
}
bool temperature_sensor_hal::is_data_ready(void)
{
bool ret;
ret = update_value();
return ret;
}
int temperature_sensor_hal::get_sensor_data(sensor_data_t &data)
{
AUTOLOCK(m_value_mutex);
data.accuracy = SENSOR_ACCURACY_GOOD;
data.timestamp = m_fired_time ;
data.value_count = 1;
data.values[0] = (float) m_temperature;
return 0;
}
bool temperature_sensor_hal::get_properties(sensor_properties_s &properties)
{
properties.name = m_chip_name;
properties.vendor = m_vendor;
properties.min_range = -45;
properties.max_range = 130;
properties.min_interval = 1;
properties.resolution = 1;
properties.fifo_count = 0;
properties.max_batch_count = 0;
return true;
}
| 25.933594
| 118
| 0.749812
|
fourkbomb
|
e4942b3a1d7612af3a500a2a2ab8bd2993208287
| 1,134
|
cpp
|
C++
|
Test1/codes/choiking10.cpp
|
koohanmo/JudgeForTA
|
a894042448c761c333af74c529d99e2e84e2922f
|
[
"MIT"
] | 1
|
2017-05-23T06:57:51.000Z
|
2017-05-23T06:57:51.000Z
|
Test1/codes/choiking10.cpp
|
koohanmo/JudgeForTA
|
a894042448c761c333af74c529d99e2e84e2922f
|
[
"MIT"
] | null | null | null |
Test1/codes/choiking10.cpp
|
koohanmo/JudgeForTA
|
a894042448c761c333af74c529d99e2e84e2922f
|
[
"MIT"
] | null | null | null |
#include <cstdio>
#include <algorithm>
#include <vector>
#include <bitset>
#include <map>
using std::vector;
long long count_num(vector<int>& d, int depth, int idx, long long val, long long limit) {
if (idx == d.size() || val > limit) return 0;
long long ret = 0;
for (int i = idx; i < d.size(); i++) {
if (depth & 1) ret += limit / (d[i] * val);
else ret -= limit / (d[i] * val);
ret += count_num(d, depth + 1, i + 1, d[i] * val, limit);
}
return ret;
}
int main(void) {
int T;
scanf("%d", &T);
for (int tc = 1; tc <= T; tc++) {
long long a, b, n;
scanf("%lld%lld%lld", &a, &b, &n);
std::vector<int> count;
std::bitset<50010> c;
long long tmp = n;
for (long long i = 2; i*i <= n; i++) {
if (!c[i]) {
if(n%i==0)
count.push_back(i);
for (long long j = i *i; j*j <= n; j += i) {
c[j] = 1;
}
while (tmp != 1 && tmp%i == 0) tmp /= i;
if (tmp == 1) break;
}
}
if (tmp != 1) count.push_back(tmp);
long long ans = count_num(count, 1, 0, 1, b) - count_num(count, 1, 0, 1, a - 1);
printf("Case #%d: %lld\n", tc, b - a +1 - ans);
}
}
| 27.658537
| 90
| 0.502646
|
koohanmo
|
e49626e1247bf52cd5bbbe5ed53a3feebda2b654
| 178
|
cpp
|
C++
|
examples/valid.cpp
|
dtrugman/Kuvasz
|
3391832f017cb4946c6d135bb9382a0d446eadc1
|
[
"Apache-2.0"
] | 2
|
2017-05-20T20:59:36.000Z
|
2021-01-15T11:01:53.000Z
|
examples/valid.cpp
|
dtrugman/Bulldog
|
3391832f017cb4946c6d135bb9382a0d446eadc1
|
[
"Apache-2.0"
] | null | null | null |
examples/valid.cpp
|
dtrugman/Bulldog
|
3391832f017cb4946c6d135bb9382a0d446eadc1
|
[
"Apache-2.0"
] | null | null | null |
#include <iostream>
#include <unistd.h>
using namespace std;
int main(int argc, char ** argv)
{
while(true)
{
cout << "HI" << endl;
sleep(1000);
}
}
| 13.692308
| 32
| 0.539326
|
dtrugman
|
e49b967061c29c9f18ae55eccce5d82fefedbbce
| 852
|
cpp
|
C++
|
stone-game/stone-game.cpp
|
Ananyaas/LeetCodeDaily
|
e134e20ac02f26dc40881c376656d3294be0df2c
|
[
"MIT"
] | 2
|
2022-01-02T19:15:00.000Z
|
2022-01-05T21:12:24.000Z
|
stone-game/stone-game.cpp
|
Ananyaas/LeetCodeDaily
|
e134e20ac02f26dc40881c376656d3294be0df2c
|
[
"MIT"
] | null | null | null |
stone-game/stone-game.cpp
|
Ananyaas/LeetCodeDaily
|
e134e20ac02f26dc40881c376656d3294be0df2c
|
[
"MIT"
] | 1
|
2022-03-11T17:11:07.000Z
|
2022-03-11T17:11:07.000Z
|
class Solution {
public:
int helper(vector<int>& piles,int left,int right,vector<vector<int>>&dp){
if(left>=right)
return 0;
if(dp[left][right]!=-1)
return dp[left][right];
int choosel=piles[left]+min(helper(piles,left+2,right,dp),helper(piles,left,right-1,dp));
int chooser=piles[right]+min(helper(piles,left+1,right,dp),helper(piles,left,right-2,dp));
return dp[left][right]=max(choosel,chooser);
}
bool stoneGame(vector<int>& piles) {
if(piles.size()==0)
return false;
int sumval=0;
vector<vector<int>>dp(piles.size()+1,vector<int>(piles.size()+1,-1));
for (int i=0;i<piles.size();i++){
sumval+=piles[i];
}
return helper(piles,0, piles.size()-1,dp)>sumval/2?true:false;
}
};
| 34.08
| 98
| 0.561033
|
Ananyaas
|
e4a4e4efe1409bfc1aaf282a67b7a3b0b915f0cf
| 2,439
|
hpp
|
C++
|
armadillo_matrix/include/armadillo_bits/op_stddev_meat.hpp
|
Lauradejong92/wire-grad
|
0bfd3fb42df363f43eb89f35c2f0769fb805f6cd
|
[
"BSD-2-Clause"
] | 1
|
2022-02-02T15:47:24.000Z
|
2022-02-02T15:47:24.000Z
|
armadillo_matrix/include/armadillo_bits/op_stddev_meat.hpp
|
Lauradejong92/wire-grad
|
0bfd3fb42df363f43eb89f35c2f0769fb805f6cd
|
[
"BSD-2-Clause"
] | null | null | null |
armadillo_matrix/include/armadillo_bits/op_stddev_meat.hpp
|
Lauradejong92/wire-grad
|
0bfd3fb42df363f43eb89f35c2f0769fb805f6cd
|
[
"BSD-2-Clause"
] | 2
|
2019-02-28T17:36:19.000Z
|
2021-01-24T14:04:18.000Z
|
// Copyright (C) 2009-2011 NICTA (www.nicta.com.au)
// Copyright (C) 2009-2011 Conrad Sanderson
//
// This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness
// for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3
// of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info)
//! \addtogroup op_stddev
//! @{
//! \brief
//! For each row or for each column, find the standard deviation.
//! The result is stored in a dense matrix that has either one column or one row.
//! The dimension for which the standard deviations are found is set via the stddev() function.
template<typename T1>
inline
void
op_stddev::apply(Mat<typename T1::pod_type>& out, const mtOp<typename T1::pod_type, T1, op_stddev>& in)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type in_eT;
typedef typename T1::pod_type out_eT;
const unwrap_check_mixed<T1> tmp(in.m, out);
const Mat<in_eT>& X = tmp.M;
const uword norm_type = in.aux_uword_a;
const uword dim = in.aux_uword_b;
arma_debug_check( (norm_type > 1), "stddev(): incorrect usage. norm_type must be 0 or 1");
arma_debug_check( (dim > 1), "stddev(): incorrect usage. dim must be 0 or 1" );
const uword X_n_rows = X.n_rows;
const uword X_n_cols = X.n_cols;
if(dim == 0)
{
arma_extra_debug_print("op_stddev::apply(), dim = 0");
arma_debug_check( (X_n_rows == 0), "stddev(): given object has zero rows" );
out.set_size(1, X_n_cols);
out_eT* out_mem = out.memptr();
for(uword col=0; col<X_n_cols; ++col)
{
out_mem[col] = std::sqrt( op_var::direct_var( X.colptr(col), X_n_rows, norm_type ) );
}
}
else
if(dim == 1)
{
arma_extra_debug_print("op_stddev::apply(), dim = 1");
arma_debug_check( (X_n_cols == 0), "stddev(): given object has zero columns" );
out.set_size(X_n_rows, 1);
podarray<in_eT> tmp(X_n_cols);
in_eT* tmp_mem = tmp.memptr();
out_eT* out_mem = out.memptr();
for(uword row=0; row<X_n_rows; ++row)
{
tmp.copy_row(X, row);
out_mem[row] = std::sqrt( op_var::direct_var( tmp_mem, X_n_cols, norm_type) );
}
}
}
//! @}
| 28.360465
| 103
| 0.647396
|
Lauradejong92
|
e4b6ffe887a483f59e891ac7502eba6aaa2aa732
| 293
|
cpp
|
C++
|
Source/UnitTest++/CurrentTest.cpp
|
rorydriscoll/RayTracer
|
772b5d47c0d181c6fe49728aabc8e0a949f285e1
|
[
"CC0-1.0"
] | 124
|
2018-06-28T16:09:09.000Z
|
2022-02-23T16:20:26.000Z
|
Source/UnitTest++/CurrentTest.cpp
|
rorydriscoll/RayTracer
|
772b5d47c0d181c6fe49728aabc8e0a949f285e1
|
[
"CC0-1.0"
] | null | null | null |
Source/UnitTest++/CurrentTest.cpp
|
rorydriscoll/RayTracer
|
772b5d47c0d181c6fe49728aabc8e0a949f285e1
|
[
"CC0-1.0"
] | 9
|
2018-06-28T17:10:42.000Z
|
2021-08-09T08:42:41.000Z
|
#include "CurrentTest.h"
namespace UnitTest {
TestResults*& CurrentTest::Results()
{
static TestResults* testResults = nullptr;
return testResults;
}
const TestDetails*& CurrentTest::Details()
{
static const TestDetails* testDetails = nullptr;
return testDetails;
}
}
| 16.277778
| 50
| 0.709898
|
rorydriscoll
|
e4b7fd1f6fa7af8c113a3f3c7393b1746d53ae76
| 642
|
cpp
|
C++
|
IL2CPP/Il2CppOutputProject/IL2CPP/libil2cpp/os/c-api/Console.cpp
|
dngoins/AutographTheWorld-MR
|
24e567c8030b73a6942e25b36b7370667c649b90
|
[
"MIT"
] | 16
|
2018-10-13T12:29:06.000Z
|
2022-02-25T14:56:47.000Z
|
IL2CPP/Il2CppOutputProject/IL2CPP/libil2cpp/os/c-api/Console.cpp
|
dngoins/AutographTheWorld-MR
|
24e567c8030b73a6942e25b36b7370667c649b90
|
[
"MIT"
] | 3
|
2018-12-27T22:46:43.000Z
|
2019-03-19T12:28:37.000Z
|
IL2CPP/Il2CppOutputProject/IL2CPP/libil2cpp/os/c-api/Console.cpp
|
dngoins/AutographTheWorld-MR
|
24e567c8030b73a6942e25b36b7370667c649b90
|
[
"MIT"
] | 4
|
2019-05-02T02:13:54.000Z
|
2021-12-16T16:03:26.000Z
|
#include "os/Console.h"
#include "os/c-api/Console-c-api.h"
extern "C"
{
int32_t UnityPalConsoleInternalKeyAvailable(int32_t ms_timeout)
{
return il2cpp::os::Console::InternalKeyAvailable(ms_timeout);
}
int32_t UnityPalConsoleSetBreak(int32_t wantBreak)
{
return il2cpp::os::Console::SetBreak(wantBreak);
}
int32_t UnityPalConsoleSetEcho(int32_t wantEcho)
{
return il2cpp::os::Console::SetEcho(wantEcho);
}
int32_t UnityPalConsoleTtySetup(const char* keypadXmit, const char* teardown, uint8_t* control_characters, int32_t** size)
{
return il2cpp::os::Console::TtySetup(keypadXmit, teardown, control_characters, size);
}
}
| 24.692308
| 122
| 0.76947
|
dngoins
|
e4becb7165e263070ca7bd23c010492b2ee0ee94
| 5,454
|
cpp
|
C++
|
gui/geometries/planegeometry.cpp
|
goossens/ObjectTalk
|
ca1d4f558b5ad2459b376102744d52c6283ec108
|
[
"MIT"
] | 6
|
2021-11-12T15:03:53.000Z
|
2022-01-28T18:30:33.000Z
|
gui/geometries/planegeometry.cpp
|
goossens/ObjectTalk
|
ca1d4f558b5ad2459b376102744d52c6283ec108
|
[
"MIT"
] | null | null | null |
gui/geometries/planegeometry.cpp
|
goossens/ObjectTalk
|
ca1d4f558b5ad2459b376102744d52c6283ec108
|
[
"MIT"
] | null | null | null |
// ObjectTalk Scripting Language
// Copyright (c) 1993-2022 Johan A. Goossens. All rights reserved.
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.
//
// Include files
//
#include "ot/function.h"
#include "planegeometry.h"
//
// OtPlaneGeometryClass::~OtPlaneGeometryClass
//
OtPlaneGeometryClass::~OtPlaneGeometryClass() {
if (heightmap) {
heightmap->detach(heightmapID);
}
if (noisemap) {
noisemap->detach(noisemapID);
}
}
//
// OtPlaneGeometryClass::init
//
OtObject OtPlaneGeometryClass::init(size_t count, OtObject* parameters) {
// set attributes
switch (count) {
case 4:
heightSegments = parameters[3]->operator int();
case 3:
widthSegments = parameters[2]->operator int();
case 2:
height = parameters[1]->operator float();
case 1:
width = parameters[0]->operator float();
case 0:
break;
default:
OtExcept("Too many parameters [%ld] for [PlaneGeometry] constructor (max 4)", count);
}
return nullptr;
}
//
// OtPlaneGeometryClass::setWidth
//
OtObject OtPlaneGeometryClass::setWidth(float w) {
width = w;
refreshGeometry = true;
return shared();
}
//
// OtPlaneGeometryClass::setHeight
//
OtObject OtPlaneGeometryClass::setHeight(float h) {
height = h;
refreshGeometry = true;
return shared();
}
//
// OtPlaneGeometryClass::setWidthSegments
//
OtObject OtPlaneGeometryClass::setWidthSegments(int ws) {
widthSegments = ws;
refreshGeometry = true;
return shared();
}
//
// OtPlaneGeometryClass::setHeightSegments
//
OtObject OtPlaneGeometryClass::setHeightSegments(int hs) {
heightSegments = hs;
refreshGeometry = true;
return shared();
}
//
// OtPlaneGeometryClass::setHeightMap
//
OtObject OtPlaneGeometryClass::setHeightMap(OtObject object) {
// sanity check
if (!object->isKindOf("HeightMap")) {
OtExcept("Expected a [HeightMap] object, not a [%s]", object->getType()->getName().c_str());
}
// cleanup
if (heightmap) {
heightmap->detach(heightmapID);
heightmap = nullptr;
}
if (noisemap) {
noisemap->detach(noisemapID);
noisemap = nullptr;
}
// set new heightmap
heightmap = object->cast<OtHeightMapClass>();
refreshGeometry = true;
heightmapID = heightmap->attach([this]() {
refreshGeometry = true;
});
return shared();
}
//
// OtPlaneGeometryClass::setNoiseMap
//
OtObject OtPlaneGeometryClass::setNoiseMap(OtObject object, int xo, int yo) {
// sanity check
if (!object->isKindOf("NoiseMap")) {
OtExcept("Expected a [NoiseMap] object, not a [%s]", object->getType()->getName().c_str());
}
// cleanup
if (heightmap) {
heightmap->detach(heightmapID);
heightmap = nullptr;
}
if (noisemap) {
noisemap->detach(noisemapID);
noisemap = nullptr;
}
// set new noisemap
noisemap = object->cast<OtNoiseMapClass>();
refreshGeometry = true;
noisemapID = noisemap->attach([this]() {
refreshGeometry = true;
});
xoffset = xo;
yoffset = yo;
return shared();
}
//
// OtPlaneGeometryClass::fillGeometry
//
void OtPlaneGeometryClass::fillGeometry() {
// add vertices
auto widthHalf = width / 2.0;
auto heightHalf = height / 2.0;
auto gridX1 = widthSegments + 1;
auto gridY1 = heightSegments + 1;
auto segmentWidth = width / (float) widthSegments;
auto segmentHeight = height / (float) heightSegments;
for (auto iy = 0; iy < gridY1; iy++) {
auto y = heightHalf - iy * segmentHeight;
for (auto ix = 0; ix < gridX1; ix++) {
auto x = ix * segmentWidth - widthHalf;
auto u = (float) ix / (float) widthSegments;
auto v = (float) iy / (float) heightSegments;
float z = 0.0;
if (heightmap) {
z = heightmap->getHeight(u, v);
} else if (noisemap) {
z = noisemap->getNoise(u * width + xoffset, v * height + yoffset);
}
addVertex(OtVertex(
glm::vec3(x, y, z),
glm::vec3(0.0, 0.0, 1.0),
glm::vec2(u, v)));
}
}
// add triangles and lines
for (auto iy = 0; iy < heightSegments; iy++) {
for (auto ix = 0; ix < widthSegments; ix++) {
auto a = ix + gridX1 * iy;
auto b = ix + gridX1 * (iy + 1);
auto c = (ix + 1) + gridX1 * (iy + 1);
auto d = (ix + 1) + gridX1 * iy;
addTriangle(a, b, d);
addTriangle(b, c, d);
if (iy == 0) {
addLine(a, d);
}
addLine(a, b);
addLine(b, c);
if (ix == widthSegments - 1) {
addLine(c, d);
}
}
}
}
//
// OtPlaneGeometryClass::getMeta
//
OtType OtPlaneGeometryClass::getMeta() {
static OtType type = nullptr;
if (!type) {
type = OtTypeClass::create<OtPlaneGeometryClass>("PlaneGeometry", OtGeometryClass::getMeta());
type->set("__init__", OtFunctionClass::create(&OtPlaneGeometryClass::init));
type->set("setWidth", OtFunctionClass::create(&OtPlaneGeometryClass::setWidth));
type->set("setHeight", OtFunctionClass::create(&OtPlaneGeometryClass::setHeight));
type->set("setWidthSegments", OtFunctionClass::create(&OtPlaneGeometryClass::setWidthSegments));
type->set("setHeightSegments", OtFunctionClass::create(&OtPlaneGeometryClass::setHeightSegments));
type->set("setHeightMap", OtFunctionClass::create(&OtPlaneGeometryClass::setHeightMap));
type->set("setNoiseMap", OtFunctionClass::create(&OtPlaneGeometryClass::setNoiseMap));
}
return type;
}
//
// OtPlaneGeometryClass::create
//
OtPlaneGeometry OtPlaneGeometryClass::create() {
OtPlaneGeometry planegeometry = std::make_shared<OtPlaneGeometryClass>();
planegeometry->setType(getMeta());
return planegeometry;
}
| 20.125461
| 100
| 0.676568
|
goossens
|
e4bfd44b8e0a2313318512d4fe9f02c69cf9f115
| 5,831
|
cc
|
C++
|
test/object_characterization/characterization_test.cc
|
ilMartoo/LiDAR-based_anomaly_detector
|
a5364992f906fe1eec8106bebdfa1fa99932e89e
|
[
"MIT"
] | null | null | null |
test/object_characterization/characterization_test.cc
|
ilMartoo/LiDAR-based_anomaly_detector
|
a5364992f906fe1eec8106bebdfa1fa99932e89e
|
[
"MIT"
] | null | null | null |
test/object_characterization/characterization_test.cc
|
ilMartoo/LiDAR-based_anomaly_detector
|
a5364992f906fe1eec8106bebdfa1fa99932e89e
|
[
"MIT"
] | null | null | null |
/**
* @file anomaly_test.cc
* @author Martín Suárez (martin.suarez.garcia@rai.usc.es)
* @date 10/05/2022
*
* Test para el módulo de la CLI
*
*/
#include "catch.hpp"
#include "catch_utils.hh"
#include <vector>
#include "object_characterization/ObjectCharacterizer.hh"
#include "object_characterization/CharacterizedObject.hh"
#include "object_characterization/DBScan.hh"
#include "scanner/IScanner.hh"
#include "models/LidarPoint.hh"
/* MOCKUP */
class ScannerMock : public IScanner {
public:
std::function<void(const LidarPoint &p)> func;
std::vector<LidarPoint> v;
ScannerMock() {
v.reserve(400 * 6 + 2);
for (int i = 0; i < 20; ++i) {
for (int j = 0; j < 20; ++j) {
v.push_back({{0, 0}, 0, 0, i, j});
v.push_back({{0, 0}, 0, 100, i, j});
v.push_back({{0, 0}, 0, i, 0, j});
v.push_back({{0, 0}, 0, i, 100, j});
v.push_back({{0, 0}, 0, i, j, 0});
v.push_back({{0, 0}, 0, i, j, 100});
}
}
v.push_back({{0, 0}, 0, -100, -100, -100});
v.push_back({{2, 0}, 0, 0, 0, 0});
}
bool init() { return true; }
ScanCode scan() {
if (!scanning) {
scanning = true;
if (func) {
for (size_t i = 0; i < v.size() && scanning; ++i) {
func(v[i]);
}
}
scanning = false;
}
return kScanOk;
}
void pause() { scanning = false; }
bool setCallback(std::function<void(const LidarPoint &p)> func) { return (bool)(this->func = func); }
void stop() {}
};
class ScannerMockBad : public IScanner {
public:
std::function<void(const LidarPoint &p)> func;
std::vector<LidarPoint> v;
ScannerMockBad() {
v.reserve(400 * 6 + 2);
for (int i = 0; i < 2000; i += 100) {
for (int j = 0; j < 2000; j += 100) {
v.push_back({{0, 0}, 0, 0, i, j});
v.push_back({{0, 0}, 0, 100, i, j});
v.push_back({{0, 0}, 0, i, 0, j});
v.push_back({{0, 0}, 0, i, 100, j});
v.push_back({{0, 0}, 0, i, j, 0});
v.push_back({{0, 0}, 0, i, j, 100});
}
}
v.push_back({{0, 0}, 0, -100, -100, -100});
v.push_back({{2, 0}, 0, 0, 0, 0});
}
bool init() { return false; }
ScanCode scan() {
if (!scanning) {
scanning = true;
if (func) {
for (size_t i = 0; i < v.size() && scanning; ++i) {
func(v[i]);
}
}
scanning = false;
}
return kScanOk;
}
void pause() { scanning = false; }
bool setCallback(std::function<void(const LidarPoint &p)> func) { return (bool)(this->func = func); }
void stop() {}
};
class ScannerMockWait : public IScanner {
public:
std::function<void(const LidarPoint &p)> func;
std::vector<LidarPoint> v;
unsigned discarded;
ScannerMockWait() : discarded(0) {
v.push_back({{0, 0}, 0, 0, 0, 0});
v.push_back({{1, 0}, 0, 0, 0, 0});
v.push_back({{2, 0}, 0, 0, 0, 0});
v.push_back({{3, 0}, 0, 0, 0, 0});
}
bool init() { return true; }
ScanCode scan() {
if(!scanning) {
scanning = true;
if (func) {
for (size_t i = 0; i < v.size() && scanning; ++i) {
func(v[i]);
++discarded;
}
}
scanning = false;
}
return kScanOk;
}
void pause() { scanning = false; }
bool setCallback(std::function<void(const LidarPoint &p)> func) { return (bool)(this->func = func); }
void stop() {}
};
/**********/
class CharacterizationFixture {
public:
ScannerMock sg;
ScannerMockBad sb;
ScannerMockWait sw;
ObjectCharacterizer ocg;
ObjectCharacterizer ocb;
ObjectCharacterizer ocw;
std::vector<Point> cubo;
std::vector<Point> plano;
CharacterizationFixture() : sg(),
sb(),
ocg(&sg, 10, 10, 0, 10, true),
ocb(&sb, 10, 10, 0, 10, false),
ocw(&sw, 10, 10, 0, 10, false) {
sg.setCallback([this](const LidarPoint &p) { this->ocg.newPoint(p); });
sb.setCallback([this](const LidarPoint &p) { this->ocb.newPoint(p); });
sw.setCallback([this](const LidarPoint &p) { this->ocw.newPoint(p); });
for (int i = 0; i <= 50; ++i) {
for (int j = 0; j <= 50; ++j) {
cubo.push_back({0, i, j});
cubo.push_back({50, i, j});
cubo.push_back({i, 0, j});
cubo.push_back({i, 50, j});
cubo.push_back({i, j, 0});
cubo.push_back({i, j, 50});
plano.push_back({i, j, 0});
}
}
cubo.push_back({-100, -100, -100});
plano.push_back({-100, -100, -100});
}
};
TEST_CASE_METHOD(CharacterizationFixture, "3.1, 3.2, 3.3", "[ObjectCharacterizer]") {
ocg.defineBackground();
// 3.1
CHECK(ocg.init());
// 3.2
CHECK(!ocb.init());
// 3.3
CHECK(!ocg.defineObject().first);
}
TEST_CASE_METHOD(CharacterizationFixture, "3.4, 3.5", "[ObjectCharacterizer]") {
// 3.4
CHECK(!ocb.defineObject().first);
// 3.5
CHECK(ocg.defineObject().first);
}
TEST_CASE_METHOD(CharacterizationFixture, "3.6", "[ObjectCharacterizer]") {
ocw.wait(1500);
CHECK(sw.discarded == 3);
}
TEST_CASE_METHOD(CharacterizationFixture, "3.7, 3.8", "[DBScan]") {
// 3.7
CHECK(DBScan::clusters(cubo).size() == 1);
// 3.8
CHECK(DBScan::normals(plano).size() == 1);
}
| 29.00995
| 105
| 0.483965
|
ilMartoo
|
e4c48c9b8b689587fddff718e33b4f96d1e854f9
| 1,059
|
cpp
|
C++
|
examples/chapter.13.16.cpp
|
Chen-Carl/GUI
|
13aa8337f2afe3b6d0d4d18b5c8eb1cf3a47cdd7
|
[
"BSL-1.0"
] | 1
|
2021-04-23T13:19:28.000Z
|
2021-04-23T13:19:28.000Z
|
examples/chapter.13.16.cpp
|
Chen-Carl/GUI
|
13aa8337f2afe3b6d0d4d18b5c8eb1cf3a47cdd7
|
[
"BSL-1.0"
] | null | null | null |
examples/chapter.13.16.cpp
|
Chen-Carl/GUI
|
13aa8337f2afe3b6d0d4d18b5c8eb1cf3a47cdd7
|
[
"BSL-1.0"
] | 2
|
2021-05-08T15:09:18.000Z
|
2021-06-03T09:49:24.000Z
|
//
// This is example code from Chapter 13.16 "Mark" of
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#include "Simple_window.h" // get access to our window library
#include "Graph.h" // get access to our graphics library facilities
//------------------------------------------------------------------------------
int main()
{
using namespace Graph_lib; // our graphics facilities are in Graph_lib
Simple_window win = {{100,100},600,400,"Circles with centers"};
Circle c1 = {{100,200},50};
Circle c2 = {{150,200},100};
Circle c3 = {{200,200},150};
win.attach(c1);
win.attach(c2);
win.attach(c3);
Mark m1 = {{100,200},'x'};
Mark m2 = {{150,200},'y'};
Mark m3 = {{200,200},'z'};
c1.set_color(Colors::blue);
c2.set_color(Colors::red);
c3.set_color(Colors::green);
win.attach(m1);
win.attach(m2);
win.attach(m3);
win.wait_for_button(); // Display!
}
//------------------------------------------------------------------------------
| 26.475
| 80
| 0.517469
|
Chen-Carl
|
e4c6b4f752dca4e75b366776c7f135c6faeac5dc
| 1,806
|
hh
|
C++
|
aku/SpeakerConfig.hh
|
phsmit/AaltoASR
|
33cb58b288cc01bcdff0d6709a296d0dfcc7f74a
|
[
"BSD-3-Clause"
] | 78
|
2015-01-07T14:33:47.000Z
|
2022-03-15T09:01:30.000Z
|
aku/SpeakerConfig.hh
|
phsmit/AaltoASR
|
33cb58b288cc01bcdff0d6709a296d0dfcc7f74a
|
[
"BSD-3-Clause"
] | 4
|
2015-05-19T13:00:34.000Z
|
2016-07-26T12:29:32.000Z
|
aku/SpeakerConfig.hh
|
phsmit/AaltoASR
|
33cb58b288cc01bcdff0d6709a296d0dfcc7f74a
|
[
"BSD-3-Clause"
] | 32
|
2015-01-16T08:16:24.000Z
|
2021-04-02T21:26:22.000Z
|
#ifndef SPEAKERCONFIG_HH
#define SPEAKERCONFIG_HH
#include <vector>
#include <set>
#include <map>
#include <string>
#include "FeatureGenerator.hh"
#include "ModelModules.hh"
namespace aku {
/** A class for handling speaker and utterance adaptations.
* Speaker ID is the primary method for changing feature configurations.
* If another level of configurations is needed, utterance IDs can
* be used. Note that utterance ID is reset when speaker ID changes.
*/
class SpeakerConfig {
public:
SpeakerConfig(FeatureGenerator &fea_gen, HmmSet *model = NULL);
void read_speaker_file(FILE *file);
void write_speaker_file(FILE *file, std::set<std::string> *speakers = NULL,
std::set<std::string> *utterances = NULL);
void set_speaker(const std::string &speaker_id);
const std::string& get_cur_speaker(void) { return m_cur_speaker; }
void set_utterance(const std::string &utterance_id);
const std::string& get_cur_utterance(void) { return m_cur_utterance; }
ModelTransformer& get_model_transformer() { return m_model_trans; }
private:
typedef std::map<std::string, ModuleConfig> ModuleMap;
typedef std::map<std::string, ModuleMap> SpeakerMap;
void retrieve_speaker_config(const std::string &speaker_id);
void retrieve_utterance_config(const std::string &utterance_id);
void set_modules(const ModuleMap &modules, bool load_new_model_trans = false);
private:
FeatureGenerator &m_fea_gen;
ModelTransformer m_model_trans;
HmmSet *m_model;
SpeakerMap m_speaker_config;
SpeakerMap m_utterance_config;
ModuleMap m_default_speaker_config;
ModuleMap m_default_utterance_config;
bool m_default_speaker_set;
bool m_default_utterance_set;
std::string m_cur_speaker;
std::string m_cur_utterance;
};
}
#endif // SPEAKERCONFIG_HH
| 28.666667
| 80
| 0.75969
|
phsmit
|
e4c6e8053bfc3e536a01e404ce2240b5e48e5224
| 1,504
|
cpp
|
C++
|
leetcode-problems/medium-33-search-in-rotated-array.cpp
|
formatkaka/dsalgo
|
a7c7386c5c161e23bc94456f93cadd0f91f102fa
|
[
"Unlicense"
] | null | null | null |
leetcode-problems/medium-33-search-in-rotated-array.cpp
|
formatkaka/dsalgo
|
a7c7386c5c161e23bc94456f93cadd0f91f102fa
|
[
"Unlicense"
] | null | null | null |
leetcode-problems/medium-33-search-in-rotated-array.cpp
|
formatkaka/dsalgo
|
a7c7386c5c161e23bc94456f93cadd0f91f102fa
|
[
"Unlicense"
] | null | null | null |
//
// Created by Siddhant on 2019-11-07.
//
#include "iostream"
#include "vector"
#include "string"
#include "algorithm"
using namespace std;
int findCenter(vector<int> &nums) {
if (nums[0] < nums[nums.size() - 1]) {
return 0;
}
if (nums.size() == 1) {
return 0;
}
int start = 0;
int end = nums.size() - 1;
int mid;
while (start < end) {
mid = (start + end) / 2;
if (nums[mid] < nums[start] && nums[mid - 1] > nums[mid]) {
return mid;
}
if (nums[mid] > nums[start]) {
start = mid;
} else {
end = mid;
}
}
return mid + 1;
}
int binSearch(vector<int> &nums, int target, int startIndex, int endIndex) {
int mid;
while (startIndex <= endIndex) {
mid = (startIndex + endIndex) / 2;
if (nums[mid] == target) {
return mid;
}
if (nums[mid] > target) {
endIndex = mid - 1;
} else {
startIndex = mid + 1;
}
}
return -1;
}
int search(vector<int> &nums, int target) {
int getCenter = findCenter(nums);
if (target <= nums[nums.size() - 1]) {
return binSearch(nums, target, getCenter, nums.size() - 1);
} else {
return binSearch(nums, target, 0, getCenter - 1);
}
}
int main() {
vector<int> nums = {3, 1};
// vector<int> nums = {4,5,6,7,0,1,2};
cout << "center index : " << search(nums, 0);
return 0;
}
| 16.898876
| 76
| 0.489362
|
formatkaka
|
e4c7746f4bf9e345624c3ea94d88532d7d0a1efb
| 6,339
|
cpp
|
C++
|
HelperFunctions/getVkPipelineRasterizationConservativeStateCreateInfoEXT.cpp
|
dkaip/jvulkan-natives-Linux-x86_64
|
ea7932f74e828953c712feea11e0b01751f9dc9b
|
[
"Apache-2.0"
] | null | null | null |
HelperFunctions/getVkPipelineRasterizationConservativeStateCreateInfoEXT.cpp
|
dkaip/jvulkan-natives-Linux-x86_64
|
ea7932f74e828953c712feea11e0b01751f9dc9b
|
[
"Apache-2.0"
] | null | null | null |
HelperFunctions/getVkPipelineRasterizationConservativeStateCreateInfoEXT.cpp
|
dkaip/jvulkan-natives-Linux-x86_64
|
ea7932f74e828953c712feea11e0b01751f9dc9b
|
[
"Apache-2.0"
] | null | null | null |
/*
* Copyright 2019-2020 Douglas Kaip
*
* 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.
*/
/*
* getVkPipelineRasterizationConservativeStateCreateInfoEXT.cpp
*
* Created on: May 28, 2019
* Author: Douglas Kaip
*/
#include "JVulkanHelperFunctions.hh"
#include "slf4j.hh"
namespace jvulkan
{
void getVkPipelineRasterizationConservativeStateCreateInfoEXT(
JNIEnv *env,
const jobject jVkPipelineRasterizationConservativeStateCreateInfoEXTObject,
VkPipelineRasterizationConservativeStateCreateInfoEXT *vkPipelineRasterizationConservativeStateCreateInfoEXT,
std::vector<void *> *memoryToFree)
{
jclass theClass = env->GetObjectClass(jVkPipelineRasterizationConservativeStateCreateInfoEXTObject);
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Could not find class for jVkPipelineRasterizationConservativeStateCreateInfoEXTObject");
return;
}
////////////////////////////////////////////////////////////////////////
VkStructureType sTypeValue = getSType(env, jVkPipelineRasterizationConservativeStateCreateInfoEXTObject);
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Call to getSType failed.");
return;
}
////////////////////////////////////////////////////////////////////////
jobject jpNextObject = getpNextObject(env, jVkPipelineRasterizationConservativeStateCreateInfoEXTObject);
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Call to getpNext failed.");
return;
}
void *pNext = nullptr;
if (jpNextObject != nullptr)
{
getpNextChain(
env,
jpNextObject,
&pNext,
memoryToFree);
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Call to getpNextChain failed.");
return;
}
}
////////////////////////////////////////////////////////////////////////
jmethodID methodId = env->GetMethodID(theClass, "getFlags", "()Ljava/util/EnumSet;");
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Could not find method id for getFlags.");
return;
}
jobject flagsObject = env->CallObjectMethod(jVkPipelineRasterizationConservativeStateCreateInfoEXTObject, methodId);
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Error calling CallObjectMethod.");
return;
}
VkPipelineRasterizationConservativeStateCreateFlagsEXT flags = (VkPipelineRasterizationConservativeStateCreateFlagsEXT)getEnumSetValue(
env,
flagsObject,
"com/CIMthetics/jvulkan/VulkanExtensions/Enums/VkPipelineRasterizationConservativeStateCreateFlagBitsEXT");
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Error calling getEnumSetValue.");
return;
}
////////////////////////////////////////////////////////////////////////
methodId = env->GetMethodID(theClass, "getConservativeRasterizationMode", "()Lcom/CIMthetics/jvulkan/VulkanExtensions/Enums/VkConservativeRasterizationModeEXT;");
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Could not find method id for getConservativeRasterizationMode.");
return;
}
jobject jVkConservativeRasterizationModeEXTObject = env->CallObjectMethod(jVkPipelineRasterizationConservativeStateCreateInfoEXTObject, methodId);
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Error calling CallObjectMethod.");
return;
}
jclass vkConservativeRasterizationModeEXTEnumClass = env->GetObjectClass(jVkConservativeRasterizationModeEXTObject);
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Could not find class for jVkConservativeRasterizationModeEXTObject.");
return;
}
jmethodID valueOfMethodId = env->GetMethodID(vkConservativeRasterizationModeEXTEnumClass, "valueOf", "()I");
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Could not find method id for valueOf.");
return;
}
VkConservativeRasterizationModeEXT vkConservativeRasterizationModeEXTEnumValue = (VkConservativeRasterizationModeEXT)env->CallIntMethod(jVkConservativeRasterizationModeEXTObject, valueOfMethodId);
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Error calling CallIntMethod.");
return;
}
////////////////////////////////////////////////////////////////////////
methodId = env->GetMethodID(theClass, "getExtraPrimitiveOverestimationSize", "()F");
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Could not find method id for getExtraPrimitiveOverestimationSize.");
return;
}
jfloat extraPrimitiveOverestimationSize = env->CallFloatMethod(jVkPipelineRasterizationConservativeStateCreateInfoEXTObject, methodId);
if (env->ExceptionOccurred())
{
LOGERROR(env, "%s", "Error calling CallFloatMethod.");
return;
}
vkPipelineRasterizationConservativeStateCreateInfoEXT->sType = sTypeValue;
vkPipelineRasterizationConservativeStateCreateInfoEXT->pNext = pNext;
vkPipelineRasterizationConservativeStateCreateInfoEXT->flags = flags;
vkPipelineRasterizationConservativeStateCreateInfoEXT->conservativeRasterizationMode = vkConservativeRasterizationModeEXTEnumValue;
vkPipelineRasterizationConservativeStateCreateInfoEXT->extraPrimitiveOverestimationSize = extraPrimitiveOverestimationSize;
}
}
| 40.634615
| 204
| 0.630541
|
dkaip
|
e4c7d64f2fd3906b184ad77fe2cc07f3ea1ddb24
| 12,101
|
cpp
|
C++
|
file-commander-core/src/cfilesystemobject.cpp
|
JnMartens/file-commander
|
ee3418225dc26e411d21c4eb88a40a3859971e18
|
[
"Apache-2.0"
] | null | null | null |
file-commander-core/src/cfilesystemobject.cpp
|
JnMartens/file-commander
|
ee3418225dc26e411d21c4eb88a40a3859971e18
|
[
"Apache-2.0"
] | null | null | null |
file-commander-core/src/cfilesystemobject.cpp
|
JnMartens/file-commander
|
ee3418225dc26e411d21c4eb88a40a3859971e18
|
[
"Apache-2.0"
] | null | null | null |
#include "cfilesystemobject.h"
#include "filesystemhelperfunctions.h"
#include "windows/windowsutils.h"
#include "assert/advanced_assert.h"
#include "lang/type_traits_fast.hpp"
#include "hash/fasthash.h"
#ifdef CFILESYSTEMOBJECT_TEST
#define QFileInfo QFileInfo_Test
#define QDir QDir_Test
#endif
DISABLE_COMPILER_WARNINGS
#include "qtcore_helpers/qdatetime_helpers.hpp"
#include <QDebug>
RESTORE_COMPILER_WARNINGS
#include <assert.h>
#include <errno.h>
#if defined __linux__ || defined __APPLE__ || defined __FreeBSD__
#include <unistd.h>
#include <sys/stat.h>
#include <wordexp.h>
#include <dirent.h>
#elif defined _WIN32
#include "windows/windowsutils.h"
#include <Windows.h>
#include <Shlwapi.h>
#pragma comment(lib, "Shlwapi.lib") // This lib would have to be added not just to the top level application, but every plugin as well, so using #pragma instead
#endif
static QString expandEnvironmentVariables(const QString& string)
{
#ifdef _WIN32
if (!string.contains('%'))
return string;
WCHAR source[16384 + 1];
WCHAR result[16384 + 1];
static_assert (sizeof(WCHAR) == 2);
const auto length = string.toWCharArray(source);
source[length] = 0;
if (const auto resultLength = ExpandEnvironmentStringsW(source, result, static_cast<DWORD>(std::size(result))); resultLength > 0)
return toPosixSeparators(QString::fromWCharArray(result, resultLength - 1));
else
return string;
#else
QString result = string;
if (result.startsWith('~'))
result.replace(0, 1, getenv("HOME"));
if (result.contains('$'))
{
wordexp_t p;
wordexp("$HOME/bin", &p, 0);
const auto w = p.we_wordv;
if (p.we_wordc > 0)
result = w[0];
wordfree(&p);
}
return result;
#endif
}
CFileSystemObject::CFileSystemObject(const QFileInfo& fileInfo) : _fileInfo(fileInfo)
{
refreshInfo();
}
CFileSystemObject::CFileSystemObject(const QString& path) : _fileInfo(expandEnvironmentVariables(path))
{
refreshInfo();
}
static QString parentForAbsolutePath(QString absolutePath)
{
if (absolutePath.endsWith('/'))
absolutePath.chop(1);
const int lastSlash = absolutePath.lastIndexOf('/');
if (lastSlash <= 0)
return {};
absolutePath.truncate(lastSlash + 1); // Keep the slash as it signifies a directory rather than a file.
return absolutePath;
}
CFileSystemObject & CFileSystemObject::operator=(const QString & path)
{
setPath(path);
return *this;
}
void CFileSystemObject::refreshInfo()
{
#ifndef _WIN32
// TODO: is this always correct?
// Should there be a special "Symlink" object type? Then it could be handled properly (e. g. delete = unlink)
_properties.exists = !_fileInfo.isSymLink() ? _fileInfo.exists() : true;
#else
_properties.exists = _fileInfo.exists();
#endif
_properties.fullPath = _fileInfo.absoluteFilePath();
// QFileInfo::isShortcut() is quite a heavy call on Windows - disabled temporarily for better performance enumerating large folders
// Time to first update for C:\Windows\WinSxS\ goes from 1900 to 3900 ms
//if (_fileInfo.isShortcut()) // This is Windows-specific, place under #ifdef?
//{
// _properties.exists = true;
// _properties.type = File;
//}
//else
if (_fileInfo.isFile())
_properties.type = File;
else if (_fileInfo.isDir())
{
// Normalization - very important for hash calculation and equality checking
// C:/1/ must be equal to C:/1
if (!_properties.fullPath.endsWith('/'))
_properties.fullPath.append('/');
#ifdef __APPLE__
_properties.type = _fileInfo.isBundle() ? Bundle : Directory;
#else
_properties.type = Directory;
#endif
}
else if (!_properties.exists && _properties.fullPath.endsWith('/'))
_properties.type = Directory;
else
{
#ifdef _WIN32
if (_properties.exists)
qInfo() << _properties.fullPath << " is neither a file nor a dir";
#else
// TODO: is this always correct?
// Should there be a special "Symlink" object type? Then it could be handled properly (e. g. delete = unlink)
if (_fileInfo.isSymLink())
_properties.type = File;
#endif
}
_properties.hash = fasthash64(_properties.fullPath.constData(), static_cast<uint64_t>(_properties.fullPath.size()) * sizeof(QChar), 0);
if (_properties.type == File)
{
_properties.extension = _fileInfo.suffix();
_properties.completeBaseName = _fileInfo.completeBaseName();
}
else if (_properties.type == Directory)
{
_properties.completeBaseName = _fileInfo.baseName();
const QString suffix = _fileInfo.completeSuffix();
if (!suffix.isEmpty())
_properties.completeBaseName = _properties.completeBaseName % '.' % suffix;
// Ugly temporary bug fix for #141
if (_properties.completeBaseName.isEmpty() && _properties.fullPath.endsWith('/'))
{
const QFileInfo tmpInfo = QFileInfo(_properties.fullPath.left(_properties.fullPath.length() - 1));
_properties.completeBaseName = tmpInfo.baseName();
const QString sfx = tmpInfo.completeSuffix();
if (!sfx.isEmpty())
_properties.completeBaseName = _properties.completeBaseName % '.' % sfx;
}
}
else if (_properties.type == Bundle)
{
_properties.extension = _fileInfo.suffix();
_properties.completeBaseName = _fileInfo.completeBaseName();
}
_properties.fullName = _properties.type == Directory ? _properties.completeBaseName : _fileInfo.fileName();
_properties.isCdUp = _properties.fullName == QLatin1String("..");
// QFileInfo::canonicalPath() / QFileInfo::absolutePath are undefined for non-files
_properties.parentFolder = parentForAbsolutePath(_properties.fullPath);
if (!_properties.exists)
return;
_properties.creationDate = toTime_t(_fileInfo.birthTime());
_properties.modificationDate = toTime_t(_fileInfo.lastModified());
_properties.size = _properties.type == File ? static_cast<uint64_t>(_fileInfo.size()) : 0ULL;
}
void CFileSystemObject::setPath(const QString& path)
{
if (path.isEmpty())
{
*this = CFileSystemObject();
return;
}
_rootFileSystemId = uint64_max;
_fileInfo.setFile(expandEnvironmentVariables(path));
refreshInfo();
}
bool CFileSystemObject::operator==(const CFileSystemObject& other) const
{
return hash() == other.hash();
}
// Information about this object
bool CFileSystemObject::isValid() const
{
return hash() != 0;
}
bool CFileSystemObject::exists() const
{
return _properties.exists;
}
const CFileSystemObjectProperties &CFileSystemObject::properties() const
{
return _properties;
}
FileSystemObjectType CFileSystemObject::type() const
{
return _properties.type;
}
bool CFileSystemObject::isFile() const
{
return _properties.type == File;
}
bool CFileSystemObject::isDir() const
{
return _properties.type == Directory || _properties.type == Bundle;
}
bool CFileSystemObject::isBundle() const
{
return _properties.type == Bundle;
}
bool CFileSystemObject::isEmptyDir() const
{
if (!isDir())
return false;
#ifdef _WIN32
WCHAR path[32768];
const int nChars = _properties.fullPath.toWCharArray(path);
path[nChars] = 0;
return PathIsDirectoryEmptyW(path) != 0;
#else
// TODO: use getdents64 on Linux
DIR *dir = ::opendir(_properties.fullPath.toLocal8Bit().constData());
if (dir == nullptr) // Not a directory or doesn't exist
return false;
struct dirent *d = nullptr;
int n = 0;
while ((d = ::readdir(dir)) != nullptr)
{
if(++n > 2)
break;
}
::closedir(dir);
return n <= 2; // Only '.' and '..' ?
#endif
}
bool CFileSystemObject::isCdUp() const
{
return _properties.isCdUp;
}
bool CFileSystemObject::isExecutable() const
{
return _fileInfo.permission(QFile::ExeUser) || _fileInfo.permission(QFile::ExeOwner) || _fileInfo.permission(QFile::ExeGroup) || _fileInfo.permission(QFile::ExeOther);
}
bool CFileSystemObject::isReadable() const
{
return _fileInfo.isReadable();
}
// Apparently, it will return false for non-existing files
bool CFileSystemObject::isWriteable() const
{
return _fileInfo.isWritable();
}
bool CFileSystemObject::isHidden() const
{
return _fileInfo.isHidden();
}
QString CFileSystemObject::fullAbsolutePath() const
{
assert(_properties.type != Directory || _properties.fullPath.isEmpty() || _properties.fullPath.endsWith('/'));
return _properties.fullPath;
}
QString CFileSystemObject::parentDirPath() const
{
assert(_properties.parentFolder.isEmpty() || _properties.parentFolder.endsWith('/'));
return _properties.parentFolder;
}
uint64_t CFileSystemObject::size() const
{
return _properties.size;
}
uint64_t CFileSystemObject::hash() const
{
return _properties.hash;
}
const QFileInfo &CFileSystemObject::qFileInfo() const
{
return _fileInfo;
}
uint64_t CFileSystemObject::rootFileSystemId() const
{
if (_rootFileSystemId == uint64_max)
{
#ifdef _WIN32
WCHAR drivePath[32768];
const auto pathLength = _properties.fullPath.toWCharArray(drivePath);
drivePath[pathLength] = 0;
const auto driveNumber = PathGetDriveNumberW(drivePath);
if (driveNumber != -1)
_rootFileSystemId = static_cast<uint64_t>(driveNumber);
#else
struct stat info;
const int ret = stat(_properties.fullPath.toUtf8().constData(), &info);
if (ret == 0 || errno == ENOENT)
_rootFileSystemId = (uint64_t) info.st_dev;
else
{
qInfo() << __FUNCTION__ << "Failed to query device ID for" << _properties.fullPath;
qInfo() << strerror(errno);
}
#endif
}
return _rootFileSystemId;
}
bool CFileSystemObject::isNetworkObject() const
{
#ifdef _WIN32
if (!_properties.fullPath.startsWith("//"))
return false;
WCHAR wPath[MAX_PATH];
const int nSymbols = toNativeSeparators(_properties.fullPath).toWCharArray(wPath);
wPath[nSymbols] = 0;
return PathIsNetworkPathW(wPath);
#else
return false;
#endif
}
bool CFileSystemObject::isSymLink() const
{
return _fileInfo.isSymLink();
}
QString CFileSystemObject::symLinkTarget() const
{
return _fileInfo.symLinkTarget();
}
bool CFileSystemObject::isMovableTo(const CFileSystemObject& dest) const
{
if (!isValid() || !dest.isValid())
return false;
const auto fileSystemId = rootFileSystemId();
const auto otherFileSystemId = dest.rootFileSystemId();
return fileSystemId == otherFileSystemId && fileSystemId != uint64_max;
}
// A hack to store the size of a directory after it's calculated
void CFileSystemObject::setDirSize(uint64_t size)
{
_properties.size = size;
}
// File name without suffix, or folder name. Same as QFileInfo::completeBaseName.
QString CFileSystemObject::name() const
{
return _properties.completeBaseName;
}
// Filename + suffix for files, same as name() for folders
QString CFileSystemObject::fullName() const
{
return _properties.fullName;
}
QString CFileSystemObject::extension() const
{
return _properties.extension;
}
QString CFileSystemObject::sizeString() const
{
return _properties.type == File ? fileSizeToString(_properties.size) : QString();
}
QString CFileSystemObject::modificationDateString() const
{
return fromTime_t(_properties.modificationDate).toLocalTime().toString(QLatin1String("dd.MM.yyyy hh:mm"));
}
// Return the list of consecutive full paths leading from the specified target to its root.
// E. g. C:/Users/user/Documents/ -> {C:/Users/user/Documents/, C:/Users/user/, C:/Users/, C:/}
std::vector<QString> pathHierarchy(const QString& path)
{
assert_r(!path.contains('\\'));
assert_r(!path.contains(QStringLiteral("//")) || !QStringView{path}.right(path.length() - 2).contains(QLatin1String("//")));
if (path.isEmpty())
return {};
else if (path == '/')
return { path };
QString pathItem = path.endsWith('/') ? path.left(path.length() - 1) : path;
std::vector<QString> result{ path };
while ((pathItem = QFileInfo(pathItem).absolutePath()).length() < result.back().length())
{
if (pathItem.endsWith('/'))
result.emplace_back(pathItem);
else
result.emplace_back(pathItem + '/');
}
return result;
}
| 26.479212
| 169
| 0.705975
|
JnMartens
|
e4c973a4f2ac749c66a5292198a2b7ee3e1a9a20
| 1,082
|
cpp
|
C++
|
source/UnitTest1/StubDataManager.cpp
|
Tronso/test_recording
|
3b581f557830526e3f0e51f40df04a5be24b7e62
|
[
"Apache-2.0"
] | null | null | null |
source/UnitTest1/StubDataManager.cpp
|
Tronso/test_recording
|
3b581f557830526e3f0e51f40df04a5be24b7e62
|
[
"Apache-2.0"
] | null | null | null |
source/UnitTest1/StubDataManager.cpp
|
Tronso/test_recording
|
3b581f557830526e3f0e51f40df04a5be24b7e62
|
[
"Apache-2.0"
] | null | null | null |
#include "stdafx.h"
#include "StubDataManager.h"
#include "Situation.h"
#include "Transition.h"
#include <memory>
#include "CppUnitTest.h"
#include "SituationGraph.h"
using std::make_shared;
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
StubDataManager::StubDataManager() : inputs() {
}
StubDataManager::~StubDataManager() {
}
void StubDataManager::storeTransition(Transition const & transition) {
Logger::WriteMessage(L"storeTransition was called");
inputs.push_back(make_shared<Transition>(transition));
}
std::unique_ptr<SituationGraph> StubDataManager::retrieveSubSituationGraph(std::shared_ptr<Situation> root)
{
return nullptr;
}
std::unique_ptr<SituationGraph> StubDataManager::retrieveSituationGraph() {
std::vector<std::shared_ptr<Transition>> t;
SituationGraph sg(t);
return move(std::make_unique<SituationGraph>(t));
}
int StubDataManager::getMaxNumberOfObjects()
{
return 0;
}
int StubDataManager::getNumberOfSituations()
{
return 0;
}
std::vector<std::shared_ptr<Transition>> const & StubDataManager::getInputs() {
return inputs;
}
| 22.081633
| 107
| 0.774492
|
Tronso
|
e4ccd51eeff9fd39234011dfc6533d0c35cb3f3c
| 948
|
cpp
|
C++
|
Introductions/Quadratic/quadratic.cpp
|
csulb-cecs282-2015sp/lectures
|
f7a88c52b85472f4e871ed439bfe65ee784f4aa9
|
[
"MIT"
] | 11
|
2015-01-20T05:57:50.000Z
|
2021-05-03T10:47:36.000Z
|
Introductions/Quadratic/quadratic.cpp
|
csulb-cecs282-2015sp/lectures
|
f7a88c52b85472f4e871ed439bfe65ee784f4aa9
|
[
"MIT"
] | null | null | null |
Introductions/Quadratic/quadratic.cpp
|
csulb-cecs282-2015sp/lectures
|
f7a88c52b85472f4e871ed439bfe65ee784f4aa9
|
[
"MIT"
] | 26
|
2015-01-20T04:38:39.000Z
|
2017-01-11T00:49:57.000Z
|
#include <iostream>
using namespace std;
int main(int argc, char* argv[]) {
cout << "This program will find the real solutions to a general quadratic "
"equation of the form ax^2 + bx + c = 0" << endl;
cout << "\nEnter a, b, and c:" << endl;
double a, b, c;
cin >> a >> b >> c;
double discriminant = b * b - 4 * a * c;
// C++ has the same control structures as Java: if, else, else if.
if (discriminant < 0) {
cout << "There are no real solutions to that equation." << endl;
}
else if (discriminant == 0) {
cout << "There is one real solution to the equation, and it is x = " <<
(-b / (2 * a)) << endl;
}
else {
double squareRoot = sqrt(discriminant);
double x1 = (-b + squareRoot) / (2 * a);
double x2 = (-b - squareRoot) / (2 * a);
cout << "There are two real solutions to the equation, and they are:\n"
"x1 = " << x1 << "\nx2 = " << x2 << endl;
}
}
| 29.625
| 78
| 0.548523
|
csulb-cecs282-2015sp
|
e4d19a84d9d54af5d4c746d15fbbee51a953ac5b
| 9,854
|
cpp
|
C++
|
tests/demo/src/cpu_conv_bias_relu_pattern.cpp
|
wuxun-zhang/mkl-dnn
|
00a239ad2c932b967234ffb528069800ffcc0334
|
[
"Apache-2.0"
] | null | null | null |
tests/demo/src/cpu_conv_bias_relu_pattern.cpp
|
wuxun-zhang/mkl-dnn
|
00a239ad2c932b967234ffb528069800ffcc0334
|
[
"Apache-2.0"
] | null | null | null |
tests/demo/src/cpu_conv_bias_relu_pattern.cpp
|
wuxun-zhang/mkl-dnn
|
00a239ad2c932b967234ffb528069800ffcc0334
|
[
"Apache-2.0"
] | null | null | null |
/*******************************************************************************
* Copyright 2020-2022 Intel Corporation
*
* 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.
*******************************************************************************/
/// @example cpu_conv_bias_relu_pattern.cpp
/// @copybrief cpu_conv_bias_relu_pattern_cpp
/// > Annotated version: @ref cpu_conv_bias_relu_pattern_cpp
/// @page cpu_conv_bias_relu_pattern_cpp CPU example for conv+bias+relu pattern
///
/// > Example code: @ref cpu_conv_bias_relu_pattern.cpp
#include <assert.h>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <stdexcept>
#include <unordered_map>
#include "oneapi/dnnl/dnnl_graph.hpp"
#include "common/execution_context.hpp"
#include "common/helpers_any_layout.hpp"
#include "common/utils.hpp"
#define assertm(exp, msg) assert(((void)msg, exp))
using namespace dnnl::graph;
using data_type = logical_tensor::data_type;
using layout_type = logical_tensor::layout_type;
// clang-format off
int main(int argc, char **argv) {
std::cout << "========Example: Conv->ReLU->Conv->ReLU========\n";
engine::kind engine_kind = parse_engine_kind(argc, argv);
if (engine_kind == engine::kind::gpu) {
printf("Don't support gpu now\n");
return -1;
}
// Step 2: Construct a example graph: `conv->relu->conv->relu`
graph g(engine_kind);
/// Create logical tensor
std::cout << "Create logical tensor--------------------------";
const std::vector<size_t> logical_id {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
std::vector<int64_t> input_dims {8, 3, 227, 227};
std::vector<int64_t> weight_dims {96, 3, 11, 11};
std::vector<int64_t> bias_dims {96};
std::vector<int64_t> weight1_dims {96, 96, 1, 1};
std::vector<int64_t> bias1_dims {96};
std::vector<int64_t> dst_dims {8, 96, 55, 55};
logical_tensor conv0_src_desc {logical_id[0], data_type::f32, input_dims, layout_type::strided};
logical_tensor conv0_weight_desc {logical_id[1], data_type::f32, weight_dims, layout_type::strided};
logical_tensor conv0_bias_desc {logical_id[2], data_type::f32, bias_dims, layout_type::strided};
logical_tensor conv0_dst_desc {logical_id[3], data_type::f32, dst_dims, layout_type::strided};
op conv0 {0, op::kind::Convolution, {conv0_src_desc, conv0_weight_desc}, {conv0_dst_desc}, "conv0"};
conv0.set_attr<std::vector<int64_t>>("strides", {4, 4});
conv0.set_attr<std::vector<int64_t>>("pads_begin", {111, 111});
conv0.set_attr<std::vector<int64_t>>("pads_end", {111, 111});
conv0.set_attr<std::string>("auto_pad", "VALID");
conv0.set_attr<std::vector<int64_t>>("dilations", {1, 1});
conv0.set_attr<std::string>("data_format", "NCX");
conv0.set_attr<std::string>("filter_format", "OIX");
conv0.set_attr<int64_t>("groups", 1);
logical_tensor conv0_bias_add_dst_desc {logical_id[9], data_type::f32, dst_dims, layout_type::strided};
op conv0_bias_add {1, op::kind::BiasAdd, {conv0_dst_desc, conv0_bias_desc}, {conv0_bias_add_dst_desc}, "conv0_bias_add"};
logical_tensor relu0_dst_desc {logical_id[4], data_type::f32, dst_dims, layout_type::strided};
op relu0 {2, op::kind::ReLU, {conv0_bias_add_dst_desc}, {relu0_dst_desc}, "relu0"};
logical_tensor conv1_weight_desc {logical_id[5], data_type::f32, weight1_dims, layout_type::strided};
logical_tensor conv1_bias_desc {logical_id[6], data_type::f32, bias1_dims, layout_type::strided};
logical_tensor conv1_dst_desc {logical_id[7], data_type::f32, dst_dims, layout_type::strided};
op conv1 {3, op::kind::Convolution, {relu0_dst_desc, conv1_weight_desc}, {conv1_dst_desc}, "conv1"};
conv1.set_attr<std::vector<int64_t>>("strides", {1, 1});
conv1.set_attr<std::vector<int64_t>>("pads_begin", {0, 0});
conv1.set_attr<std::vector<int64_t>>("pads_end", {0, 0});
conv1.set_attr<std::vector<int64_t>>("dilations", {1, 1});
conv1.set_attr<std::string>("data_format", "NCX");
conv1.set_attr<std::string>("filter_format", "OIX");
conv1.set_attr<int64_t>("groups", 1);
logical_tensor conv1_bias_add_dst_desc {logical_id[10], data_type::f32, dst_dims, layout_type::strided};
op conv1_bias_add {4, op::kind::BiasAdd, {conv1_dst_desc, conv1_bias_desc}, {conv1_bias_add_dst_desc}, "conv1_bias_add"};
logical_tensor relu1_dst_desc {logical_id[8], data_type::f32, dst_dims, layout_type::strided};
op relu1 {5, op::kind::ReLU, {conv1_bias_add_dst_desc}, {relu1_dst_desc}, "relu1"};
std::cout << "Success!\n";
std::unordered_map<size_t, op::kind> op_id_kind_map {{0, op::kind::Convolution},
{1, op::kind::BiasAdd}, {2, op::kind::ReLU}, {3, op::kind::Convolution},
{4, op::kind::BiasAdd}, {5, op::kind::ReLU}};
/// Add OP
std::cout << "Add OP to graph--------------------------------";
g.add_op(conv0);
g.add_op(relu0);
g.add_op(conv1);
g.add_op(relu1);
g.add_op(conv0_bias_add);
g.add_op(conv1_bias_add);
std::cout << "Success!\n";
// Step 3: Filter and get partitions
/// Graph will be filtered into two partitions: `conv0+relu0` and `conv1+relu1`
/// Setting `DNNL_GRAPH_DUMP=1` can save internal graphs before/after graph fusion into dot files
std::cout << "Filter and get partition-----------------------";
auto partitions = g.get_partitions(partition::policy::fusion);
std::cout << "Success!\n";
std::cout << "Number of returned partitions: " << partitions.size() << "\n";
for (size_t i = 0; i < partitions.size(); ++i) {
std::cout << "Partition[" << partitions[i].get_id()
<< "]'s supporting status: "
<< (partitions[i].is_supported() ? "true" : "false") << "\n";
}
/// mark the output logical tensors of partition as ANY layout enabled
std::unordered_set<size_t> id_to_set_any_layout;
set_any_layout(partitions, id_to_set_any_layout);
/// construct a new engine
engine e {engine_kind, 0};
/// construct a new stream
stream s {e};
std::vector<compiled_partition> c_partitions(partitions.size());
// mapping from id to tensors
tensor_map tm;
// mapping from id to queried logical tensor from compiled partition
// used to record the logical tensors that are previously enabled with ANY layout
std::unordered_map<size_t, logical_tensor> id_to_queried_logical_tensors;
for (size_t i = 0; i < partitions.size(); ++i) {
if (partitions[i].is_supported()) {
std::cout << "\nPartition[" << partitions[i].get_id() << "] is being processed.\n";
std::vector<logical_tensor> inputs = partitions[i].get_in_ports();
std::vector<logical_tensor> outputs = partitions[i].get_out_ports();
/// replace input logical tensor with the queried one
replace_with_queried_logical_tensors(inputs, id_to_queried_logical_tensors);
/// update output logical tensors with ANY layout
update_tensors_with_any_layout(outputs, id_to_set_any_layout);
std::cout << "Compiling--------------------------------------";
/// compile to generate compiled partition
c_partitions[i] = partitions[i].compile(inputs, outputs, e);
std::cout << "Success!\n";
record_queried_logical_tensors(partitions[i].get_out_ports(), c_partitions[i],
id_to_queried_logical_tensors);
std::cout << "Creating tensors and allocating memory buffer--";
std::vector<tensor> input_ts = tm.construct_and_initialize_tensors(inputs, c_partitions[i], e, 1);
std::vector<tensor> output_ts = tm.construct_and_initialize_tensors(outputs, c_partitions[i], e, 0);
std::cout << "Success!\n";
std::cout << "Executing compiled partition-------------------";
/// execute the compiled partition
c_partitions[i].execute(s, input_ts, output_ts);
std::cout << "Success!\n";
} else {
std::vector<size_t> unsupported_op_ids = partitions[i].get_ops();
assertm(unsupported_op_ids.size() == 1, "Unsupported partition only "
"contains single op.");
if (op_id_kind_map[unsupported_op_ids[0]] == op::kind::Wildcard) {
std::cout << "\nWarning (actually an error): partition " << partitions[i].get_id() <<
" contains only a Wildcard op which cannot be computed.\n";
} else {
/// Users need to write implementation code by themselves.
continue;
}
}
}
// Step 6: Check correctness of the output results
std::cout << "Check correctness------------------------------";
float expected_result
= (1 * 11 * 11 * 3 + /* conv0 bias */ 1.0f) * (1 * 1 * 96)
+ /* conv1 bias */ 1.0f;
float *actual_output_ptr = tm.get(relu1_dst_desc.get_id()).get_data_handle<float>();
auto output_dims = relu1_dst_desc.get_dims();
auto num_elem = product(output_dims);
std::vector<float> expected_output(num_elem, expected_result);
compare_data(expected_output.data(), actual_output_ptr, num_elem);
std::cout << "Success!\n";
std::cout << "============Run Example Successfully===========\n";
return 0;
}
// clang-format on
| 44.995434
| 125
| 0.64177
|
wuxun-zhang
|
e4d68f2a64ee23cc1e0872e66256c4296e3763b9
| 4,825
|
cpp
|
C++
|
source/FAST/Algorithms/CoherentPointDrift/Affine.cpp
|
andreped/FAST
|
361819190ea0ae5a2f068e7bd808a1c70af5a171
|
[
"BSD-2-Clause"
] | null | null | null |
source/FAST/Algorithms/CoherentPointDrift/Affine.cpp
|
andreped/FAST
|
361819190ea0ae5a2f068e7bd808a1c70af5a171
|
[
"BSD-2-Clause"
] | null | null | null |
source/FAST/Algorithms/CoherentPointDrift/Affine.cpp
|
andreped/FAST
|
361819190ea0ae5a2f068e7bd808a1c70af5a171
|
[
"BSD-2-Clause"
] | null | null | null |
#include "CoherentPointDrift.hpp"
#include "Affine.hpp"
#include <limits>
#include <iostream>
namespace fast {
CoherentPointDriftAffine::CoherentPointDriftAffine() {
mScale = 1.0;
mTransformationType = TransformationType::AFFINE;
}
void CoherentPointDriftAffine::initializeVarianceAndMore() {
// Initialize the variance in the CPD registration
mVariance = ( (double)mNumMovingPoints * (mFixedPoints.transpose() * mFixedPoints).trace() +
(double)mNumFixedPoints * (mMovingPoints.transpose() * mMovingPoints).trace() -
2.0 * mFixedPoints.colwise().sum() * mMovingPoints.colwise().sum().transpose() ) /
(double)(mNumFixedPoints * mNumMovingPoints * mNumDimensions);
mIterationError = mTolerance + 10.0;
mObjectiveFunction = mObjectiveFunction = std::numeric_limits<double>::max();
mResponsibilityMatrix = MatrixXf::Zero(mNumMovingPoints, mNumFixedPoints);
}
void CoherentPointDriftAffine::maximization(Eigen::MatrixXf &fixedPoints, Eigen::MatrixXf &movingPoints) {
double startM = omp_get_wtime();
// Define some useful matrix sums
mPt1 = mResponsibilityMatrix.transpose().rowwise().sum(); // mNumFixedPoints x 1
mP1 = mResponsibilityMatrix.rowwise().sum(); // mNumMovingPoints x 1
mNp = mPt1.sum(); // 1 (sum of all P elements)
double timeEndMUseful = omp_get_wtime();
// Estimate new mean vectors
MatrixXf fixedMean = fixedPoints.transpose() * mPt1 / mNp;
MatrixXf movingMean = movingPoints.transpose() * mP1 / mNp;
// Center point sets around estimated mean
MatrixXf fixedPointsCentered = fixedPoints - fixedMean.transpose().replicate(mNumFixedPoints, 1);
MatrixXf movingPointsCentered = movingPoints - movingMean.transpose().replicate(mNumMovingPoints, 1);
double timeEndMCenter = omp_get_wtime();
/* **********************************************************
* Find transformation parameters: affine matrix, translation
* *********************************************************/
MatrixXf A = fixedPointsCentered.transpose() * mResponsibilityMatrix.transpose() * movingPointsCentered;
MatrixXf YPY = movingPointsCentered.transpose() * mP1.asDiagonal() * movingPointsCentered;
MatrixXf XPX = fixedPointsCentered.transpose() * mPt1.asDiagonal() * fixedPointsCentered;
mAffineMatrix = A * YPY.inverse();
mTranslation = fixedMean - mAffineMatrix * movingMean;
// Update variance
MatrixXf ABt = A * mAffineMatrix.transpose();
mVariance = ( XPX.trace() - ABt.trace() ) / (mNp * mNumDimensions);
if (mVariance < 0) {
mVariance = std::fabs(mVariance);
} else if (mVariance == 0){
mVariance = 10.0 * std::numeric_limits<double>::epsilon();
mRegistrationConverged = true;
}
double timeEndMParameters = omp_get_wtime();
/* ****************
* Update transform
* ***************/
Affine3f iterationTransform = Affine3f::Identity();
iterationTransform.translation() = Vector3f(mTranslation);
iterationTransform.linear() = mAffineMatrix;
Affine3f currentRegistrationTransform;
MatrixXf registrationMatrix = iterationTransform.matrix() * mTransformation->get().matrix();
currentRegistrationTransform.matrix() = registrationMatrix;
mTransformation->set(currentRegistrationTransform);
/* *************************
* Transform the point cloud
* ************************/
MatrixXf movingPointsTransformed =
movingPoints * mAffineMatrix.transpose() + mTranslation.transpose().replicate(mNumMovingPoints, 1);
movingPoints = movingPointsTransformed;
/* ******************************************
* Calculate change in the objective function
* *****************************************/
double objectiveFunctionOld = mObjectiveFunction;
mObjectiveFunction =
(XPX.trace() - 2 * ABt.trace() + YPY.trace() ) / (2 * mVariance)
+ (mNp * mNumDimensions)/2 * log(mVariance);
mIterationError = std::fabs( (mObjectiveFunction - objectiveFunctionOld) / objectiveFunctionOld);
mRegistrationConverged = mIterationError <= mTolerance;
double endM = omp_get_wtime();
timeM += endM - startM;
timeMUseful += timeEndMUseful - startM;
timeMCenter += timeEndMCenter - timeEndMUseful;
timeMParameters += timeEndMParameters - timeEndMCenter;
timeMUpdate += endM - timeEndMParameters;
}
}
| 45.093458
| 115
| 0.606218
|
andreped
|
e4d8a4b4ae522fb1e9d698f91e4c41dc01fcbb26
| 2,137
|
cpp
|
C++
|
tc 160+/TheEquation.cpp
|
ibudiselic/contest-problem-solutions
|
88082981b4d87da843472e3ca9ed5f4c42b3f0aa
|
[
"BSD-2-Clause"
] | 3
|
2015-05-25T06:24:37.000Z
|
2016-09-10T07:58:00.000Z
|
tc 160+/TheEquation.cpp
|
ibudiselic/contest-problem-solutions
|
88082981b4d87da843472e3ca9ed5f4c42b3f0aa
|
[
"BSD-2-Clause"
] | null | null | null |
tc 160+/TheEquation.cpp
|
ibudiselic/contest-problem-solutions
|
88082981b4d87da843472e3ca9ed5f4c42b3f0aa
|
[
"BSD-2-Clause"
] | 5
|
2015-05-25T06:24:40.000Z
|
2021-08-19T19:22:29.000Z
|
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
using namespace std;
class TheEquation {
public:
int leastSum(int X, int Y, int P) {
for (int sum=2; sum<=2*P; ++sum) {
for (int a=1; a<sum; ++a) {
int b = sum-a;
if ((a*X + b*Y) % P == 0) {
return sum;
}
}
}
return -1;
}
// BEGIN CUT HERE
public:
void run_test(int Case) { if ((Case == -1) || (Case == 0)) test_case_0(); if ((Case == -1) || (Case == 1)) test_case_1(); if ((Case == -1) || (Case == 2)) test_case_2(); if ((Case == -1) || (Case == 3)) test_case_3(); if ((Case == -1) || (Case == 4)) test_case_4(); }
private:
template <typename T> string print_array(const vector<T> &V) { ostringstream os; os << "{ "; for (typename vector<T>::const_iterator iter = V.begin(); iter != V.end(); ++iter) os << '\"' << *iter << "\","; os << " }"; return os.str(); }
void verify_case(int Case, const int &Expected, const int &Received) { cerr << "Test Case #" << Case << "..."; if (Expected == Received) cerr << "PASSED" << endl; else { cerr << "FAILED" << endl; cerr << "\tExpected: \"" << Expected << '\"' << endl; cerr << "\tReceived: \"" << Received << '\"' << endl; } }
void test_case_0() { int Arg0 = 2; int Arg1 = 6; int Arg2 = 5; int Arg3 = 3; verify_case(0, Arg3, leastSum(Arg0, Arg1, Arg2)); }
void test_case_1() { int Arg0 = 5; int Arg1 = 5; int Arg2 = 5; int Arg3 = 2; verify_case(1, Arg3, leastSum(Arg0, Arg1, Arg2)); }
void test_case_2() { int Arg0 = 998; int Arg1 = 999; int Arg2 = 1000; int Arg3 = 501; verify_case(2, Arg3, leastSum(Arg0, Arg1, Arg2)); }
void test_case_3() { int Arg0 = 1; int Arg1 = 1; int Arg2 = 1000; int Arg3 = 1000; verify_case(3, Arg3, leastSum(Arg0, Arg1, Arg2)); }
void test_case_4() { int Arg0 = 347; int Arg1 = 873; int Arg2 = 1000; int Arg3 = 34; verify_case(4, Arg3, leastSum(Arg0, Arg1, Arg2)); }
// END CUT HERE
};
// BEGIN CUT HERE
int main()
{
TheEquation ___test;
___test.run_test(-1);
}
// END CUT HERE
| 37.491228
| 309
| 0.568086
|
ibudiselic
|
e4d95ee0ae960e5ddb81f748cace7a7a48447a93
| 4,147
|
cpp
|
C++
|
note_to_midi.cpp
|
jkhollandjr/music_generation
|
6338b2b05d2e739caa55eead041e6eef328a52ca
|
[
"MIT"
] | null | null | null |
note_to_midi.cpp
|
jkhollandjr/music_generation
|
6338b2b05d2e739caa55eead041e6eef328a52ca
|
[
"MIT"
] | null | null | null |
note_to_midi.cpp
|
jkhollandjr/music_generation
|
6338b2b05d2e739caa55eead041e6eef328a52ca
|
[
"MIT"
] | null | null | null |
// note_to_midi.cpp
//
// Writes a midifile using the notes.txt file and the functions from the Midifile library.
//
// NOTE: This code has been adapted from an example provided by the Midifile library
//The original code described how to create a track from arrays of integers corresponding to
//the rythm and midi notes.
//
//Our specific contribution includes the input and output operator and separation of vector into
//multiple other vectors, which are added to the musical tracks separately. We also created a method
//of randomly generating the rythm, rather that hard-coding it.
#include "MidiFile.h"
#include <iostream>
#include "std_lib_facilities.h"
using namespace std;
typedef unsigned char uchar;
///////////////////////////////////////////////////////////////////////////
int main(int argc, char** argv) {
MidiFile outputfile; // create an empty MIDI file with one track
outputfile.absoluteTicks(); // time information stored as absolute time
// (will be coverted to delta time when written)
outputfile.addTrack(3); // Add another three tracks to the MIDI file
vector<uchar> midievent; // temporary storage for MIDI events
midievent.resize(3); // set the size of the array to 3 bytes
int tpq = 120; // default value in MIDI file is 48
outputfile.setTicksPerQuarterNote(tpq);
//input operates that reads in the notes from notes.txt, and sends them to a vector
ifstream ist {"notes.txt"};
vector<int> note_values;
int tmp;
while (ist >> tmp) {
note_values.push_back(tmp);
}
vector<int> voice1;
vector<int> voice2;
vector<int> voice3;
//Vector of integers (notes) is split into three differet vectors, or "voices" such that every third
//note is added to a specific vector, given different starting points
for (unsigned i=2; i<note_values.size(); i+=3)
voice1.push_back(note_values[i]);
for (unsigned i=1; i<note_values.size(); i+=3)
voice2.push_back(note_values[i]);
for (unsigned i=0; i<note_values.size(); i+=3)
voice3.push_back(note_values[i]);
//vector will hold the rythm information
vector<double> rhythm1(voice1.size());
vector<double> note_lengths{0.5, 1.0, 2.0};
for (unsigned i=0; i<rhythm1.size()-2; i++)
rhythm1[i] = note_lengths[rand() % 2]; // randomly generate eight, quarter or half note
rhythm1[rhythm1.size()-2] = 4.0; // end on whole note
rhythm1[rhythm1.size()-1] = -1.0; // -1 to stop reading
vector<double> rhythm2 = rhythm1;
vector<double> rhythm3 = rhythm1;
// store a melody line in track 1 (track 0 left empty for conductor info)
int i=0;
int actiontime = 0; // temporary storage for MIDI event time
midievent[2] = 64; // store attack/release velocity for note command
while (voice1[i] >= 0) {
midievent[0] = 0x90; // store a note on command (MIDI channel 1)
midievent[1] = voice1[i];
outputfile.addEvent(1, actiontime, midievent);
actiontime += tpq * rhythm1[i];
midievent[0] = 0x80; // store a note on command (MIDI channel 1)
outputfile.addEvent(1, actiontime, midievent);
i++;
}
// store a base line in track 2
i=0;
actiontime = 0; // reset time for beginning of file
midievent[2] = 64;
while (voice2[i] >= 0) {
midievent[0] = 0x90;
midievent[1] = voice2[i];
outputfile.addEvent(2, actiontime, midievent);
actiontime += tpq * rhythm2[i];
midievent[0] = 0x80;
outputfile.addEvent(2, actiontime, midievent);
i++;
}
// store a base line in track 3
i=0;
actiontime = 0; // reset time for beginning of file
midievent[2] = 64;
while (voice3[i] >= 0) {
midievent[0] = 0x90;
midievent[1] = voice3[i];
outputfile.addEvent(3, actiontime, midievent);
actiontime += tpq * rhythm3[i];
midievent[0] = 0x80;
outputfile.addEvent(3, actiontime, midievent);
i++;
}
outputfile.sortTracks(); // make sure data is in correct order
outputfile.write("song.mid"); // write Standard MIDI File
return 0;
}
| 36.377193
| 103
| 0.645768
|
jkhollandjr
|
e4db07f6f4cbb77264713f5e3e7f28ea0f20aefd
| 9,326
|
hpp
|
C++
|
include/ghex/transport_layer/ucx/context.hpp
|
tehrengruber/GHEX
|
f164bb625aaa106f77d31d45fce05c4711b066f0
|
[
"BSD-3-Clause"
] | null | null | null |
include/ghex/transport_layer/ucx/context.hpp
|
tehrengruber/GHEX
|
f164bb625aaa106f77d31d45fce05c4711b066f0
|
[
"BSD-3-Clause"
] | null | null | null |
include/ghex/transport_layer/ucx/context.hpp
|
tehrengruber/GHEX
|
f164bb625aaa106f77d31d45fce05c4711b066f0
|
[
"BSD-3-Clause"
] | null | null | null |
/*
* GridTools
*
* Copyright (c) 2014-2020, ETH Zurich
* All rights reserved.
*
* Please, refer to the LICENSE file in the root directory.
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#ifndef INCLUDED_GHEX_TL_UCX_CONTEXT_HPP
#define INCLUDED_GHEX_TL_UCX_CONTEXT_HPP
#include "../context.hpp"
#include "./communicator.hpp"
#include "../communicator.hpp"
#include "../util/pthread_spin_mutex.hpp"
#ifdef GHEX_USE_PMI
// use the PMI interface ...
#include "./address_db_pmi.hpp"
#else
// ... and go to MPI if not available
#include "./address_db_mpi.hpp"
#endif
#include "./address_db.hpp"
namespace gridtools {
namespace ghex {
namespace tl {
namespace ucx {
struct transport_context
{
public: // member types
using tag = ucx_tag;
using rank_type = endpoint_t::rank_type;
using worker_type = worker_t;
using communicator_type = tl::communicator<communicator>;
private: // member types
using mutex_t = pthread_spin::recursive_mutex;
struct ucp_context_h_holder
{
ucp_context_h m_context;
~ucp_context_h_holder() { ucp_cleanup(m_context); }
};
using worker_vector = std::vector<std::unique_ptr<worker_type>>;
private: // members
MPI_Comm m_mpi_comm;
const mpi::rank_topology& m_rank_topology;
type_erased_address_db_t m_db;
ucp_context_h_holder m_context;
std::size_t m_req_size;
std::unique_ptr<worker_type> m_worker; // shared, serialized - per rank
worker_vector m_workers; // per thread
mutex_t m_mutex;
friend class worker_t;
public: // dtor
~transport_context()
{
// ucp_worker_destroy should be called after a barrier
// use MPI IBarrier and progress all workers
MPI_Request req = MPI_REQUEST_NULL;
int flag;
MPI_Ibarrier(m_mpi_comm, &req);
while(true)
{
// make communicators from workers and progress
for (auto& w_ptr : m_workers)
communicator_type{m_worker.get(), w_ptr.get()}.progress();
communicator_type{m_worker.get(), m_worker.get()}.progress();
MPI_Test(&req, &flag, MPI_STATUS_IGNORE);
if(flag) break;
}
// close endpoints
for (auto& w_ptr : m_workers)
w_ptr->m_endpoint_cache.clear();
m_worker->m_endpoint_cache.clear();
// another MPI barrier to be sure
MPI_Barrier(m_mpi_comm);
}
public: // ctors
template<typename DB>
transport_context(const mpi::rank_topology& t, DB&& db)
: m_mpi_comm{t.mpi_comm()}
, m_rank_topology{t}
, m_db{std::forward<DB>(db)}
{
// read run-time context
ucp_config_t* config_ptr;
GHEX_CHECK_UCX_RESULT(
ucp_config_read(NULL,NULL, &config_ptr)
);
// set parameters
ucp_params_t context_params;
// define valid fields
context_params.field_mask =
UCP_PARAM_FIELD_FEATURES | // features
UCP_PARAM_FIELD_REQUEST_SIZE | // size of reserved space in a non-blocking request
UCP_PARAM_FIELD_TAG_SENDER_MASK | // mask which gets sender endpoint from a tag
UCP_PARAM_FIELD_MT_WORKERS_SHARED | // multi-threaded context: thread safety
UCP_PARAM_FIELD_ESTIMATED_NUM_EPS | // estimated number of endpoints for this context
UCP_PARAM_FIELD_REQUEST_INIT ; // initialize request memory
// features
context_params.features =
UCP_FEATURE_TAG ; // tag matching
// additional usable request size
context_params.request_size = request_data_size::value;
// thread safety
// this should be true if we have per-thread workers,
// otherwise, if one worker is shared by all thread, it should be false
// requires benchmarking.
context_params.mt_workers_shared = true;
// estimated number of connections
// affects transport selection criteria and theresulting performance
context_params.estimated_num_eps = m_db.est_size();
// mask
// mask which specifies particular bits of the tag which can uniquely identify
// the sender (UCP endpoint) in tagged operations.
//context_params.tag_sender_mask = 0x00000000fffffffful;
context_params.tag_sender_mask = 0xfffffffffffffffful;
// needed to zero the memory region. Otherwise segfaults occured
// when a std::function destructor was called on an invalid object
context_params.request_init = &request_init;
// initialize UCP
GHEX_CHECK_UCX_RESULT(
ucp_init(&context_params, config_ptr, &m_context.m_context)
);
ucp_config_release(config_ptr);
// check the actual parameters
ucp_context_attr_t attr;
attr.field_mask =
UCP_ATTR_FIELD_REQUEST_SIZE | // internal request size
UCP_ATTR_FIELD_THREAD_MODE; // thread safety
ucp_context_query(m_context.m_context, &attr);
m_req_size = attr.request_size;
if (attr.thread_mode != UCS_THREAD_MODE_MULTI)
throw std::runtime_error("ucx cannot be used with multi-threaded context");
// make shared worker
// use single-threaded UCX mode, as per developer advice
// https://github.com/openucx/ucx/issues/4609
m_worker.reset(new worker_type{get(), m_db, m_mutex, UCS_THREAD_MODE_SINGLE, m_rank_topology});
// intialize database
m_db.init(m_worker->address());
}
MPI_Comm mpi_comm() const noexcept { return m_mpi_comm; }
communicator_type get_serial_communicator()
{
return {m_worker.get(),m_worker.get()};
}
communicator_type get_communicator()
{
std::lock_guard<mutex_t> lock(m_mutex); // we need to guard only the insertion in the vector,
// but this is not a performance critical section
m_workers.push_back(std::make_unique<worker_type>(get(), m_db, m_mutex, UCS_THREAD_MODE_SERIALIZED, m_rank_topology));
return {m_worker.get(), m_workers[m_workers.size()-1].get()};
}
rank_type rank() const { return m_db.rank(); }
rank_type size() const { return m_db.size(); }
ucp_context_h get() const noexcept { return m_context.m_context; }
};
} // namespace ucx
template<>
struct context_factory<ucx_tag>
{
using context_type = context<ucx::transport_context>;
static std::unique_ptr<context_type> create(MPI_Comm comm)
{
auto new_comm = detail::clone_mpi_comm(comm);
#if defined GHEX_USE_PMI
ucx::address_db_pmi addr_db{new_comm};
#else
ucx::address_db_mpi addr_db{new_comm};
#endif
return std::unique_ptr<context_type>{
new context_type{new_comm, std::move(addr_db)}};
}
};
} // namespace tl
} // namespace ghex
} // namespace gridtools
#endif /* INCLUDED_GHEX_TL_UCX_CONTEXT_HPP */
| 45.715686
| 142
| 0.493245
|
tehrengruber
|
e4dfcdb408a6511563513d8d2fc5c5bd91d7594a
| 153
|
cpp
|
C++
|
VC2010Samples/MFC/Visual C++ 2008 Feature Pack/DrawClient/DrawClientHandlers/DrawCliSearchHandler.cpp
|
alonmm/VCSamples
|
6aff0b4902f5027164d593540fcaa6601a0407c3
|
[
"MIT"
] | 300
|
2019-05-09T05:32:33.000Z
|
2022-03-31T20:23:24.000Z
|
VC2010Samples/MFC/Visual C++ 2008 Feature Pack/DrawClient/DrawClientHandlers/DrawCliSearchHandler.cpp
|
JaydenChou/VCSamples
|
9e1d4475555b76a17a3568369867f1d7b6cc6126
|
[
"MIT"
] | 9
|
2016-09-19T18:44:26.000Z
|
2018-10-26T10:20:05.000Z
|
VC2010Samples/MFC/Visual C++ 2008 Feature Pack/DrawClient/DrawClientHandlers/DrawCliSearchHandler.cpp
|
JaydenChou/VCSamples
|
9e1d4475555b76a17a3568369867f1d7b6cc6126
|
[
"MIT"
] | 633
|
2019-05-08T07:34:12.000Z
|
2022-03-30T04:38:28.000Z
|
// DrawCliSearchHandler.cpp : Implementation of CDrawCliSearchHandler
#include "stdafx.h"
#include "DrawCliSearchHandler.h"
// CDrawCliSearchHandler
| 17
| 69
| 0.803922
|
alonmm
|
e4eaf8b336af747dc1cce9408bb55237f8768dc3
| 2,322
|
cpp
|
C++
|
code-cpp/nloop-math-inc.cpp
|
att-circ-contrl/NeuroLoop
|
7847fcaa6237c406fbad879b10352618504613c9
|
[
"CC-BY-4.0"
] | 1
|
2021-01-22T05:40:23.000Z
|
2021-01-22T05:40:23.000Z
|
code-cpp/nloop-math-inc.cpp
|
att-circ-contrl/NeuroLoop
|
7847fcaa6237c406fbad879b10352618504613c9
|
[
"CC-BY-4.0"
] | null | null | null |
code-cpp/nloop-math-inc.cpp
|
att-circ-contrl/NeuroLoop
|
7847fcaa6237c406fbad879b10352618504613c9
|
[
"CC-BY-4.0"
] | null | null | null |
// Attention Circuits Control Laboratory - NeuroLoop project
// Miscellaneous math routines.
// Written by Christopher Thomas.
// Copyright (c) 2020 by Vanderbilt University. This work is licensed under
// the Creative Commons Attribution 4.0 International License.
// NOTE - Because this implements template code, it has to be included by
// every file that instantiates templates.
// Only one copy of each instantiated variant will actually be compiled;
// extra copies get pruned at link-time.
//
// Functions
// Single-sample function for fast modulo arithmetic of non-negative integers.
// This tests for quotients up to (2^count)-1.
// Division is expensive, especially in FPGAs, so for situations where we
// know that the quotient is small, shift-and-subtract can be less
// resource-intensive.
// NOTE - We're counting on the compiler being smart enough to inline this.
template <class datatype_t, int subcount>
datatype_t nloop_FastModulo(datatype_t sample, datatype_t modulus)
{
int bitshift;
datatype_t testval;
// This will actually be pretty slow in software. We're using it to get a
// 1:1 mapping between software and FPGA code.
for (bitshift = subcount; bitshift > 0; bitshift--)
{
testval = modulus << (bitshift - 1);
if (sample >= testval)
sample -= testval;
}
return sample;
}
// Slice-based function for fast modulo arithmetic of non-negative integers.
// This tests for quotients up to 2^(count-1).
// Division is expensive, especially in FPGAs, so for situations where we
// know that the quotient is small, shift-and-subtract can be less
// resource-intensive.
// Input and output may reference the same object.
template <class datatype_t, int subcount, int bankcount, int chancount>
void nloop_FastModulo_Bank(
nloop_SampleSlice_t<datatype_t,bankcount,chancount> &indata,
nloop_SampleSlice_t<datatype_t,bankcount,chancount> &moduli,
nloop_SampleSlice_t<datatype_t,bankcount,chancount> &outdata
)
{
int bidx, cidx;
for (bidx = 0; bidx < bankcount; bidx++)
for (cidx = 0; cidx < chancount; cidx++)
// NOTE - We're counting on the compiler inlining this, for speed.
outdata.data[bidx][cidx] = nloop_FastModulo<datatype_t,subcount>
(indata.data[bidx][cidx], moduli.data[bidx][cidx]);
}
//
// This is the end of the file.
| 32.704225
| 78
| 0.736003
|
att-circ-contrl
|
e4eb1e58974ce0866109916f3ef05b2547491e0b
| 3,631
|
cpp
|
C++
|
src/saiga/vision/ceres/CeresBASmooth.cpp
|
muetimueti/saiga
|
32b54a8fc7b1251368e07e7d31c15ac90cee3b32
|
[
"MIT"
] | null | null | null |
src/saiga/vision/ceres/CeresBASmooth.cpp
|
muetimueti/saiga
|
32b54a8fc7b1251368e07e7d31c15ac90cee3b32
|
[
"MIT"
] | null | null | null |
src/saiga/vision/ceres/CeresBASmooth.cpp
|
muetimueti/saiga
|
32b54a8fc7b1251368e07e7d31c15ac90cee3b32
|
[
"MIT"
] | null | null | null |
/**
* Copyright (c) 2017 Darius Rückert
* Licensed under the MIT License.
* See LICENSE file for more information.
*/
#include "CeresBASmooth.h"
#include "saiga/core/time/timer.h"
#include "saiga/vision/ceres/CeresHelper.h"
#include "saiga/vision/ceres/CeresKernel_BARS_Intr4.h"
#include "saiga/vision/ceres/CeresKernel_BA_Intr4.h"
#include "saiga/vision/ceres/CeresKernel_SmoothBA.h"
#include "saiga/vision/ceres/local_parameterization_se3.h"
#include "saiga/vision/scene/Scene.h"
#include "ceres/ceres.h"
#include "ceres/problem.h"
#include "ceres/rotation.h"
#include "ceres/solver.h"
#define BA_AUTODIFF
namespace Saiga
{
OptimizationResults CeresBASmooth::initAndSolve()
{
auto& scene = *_scene;
SAIGA_OPTIONAL_BLOCK_TIMER(optimizationOptions.debugOutput);
ceres::Problem::Options problemOptions;
problemOptions.local_parameterization_ownership = ceres::DO_NOT_TAKE_OWNERSHIP;
problemOptions.cost_function_ownership = ceres::DO_NOT_TAKE_OWNERSHIP;
problemOptions.loss_function_ownership = ceres::DO_NOT_TAKE_OWNERSHIP;
ceres::Problem problem(problemOptions);
Sophus::test::LocalParameterizationSE3<false> camera_parameterization;
for (size_t i = 0; i < scene.extrinsics.size(); ++i)
{
problem.AddParameterBlock(scene.extrinsics[i].se3.data(), 7, &camera_parameterization);
if (scene.extrinsics[i].constant) problem.SetParameterBlockConstant(scene.extrinsics[i].se3.data());
}
for (auto& wp : scene.worldPoints)
{
problem.AddParameterBlock(wp.p.data(), 3);
problem.SetParameterBlockConstant(wp.p.data());
}
ceres::HuberLoss lossFunctionMono(baOptions.huberMono);
ceres::HuberLoss lossFunctionStereo(baOptions.huberStereo);
int monoCount = 0;
int stereoCount = 0;
for (auto& img : scene.images)
{
for (auto& ip : img.stereoPoints)
{
if (!ip) continue;
if (ip.depth > 0)
{
stereoCount++;
}
else
{
monoCount++;
}
}
}
std::vector<std::unique_ptr<CostBAMonoAnalytic>> monoCostFunctions;
std::vector<std::unique_ptr<CostBAStereoAnalytic>> stereoCostFunctions;
monoCostFunctions.reserve(monoCount);
stereoCostFunctions.reserve(stereoCount);
for (auto& img : scene.images)
{
auto& extr = scene.extrinsics[img.extr].se3;
auto& camera = scene.intrinsics[img.intr];
for (auto& ip : img.stereoPoints)
{
if (!ip) continue;
auto& wp = scene.worldPoints[ip.wp].p;
double w = ip.weight * scene.scale();
auto cost_function = CostBAMono::create(camera, ip.point, w);
ceres::LossFunction* lossFunction = baOptions.huberMono > 0 ? &lossFunctionMono : nullptr;
problem.AddResidualBlock(cost_function, lossFunction, extr.data(), wp.data());
}
}
for (auto& sc : scene.smoothnessConstraints)
{
auto& p1 = scene.extrinsics[scene.images[sc.ex1].extr].se3;
auto& p2 = scene.extrinsics[scene.images[sc.ex2].extr].se3;
auto& p3 = scene.extrinsics[scene.images[sc.ex3].extr].se3;
auto w = sc.weight;
auto cost_function = CostSmoothBA::create(w);
problem.AddResidualBlock(cost_function, nullptr, p1.data(), p2.data(), p3.data());
}
ceres::Solver::Options ceres_options = make_options(optimizationOptions);
OptimizationResults result = ceres_solve(ceres_options, problem);
return result;
}
} // namespace Saiga
| 28.590551
| 108
| 0.658772
|
muetimueti
|
e4f04f56cb5c8bb13e36f54701754da0ad28a75d
| 614
|
tpp
|
C++
|
src/memory/alloc_sthread_next_fit_part_none.tpp
|
clearlycloudy/concurrent
|
243246f3244cfaf7ffcbfc042c69980d96f988e4
|
[
"MIT"
] | 9
|
2019-05-14T01:07:08.000Z
|
2020-11-12T01:46:11.000Z
|
src/memory/alloc_sthread_next_fit_part_none.tpp
|
clearlycloudy/concurrent
|
243246f3244cfaf7ffcbfc042c69980d96f988e4
|
[
"MIT"
] | null | null | null |
src/memory/alloc_sthread_next_fit_part_none.tpp
|
clearlycloudy/concurrent
|
243246f3244cfaf7ffcbfc042c69980d96f988e4
|
[
"MIT"
] | null | null | null |
#include <new>
template< class T, class... Args >
T * alloc_sthread_next_fit_part_none_impl::newing( void * p, Args&&... args ){
if( nullptr == p ){
if( !allocating( &p, sizeof(T) ) ){
//allocation failed
std::bad_alloc bad_alloc;
throw bad_alloc;
return nullptr;
}
}
return static_cast<T*> ( new( p ) T( std::forward<Args>(args)...) ); //constructor via placement
}
template< class T >
bool alloc_sthread_next_fit_part_none_impl::deleting( T * p ){
if( nullptr == p ){
return false;
}
p->~T(); //call destructor
return freeing( (void *) p ); //reclaim memory
}
| 26.695652
| 100
| 0.620521
|
clearlycloudy
|
e4f5510e0668e5d718938faad6dbba6e00a2a493
| 65
|
cpp
|
C++
|
msbuild-maven-plugin/src/test/resources/unit/source-listing/project2/project2.cpp
|
sunnymoon/msbuild-maven-plugin
|
86fa207675d5d51f864c3e636c2a10b1d6c2afd5
|
[
"Apache-2.0"
] | 3
|
2015-03-26T16:06:32.000Z
|
2017-12-08T19:31:38.000Z
|
msbuild-maven-plugin/src/test/resources/unit/source-listing/project2/project2.cpp
|
sunnymoon/msbuild-maven-plugin
|
86fa207675d5d51f864c3e636c2a10b1d6c2afd5
|
[
"Apache-2.0"
] | 6
|
2015-09-07T06:45:15.000Z
|
2021-06-30T08:16:13.000Z
|
msbuild-maven-plugin/src/test/resources/unit/source-listing/project2/project2.cpp
|
sunnymoon/msbuild-maven-plugin
|
86fa207675d5d51f864c3e636c2a10b1d6c2afd5
|
[
"Apache-2.0"
] | 2
|
2015-09-07T07:02:38.000Z
|
2019-09-25T21:20:26.000Z
|
#include "project2.h"
int project2_method1()
{
return 0;
}
| 8.125
| 22
| 0.646154
|
sunnymoon
|
e4f70561dfe99acf0c70d16cd3cd2c00c24c6d94
| 15,703
|
cpp
|
C++
|
src/fdm/auto/fdm_Autopilot.cpp
|
marek-cel/mscsim-cc0
|
348f659eae61fd998df8bf2fa81090596548d06d
|
[
"CC0-1.0"
] | 4
|
2020-03-03T08:10:59.000Z
|
2021-09-04T08:02:17.000Z
|
src/fdm/auto/fdm_Autopilot.cpp
|
marek-cel/mscsim-cc0
|
348f659eae61fd998df8bf2fa81090596548d06d
|
[
"CC0-1.0"
] | null | null | null |
src/fdm/auto/fdm_Autopilot.cpp
|
marek-cel/mscsim-cc0
|
348f659eae61fd998df8bf2fa81090596548d06d
|
[
"CC0-1.0"
] | null | null | null |
/****************************************************************************//*
* Copyright (C) 2021 Marek M. Cel
*
* Creative Commons Legal Code
*
* CC0 1.0 Universal
*
* CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
* LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
* ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
* INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
* REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
* PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
* THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
* HEREUNDER.
*
* Statement of Purpose
*
* The laws of most jurisdictions throughout the world automatically confer
* exclusive Copyright and Related Rights (defined below) upon the creator
* and subsequent owner(s) (each and all, an "owner") of an original work of
* authorship and/or a database (each, a "Work").
*
* Certain owners wish to permanently relinquish those rights to a Work for
* the purpose of contributing to a commons of creative, cultural and
* scientific works ("Commons") that the public can reliably and without fear
* of later claims of infringement build upon, modify, incorporate in other
* works, reuse and redistribute as freely as possible in any form whatsoever
* and for any purposes, including without limitation commercial purposes.
* These owners may contribute to the Commons to promote the ideal of a free
* culture and the further production of creative, cultural and scientific
* works, or to gain reputation or greater distribution for their Work in
* part through the use and efforts of others.
*
* For these and/or other purposes and motivations, and without any
* expectation of additional consideration or compensation, the person
* associating CC0 with a Work (the "Affirmer"), to the extent that he or she
* is an owner of Copyright and Related Rights in the Work, voluntarily
* elects to apply CC0 to the Work and publicly distribute the Work under its
* terms, with knowledge of his or her Copyright and Related Rights in the
* Work and the meaning and intended legal effect of CC0 on those rights.
*
* 1. Copyright and Related Rights. A Work made available under CC0 may be
* protected by copyright and related or neighboring rights ("Copyright and
* Related Rights"). Copyright and Related Rights include, but are not
* limited to, the following:
*
* i. the right to reproduce, adapt, distribute, perform, display,
* communicate, and translate a Work;
* ii. moral rights retained by the original author(s) and/or performer(s);
* iii. publicity and privacy rights pertaining to a person's image or
* likeness depicted in a Work;
* iv. rights protecting against unfair competition in regards to a Work,
* subject to the limitations in paragraph 4(a), below;
* v. rights protecting the extraction, dissemination, use and reuse of data
* in a Work;
* vi. database rights (such as those arising under Directive 96/9/EC of the
* European Parliament and of the Council of 11 March 1996 on the legal
* protection of databases, and under any national implementation
* thereof, including any amended or successor version of such
* directive); and
* vii. other similar, equivalent or corresponding rights throughout the
* world based on applicable law or treaty, and any national
* implementations thereof.
*
* 2. Waiver. To the greatest extent permitted by, but not in contravention
* of, applicable law, Affirmer hereby overtly, fully, permanently,
* irrevocably and unconditionally waives, abandons, and surrenders all of
* Affirmer's Copyright and Related Rights and associated claims and causes
* of action, whether now known or unknown (including existing as well as
* future claims and causes of action), in the Work (i) in all territories
* worldwide, (ii) for the maximum duration provided by applicable law or
* treaty (including future time extensions), (iii) in any current or future
* medium and for any number of copies, and (iv) for any purpose whatsoever,
* including without limitation commercial, advertising or promotional
* purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
* member of the public at large and to the detriment of Affirmer's heirs and
* successors, fully intending that such Waiver shall not be subject to
* revocation, rescission, cancellation, termination, or any other legal or
* equitable action to disrupt the quiet enjoyment of the Work by the public
* as contemplated by Affirmer's express Statement of Purpose.
*
* 3. Public License Fallback. Should any part of the Waiver for any reason
* be judged legally invalid or ineffective under applicable law, then the
* Waiver shall be preserved to the maximum extent permitted taking into
* account Affirmer's express Statement of Purpose. In addition, to the
* extent the Waiver is so judged Affirmer hereby grants to each affected
* person a royalty-free, non transferable, non sublicensable, non exclusive,
* irrevocable and unconditional license to exercise Affirmer's Copyright and
* Related Rights in the Work (i) in all territories worldwide, (ii) for the
* maximum duration provided by applicable law or treaty (including future
* time extensions), (iii) in any current or future medium and for any number
* of copies, and (iv) for any purpose whatsoever, including without
* limitation commercial, advertising or promotional purposes (the
* "License"). The License shall be deemed effective as of the date CC0 was
* applied by Affirmer to the Work. Should any part of the License for any
* reason be judged legally invalid or ineffective under applicable law, such
* partial invalidity or ineffectiveness shall not invalidate the remainder
* of the License, and in such case Affirmer hereby affirms that he or she
* will not (i) exercise any of his or her remaining Copyright and Related
* Rights in the Work or (ii) assert any associated claims and causes of
* action with respect to the Work, in either case contrary to Affirmer's
* express Statement of Purpose.
*
* 4. Limitations and Disclaimers.
*
* a. No trademark or patent rights held by Affirmer are waived, abandoned,
* surrendered, licensed or otherwise affected by this document.
* b. Affirmer offers the Work as-is and makes no representations or
* warranties of any kind concerning the Work, express, implied,
* statutory or otherwise, including without limitation warranties of
* title, merchantability, fitness for a particular purpose, non
* infringement, or the absence of latent or other defects, accuracy, or
* the present or absence of errors, whether or not discoverable, all to
* the greatest extent permissible under applicable law.
* c. Affirmer disclaims responsibility for clearing rights of other persons
* that may apply to the Work or any use thereof, including without
* limitation any person's Copyright and Related Rights in the Work.
* Further, Affirmer disclaims responsibility for obtaining any necessary
* consents, permissions or other rights required for any use of the
* Work.
* d. Affirmer understands and acknowledges that Creative Commons is not a
* party to this document and has no duty or obligation with respect to
* this CC0 or use of the Work.
******************************************************************************/
#include <fdm/auto/fdm_Autopilot.h>
#include <fdm/utils/fdm_Misc.h>
#include <fdm/utils/fdm_Units.h>
#include <fdm/xml/fdm_XmlUtils.h>
#include <iostream>
////////////////////////////////////////////////////////////////////////////////
using namespace fdm;
////////////////////////////////////////////////////////////////////////////////
Autopilot::Autopilot( FlightDirector *fd ) :
_fd ( fd ),
_pid_r ( 0.0, 0.0, 0.0, -1.0, 1.0 ),
_pid_p ( 0.0, 0.0, 0.0, -1.0, 1.0 ),
_pid_y ( 0.0, 0.0, 0.0, -1.0, 1.0 ),
_max_rate_roll ( DBL_MAX ),
_max_rate_pitch ( DBL_MAX ),
_max_rate_yaw ( DBL_MAX ),
_min_roll ( -M_PI_2 ),
_max_roll ( M_PI_2 ),
_min_pitch ( -M_PI_2 ),
_max_pitch ( M_PI_2 ),
_min_alt ( 0.0 ),
_max_alt ( DBL_MAX ),
_min_ias ( 0.0 ),
_max_ias ( DBL_MAX ),
_min_vs ( -DBL_MAX ),
_max_vs ( DBL_MAX ),
_ctrl_roll ( 0.0 ),
_ctrl_pitch ( 0.0 ),
_ctrl_yaw ( 0.0 ),
_yaw_damper ( false ),
_testing ( false ),
_engaged ( false )
{
_pid_r.setAntiWindup( PID::Calculation );
_pid_p.setAntiWindup( PID::Calculation );
_pid_y.setAntiWindup( PID::Calculation );
_gain_ias_r = Table1::oneRecordTable( 1.0 );
_gain_ias_p = Table1::oneRecordTable( 1.0 );
_gain_ias_y = Table1::oneRecordTable( 1.0 );
}
////////////////////////////////////////////////////////////////////////////////
Autopilot::~Autopilot() {}
////////////////////////////////////////////////////////////////////////////////
void Autopilot::readData( XmlNode &dataNode )
{
if ( dataNode.isValid() )
{
int result = FDM_SUCCESS;
if ( result == FDM_SUCCESS ) result = XmlUtils::read( dataNode, &_min_roll , "min_roll" , true );
if ( result == FDM_SUCCESS ) result = XmlUtils::read( dataNode, &_max_roll , "max_roll" , true );
if ( result == FDM_SUCCESS ) result = XmlUtils::read( dataNode, &_min_pitch , "min_pitch" , true );
if ( result == FDM_SUCCESS ) result = XmlUtils::read( dataNode, &_max_pitch , "max_pitch" , true );
if ( result == FDM_SUCCESS ) result = XmlUtils::read( dataNode, &_min_alt , "min_alt" , true );
if ( result == FDM_SUCCESS ) result = XmlUtils::read( dataNode, &_max_alt , "max_alt" , true );
if ( result == FDM_SUCCESS ) result = XmlUtils::read( dataNode, &_min_ias , "min_ias" , true );
if ( result == FDM_SUCCESS ) result = XmlUtils::read( dataNode, &_max_ias , "max_ias" , true );
if ( result == FDM_SUCCESS ) result = XmlUtils::read( dataNode, &_min_vs , "min_vs" , true );
if ( result == FDM_SUCCESS ) result = XmlUtils::read( dataNode, &_max_vs , "max_vs" , true );
if ( result == FDM_SUCCESS )
{
XmlNode nodeRoll = dataNode.getFirstChildElement( "ctrl_roll" );
XmlNode nodePitch = dataNode.getFirstChildElement( "ctrl_pitch" );
XmlNode nodeYaw = dataNode.getFirstChildElement( "ctrl_yaw" );
readChannel( nodeRoll , &_max_rate_roll , &_pid_r, &_gain_ias_r );
readChannel( nodePitch , &_max_rate_pitch , &_pid_p, &_gain_ias_p );
readChannel( nodeYaw , &_max_rate_yaw , &_pid_y, &_gain_ias_y );
}
else
{
XmlUtils::throwError( __FILE__, __LINE__, dataNode );
}
XmlNode nodeFlightDirector = dataNode.getFirstChildElement( "flight_director" );
_fd->readData( nodeFlightDirector );
}
else
{
XmlUtils::throwError( __FILE__, __LINE__, dataNode );
}
}
////////////////////////////////////////////////////////////////////////////////
void Autopilot::initialize() {}
////////////////////////////////////////////////////////////////////////////////
void Autopilot::update( double timeStep,
double roll, double pitch, double heading,
double altitude, double airspeed,
double turn_rate, double yaw_rate, double climb_rate,
double dme_distance,
double nav_deviation, bool nav_active,
double loc_deviation, bool loc_active,
double gs_deviation, bool gs_active )
{
_fd->update( timeStep,
heading,
altitude, airspeed,
turn_rate, climb_rate,
dme_distance,
nav_deviation, nav_active,
loc_deviation, loc_active,
gs_deviation, gs_active );
if ( _engaged && _fd->isEngaged() )
{
_pid_r.update( timeStep, _fd->getCmdRoll() - roll );
_pid_p.update( timeStep, _fd->getCmdPitch() - pitch );
}
else
{
_pid_r.reset();
_pid_p.reset();
_ctrl_roll = 0.0;
_ctrl_pitch = 0.0;
}
if ( _yaw_damper )
{
_pid_y.update( timeStep, -yaw_rate );
}
else
{
_pid_y.reset();
_ctrl_yaw = 0.0;
}
double ctrl_roll = _gain_ias_r.getValue( airspeed ) * _pid_r.getValue();
double ctrl_pitch = _gain_ias_p.getValue( airspeed ) * _pid_p.getValue();
double ctrl_yaw = _gain_ias_y.getValue( airspeed ) * _pid_y.getValue();
// if ( _softRide )
// {
// ctrl_roll *= _softRideCoef;
// ctrl_pitch *= _softRideCoef;
// ctrl_yaw *= _softRideCoef;
// }
_ctrl_roll = Misc::rate( timeStep, _max_rate_roll , _ctrl_roll , ctrl_roll );
_ctrl_pitch = Misc::rate( timeStep, _max_rate_pitch , _ctrl_pitch , ctrl_pitch );
_ctrl_yaw = Misc::rate( timeStep, _max_rate_yaw , _ctrl_yaw , ctrl_yaw );
_ctrl_roll = Misc::satur( -1.0, 1.0, _ctrl_roll );
_ctrl_pitch = Misc::satur( -1.0, 1.0, _ctrl_pitch );
_ctrl_yaw = Misc::satur( -1.0, 1.0, _ctrl_yaw );
}
////////////////////////////////////////////////////////////////////////////////
void Autopilot::setAltitude( double altitude )
{
_fd->setAltitude( fdm::Misc::satur( _min_alt, _max_alt, altitude ) );
}
////////////////////////////////////////////////////////////////////////////////
void Autopilot::setAirspeed( double airspeed )
{
_fd->setAirspeed( fdm::Misc::satur( _min_ias, _max_ias, airspeed ) );
}
////////////////////////////////////////////////////////////////////////////////
void Autopilot::setClimbRate( double climb_rate )
{
_fd->setClimbRate( fdm::Misc::satur( _min_vs, _max_vs, climb_rate ) );
}
////////////////////////////////////////////////////////////////////////////////
void Autopilot::setHeading( double heading )
{
_fd->setHeading( heading );
}
////////////////////////////////////////////////////////////////////////////////
void Autopilot::setCourse( double course )
{
_fd->setCourse( course );
}
////////////////////////////////////////////////////////////////////////////////
void Autopilot::setRoll( double roll )
{
_fd->setRoll( Misc::satur( _min_roll, _max_roll, roll ) );
}
////////////////////////////////////////////////////////////////////////////////
void Autopilot::setPitch( double pitch )
{
_fd->setPitch( Misc::satur( _min_pitch, _max_pitch, pitch ) );
}
////////////////////////////////////////////////////////////////////////////////
void Autopilot::readChannel( const XmlNode &dataNode, double *max_rate,
PID *pid, Table1 *gain_ias )
{
if ( dataNode.isValid() )
{
int result = XmlUtils::read( dataNode, max_rate, "max_rate" );
if ( result != FDM_SUCCESS ) XmlUtils::throwError( __FILE__, __LINE__, dataNode );
XmlNode nodePID = dataNode.getFirstChildElement( "pid" );
if ( FDM_SUCCESS != XmlUtils::read( nodePID, pid, -1.0, 1.0 ) )
{
XmlUtils::throwError( __FILE__, __LINE__, dataNode );
}
result = XmlUtils::read( dataNode, gain_ias, "gain_ias", true );
if ( result != FDM_SUCCESS ) XmlUtils::throwError( __FILE__, __LINE__, dataNode );
}
else
{
XmlUtils::throwError( __FILE__, __LINE__, dataNode );
}
}
| 42.099196
| 107
| 0.6202
|
marek-cel
|
e4f86b1723ea317e9b76ca740687d0924cd369ff
| 1,435
|
hpp
|
C++
|
include/ash/fsm/DynamicComponentProvider.hpp
|
CorundumGames/AshPlusPlus
|
d346cf9029798e710fee4d8e3d5f305c90d04caa
|
[
"MIT"
] | 2
|
2016-12-17T23:19:06.000Z
|
2017-07-19T14:44:57.000Z
|
include/ash/fsm/DynamicComponentProvider.hpp
|
CorundumGames/AshPlusPlus
|
d346cf9029798e710fee4d8e3d5f305c90d04caa
|
[
"MIT"
] | null | null | null |
include/ash/fsm/DynamicComponentProvider.hpp
|
CorundumGames/AshPlusPlus
|
d346cf9029798e710fee4d8e3d5f305c90d04caa
|
[
"MIT"
] | null | null | null |
#ifndef DYNAMICCOMPONENTPROVIDER_HPP
#define DYNAMICCOMPONENTPROVIDER_HPP
#include <functional>
#include "ash/fsm/IComponentProvider.hpp"
using std::function;
namespace ash {
namespace fsm {
/**
* This component provider calls a function to get the component instance. The function must return a single component
* of the appropriate type.
*/
template<class C>
class DynamicComponentProvider : public IComponentProvider<C, function<C(void)>>
{
public:
/**
* Constructor
*
* @param closure The function that will return the component instance when called.
*/
DynamicComponentProvider(const function<C(void)>& closure) :
_closure(closure) {}
virtual ~DynamicComponentProvider() {}
/**
* Used to request a component from this provider
*
* @return The instance returned by calling the function
*/
C getComponent() const {
return this->_closure();
}
/**
* Used to compare this provider with others. Any provider that uses the function or method closure to provide
* the instance is regarded as equivalent.
*
* @return The function
*/
function<C(void)> const& identifier() const {
return this->_closure;
}
private:
function<C(void)> _closure;
};
}
}
#endif // DYNAMICCOMPONENTPROVIDER_HPP
| 26.090909
| 118
| 0.632056
|
CorundumGames
|
e4fe87fe85ad1b1ee8f39ef4649ce09822f437fd
| 2,508
|
cpp
|
C++
|
trikScriptRunner/src/trikVariablesServer.cpp
|
thetoropov/trikRuntime
|
f236e441875ff4ab999803252f26075e089ae04c
|
[
"Apache-2.0"
] | null | null | null |
trikScriptRunner/src/trikVariablesServer.cpp
|
thetoropov/trikRuntime
|
f236e441875ff4ab999803252f26075e089ae04c
|
[
"Apache-2.0"
] | null | null | null |
trikScriptRunner/src/trikVariablesServer.cpp
|
thetoropov/trikRuntime
|
f236e441875ff4ab999803252f26075e089ae04c
|
[
"Apache-2.0"
] | null | null | null |
/* Copyright 2018 Anastasiia Kornilova, CyberTech Labs Ltd.
*
* 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 "trikVariablesServer.h"
#include <QtCore/QJsonDocument>
#include <QtCore/QRegExp>
#include <QtNetwork/QTcpSocket>
using namespace trikScriptRunner;
TrikVariablesServer::TrikVariablesServer() :
mTcpServer(new QTcpServer(this))
{
connect(mTcpServer.data(), SIGNAL(newConnection()), this, SLOT(onNewConnection()));
mTcpServer->listen(QHostAddress::LocalHost, port);
}
void TrikVariablesServer::sendHTTPResponse(const QJsonObject &json)
{
QByteArray jsonBytes = QJsonDocument(json).toJson();
// TODO: Create other way for endline constant, get rid of define
#define NL "\r\n"
QString header = "HTTP/1.0 200 OK" NL
"Connection: close" NL
"Content-type: text/plain, charset=us-ascii" NL
"Content-length: " + QString::number(jsonBytes.size()) + NL
NL;
#undef NL
mCurrentConnection->write(header.toLatin1());
mCurrentConnection->write(jsonBytes);
mCurrentConnection->close();
}
void TrikVariablesServer::onNewConnection()
{
// TODO: Object from nextPendingConnection is a child of QTcpServer, so it will be automatically
// deleted when QTcpServer is destroyed. Maybe it may sense to call "deleteLater" explicitly,
// to avoid wasting memory.
mCurrentConnection = mTcpServer->nextPendingConnection();
connect(mCurrentConnection, SIGNAL(readyRead()), this, SLOT(processHTTPRequest()));
}
void TrikVariablesServer::processHTTPRequest()
{
// TODO: Make sure, that different connections aren't intersected using mutex or
// support multiple connections simultaneously
QStringList list;
while (mCurrentConnection->canReadLine())
{
QString data = QString(mCurrentConnection->readLine());
list.append(data);
}
const QString cleanString = list.join("").remove(QRegExp("[\\n\\t\\r]"));
const QStringList words = cleanString.split(QRegExp("\\s+"), QString::SkipEmptyParts);
if (words[1] == "/web/") {
emit getVariables("web");
}
}
| 33.44
| 97
| 0.743222
|
thetoropov
|
90004e8a92fba5a459375e80590161f80ef06eb2
| 6,481
|
hpp
|
C++
|
include/tile_grid.hpp
|
zerebubuth/osmium-history-splitter
|
9e2445440fc26a29d9ceeb1833937d910b28ff9c
|
[
"BSL-1.0"
] | null | null | null |
include/tile_grid.hpp
|
zerebubuth/osmium-history-splitter
|
9e2445440fc26a29d9ceeb1833937d910b28ff9c
|
[
"BSL-1.0"
] | null | null | null |
include/tile_grid.hpp
|
zerebubuth/osmium-history-splitter
|
9e2445440fc26a29d9ceeb1833937d910b28ff9c
|
[
"BSL-1.0"
] | null | null | null |
#ifndef OSMIUM_HISTORY_SPLITTER_TILE_GRID_HPP
#define OSMIUM_HISTORY_SPLITTER_TILE_GRID_HPP
/*
This file is part of the Osmium History Splitter
Copyright 2015 Matt Amos <zerebubuth@gmail.com>.
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include <osmium/osm/node.hpp>
#include <osmium/osm/way.hpp>
#include <osmium/osm/relation.hpp>
#include <osmium/memory/buffer.hpp>
#include <boost/format.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/member.hpp>
#include <memory>
#include <fstream>
namespace hsplitter {
// TODO: remove, or make hidden by debug flag
extern size_t g_evictions, g_flushes;
// represents a memory buffer waiting to be written to
// a particular tile file. this is buffered so that we
// don't have to have a whole load of open file
// descriptors.
struct tile_file {
typedef osmium::memory::Buffer buffer;
typedef std::unique_ptr<buffer> buffer_ptr;
typedef hsplitter::tile_t tile_t;
tile_file()
: m_id(0), m_buffer_dir(), m_buffer() {
}
tile_file(tile_t id, size_t capacity, const std::string &buffer_dir)
: m_id(id),
m_buffer_dir(buffer_dir),
m_buffer(new buffer(capacity, osmium::memory::Buffer::auto_grow::yes)) {
set_callback();
}
tile_file(tile_file &&tf) : m_id(tf.m_id), m_buffer_dir(tf.m_buffer_dir), m_buffer() {
swap_buffer(tf.m_buffer);
}
tile_file(const tile_file &) = delete;
const tile_file &operator=(tile_file &&tf) {
m_id = tf.m_id;
m_buffer_dir = tf.m_buffer_dir;
swap_buffer(tf.m_buffer);
return *this;
}
const tile_file &operator=(const tile_file &) = delete;
void write(const osmium::OSMObject &obj) {
assert(!empty());
m_buffer->add_item(obj);
m_buffer->commit();
}
void flush() {
assert(!empty());
static_flush(m_id, *m_buffer, m_buffer_dir);
}
static void static_flush(hsplitter::tile_t id, osmium::memory::Buffer &buffer,
const std::string &buffer_dir) {
assert(buffer);
if (buffer.begin() != buffer.end()) {
// TODO: configurable, default to $TMPDIR
std::string filename = (boost::format("%1%/%2%.buf") % buffer_dir % id).str();
std::ofstream file(filename, std::ios::binary | std::ios::ate | std::ios::app);
file.write(reinterpret_cast<const char *>(buffer.data()), buffer.committed());
buffer.clear();
std::fill(buffer.data(), buffer.data() + buffer.capacity(), 0);
++g_flushes;
}
}
void swap(tile_file &tf) {
std::swap(m_id, tf.m_id);
std::swap(m_buffer_dir, tf.m_buffer_dir);
swap_buffer(tf.m_buffer);
}
bool empty() const {
return !m_buffer;
}
tile_t m_id;
std::string m_buffer_dir;
private:
buffer_ptr m_buffer;
void swap_buffer(buffer_ptr &other) {
if (m_buffer) {
m_buffer->set_full_callback([](osmium::memory::Buffer&){});
}
if (other) {
other->set_full_callback([](osmium::memory::Buffer&){});
}
std::swap(m_buffer, other);
set_callback();
}
void set_callback() {
const hsplitter::tile_t id = m_id;
const std::string buffer_dir = m_buffer_dir;
if (m_buffer) {
m_buffer->set_full_callback([id, buffer_dir](osmium::memory::Buffer &b) {
static_flush(id, b, buffer_dir);
});
}
}
};
// LRU cache of buffers
struct tile_grid {
typedef boost::multi_index::multi_index_container<
tile_file,
boost::multi_index::indexed_by<
boost::multi_index::sequenced<>,
boost::multi_index::hashed_unique<boost::multi_index::member<tile_file, hsplitter::tile_t, &tile_file::m_id> >
>
> mru_tile_set;
tile_grid(size_t n_tiles, size_t capacity, const std::string &buffer_dir) {
m_buffer_dir = buffer_dir;
for (size_t i = 0; i < n_tiles; ++i) {
tile_file tf(0, capacity, m_buffer_dir);
m_free_tiles.emplace_back(std::move(tf));
}
}
tile_file &tile(hsplitter::tile_t id) {
auto &tile_idx = m_open_tiles.get<1>();
auto itr = tile_idx.find(id);
if (itr == tile_idx.end()) {
if (m_free_tiles.empty()) {
evict_lru_tile();
}
tile_file tf;
tf.swap(m_free_tiles.front());
m_free_tiles.pop_front();
tf.m_id = id;
tf.m_buffer_dir = m_buffer_dir;
auto pair = tile_idx.emplace(std::move(tf));
itr = pair.first;
}
m_open_tiles.relocate(m_open_tiles.begin(), m_open_tiles.project<0>(itr));
assert(itr->m_id == id);
return const_cast<tile_file &>(*itr);
}
void evict_lru_tile() {
assert(m_open_tiles.size() > 0);
auto &tile = const_cast<tile_file &>(m_open_tiles.back());
tile.flush();
m_free_tiles.emplace_front();
m_free_tiles.front().swap(tile);
assert(m_open_tiles.back().empty());
m_open_tiles.pop_back();
++g_evictions;
}
void close() {
for (auto &tile : m_open_tiles) {
const_cast<tile_file &>(tile).flush();
}
}
private:
std::list<tile_file> m_free_tiles;
mru_tile_set m_open_tiles;
std::string m_buffer_dir;
};
} // namespace hsplitter
#endif /* OSMIUM_HISTORY_SPLITTER_TILE_GRID_HPP */
| 29.459091
| 116
| 0.69156
|
zerebubuth
|
07e57da13a7e38a2d6726256469f26f9da43e480
| 6,484
|
hpp
|
C++
|
include/VROSC/UserProfileDataModel.hpp
|
v0idp/virtuoso-codegen
|
6f560f04822c67f092d438a3f484249072c1d21d
|
[
"Unlicense"
] | null | null | null |
include/VROSC/UserProfileDataModel.hpp
|
v0idp/virtuoso-codegen
|
6f560f04822c67f092d438a3f484249072c1d21d
|
[
"Unlicense"
] | null | null | null |
include/VROSC/UserProfileDataModel.hpp
|
v0idp/virtuoso-codegen
|
6f560f04822c67f092d438a3f484249072c1d21d
|
[
"Unlicense"
] | 1
|
2022-03-30T21:07:35.000Z
|
2022-03-30T21:07:35.000Z
|
// Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
#include "beatsaber-hook/shared/utils/byref.hpp"
// Including type: VROSC.BaseDataModel
#include "VROSC/BaseDataModel.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils-properties.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils-fields.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
#include "beatsaber-hook/shared/utils/typedefs-string.hpp"
// Completed includes
// Type namespace: VROSC
namespace VROSC {
// Forward declaring type: UserProfileDataModel
class UserProfileDataModel;
}
#include "beatsaber-hook/shared/utils/il2cpp-type-check.hpp"
NEED_NO_BOX(::VROSC::UserProfileDataModel);
DEFINE_IL2CPP_ARG_TYPE(::VROSC::UserProfileDataModel*, "VROSC", "UserProfileDataModel");
// Type namespace: VROSC
namespace VROSC {
// Size: 0x60
#pragma pack(push, 1)
// Autogenerated type: VROSC.UserProfileDataModel
// [TokenAttribute] Offset: FFFFFFFF
class UserProfileDataModel : public ::VROSC::BaseDataModel {
public:
public:
// public System.String Username
// Size: 0x8
// Offset: 0x18
::StringW Username;
// Field size check
static_assert(sizeof(::StringW) == 0x8);
// public System.String Email
// Size: 0x8
// Offset: 0x20
::StringW Email;
// Field size check
static_assert(sizeof(::StringW) == 0x8);
// public System.String OculusId
// Size: 0x8
// Offset: 0x28
::StringW OculusId;
// Field size check
static_assert(sizeof(::StringW) == 0x8);
// public System.String OculusUsername
// Size: 0x8
// Offset: 0x30
::StringW OculusUsername;
// Field size check
static_assert(sizeof(::StringW) == 0x8);
// public System.String SteamId
// Size: 0x8
// Offset: 0x38
::StringW SteamId;
// Field size check
static_assert(sizeof(::StringW) == 0x8);
// public System.String SteamUsername
// Size: 0x8
// Offset: 0x40
::StringW SteamUsername;
// Field size check
static_assert(sizeof(::StringW) == 0x8);
// public System.String LastLogin
// Size: 0x8
// Offset: 0x48
::StringW LastLogin;
// Field size check
static_assert(sizeof(::StringW) == 0x8);
// public System.String CreationDate
// Size: 0x8
// Offset: 0x50
::StringW CreationDate;
// Field size check
static_assert(sizeof(::StringW) == 0x8);
// public System.String AcceptedEULAVersion
// Size: 0x8
// Offset: 0x58
::StringW AcceptedEULAVersion;
// Field size check
static_assert(sizeof(::StringW) == 0x8);
public:
// Get instance field reference: public System.String Username
[[deprecated("Use field access instead!")]] ::StringW& dyn_Username();
// Get instance field reference: public System.String Email
[[deprecated("Use field access instead!")]] ::StringW& dyn_Email();
// Get instance field reference: public System.String OculusId
[[deprecated("Use field access instead!")]] ::StringW& dyn_OculusId();
// Get instance field reference: public System.String OculusUsername
[[deprecated("Use field access instead!")]] ::StringW& dyn_OculusUsername();
// Get instance field reference: public System.String SteamId
[[deprecated("Use field access instead!")]] ::StringW& dyn_SteamId();
// Get instance field reference: public System.String SteamUsername
[[deprecated("Use field access instead!")]] ::StringW& dyn_SteamUsername();
// Get instance field reference: public System.String LastLogin
[[deprecated("Use field access instead!")]] ::StringW& dyn_LastLogin();
// Get instance field reference: public System.String CreationDate
[[deprecated("Use field access instead!")]] ::StringW& dyn_CreationDate();
// Get instance field reference: public System.String AcceptedEULAVersion
[[deprecated("Use field access instead!")]] ::StringW& dyn_AcceptedEULAVersion();
// public override System.String get_Key()
// Offset: 0x191FAA4
// Implemented from: VROSC.BaseDataModel
// Base method: System.String BaseDataModel::get_Key()
::StringW get_Key();
// public override System.Int32 get_Version()
// Offset: 0x191FAE8
// Implemented from: VROSC.BaseDataModel
// Base method: System.Int32 BaseDataModel::get_Version()
int get_Version();
// public System.Void .ctor()
// Offset: 0x191F258
// Implemented from: VROSC.BaseDataModel
// Base method: System.Void BaseDataModel::.ctor()
template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary>
static UserProfileDataModel* New_ctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::UserProfileDataModel::.ctor");
return THROW_UNLESS((::il2cpp_utils::New<UserProfileDataModel*, creationType>()));
}
}; // VROSC.UserProfileDataModel
#pragma pack(pop)
static check_size<sizeof(UserProfileDataModel), 88 + sizeof(::StringW)> __VROSC_UserProfileDataModelSizeCheck;
static_assert(sizeof(UserProfileDataModel) == 0x60);
}
#include "beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp"
// Writing MetadataGetter for method: VROSC::UserProfileDataModel::get_Key
// Il2CppName: get_Key
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::StringW (VROSC::UserProfileDataModel::*)()>(&VROSC::UserProfileDataModel::get_Key)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(VROSC::UserProfileDataModel*), "get_Key", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: VROSC::UserProfileDataModel::get_Version
// Il2CppName: get_Version
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<int (VROSC::UserProfileDataModel::*)()>(&VROSC::UserProfileDataModel::get_Version)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(VROSC::UserProfileDataModel*), "get_Version", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: VROSC::UserProfileDataModel::New_ctor
// Il2CppName: .ctor
// Cannot get method pointer of value based method overload from template for constructor!
// Try using FindMethod instead!
| 42.940397
| 157
| 0.704812
|
v0idp
|
07e60c98d31fb4840a4cd99c762a74178cab115d
| 715
|
cpp
|
C++
|
0000/10/11a.cpp
|
actium/cf
|
d7be128c3a9adb014a231a399f1c5f19e1ab2a38
|
[
"Unlicense"
] | 1
|
2020-07-03T15:55:52.000Z
|
2020-07-03T15:55:52.000Z
|
0000/10/11a.cpp
|
actium/cf
|
d7be128c3a9adb014a231a399f1c5f19e1ab2a38
|
[
"Unlicense"
] | null | null | null |
0000/10/11a.cpp
|
actium/cf
|
d7be128c3a9adb014a231a399f1c5f19e1ab2a38
|
[
"Unlicense"
] | 3
|
2020-10-01T14:55:28.000Z
|
2021-07-11T11:33:58.000Z
|
#include <iostream>
#include <vector>
template <typename T>
std::istream& operator >>(std::istream& input, std::vector<T>& v)
{
for (T& a : v)
input >> a;
return input;
}
void answer(unsigned v)
{
std::cout << v << '\n';
}
void solve(std::vector<unsigned>& b, unsigned d)
{
const size_t n = b.size();
unsigned k = 0;
for (size_t i = 1; i < n; ++i) {
if (b[i] > b[i-1])
continue;
const unsigned c = (b[i-1] - b[i] + d) / d;
b[i] += c * d, k += c;
}
answer(k);
}
int main()
{
size_t n;
std::cin >> n;
unsigned d;
std::cin >> d;
std::vector<unsigned> b(n);
std::cin >> b;
solve(b, d);
return 0;
}
| 14.3
| 65
| 0.47972
|
actium
|
07f052996f4c016b69bd7c19e72bd286f6c73143
| 945
|
cpp
|
C++
|
.LHP/He10/T.Hung/1160/1160/1160.cpp
|
sxweetlollipop2912/MaCode
|
661d77a2096e4d772fda2b6a7f80c84113b2cde9
|
[
"MIT"
] | null | null | null |
.LHP/He10/T.Hung/1160/1160/1160.cpp
|
sxweetlollipop2912/MaCode
|
661d77a2096e4d772fda2b6a7f80c84113b2cde9
|
[
"MIT"
] | null | null | null |
.LHP/He10/T.Hung/1160/1160/1160.cpp
|
sxweetlollipop2912/MaCode
|
661d77a2096e4d772fda2b6a7f80c84113b2cde9
|
[
"MIT"
] | null | null | null |
// AC UVa
#include "pch.h"
#include <iostream>
#include <algorithm>
#define maxN 100002
#define maxM 10000000001
#define root first
#define rank second
#define fin -1
typedef int maxn;
typedef long long maxm;
typedef std::pair <maxn, maxn> info_t;
info_t info[maxN];
maxm res;
void Init() {
res = 0;
for (maxn i = 0; i < maxN - 1; i++) {
info[i].root = i;
info[i].rank = 0;
}
}
maxn Root(maxn x) {
while (x != info[x].root) x = info[x].root;
return x;
}
void Union(maxn x, maxn y) {
x = Root(x); y = Root(y);
if (x == y) {
++res;
return;
}
if (info[x].rank < info[y].rank)
info[x].root = y;
else {
info[y].root = x;
if (info[y].rank == info[x].rank) ++info[x].rank;
}
}
int main() {
std::ios_base::sync_with_stdio(0);
std::cin.tie(0);
Init();
maxn a, b;
while (std::cin >> a) {
if (a == fin) {
std::cout << res << '\n';
Init();
}
else {
std::cin >> b;
a; b;
Union(a, b);
}
}
}
| 13.695652
| 51
| 0.554497
|
sxweetlollipop2912
|
07f05685c2e0b0de37a0a77ffddfc75c3aaeb12d
| 2,877
|
hpp
|
C++
|
modules/core/adjacent/include/nt2/core/functions/expr/adjfun.hpp
|
psiha/nt2
|
5e829807f6b57b339ca1be918a6b60a2507c54d0
|
[
"BSL-1.0"
] | 34
|
2017-05-19T18:10:17.000Z
|
2022-01-04T02:18:13.000Z
|
modules/core/adjacent/include/nt2/core/functions/expr/adjfun.hpp
|
psiha/nt2
|
5e829807f6b57b339ca1be918a6b60a2507c54d0
|
[
"BSL-1.0"
] | null | null | null |
modules/core/adjacent/include/nt2/core/functions/expr/adjfun.hpp
|
psiha/nt2
|
5e829807f6b57b339ca1be918a6b60a2507c54d0
|
[
"BSL-1.0"
] | 7
|
2017-12-02T12:59:17.000Z
|
2021-07-31T12:46:14.000Z
|
//==============================================================================
// Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2012 LRI UMR 8623 CNRS/Univ Paris Sud XI
// Copyright 2011 - 2012 MetaScale SAS
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//==============================================================================
#ifndef NT2_CORE_FUNCTIONS_EXPR_ADJFUN_HPP_INCLUDED
#define NT2_CORE_FUNCTIONS_EXPR_ADJFUN_HPP_INCLUDED
#include <nt2/core/functions/adjfun.hpp>
#include <nt2/include/functions/firstnonsingleton.hpp>
namespace nt2 { namespace ext
{
/// INTERNAL ONLY
BOOST_DISPATCH_IMPLEMENT ( adjfun_, tag::cpu_
, (Functor)(A0)
, (unspecified_<Functor>)
((ast_<A0, nt2::container::domain>))
)
{
typedef typename boost::proto::
result_of::make_expr< nt2::tag::adjfun_
, container::domain
, A0 const&
, std::size_t
, Functor
>::type result_type;
BOOST_FORCEINLINE
result_type operator()(Functor const& f, A0 const& a0) const
{
std::size_t along = nt2::firstnonsingleton(a0) - 1u;
return boost::proto::make_expr< nt2::tag::adjfun_
, container::domain
>( boost::cref(a0), along, f );
}
};
/// INTERNAL ONLY
BOOST_DISPATCH_IMPLEMENT ( adjfun_, tag::cpu_
, (Functor)(A0)(Along)
, (unspecified_<Functor>)
((ast_<A0, nt2::container::domain>))
(scalar_<integer_<Along> >)
)
{
typedef typename boost::proto::
result_of::make_expr< nt2::tag::adjfun_
, container::domain
, A0 const&
, std::size_t
, Functor
>::type result_type;
BOOST_FORCEINLINE
result_type operator()(Functor const& f, A0 const& a0, Along const& d) const
{
std::size_t along = d-1;
return boost::proto::make_expr< nt2::tag::adjfun_
, container::domain
>( boost::cref(a0), along, f );
}
};
} }
#endif
| 40.521127
| 80
| 0.423705
|
psiha
|
07f2bf2d0d9337d16ebe4be5060ea980ee525b14
| 5,616
|
cpp
|
C++
|
tests/src/map/map_tests_observers.cpp
|
matboivin/ft_containers
|
9653552ba3b8eaf215ea37315942c00aeafbf352
|
[
"WTFPL"
] | null | null | null |
tests/src/map/map_tests_observers.cpp
|
matboivin/ft_containers
|
9653552ba3b8eaf215ea37315942c00aeafbf352
|
[
"WTFPL"
] | null | null | null |
tests/src/map/map_tests_observers.cpp
|
matboivin/ft_containers
|
9653552ba3b8eaf215ea37315942c00aeafbf352
|
[
"WTFPL"
] | null | null | null |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* map_tests_observers.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mboivin <mboivin@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/24 17:11:14 by mboivin #+# #+# */
/* Updated: 2022/01/24 18:27:13 by mboivin ### ########.fr */
/* */
/* ************************************************************************** */
#include <iomanip>
#include <iostream>
#include "utility.hpp"
#include "tests.hpp"
#include "map_tests.hpp"
#if defined(TEST_FT)
namespace ft
#else
namespace std
#endif
{
typedef map<std::string,int,size_compare<std::string> > s_int_map;
void test_map_key_comp(void)
{
std::cout << "TEST: Non-member key_comp() \n\n";
explain_test("Returns a copy of the comparison object used by the container"
"to compare keys.");
// create map
int_s_map m1;
int_s_map expected1;
// get key comparison object
int_s_map::key_compare less_comp = m1.key_comp();
std::cout << "map<int, std::string>\n\n";
// insert elements
m1.insert(make_pair(200, "foo"));
m1.insert(make_pair(100, "qwerty"));
m1.insert(make_pair(100, "qwerty"));
m1.insert(make_pair(400, "42"));
m1.insert(make_pair(300, "bar"));
m1.insert(make_pair(300, "bar"));
m1.insert(make_pair(100, "qwerty"));
m1.insert(make_pair(100, "qwerty"));
// expected result
expected1.insert(make_pair(100, "qwerty"));
expected1.insert(make_pair(200, "foo"));
expected1.insert(make_pair(300, "bar"));
expected1.insert(make_pair(400, "42"));
int highest1 = m1.rbegin()->first;
int_s_map::iterator it1 = m1.begin();
do
{
std::cout << it1->first << " => " << it1->second << '\n';
} while (less_comp((*it1++).first, highest1));
std::cout << '\n';
// assert map meets expected result
assert(m1 == expected1);
// create map
s_int_map m2;
s_int_map expected2;
// get key comparison object
s_int_map::key_compare strlen_comp = m2.key_comp();
std::cout << "map<std::string, int>\n\n";
// insert elements
m2.insert(make_pair("foo", 200));
m2.insert(make_pair("qwerty", 100));
m2.insert(make_pair("qwerty", 100));
m2.insert(make_pair("qwerty", 100));
m2.insert(make_pair("qwerty", 100));
m2.insert(make_pair("foo", 200));
m2.insert(make_pair("foo", 200));
m2.insert(make_pair("bar", 300));
m2.insert(make_pair("42", 400));
m2.insert(make_pair("bar", 300));
m2.insert(make_pair("bar", 300));
m2.insert(make_pair("bar", 300));
// expected result
expected2.insert(make_pair("42", 400));
expected2.insert(make_pair("foo", 200));
expected2.insert(make_pair("qwerty", 100));
std::string highest2 = m2.rbegin()->first;
s_int_map::iterator it2 = m2.begin();
do
{
std::cout << it2->first << " => " << it2->second << '\n';
} while (strlen_comp((*it2++).first, highest2));
std::cout << '\n';
// assert map meets expected result
assert(m2 == expected2);
}
void test_map_value_comp(void)
{
std::cout << "TEST: Non-member value_comp() \n\n";
explain_test("Returns a copy of the comparison object used by the container"
"to compare elements.");
// create map
int_s_map m1;
int_s_map expected1;
std::cout << "map<int, std::string>\n\n";
// insert elements
m1.insert(make_pair(200, "foo"));
m1.insert(make_pair(100, "qwerty"));
m1.insert(make_pair(100, "qwerty"));
m1.insert(make_pair(400, "42"));
m1.insert(make_pair(300, "bar"));
m1.insert(make_pair(300, "bar"));
m1.insert(make_pair(100, "qwerty"));
m1.insert(make_pair(100, "qwerty"));
// expected result
expected1.insert(make_pair(100, "qwerty"));
expected1.insert(make_pair(200, "foo"));
expected1.insert(make_pair(300, "bar"));
expected1.insert(make_pair(400, "42"));
pair<int,std::string> highest1 = *m1.rbegin();
int_s_map::iterator it1 = m1.begin();
do
{
std::cout << it1->first << " => " << it1->second << '\n';
} while (m1.value_comp()(*it1++, highest1));
std::cout << '\n';
// assert map meets expected result
assert(m1 == expected1);
// create map
s_int_map m2;
s_int_map expected2;
std::cout << "map<std::string, int>\n\n";
// insert elements
m2.insert(make_pair("foo", 200));
m2.insert(make_pair("qwerty", 100));
m2.insert(make_pair("qwerty", 100));
m2.insert(make_pair("qwerty", 100));
m2.insert(make_pair("qwerty", 100));
m2.insert(make_pair("foo", 200));
m2.insert(make_pair("foo", 200));
m2.insert(make_pair("bar", 300));
m2.insert(make_pair("42", 400));
m2.insert(make_pair("bar", 300));
m2.insert(make_pair("bar", 300));
m2.insert(make_pair("bar", 300));
// expected result
expected2.insert(make_pair("42", 400));
expected2.insert(make_pair("foo", 200));
expected2.insert(make_pair("qwerty", 100));
pair<std::string,int> highest2 = *m2.rbegin();
s_int_map::iterator it2 = m2.begin();
do
{
std::cout << it2->first << " => " << it2->second << '\n';
} while (m2.value_comp()(*it2++, highest2));
std::cout << '\n';
// assert map meets expected result
assert(m2 == expected2);
}
}
| 29.714286
| 80
| 0.552172
|
matboivin
|
07f455643b86280405bd8ad44d5413901f820d16
| 690
|
cpp
|
C++
|
Source/Contrib/Libctiny/printf.cpp
|
Skight/wndspy
|
b89cc2df88ca3e58b26be491814008aaf6f11122
|
[
"Apache-2.0"
] | 24
|
2017-03-16T05:32:44.000Z
|
2021-12-11T13:49:07.000Z
|
Source/Contrib/Libctiny/printf.cpp
|
zhen-e-liu/wndspy
|
b89cc2df88ca3e58b26be491814008aaf6f11122
|
[
"Apache-2.0"
] | null | null | null |
Source/Contrib/Libctiny/printf.cpp
|
zhen-e-liu/wndspy
|
b89cc2df88ca3e58b26be491814008aaf6f11122
|
[
"Apache-2.0"
] | 13
|
2017-03-16T05:26:12.000Z
|
2021-07-04T16:24:42.000Z
|
//==========================================
// LIBCTINY - Matt Pietrek 2001
// MSDN Magazine, January 2001
//==========================================
#include <windows.h>
#include <stdio.h>
#include <stdarg.h>
// Force the linker to include USER32.LIB
#pragma comment(linker, "/defaultlib:user32.lib")
extern "C" int __cdecl printf(const char * format, ...)
{
char szBuff[1024];
int retValue;
DWORD cbWritten;
va_list argptr;
va_start( argptr, format );
retValue = wvsprintf( szBuff, format, argptr );
va_end( argptr );
WriteFile( GetStdHandle(STD_OUTPUT_HANDLE), szBuff, retValue,
&cbWritten, 0 );
return retValue;
}
| 23.793103
| 66
| 0.566667
|
Skight
|
07f506ae8a9eb021c51c373cda86f5a3eba4fde8
| 4,569
|
hpp
|
C++
|
SamSrc/sam/VertexConstraintChecker.hpp
|
dirkcgrunwald/SAM
|
0478925c506ad38fd405954cc4415a3e96e77d90
|
[
"MIT"
] | 6
|
2019-08-16T07:13:17.000Z
|
2021-06-08T21:15:52.000Z
|
SamSrc/sam/VertexConstraintChecker.hpp
|
dirkcgrunwald/SAM
|
0478925c506ad38fd405954cc4415a3e96e77d90
|
[
"MIT"
] | 1
|
2020-05-30T20:35:18.000Z
|
2020-05-30T20:35:18.000Z
|
SamSrc/sam/VertexConstraintChecker.hpp
|
dirkcgrunwald/SAM
|
0478925c506ad38fd405954cc4415a3e96e77d90
|
[
"MIT"
] | 3
|
2020-02-17T18:38:14.000Z
|
2021-03-28T02:47:57.000Z
|
#ifndef SAM_VERTEX_CONSTRAINT_CHECKER_HPP
#define SAM_VERTEX_CONSTRAINT_CHECKER_HPP
#include <sam/FeatureMap.hpp>
#include <sam/Util.hpp>
#include <sam/EdgeDescription.hpp>
namespace sam {
class VertexConstraintCheckerException : public std::runtime_error {
public:
VertexConstraintCheckerException(char const * message) :
std::runtime_error(message) { }
VertexConstraintCheckerException(std::string message) :
std::runtime_error(message) { }
};
/**
* A class that has the logic to check vertex constraints.
* Vertex constraints are defined within subgraph queries and form
* constraints on individual vertices. The currently supported
* constraints are
*
* in - The vertex is a key in the feature map for a particular feature.
* Example:
* bait in Top100
* This means that the vertex variable bait has a binding that is found
* as a key in the featureMap under feature Top100.
*
* notIn - Similar to "in", but this time the vertex should not be found
* in the feature map for the specified feature.
*
* TODO: other vertex constraints to be defined. The class seems somewhat
* specific to "in" and "notIn", so may be hard to generalize to other
* types of vertex constaints.
*/
template <typename SubgraphQueryType>
class VertexConstraintChecker
{
private:
std::shared_ptr<const FeatureMap> featureMap;
SubgraphQueryType const* subgraphQuery;
public:
/**
* The constructor for the VertexConstraintChecker class. You provide
* 1) featureMap - This is used for the "in" and "notIn" vertex
* constraints. We use the featureMap to see if a vertex is found
* in the featureMap for a given feature.
* 2) The subgraph query itself. The only thing we use the subgraph
* query for is to get the list of vertex constraints.
* TODO: Might be nice to get rid of the reference to the subgraph
* query.
*/
VertexConstraintChecker(std::shared_ptr<const FeatureMap> featureMap,
SubgraphQueryType const* subgraphQuery)
{
this->featureMap = featureMap;
this->subgraphQuery = subgraphQuery;
}
bool check(std::string variable, std::string vertex) const
{
DEBUG_PRINT("VertexConstraintChecker checking variable %s vertex %s\n",
variable.c_str(), vertex.c_str());
// lambda function that checks that the
auto existsVertex = [vertex](Feature const * feature)->bool {
auto topKFeature = static_cast<TopKFeature const *>(feature);
auto keys = topKFeature->getKeys();
auto it = std::find(keys.begin(), keys.end(), vertex);
if (it != keys.end()) {
return true;
}
return false;
};
for (auto constraint : subgraphQuery->getConstraints(variable))
{
std::string featureName = constraint.featureName;
DEBUG_PRINT("VertexConstraintChecker variable %s vertex %s featureName"
" %s\n", variable.c_str(), vertex.c_str(), featureName.c_str());
// If the feature doesn't exist, return false.
if (!featureMap->exists("", featureName)) {
DEBUG_PRINT("VertexConstraintChecker returning false for "
"variable %s and vertex %s becaure featureName %s doesn't exist\n",
variable.c_str(), vertex.c_str(), featureName.c_str());
return false;
}
auto feature = featureMap->at("", featureName);
switch(constraint.op)
{
case VertexOperator::In:
if (!feature->template evaluate<bool>(existsVertex))
{
DEBUG_PRINT("VertexConstraintChecker(In) returning false for "
"variable %s and vertex %s\n", variable.c_str(), vertex.c_str());
return false;
}
break;
case VertexOperator::NotIn:
if (feature->template evaluate<bool>(existsVertex))
{
DEBUG_PRINT("VertexConstraintChecker(NotIn) returning false for"
" variable %s and vertex %s\n", variable.c_str(), vertex.c_str());
return false;
}
break;
default:
throw VertexConstraintCheckerException(
"Unsupported vertex constraint.");
}
}
DEBUG_PRINT("VertexConstraintChecker returning true for variable %s and "
"vertex %s\n", variable.c_str(), vertex.c_str());
return true;
}
/**
*
* \param variable The variable name of the vertex.
* \param vertex The actual value of the vertex.
*/
bool operator()(std::string variable, std::string vertex) const
{
return check(variable, vertex);
}
};
}
#endif
| 33.844444
| 80
| 0.664697
|
dirkcgrunwald
|
07f5430a6b96954a950a8e9861a1f1ed527049e4
| 2,532
|
hpp
|
C++
|
src/spinlock_put.hpp
|
degarashi/revenant
|
9e671320a5c8790f6bdd1b14934f81c37819f7b3
|
[
"MIT"
] | null | null | null |
src/spinlock_put.hpp
|
degarashi/revenant
|
9e671320a5c8790f6bdd1b14934f81c37819f7b3
|
[
"MIT"
] | null | null | null |
src/spinlock_put.hpp
|
degarashi/revenant
|
9e671320a5c8790f6bdd1b14934f81c37819f7b3
|
[
"MIT"
] | null | null | null |
#pragma once
#include "spinlock_detail.hpp"
namespace rev {
//! 一時的なロック解除機能を備えたSpinLock
/*! あるスレッドがロック中でも一旦アンロックし、別のスレッドがロックできるようにする */
template <class T>
class SpinLockPut {
private:
struct InnerP {
SpinLockPut& _s;
bool _bLocked;
InnerP(InnerP&& p) noexcept:
_s(p._s),
_bLocked(p._bLocked)
{
p._bLocked = false;
}
InnerP(SpinLockPut& s):
_s(s)
{
_bLocked = _s._put();
}
~InnerP() noexcept(false) {
if(_bLocked)
_s._put_reset();
}
};
using Inner = detail::SpinInner<SpinLockPut<T>, T, detail::CallUnlock>;
using CInner = detail::SpinInner<SpinLockPut<T>, const T, detail::CallUnlock>;
friend struct detail::CallUnlock;
using ThreadID_OP = spi::Optional<SDL_threadID>;
TLS<int> _tlsCount;
ThreadID_OP _lockID;
int _lockCount;
Mutex _mutex;
T _data;
void _unlock() NOEXCEPT_IF_RELEASE {
D_Assert0(_lockID && *_lockID == *tls_threadID);
D_Assert0(_lockCount >= 1);
if(--_lockCount == 0)
_lockID = spi::none;
_mutex.unlock();
}
template <class I>
I _lock(bool bBlock) {
if(bBlock)
_mutex.lock();
if(bBlock || _mutex.try_lock()) {
if(!_lockID) {
_lockCount = 1;
_lockID = *tls_threadID;
} else {
D_Assert0(*_lockID == *tls_threadID);
++_lockCount;
}
return I(*this, &_data);
}
return I(*this, nullptr);
}
void _put_reset() {
_mutex.lock();
// TLS変数に対比してた回数分、再度MutexのLock関数を呼ぶ
_lockID = *tls_threadID;
_lockCount = _tlsCount.get()-1;
*_tlsCount = -1;
int tmp = _lockCount;
while(--tmp != 0)
_mutex.lock();
}
bool _put() {
// 自スレッドがロックしてたらカウンタを退避して一旦解放
if(_mutex.try_lock()) {
if(_lockCount > 0) {
++_lockCount;
*_tlsCount = _lockCount; // ロックしてた回数をTLS変数に退避
int tmp = _lockCount;
_lockCount = 0;
_lockID = spi::none;
// 今までロックしてた回数分、MutexのUnlock回数を呼ぶ
while(tmp-- != 0)
_mutex.unlock();
return true;
}
_mutex.unlock();
}
return false;
}
public:
SpinLockPut():
_lockCount(0)
{
_tlsCount = -1;
}
Inner lock() {
return _lock<Inner>(true);
}
CInner lockC() const {
return const_cast<SpinLockPut*>(this)->_lock<CInner>(true);
}
Inner try_lock() {
return _lock<Inner>(false);
}
CInner try_lockC() const {
return const_cast<SpinLockPut*>(this)->_lock<CInner>(false);
}
InnerP put() {
return InnerP(*this);
}
};
}
| 21.827586
| 81
| 0.592022
|
degarashi
|
07f6de5e46ad8c3c22e62e40f55d61ff9f523441
| 5,589
|
cpp
|
C++
|
UE4Cleaner/UE4Cleaner.cpp
|
Vaei/ue4cleaner
|
ee49f2f6e71f19f2449963c60ecc750b44df70b6
|
[
"MIT"
] | 6
|
2019-03-01T20:47:13.000Z
|
2021-05-28T12:37:10.000Z
|
UE4Cleaner/UE4Cleaner.cpp
|
Vaei/ue4cleaner
|
ee49f2f6e71f19f2449963c60ecc750b44df70b6
|
[
"MIT"
] | null | null | null |
UE4Cleaner/UE4Cleaner.cpp
|
Vaei/ue4cleaner
|
ee49f2f6e71f19f2449963c60ecc750b44df70b6
|
[
"MIT"
] | 1
|
2021-02-18T08:32:55.000Z
|
2021-02-18T08:32:55.000Z
|
// Copyright (c) 2019 Jared Taylor / Vaei. All Rights Reserved.
// UE4Cleaner.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <windows.h>
#include <filesystem>
using namespace std;
namespace fs = std::filesystem;
bool StringStartsWith(const string& inString, const string& startsWith)
{
return (inString.compare(0, startsWith.length(), startsWith) == 0);
}
bool StringEndsWith(const string& inString, const string& endsWith)
{
return (inString.compare(inString.length() - endsWith.length(), endsWith.length(), endsWith) == 0);
}
void StringRemove(string& inString, const string& delimiter)
{
inString = inString.erase(0, inString.find(delimiter) + delimiter.length());
}
string StringReplaceAll(std::string str, const std::string& from, const std::string& to)
{
size_t start_pos = 0;
while ((start_pos = str.find(from, start_pos)) != std::string::npos)
{
str.replace(start_pos, from.length(), to);
start_pos += to.length(); // Handles case where 'to' is a substring of 'from'
}
return str;
}
wstring s2ws(const string& str)
{
if (str.empty()) return std::wstring();
int size_needed = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), NULL, 0);
std::wstring wstrTo(size_needed, 0);
MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), &wstrTo[0], size_needed);
return wstrTo;
}
string ws2s(const std::wstring& wstr)
{
if (wstr.empty()) return std::string();
int size_needed = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), NULL, 0, NULL, NULL);
std::string strTo(size_needed, 0);
WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), &strTo[0], size_needed, NULL, NULL);
return strTo;
}
int FatalError(const string& errorString, const int errorId)
{
const char *errorChar = errorString.c_str();
cout << "[Fatal] " << errorChar << ". Exiting with error code: " << to_string(errorId) << endl;
return errorId;
}
wstring ReadRegValue(HKEY root, wstring key, wstring name)
{
HKEY hKey;
if (RegOpenKeyEx(root, key.c_str(), 0, KEY_READ, &hKey) != ERROR_SUCCESS)
throw "Could not open registry key";
DWORD type;
DWORD cbData;
if (RegQueryValueEx(hKey, name.c_str(), NULL, &type, NULL, &cbData) != ERROR_SUCCESS)
{
RegCloseKey(hKey);
throw "Could not read registry value";
}
if (type != REG_SZ)
{
RegCloseKey(hKey);
throw "Incorrect registry value type";
}
wstring value(cbData / sizeof(wchar_t), L'\0');
if (RegQueryValueEx(hKey, name.c_str(), NULL, NULL, reinterpret_cast<LPBYTE>(&value[0]), &cbData) != ERROR_SUCCESS)
{
RegCloseKey(hKey);
throw "Could not read registry value";
}
RegCloseKey(hKey);
size_t firstNull = value.find_first_of(L'\0');
if (firstNull != string::npos)
value.resize(firstNull);
return value;
}
/**
* return: number of files or directories deleted
*/
uintmax_t delete_directory(const string& path)
{
fs::path dir = path;
return fs::remove_all(path);
}
int main(int argc, char* argv[])
{
TCHAR pwd[MAX_PATH];
GetCurrentDirectory(MAX_PATH, pwd);
static const wstring regPath = s2ws("Software\\Epic Games\\Unreal Engine\\Builds"); // Path to registry entry used by UE4 when generating project files
fs::path path = pwd;
bool cleanonly = false;
bool plugins = false;
// Check if plugins flag is set or if we want to skip generation
if (argc > 1) // First is application name
{
for (int i = 1; i < argc; i++)
{
if (argv[i] == "/plugins")
{
plugins = true;
}
else if (argv[i] == "/clean")
{
cleanonly = true;
}
}
}
// Validate args
if (path.string().length() == 0)
{
return FatalError("Invalid path", 997);
}
// Check the directory exists
if (fs::exists(path))
{
// Delete the binaries, intermediate, sln in the project root
{
fs::path path_binaries = path.string() + "\\binaries";
fs::path path_intermediate = path.string() + "\\intermediate";
if (fs::exists(path_binaries))
{
fs::remove_all(path_binaries);
}
if (fs::exists(path_intermediate))
{
fs::remove_all(path_intermediate);
}
for (const auto& entry : fs::directory_iterator(path))
{
if (StringEndsWith(entry.path().string(), ".sln"))
{
fs::remove_all(entry.path());
break;
}
}
}
// Delete the binaries and intermediate for each plugin (if set)
if (plugins)
{
fs::path path_plugins = path.string() + "\\plugins";
if (fs::exists(path_plugins))
{
for (const auto& entry : fs::directory_iterator(path_plugins))
{
if(fs::is_directory(entry.path()))
{
fs::path path_binaries = entry.path().string() + "\\binaries";
fs::path path_intermediate = entry.path().string() + "\\intermediate";
if (fs::exists(path_binaries))
{
fs::remove_all(path_binaries);
}
if (fs::exists(path_intermediate))
{
fs::remove_all(path_intermediate);
}
}
}
}
}
}
else
{
return FatalError("path does not exist", 995);
}
// Generate project files...
if (!cleanonly)
{
for (const auto& entry : fs::directory_iterator(path))
{
// Locate the .uproject
if (StringEndsWith(entry.path().string(), ".uproject"))
{
system("setlocal");
wstring regVal2 = ReadRegValue(HKEY_CLASSES_ROOT, s2ws("Unreal.ProjectFile\\shell\\rungenproj"), s2ws("Icon"));
string sysCmd = "\"" + ws2s(regVal2);
sysCmd += " /projectfiles";
sysCmd += " \"" + entry.path().string() + "\"";
sysCmd += "\"";
system(sysCmd.c_str());
}
}
}
}
| 25.289593
| 153
| 0.658078
|
Vaei
|
07fa8bf96c8e7a17d0afc8adf538f6421f13d545
| 1,933
|
cpp
|
C++
|
AdenitaCoreSE/source/ADNMixins.cpp
|
edellano/Adenita-SAMSON-Edition-Win-
|
6df8d21572ef40fe3fc49165dfaa1d4318352a69
|
[
"BSD-3-Clause"
] | 2
|
2020-09-07T20:48:43.000Z
|
2021-09-03T05:49:59.000Z
|
AdenitaCoreSE/source/ADNMixins.cpp
|
edellano/Adenita-SAMSON-Edition-Linux
|
a7e267e5dd37e0073f4d1e3e603c5fb1c69a350a
|
[
"BSD-3-Clause"
] | 6
|
2020-04-05T18:39:28.000Z
|
2022-01-11T14:28:55.000Z
|
AdenitaCoreSE/source/ADNMixins.cpp
|
edellano/Adenita-SAMSON-Edition-Linux
|
a7e267e5dd37e0073f4d1e3e603c5fb1c69a350a
|
[
"BSD-3-Clause"
] | 2
|
2021-07-13T12:58:13.000Z
|
2022-01-11T13:52:00.000Z
|
#include "ADNMixins.hpp"
Nameable::Nameable(const Nameable & other)
{
*this = other;
}
Nameable & Nameable::operator=(const Nameable & other)
{
if (&other == this) {
return *this;
}
SetName(other.GetName());
return *this;
}
void Nameable::SetName(std::string name)
{
name_ = name;
}
std::string Nameable::GetName() const
{
return name_;
}
Positionable::Positionable(const Positionable & other)
{
*this = other;
}
Positionable & Positionable::operator=(const Positionable & other)
{
if (&other == this) {
return *this;
}
SetPosition(other.GetPosition());
return *this;
}
void Positionable::SetPosition(ublas::vector<double> pos)
{
position_ = pos;
}
ublas::vector<double> Positionable::GetPosition() const
{
return position_;
}
Identifiable::Identifiable(const Identifiable & other)
{
*this = other;
}
Identifiable & Identifiable::operator=(const Identifiable & other)
{
if (&other == this) {
return *this;
}
SetId(other.GetId());
return *this;
}
void Identifiable::SetId(int id)
{
id_ = id;
}
int Identifiable::GetId() const
{
return id_;
}
Orientable::Orientable()
{
e1_ = ublas::vector<double>(3, 0.0);
e2_ = ublas::vector<double>(3, 0.0);
e3_ = ublas::vector<double>(3, 0.0);
}
Orientable::Orientable(const Orientable & other)
{
*this = other;
}
Orientable & Orientable::operator=(const Orientable & other)
{
if (&other == this) {
return *this;
}
SetE1(other.GetE1());
SetE2(other.GetE2());
SetE3(other.GetE3());
return *this;
}
void Orientable::SetE1(ublas::vector<double> e1)
{
e1_ = e1;
}
void Orientable::SetE2(ublas::vector<double> e2)
{
e2_ = e2;
}
void Orientable::SetE3(ublas::vector<double> e3)
{
e3_ = e3;
}
ublas::vector<double> Orientable::GetE1() const
{
return e1_;
}
ublas::vector<double> Orientable::GetE2() const
{
return e2_;
}
ublas::vector<double> Orientable::GetE3() const
{
return e3_;
}
| 14.318519
| 66
| 0.65701
|
edellano
|
5804ce8b05c4fe8086a3c4f7d09e5810ef183624
| 2,271
|
cpp
|
C++
|
201512/3.cpp
|
qzylalala/CSP
|
8bd474b0cb70b90c41e3fb87452724c5a2bc14fa
|
[
"Apache-2.0"
] | 23
|
2021-03-01T07:07:48.000Z
|
2022-03-19T12:49:14.000Z
|
201512/3.cpp
|
qzylalala/CSP
|
8bd474b0cb70b90c41e3fb87452724c5a2bc14fa
|
[
"Apache-2.0"
] | null | null | null |
201512/3.cpp
|
qzylalala/CSP
|
8bd474b0cb70b90c41e3fb87452724c5a2bc14fa
|
[
"Apache-2.0"
] | 2
|
2021-08-30T09:35:17.000Z
|
2021-09-10T12:26:13.000Z
|
#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#define x first
#define y second
using namespace std;
typedef pair<int, int> pii;
const int N = 110;
bool visited[N][N];
char g[N][N];
int st[N][N];
int m, n, q;
// st 0 : '.' 1 : '-' 2 : '|' 3 : '+'
void op0(int x1, int y1, int x2, int y2) {
if (y1 == y2) {
int x_min = min(x1, x2), x_max = max(x1, x2);
for (int i = x_min; i <= x_max; i++) {
if (st[i][y1] == 0) st[i][y1] = 2;
else if (st[i][y1] == 1) st[i][y1] = 3;
else continue;
}
}
else {
int y_min = min(y1, y2), y_max = max(y1, y2);
for (int i = y_min; i <= y_max; i++) {
if (st[x1][i] == 0) st[x1][i] = 1;
else if (st[x1][i] == 2) st[x1][i] = 3;
else continue;
}
}
}
void op1(int sx, int sy, char ch) {
int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};
memset(visited, false, sizeof visited);
queue<pii> q;
q.push({sx, sy});
visited[sx][sy] = true;
while(q.size()) {
pii p = q.front();
q.pop();
int x = p.x, y = p.y;
g[x][y] = ch;
for (int i = 0; i < 4; i++) {
int a = x + dx[i], b = y + dy[i];
if (a < 0 || a >= n || b < 0 || b >= m || visited[a][b]) continue;
if (st[a][b] != 0) continue;
q.push({a, b});
visited[a][b] = true;
}
}
}
int main() {
cin >> m >> n >> q;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
g[i][j] = '.';
}
}
while(q --) {
int op;
cin >> op;
if (op == 0) {
int x1, x2, y1, y2;
cin >> x1 >> y1 >> x2 >> y2;
op0(n - 1 - y1, x1, n - 1 - y2, x2);
}
else {
int x, y;
char ch;
cin >> x >> y >> ch;
op1(n - 1 - y, x, ch);
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (st[i][j] == 1) g[i][j] = '-';
if (st[i][j] == 2) g[i][j] = '|';
if (st[i][j] == 3) g[i][j] = '+';
cout << g[i][j];
}
cout << endl;
}
return 0;
}
| 22.048544
| 78
| 0.359313
|
qzylalala
|
5805aa0d94e61eb592d413180b2403d51b90a449
| 3,085
|
hpp
|
C++
|
external/boost_1_60_0/qsboost/preprocessor/repetition/enum_shifted_binary_params.hpp
|
wouterboomsma/quickstep
|
a33447562eca1350c626883f21c68125bd9f776c
|
[
"MIT"
] | 1
|
2019-06-27T17:54:13.000Z
|
2019-06-27T17:54:13.000Z
|
external/boost_1_60_0/qsboost/preprocessor/repetition/enum_shifted_binary_params.hpp
|
wouterboomsma/quickstep
|
a33447562eca1350c626883f21c68125bd9f776c
|
[
"MIT"
] | null | null | null |
external/boost_1_60_0/qsboost/preprocessor/repetition/enum_shifted_binary_params.hpp
|
wouterboomsma/quickstep
|
a33447562eca1350c626883f21c68125bd9f776c
|
[
"MIT"
] | null | null | null |
# /* **************************************************************************
# * *
# * (C) Copyright Paul Mensonides 2005. *
# * Distributed under the Boost Software License, Version 1.0. (See *
# * accompanying file LICENSE_1_0.txt or copy at *
# * http://www.boost.org/LICENSE_1_0.txt) *
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef QSBOOST_PREPROCESSOR_REPETITION_ENUM_SHIFTED_BINARY_PARAMS_HPP
# define QSBOOST_PREPROCESSOR_REPETITION_ENUM_SHIFTED_BINARY_PARAMS_HPP
#
# include <qsboost/preprocessor/arithmetic/dec.hpp>
# include <qsboost/preprocessor/arithmetic/inc.hpp>
# include <qsboost/preprocessor/cat.hpp>
# include <qsboost/preprocessor/config/config.hpp>
# include <qsboost/preprocessor/punctuation/comma_if.hpp>
# include <qsboost/preprocessor/repetition/repeat.hpp>
# include <qsboost/preprocessor/tuple/elem.hpp>
# include <qsboost/preprocessor/tuple/rem.hpp>
#
# /* BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS */
#
# if ~QSBOOST_PP_CONFIG_FLAGS() & QSBOOST_PP_CONFIG_EDG()
# define QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(count, p1, p2) QSBOOST_PP_REPEAT(QSBOOST_PP_DEC(count), QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M, (p1, p2))
# else
# define QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(count, p1, p2) QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_I(count, p1, p2)
# define QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_I(count, p1, p2) QSBOOST_PP_REPEAT(QSBOOST_PP_DEC(count), QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M, (p1, p2))
# endif
#
# if QSBOOST_PP_CONFIG_FLAGS() & QSBOOST_PP_CONFIG_STRICT()
# define QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M(z, n, pp) QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_IM(z, n, QSBOOST_PP_TUPLE_REM_2 pp)
# define QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_IM(z, n, im) QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_I(z, n, im)
# else
# define QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M(z, n, pp) QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_I(z, n, QSBOOST_PP_TUPLE_ELEM(2, 0, pp), QSBOOST_PP_TUPLE_ELEM(2, 1, pp))
# endif
#
# define QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_I(z, n, p1, p2) QSBOOST_PP_COMMA_IF(n) QSBOOST_PP_CAT(p1, QSBOOST_PP_INC(n)) QSBOOST_PP_CAT(p2, QSBOOST_PP_INC(n))
#
# /* BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z */
#
# if ~QSBOOST_PP_CONFIG_FLAGS() & QSBOOST_PP_CONFIG_EDG()
# define QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z(z, count, p1, p2) QSBOOST_PP_REPEAT_ ## z(QSBOOST_PP_DEC(count), QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M, (p1, p2))
# else
# define QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z(z, count, p1, p2) QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z_I(z, count, p1, p2)
# define QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z_I(z, count, p1, p2) QSBOOST_PP_REPEAT_ ## z(QSBOOST_PP_DEC(count), QSBOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M, (p1, p2))
# endif
#
# endif
| 59.326923
| 175
| 0.688817
|
wouterboomsma
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.