Questions tagged [instance]

In object-oriented programming an instance is an occurrence or a copy of an object, whether currently executing or not.

Instances of a class share the same set of attributes, yet will typically differ in what those attributes contain. For example, a class "Employee" would describe the attributes common to all instances of the Employee class. For the purposes of the task being solved Employee objects may be generally alike, but vary in such attributes as "name" and "salary".

Related tags:

5388 questions
1
vote
2 answers

Pass instance variable from one to another class without calling first class method

I have a Python module consisting of multiple classes, of which the first one does an extensive data import and the following ones create files based on the output of the first class: class ImportData: def __init__(self): self.result_csv =…
29nivek
  • 35
  • 7
1
vote
1 answer

Android: How to have a single (main) Activity instance or retrieve the Activity instance that I need?

I am developing an Android app that execute a thread and update the GUI via a GUI Handler on GUI Activity. I need that the thread runs also when the user put the app in background. This is done! My problem is that I want to return to the Activity…
1
vote
3 answers

Using a constructor on a JavaScript static instance

I'm writing a JavaScript library in which I want some methods and properties public and other private. The following seems a great way of doing this whilst wrapping everything up into a single object. (function (window) { var Thing = function()…
bdls
  • 4,578
  • 6
  • 24
  • 30
1
vote
1 answer

Updating integer within string row for each instance in R dataframe

I have a dataframe similar to the following reproducible one in which one column contains HTML code: ID <- c(15, 25, 90, 1, 23, 543) HTML <- c("[demography_form][1]
[demography_form_date][1]",…
Andrea
  • 607
  • 8
  • 21
1
vote
1 answer

Check whether a variable is instance of ResNet50

I am checking whether model = ResNet50(weights='imagenet', include_top=False, pooling="avg") is instance of keras.applications.ResNet50 What I have done is: isinstance(model, ResNet50) but unfortunately this is raising me the following…
tail
  • 355
  • 2
  • 11
1
vote
1 answer

Why I see only 100 maxmimum total concurrent requests whem the limit is 1000?

Graphic Invocations By default amazon says that there are can be 1000 instances for free plan. But when i've write a highload stress-testing with multiple requests at the same time, only 100 instances are allocated. Why this is happen? I've expect…
1
vote
4 answers

why is constructor expected in instance definition in Haskell

Can anyone explain this error: Syntax error in instance head (constructor expected) class Nullable v where default_val :: v instance Num a => Nullable a where -- error reported here default_val = 0::a Thanks
Keynan
  • 1,338
  • 1
  • 10
  • 18
1
vote
1 answer

How to Get the value of a datatype from Class of Project2 to Class of Project1? - Visual Studio 2010 C#

I have 1 solution consisting of 2 projects. 1 is Windows Application and the other is Class Library. In the class library, there's a class that the value of its datatype is needed by the Windows Application. I came up with this, //Proj2 public…
Sam Araja
  • 13
  • 3
1
vote
0 answers

Swift 5.7 Error: [plugin] AddInstanceForFactory: No factory registered for id

Everything is work fine, but why I get this error. This is all my code. import UIKit import AVFoundation class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } var player:…
binev.dev
  • 11
  • 2
1
vote
0 answers

MWAA Airflow "Executor reports task instance finished (success) although the task says its queued." Causing task failure

Running AWS Airflow Managed (2.2.2) service with Celery, multiple schedulers, and noticing a lot of tasks that use Sensors (time-based reschedule sensors) seem be marked as failed even though some of them continue to run until completion. The Sensor…
evzdfx
  • 33
  • 3
1
vote
0 answers

Why can't you define the instance structure of a derivable type in GObject

What I'm trying to imitate with GObject Here's a simple C++ example: #include using std::cout; using std::endl; class Matrix { public: Matrix (int rows, int cols) { this->rows = rows; this->cols = cols; …
Gabs
  • 63
  • 1
  • 1
  • 6
1
vote
1 answer

In Reference class - The method "get_tree()" isn't declared in the current class error in Godot

I am currently working on my game's save and load states, and I created a global script to use it. The script extends Reference class and uses the .dat file extension for saving and loading files. But I can't use the method get_tree() in the…
DinoNyte
  • 35
  • 6
1
vote
2 answers

Nonexistent function 'instance' in base 'Nil' in Godot for instancing the player

I am currently working on my game's save and load states, and I created a global script to use it. In the script, I preload the player scene and then later in the load_game() function I instance it. And the instance doesn't seem to work. I get the…
DinoNyte
  • 35
  • 6
1
vote
0 answers

How to count at runtime a number of currently existing instances of object of type X?

So I can not change object code, I have X instances of it allocated from various assemblies. I want to count how many instances there are. How to count at runtime a number of currently existing instances of object of type X using reflection or…
DuckQueen
  • 772
  • 10
  • 62
  • 134
1
vote
2 answers

How to get instance of MapView in ArcGIS and use between two useEffect hooks in react?

import MapView from "@arcgis/core/views/MapView"; useEffect(() => { const map = new Map({ basemap: "arcgis-topographic", // Basemap layer service }); const view = new MapView({ map: map, center: [longitude, latitude], //…
Dostonbek
  • 11
  • 2