Category "class"

How to make a tuple give a random new tuple?

I am trying to take a position (a,b) and via the code receive a random new position (a,b).. I am having great trouble implementing the code and what I got is by

Append to existing tuple in c++

i am trying to make a thing to store types in list. The best thing is to use a tuple. then to get the type i use tuple_element_t. But the problem is when append

error: type ‘class’ is not a direct base of ‘class’

I haven't been able to find an answer that relates specifically to my question. It's a bit of a "strange" case in terms of what I've seen. So I have a class C

Problem with updating styles in JS for my class

So I have a problem with updating styles in JS for my class. In debug I can see that variables change correctly foreach object as they should, but style changes

enforcement for abstract properties in python3

I have this abstract class class Kuku(ABC): def __init__(self): self.a = 4 @property @abstractmethod def kaka(self): pass

Typescript error: An outer value of 'this' is shadowed by this container

I had an error in a Typescript class method declaration, but I don't understand how the error message relates back to the bug. The message seems to be saying

I started learning DSA ,while writing code for stack DS in c++ , I came across this error

I started learning DSA ,while writing code for stack DS in c++ , I came across this error. So, while I was trying fixing it , I get to know that when I am using

What is the difference between protected and public variable in python

In python, what is the difference between protected and public variable in a class class A: def __init__(self): self._protected="protected"

How to add a property to an existing class programmatically?

I want to add another property public int ID { get; set; } to the class below using C#. I don't know if there is a way beside T4 or partial class. How about Cod

Parts of a structure in C++ [closed]

Here is a code of a structure. On that there is a BSTree function included on the structure. I am stuck because I do not understand how a func

How do I create a scoped class without @include?

I managed to create a scoped CSS class like this: .container { @import "./baa"; /* other props ... */ } but since @import is getting depreciated,

Is field initialization by another field permitted?

I'm trying to do this in my class: class Foo { _errorHappened = new Subject(); errorHappened = this._errorHappened.asObservable(); } I'm using a field'

ReferenceError: can't access lexical declaration `Tag' before initialization

Hi I'm working on a Vanilla JS SPA project, and I wanted to implement some principles from React, but just in plain JavaScript. But there is an issue with impo

method validateAge in class UserValidator cannot be applied to given types; validator.validateAge();

I need some explanation about what have I done wrong and how to do it better. Sometimes it's difficult for me to understand everything. public class UserValidat

AttributeError: 'super' object has no attribute 'word_weighting'

I have a super class FTM: class FTM: def __init__(self,word_weighting = 'normal'): self.word_weighting = word_weighting def get_sparse_glob

Instancing objects with loop and get one dataframe from it

I have defined a class "Scraper" and the method "scraping" contained in it outputs a list with price information ("results"). My objects are several online shop

Maven Fatal error compiling: directory not found: maven-compiler-plugin

I am trying to run the official Java EE 7 Tutorial code examples and get the error. I have read about it here and most of the results say that you have to check

How can I extend a 3rd party Javascript object using typescript

I've been trying to figure out how to do this most of the after noon, and I'm either not getting something, or I'm approaching things wrong. I'm currently worki

Class template with methods already defined

I have two methods inside a class (mask_im and save_im) that I must include in several other classes in separate modules. How can I create a class with those tw

Class template with methods already defined

I have two methods inside a class (mask_im and save_im) that I must include in several other classes in separate modules. How can I create a class with those tw