Category "c++"

Qt Window incorrect size until user event

I'm creating a screen where users can add certain tiles to use in an editor, but when adding a tile the window does not correctly resize to fit the content. Exc

Reading stack pop/push operations by text-file input

I have a text file with the following contents: 2 S 8 push 2 push 3 push 5 push 7 pop print push 6 print S 4 pop print push 1 print An assignment gives: The f

Problems with cout and a specific string length arithmatic operation c++

This is my first attempt at LCS. The problem I have is with the last portion. When the two input strings are 'mango' and 'man', it seems that cout keeps messing

OpenGL two rotations on one model

I have loaded a model of a coin, and I want it to constantly rotate around its axis: model = glm::rotate(model, (float)glfwGetTime(), glm::vec3(0, 1, 0)); But

Concise RAII for Trompeloeil mocks

I have classes like this: /* "Things" can be "zarked", but only when opened, and they must be closed afterwards */ class ThingInterface { public: // Open the

Compilation error C2048 while compiling in visual studio 2019 MSVC, but works fine with clang++?

I tried to compile the following sample code with clang compiler and it works fine. Compiler Details: Apple clang version 12.0.0 (clang-1200.0.32.28) Target: x

Implementation of scipy.signla.filtfilt in c++? [closed]

I am trying to implement scipy.signal.filtfilt function in c++ and I am wondering if there is already an implementation available of this?

Lvalue-to-rvalue conversion for class types: is there copying involved?

(I asked this question before but didn't give a viable example so I deleted previous one. I hope on this one I got the example right.) Case: #include <iostre

Pure OpenGL on Windows? [duplicate]

I want to use OpenGL without GLFW, the docs say that I need to add opengl32.lib to linker dependencies. How do I specifically import OpenGL an

What is the meaning of Google Benchmark Iteration?

I am working with Google Benchmark to measure the execution time of some code. For example, I wrote the following code to measure its execution time performance

Find place that causes segmentation fault without IDE

I'm studying one project in C++. It's quite big, build is created with cmake. After installing all dependencies and libs it's the build is done fine. But when I

Performing matrix-operations (e.g. product and inverse) over GF(2^6) in C++

I want to implement some matrix operations such as product and inverse computation over a Galois Field GF(64) in C++ language. I have normally used Eigen libra

Embedding Python in DLL: Access violation reading location when Py_DECREF list object

I am trying to embed Python into an an XLL to allow Python functions to be called within Excel. An XLL is a DLL that also includes at a minimum 2 functions that

C++ Read txt and put each line into Dynamic Array

I am trying to read input.txt file, and trying to put each line into the array as string (later on I will use each element of array in initializing obj that's w

CMake 'undefined reference' error with CERN-ROOT

I'm writing a small addition to CERN ROOT and now can't get rid of 'undefined reference' errors on every function from ROOT that I use (and my classes too). Can

generating all permuated products from a map is not working

My code: #include <bits/stdc++.h> using namespace std; using ll = long long; vector<ll> generate_all(map<ll, int> mp, int keys

Tensorflow Op: how to include libtensorflow_framework.so?

I followed the instructions of this tutorial: https://www.tensorflow.org/extend/adding_an_op#implement_the_gradient_in_python. There is this comment provided: g

FetchContent vs ExternalProject

I am building a project with Cmake and use FetchContent to manage dependencies. For several reasons I cannot depend on system-wide installed packages, so this p

Parsing JSON messages in C++

I am writing an embedded C++ MQTT application which subscribes to topics and receives messages every few seconds. I need to parse the received String message an

Passing unsigned int input attribute to vertex shader

In a typical building of a vertex-array-buffer, I am trying to pass an unsigned int attribute along side other classical ones (vertex, normal, texture coordinat