Questions tagged [instantiation]

Instantiation is the process of creating objects from a class in most object oriented and object based languages. In the C++ language, instantiation is the process of creating a class or function from a class template or function template.

2609 questions
0
votes
1 answer

VBA Excel Interface implementation and inheritance issues

My task is a little complicated, first I show you the problem, then what I tried and where i get lost. So let's assume I have three worksheets (A, B, C). These sheets have a table. The table has titles with similar and different names. Also the…
HowToTellAChild
  • 623
  • 1
  • 9
  • 21
0
votes
1 answer

Unable to access GridView from inside controller class?

I'm having a problem trying to access the properties and methods on an instance from my GridView class from inside my controller. I'm sure it's a quick fix but I've been at it for a while and can't seem to figure it out. Any help is…
Kyle Lambert
  • 369
  • 2
  • 13
0
votes
3 answers

Why make an instance of a class before using it?

Original question I've seen pretty much in all examples people first making an instance of a class: ss = StandardScaler() and only after that use the methods from the instance: ss.fit_transform(df), rather than calling the method on the class…
Mikko Haavisto
  • 991
  • 7
  • 10
0
votes
1 answer

Create a copy of a child gameObject and have it still exist when the parent is deleted

I have implemented an instantiation spawn system into my endless runner game. I want to have a gameObject inside a parent gameOject to follow the player as far as it needs to and not disappear when the parent gameobject is called back in the…
Ramesh Madara
  • 11
  • 1
  • 5
0
votes
2 answers

How to pass LocalDate type as parameter via scanner?

I would like to instantiate an object of another class via scanner, but one of the parameters I need to pass is a LocalDate type. This is why I created a method in my main class in order to ask the user for a String input in a given order (for…
0
votes
1 answer

How to modify OpenStruct in the instantiated class

I have the following code where I instantiate an object that returns an OpenStruct result. require 'ostruct' class TestModel attr_accessor :result def initializer end def result OpenStruct.new(successful?: false) end def…
anna
  • 65
  • 6
0
votes
1 answer

Why does the Python's inheritance mechanism allow me to define classes that do not get properly instantiated?

I'm sorry for the rather vague formulation of the question. I'll try to clarify what I mean through a simple example below. I have a class I want to use as a base for other classes: class parent: def __init__(self, constant): …
Pythonist
  • 1,937
  • 1
  • 14
  • 25
0
votes
1 answer

How can I create a Class in Python3 using OOP to load and read data from an Excel file?

I am trying to create a Class called 'Settings' that can load an excel file, and create a dictionary called 'data' that returns the data from the individual sheets ('the key') of my excel file as a dataframe (the 'value'). I have laid out my…
0
votes
0 answers

How to call methods from other class without instantiating the class that contains the methods

i am using a third party library to create software for a java controlled PLC. the 3th party library requires you to define all needed Inputs and outputs etc. Then you click generate and it will generate a massive load of getters/setters and…
mittens13
  • 17
  • 7
0
votes
1 answer

How to create a new object instance of class being the same type of another instance by only knowing it as base class type?

How to dynamic down casting in C#? I have these classes as follows: public class Base { } public class A : Base { public string name; } public class B : Base { public string name; } public class C : Base { public string name; } I…
2nan
  • 11
  • 5
0
votes
1 answer

Coroutine not working from inside an instantiated object

I'm creating some lines of many diffent rectangles. Both lines and rectangles are created by code. I do some logic with the rectangle's vertices and update that information in my instantiated rectangles. This works really well. Then on each…
hard
  • 23
  • 3
0
votes
2 answers

error LNK2019: unresolved external symbol "public: __thiscall RNG::RNG(unsigned __int64)" (??0RNG@@QAE@_K@Z) referenced in function _main

I'm getting the above error when I build the files below, using cl.exe in VSCode. I've been staring at this code for a full day and can't see the error. I've tried a bunch of things, some irrational, to no avail. When attempting to build it I get…
0
votes
3 answers

How does one use python's __import__() and getattr() to correctly to instantiate nested classes?

I have the following code in module xyz: Class Outer: Class Nested: pass I can successfully instantiate Outer objects as follows module = __import__("xyz", fromlist=['']) the_class = getattr(module, "Outer") instance =…
OldSchool
  • 459
  • 1
  • 3
  • 14
0
votes
1 answer

Cannot spin instance more than 2gb memory in openstack packstack

I deployed openstack packstack (all-in-one) in centos7 server with 8vcpu and 16gb memory. Deployment of packstack openstack successful completed. I can spin instances with flavor with 2gb or less but when use 4g or 6g ith will return fail…
chenoi
  • 575
  • 3
  • 8
  • 30
0
votes
1 answer

Why is the size of a template 1 Byte in C++?

With using, an alias for a type can be defined and a unit of this type has the same size like an original instantation (1). A template however only weights 1 byte (2). using aliasOfInt = int; template struct intWrapper { using…
TMOTTM
  • 3,286
  • 6
  • 32
  • 63
1 2 3
99
100