65,119 questions
4
votes
2
answers
100
views
How can I prevent an object from being modified after it’s created in Java?
I’m trying to make sure an object can’t be modified after it’s created in Java. For example, in the class below, I can change the values of model and year using setters. But I want to prevent that and ...
-4
votes
3
answers
68
views
How to create list of class instances from a dictionary in python [closed]
I'm trying to refactor some code where I instantiate a lot of different classes and set their properties and wondered if I might be able to use a dictionary in some way.
Is it possible in python to ...
-8
votes
0
answers
100
views
Is there a way to initialize an object using an array (or string) or a dynamic name construct (so multiple)? [closed]
1st part: Relative to struct in C:
I'm asking how to initialize as an object like:
a char array[] of strings
returning (if is possible) the names in the 'char array'
of n elements like: struct Complex ...
1
vote
1
answer
67
views
Clarification on Computed Properties [closed]
I’m studying TypeScript and came across this pattern:
type Animal = { [key: string]: number };
let Tiger: Animal = { legs: 4, age: 5, tail: 1, eyes :2 };
From what I understand, this allows adding ...
-3
votes
0
answers
94
views
How to read the object instead of the memory address
I've been working on this project and when I try to read the data stored in the memory retrieves only the memory address instead of reading the object I tried to see if it was a problem with my code ...
-5
votes
0
answers
82
views
How are initialization and assignment fundamentally different? [duplicate]
take the following classes for example:
class Test
{
public:
int a=1;// no error
};
class Test
{
public:
int a;
a=1; // error
};
Here the second case gives error. After a few ...
0
votes
1
answer
30
views
Creating a Map from Flatten in Terraform
Here is my issue - I have a locals code block like the below. I need to create a Map from these values (these values are used in multiple places)
locals {
object = {
1 = {
name = "...
1
vote
1
answer
116
views
Matching Card Game using JS
*{
box-sizing: border-box;
}
.clear {
clear: both;
}
section {
border: 1px solid black;
height: 200px;
width: 50%;
float: left;
}
<!DOCTYPE html>
<html lang="en">
<...
-2
votes
2
answers
85
views
How do I call the method from a class that creates other objects? [closed]
I have five classes. My Main class, a form class, two subclasses that extend the form class and a createForm class I am forced to use to create new instances of the subclass.
public class FormenFabrik ...
1
vote
1
answer
51
views
Attaching inner functions that use the same random number to related button click events js
I'm working on a game that will take a random object, and use that same random object for a series of questions/functions. I'm having trouble getting the next piece of code to run after clicking the &...
2
votes
0
answers
49
views
How to compare two Powershell objects, property by property?
I'm trying to compare to MECM outputs from $cmAppBefore = Get-CMApplication -LocalizedDisplayName $cmAppName | Select-Object * (to an after object). The objects returned are standard objects as well ...
4
votes
1
answer
48
views
C++ Makefile object file doesn't exist. It needs to be manually created
I have the following Makefile for building my C++ application :
SRC_DIR := ./src
OBJ_DIR := ./obj
INC_DIR := -I./include
SRC_FILES := $(wildcard $(SRC_DIR)/*.cpp)
OBJ_FILES := $(patsubst $(SRC_DIR)/%....
0
votes
0
answers
42
views
Access system object via a view whose owner is granted with grant option
I have created the following view in my database, my schema
CREATE VIEW [OMEGACA].[V_SYS_MANAGE_ACC]
AS
SELECT
name, object_id, parent_class, parent_class_desc, parent_id,
...
0
votes
0
answers
31
views
Constructor and datatype not matching in java [duplicate]
I'm relatively new to Java and object oriented programming, and I don't understand why sometimes the constructor used in declaring and object will be a subclass of the objects type instead of the ...
-3
votes
1
answer
73
views
Adding a Script to an Object from a list of Scripts during runtime in Unity
for the game I'm working on I had my groups write multiple scripts that I would be implementing into the project. Each script would contain the dialogue for the game. It was a rushed solution and very ...