An instance is a specific realization of any object.
Questions tagged [instances]
516 questions
-1
votes
2 answers
Access to the methods of the class from which it was instantiated another class
I'm trying to access the methods of the class from which it was instantiated another class, I mean, accessing to the "parent" instance without creating a new instance of it.
class A():
def __init__(self):
...
b_instance = B()…

kmsdev
- 13
- 3
-1
votes
1 answer
Is there any way to create a new Category instance automatically when launching app?
I have a Category model and an Article model. The association is set up so a Category has many articles. A regular user should not be able to create a user.
I was wondering, is there any way in Rails for me to automatically create instances of…

kwngo
- 9
- 1
- 3
-1
votes
1 answer
Can you pass an argument in Python that becomes a class instance?
This may be a simple question but I haven't found the answer to this online anywhere. I want to take an argument or input and use that name to create an instance of a class. Is that possible?
Example:
def make_instance(argument):
# argument =…

user3925300
- 1
- 1
-1
votes
2 answers
Haskell - create instance of class (how to do it right?)
I read the chapter about that topic in "learn you a haskell" and tried to find some hints on different websites - but are still unable to solve the following task.
Im a haskell newbie (6 weeks of "experience") and its the first time I have to work…

user3684652
- 29
- 4
-1
votes
1 answer
Using an Array of Class Instances in multiple source files
I am trying to access an array of class instances from two source files, was hoping you could point me in the right direction. Here's roughly what I have so far.
//X.h
extern Object myObj[5];
//A.cpp
#include X.h
Object…

GeorgeV
- 72
- 1
- 9
-1
votes
1 answer
Getting objects inside definitions Python/Django
My question is how do I get an object inside of a function?
class PurchaseOrder(models.Model):
product = models.CharField(max_length=256)
vendor = models.CharField(max_length=256)
def send_email_on_new_order(instance, created, raw,…

Mdjon26
- 2,145
- 4
- 19
- 29
-1
votes
1 answer
C# Add extension method to instance of class?
I basically want to inject an extension method to each copy of ArrayList, which would perform the following behavior:
ArrayList ourList = new ArrayList();
ourList.Add(randomarray or random arraylist);
It'd add the CONTENT of the given array,…

Jan Berktold
- 976
- 1
- 11
- 33
-1
votes
1 answer
New object instance not being recognized- Java
I am having trouble getting a random generator instance from being recognized as an object and it won't allow for use within another .class file. The base code for the random integer generator is this:
package RandomInstanceGenerator;
import…

userLost
- 3
- 4
-2
votes
2 answers
C#, Can't load multiple instances of a plugin
I have a single plugin, that takes value for an input and returns the result. I'm loading it like this:
public void load_modules()
{
string path = Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName;
string pluginDir =…

user1015551
- 197
- 3
- 20
-2
votes
2 answers
Line from one instance to another not working Action Script 3.0
I am trying to create to movable instances, that are draggable, and which have a line connecting them which updates automatically.
The thing is: The original line just goes randomly and doesn't update as the instances (mc1, mc2) are being dragged.
…

8-bit mate
- 85
- 2
- 11
-2
votes
1 answer
Amazon VPC Subnet and IP
This question is for AWS Engineers. I was reading about AWS VPC. It says VPC peering allows to connect 1 subnet to another subnet inside another VPC. Also it says, Instances on both subnet work as if they were in 1 subnet. So the question comes,…

Farrukh Sadykov
- 1
- 4
-2
votes
1 answer
abbr several times with one tag
I'm writing a walk-through, and I'd like the reader to be able to hover over a word from anywhere within the script and get the definition, but I'd like to only define the abbr once. Is there a way in html or css that I can do this?
-2
votes
2 answers
How to define an instance of a class by user input?
I have been trying to create a program that calculates and records calories contained in certain meals, and I have a class named 'Food' which I would like to create instances of by user input. I have done a good lot of searching and haven't found…

Michael Tracey
- 79
- 6
-2
votes
1 answer
Adding instances to a list
Overview
My group has built hardware that needs to communicate with software that we're supposed to write. However we all are at a standstill because we can't figure this issue out. We have searched a lot but to no avail. We would love ANY help.…

e_phed
- 21
- 3
-2
votes
1 answer
OpenGL - How can I get individual rotating?
I got some problem with OpenGL matrix system.
I made five instances like below. I want to get their individual working.
C_IMGMGR cImgmgr1( 200 , 170 );
C_IMGMGR cImgmgr2( 200 , 170 );
C_IMGMGR cImgmgr3( 200 , 170 );
C_IMGMGR cImgmgr4( 200 , 170…

JYO
- 3
- 3