All Questions
65
questions
0
votes
1
answer
183
views
Adding a property that is hidden unless it has a value
I'm adding a class related to software packages. Here is a barebones version for the purposes of this question:
class Package {
$Name; $Latest; $Prerelease
[string]ToString(){ return $this....
1
vote
1
answer
235
views
How can I read the name of a thread in a C# application?
I'm working on a multithreaded application, written in C#.
I would like to verify if a thread is already running or not.
You might think "How easy can that be?", but there seems to be a ...
0
votes
2
answers
2k
views
TypeError: object of type 'property' has no len()
I have this code of a class that contains a list _offers of custom Offer objects. For this list I created a property to allow access to it:
class OffersManager:
_offers: list[Offer] = []
...
0
votes
2
answers
339
views
How do I make the child object not inherit a method or property from the parent object?
I'm creating a child object using class, but I don't want it to inherit some properties and methods from the parent object.
I want to know if there is any way to do this.
my code:
class Player {
#...
0
votes
0
answers
57
views
C# Object properties comparison
I have a class which is used for objects comparison:
public static class ComparisonHelper
{
public static bool DeepCompare(this object obj, object another)
{
if (...
0
votes
2
answers
204
views
C# access to stack object property
How can I access the objects property in this situation?
Araba araba = new Araba();
araba.Renk = "mavi";
araba.fiyat = 12345;
// I created this class and it working normally
ArrayTypedStack ...
1
vote
0
answers
161
views
VBA: Creating a class property that is an array of dictionaries
In Microsoft Excel VBA I need to create a class that has two properties, "Name" and "Holdings". "Name" is just a string so the code for that is easy. But I need "...
1
vote
1
answer
384
views
Assigning TypeScript property values with = vs :
I have the following Angular component:
@Component({
...
template: `
<div>{{getDisplayValue(value)}}</div>
<button (click)="value= { display: 'one' }">1</button&...
-1
votes
1
answer
36
views
Class including list
when i am assigning the values in the list its saying object not set to instance of an object any help , i can retrieve from other service , when i am trying to assign the value in the list its ...
0
votes
1
answer
449
views
Set class property inside an array in swift
I was wondering if there is a possibility to set a class property via an array:
class Test {
var x: Int = 0
var y: Int = 0
var z: Int = 0
}
let newTest = Test()
let myArray = [newTest.x, ...
-1
votes
1
answer
343
views
Python 3.7 Class Property Returns Object
I am trying to create a class with properties. Every time I access the property, no matter how I try, I get <property object at xxx>. I am running version 3.7.8 in Visual Studio Community 2019....
0
votes
1
answer
52
views
How to store order of user input and update string
I am trying to make the field 'all names' display all of the selected 'names' (letters in this case) in the order they have been selected (assumed left-to-right). What I have written seems to only be ...
-1
votes
1
answer
360
views
Python: How to: attribute of an instance which depends on flag, which is itself an attribute of that instance / object
Consider the following minimal example for my question:
class MyClass:
a = False
b = 0
if a:
b = 1
MCinst = MyClass()
Here MCinst has two attributes, MCinst.a and MCinst.b with ...
0
votes
1
answer
240
views
Dynamically creating objects in typescript
i'm trying to make a dynamic number of objects based on the number and type of arguments passed to it
my general skeleton looks like this
interface KeyValue {
key: string;
value: string;
}
class ...
2
votes
2
answers
34
views
Can one property value be passed as a argument to another property whose value is computed via a function ? (in Javascript ES6 with classes)
class A {
constructor(inval){
this.c = inval;
}
b() {
return this.c + 1;
}
e(z) {
return z+ Math.floor(Math.random()*10);
}
d() {
let x = {
x1: this.b(),
x2: ...