All Questions
566
questions
0
votes
1
answer
34
views
R Reference Class Add New Variable by Name
Consider the following R code :
MyClass <- setRefClass("MyClass",
fields = list(
),
methods = list(
initialize = function(x){
#give new attribute x
...
2
votes
3
answers
129
views
Pass reference argument to STL container element constructor
Very often in C++ I want an STL container of a type which has a reference member:
struct C {};
struct S
{
S() = default;
S(const C& c) : _c(c)
{}
const C& _c; // I always ...
-2
votes
1
answer
95
views
Why am I getting "Read access violation. _Right_data was 0xFFFFFFFFFFFFFFF7" when calling a function of a parent class?
I have a class (A) that contains a list of objects of another class (B). In creating an object of class A, it makes a list of objects of class B and then calls a function of each of the B objects. ...
0
votes
0
answers
30
views
C# Label maker application question from a novice
My retail company uses a comparatively simple label printer application that has some tables of selections to choose from and how many.
There are two classes in question. One PrintLabels class has a ...
0
votes
3
answers
53
views
how to reference arguments with parameters in a function?
class Score(
val score:Int
){
fun PersonalScore(){
println(score)
}
}
fun comPare(a: Int, b: Int, c: Int): Int{
var max = a
if(max < b) max = b
if(max < c) max = ...
-1
votes
1
answer
50
views
How to iterate through dictionary and set values from a class
I have an empty dictionary (tried both completely empty and with keys from list - same results).
I am then trying to iterate through that same list (in this case rooms in a building), pull some data ...
0
votes
1
answer
54
views
Avoiding Memory Duplication when Storing DataFrame Views as Class Attributes in Python
I'm working with a large Pandas DataFrame and employing a time series cross-validation using a rolling window. During each iteration, I split the DataFrame into three separate datasets based on ...
0
votes
1
answer
41
views
An array of classes where you pass the neighbors (Conways GoL)
i tried to create the 'Conweys game of life'. So at first i create a empty (null) arrays of tile's. Then i set a list for each neightbour tile to commit it on the creating tile on this place of the ...
-3
votes
1
answer
148
views
Can you pass a reference to an object that has not been created yet? [duplicate]
So I'm trying to program a Conway's Game Of Life type game in one dimension. For the cell class, I want to have two references that point to the cell to the right and the cell to the left.
However, I'...
1
vote
1
answer
100
views
Why does "cout << ++Object;" produce an error? (Both << and ++ have been overloaded)
In the code below, both << and ++ operators have been overloaded:
#include <iostream>
using namespace std;
class Test{
public:
int num=0;
Test operator++(){
num++;
...
-2
votes
1
answer
100
views
shared pointer as variable in namespace: make sure there is no unexpected behavior
class A
{
public:
A(const std::shared_ptr<B> params_);
private:
const std::shared_ptr<B> params;
void fun1();
};
A::A(const std::shared_ptr<B> ...
0
votes
0
answers
48
views
question on properly managing reference members in a local class in C++
Is the reason why I got a garbage value because of the following or am I wrong?
the Other object o passed as an argument to the Inner constructor, goes out of scope after the Inner object has been ...
0
votes
1
answer
484
views
Why am I getting → error: no matching function for call to 'Date::Date()'? [duplicate]
I have 2 classes, each holding private variables and initialized in their own respective constructors that use an initializer list.
The instructions for class Date states that:
In the public part of ...
0
votes
1
answer
35
views
How can I reference a class from a string?
There are several related questions but I'm not quite seeing how to apply the answers in my situation.
I'm trying to define as a constant whether to use program A or B.
In a Constants module I set a ...
0
votes
0
answers
59
views
C++ Problem with Pointers in subclass objects
I have a class touchButton in a separate header files below. This is as i need to create an object of Adafruit's RA8875 display in my main file, as i also need it there. Thats no problem, works out ...