79,843 questions
-2
votes
0
answers
104
views
How do I resolve "Exception in thread 'main'" error and get correct output? [closed]
The scanner utility is a virtual example of equipment that I need to generate input from. I created the inputCities() method, but my program will not output anything, and I continuously run into the ...
4
votes
1
answer
79
views
How to create a class that generates auto-updateable plots
I want to create a class that will create updateable plots. I plan on having 8-16 figures in one window, so it would be nice to have a class that would initiate these for me. These graphs will auto-...
0
votes
1
answer
103
views
How to make a generalized template class? [closed]
I've done some amateur object-oriented programming in C++ and I have a quick question of what is possible when creating your own class.
I've attempted to make a generalized 3-tuple template class that ...
1
vote
1
answer
107
views
Class objects inaccessible for the subs other than the one the object has been instantiated
I run calculations with muliple subs and functions looping up to get a result. Based on the number of iterations done by counters I change some variables to suit my needs. So far the counters have ...
Best practices
0
votes
8
replies
52
views
Initialize a Typescript class property once
Let's say I have a class with many parameters. In Typescript, this is how the class is created:
class ClassName {
private para1: string
para2: boolean
para3: number = 6
protected ...
Best practices
0
votes
3
replies
71
views
Python Inheritance Class Argument NameError
I’ve searched the space of Python nested class inheritance and have read that it's not best practice. I have a NameError on the following:
class A()
pass
class B(A)
pass
I indeed ...
Best practices
0
votes
4
replies
222
views
Is it safe to use public functions in C++?
I am creating a program with C++ language that working with strong cryptography.
Does it matter if I use public or private functions where contains a secret algorithms, any sensitive structures of ...
3
votes
1
answer
110
views
Powershell Class generic interface arguments type resolution problem
Can't seems to find why generic interface types are allowed in powershell class argument attributes, but they can't accept anything - powershell class type resolution doesn't work in this case. Is ...
1
vote
2
answers
96
views
JavaScript: How many objects are allocated when returning an object literal from a class constructor?
Let's say I have this code:
class MyClass {
constructor() {
return {};
}
}
const x = new MyClass(); // how many objects are instantiated with this?
I know that variable x just holds ...
0
votes
2
answers
117
views
How to break circular dependency in Python class when trying to separate a simple wrapper class from a heavier implementation?
I am trying to build a small scale deep learning framework. I defined my tensor class as follows
class Tensor:
__slots__ = (
"_backend",
"_data",
"...
3
votes
2
answers
107
views
Verbose in class with "using module" directive
I faced a specific behavior while using verbose output in class.
This works like a charm:
# SomeModule.psm1
class SomeClass {
SomeClass() {
Write-Verbose "It works!"
}
}
...
Advice
1
vote
4
replies
73
views
Add an instance to a virtual subclass?
With abstract subclasses on can use register to add other classes as a "virtual" subclass, what would be a way to do that for a single instance based on it fullfilling some criteria?
The &...
Advice
1
vote
3
replies
65
views
Creating classes/class objects in JS - perhaps jQuery, not sure
What is this?
(function (Skd, $, undefined) {
title = "SkdInternal"; // internal?
#title = "SkdPrivate"; // private?
Skd.title = "Skd"; // public?
Skd....
Best practices
0
votes
5
replies
90
views
using variable of type Class<?> in switch construct
i'm in need of a data container for several data types and fail to write some omnipotent :-) converter func.
Maybe my idea is crab, in this case please give me a hint what concept to use.
My current ...
1
vote
2
answers
173
views
Trouble with VBA Class Instantiation [closed]
I've created a VBA Class module and written all the necessary code within it. When I go to use it, in Excel, I instantiate it in a global module as follows.
Public gblFrequencyList As New clsLists
...