Skip to main content
Filter by
Sorted by
Tagged with
Best practices
0 votes
4 replies
202 views

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 ...
humankind's user avatar
3 votes
1 answer
99 views

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 ...
Zedarc7's user avatar
  • 33
1 vote
2 answers
89 views

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 ...
user3163495's user avatar
  • 4,046
0 votes
2 answers
108 views

I am trying to build a small scale deep learning framework. I defined my tensor class as follows class Tensor: __slots__ = ( "_backend", "_data", "...
Featherball's user avatar
3 votes
2 answers
103 views

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!" } } ...
Aleksej Egorov's user avatar
Advice
1 vote
4 replies
71 views

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 &...
Minimo's user avatar
  • 9
Advice
1 vote
3 replies
65 views

What is this? (function (Skd, $, undefined) { title = "SkdInternal"; // internal? #title = "SkdPrivate"; // private? Skd.title = "Skd"; // public? Skd....
Stig's user avatar
  • 1
Best practices
0 votes
4 replies
83 views

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 ...
Synopsis's user avatar
  • 364
1 vote
2 answers
168 views

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 ...
Dave Clark's user avatar
Advice
0 votes
4 replies
125 views

I have a class in VB.NET. The definition of this class is re-defined according to need. For example: TR as char(2), F1 as Char(10) then later TS as Char(2) F1 as float. I want to define one class and ...
Tleilax's user avatar
  • 75
2 votes
1 answer
116 views

I working on a code where it is necessary to have large integers, here is a simplified version of it (len_class.py): class BigLen(): def __len__(self): return 10**100 However I'm running ...
user126306's user avatar
0 votes
2 answers
139 views

I want to create a custom method I can use for any WC_Product class, so I can use $product->get_lead_time(); anytime I have a product object available. I currently have it working for Simple ...
Alexandra Chavez's user avatar
0 votes
1 answer
80 views

<span class="SpellingError SCXO166867203 BCX8" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:left bottom;">bv</span><span class="...
Retroshift's user avatar
2 votes
1 answer
212 views

I'm trying to print elements of matrix (example will be below). Here is the following code written in Dev-C++: #include <iostream> using namespace std; class Matrix { private: int **...
Michael's user avatar
  • 11
2 votes
2 answers
123 views

I have the following code that defines an abstract class and its final subclasse. The two classes are both subclasses of the equinox.Module class, which registers class attributes as the leaves of a ...
Ben's user avatar
  • 539
3 votes
4 answers
112 views

Let's say I have a python file test.py that looks like this: class MyFirstClass(): prop=3 class MySecondClass(): prop1 = 0. prop2 = MyFirstClass() Then I can run this and it works: from ...
Ben's user avatar
  • 539
1 vote
3 answers
136 views

In our JavaScript web app, we use a custom-made component framework. All of our components are defined as classes using the class syntax. We can make child classes that inherit the parents, and they ...
John Brink's user avatar
1 vote
1 answer
85 views

I have an issue with the data within an extension class does not change when I change data within the super class. This might be an XY issue or caused by the fact that I'm still not used to using ...
tacoshy's user avatar
  • 13.3k
-3 votes
1 answer
114 views

I'm not super experienced with C#, and this is a bit of a puzzle. Consider the following code: #nullable enable using System.Collections.Generic; // Biology.dll public abstract class Animal { ...
suszterpatt's user avatar
  • 8,327
0 votes
1 answer
86 views

I'm not a professional programmer. I'm teaching my children and decided to create a solver to nonograms puzzles. The algorithm itself is not what concerns me, but the proper way to code it. What I ...
Mateo's user avatar
  • 138
-5 votes
1 answer
146 views

I made the next class obj = MyClass() fds=['a','b','c'] for i in fds: attribute_name = f"{i}" setattr(obj, attribute_name, [f"{i}"]) print(obj.i) I know that obj.i is ...
Javier Olivares's user avatar
1 vote
1 answer
152 views

A while ago I wrote a small function to easily Use-ClassAccessors in PowerShell. I would like to add a new feature: Any accessor method (in the form of get_<property name>()) will automatically ...
iRon's user avatar
  • 24.4k
-4 votes
4 answers
171 views

I'm trying to use a for loop to iterate through a set of objects, check if those objects store string data (specifically their 'Pokemon.evolution' variable) which is the same as a the name of one of ...
mycode.exe's user avatar
-5 votes
2 answers
106 views

I am working on an example of a class called Car. Can you help clarify the difference between the attributes after the initialization statement and those within the indentation? How is ...
four77's user avatar
  • 165
0 votes
1 answer
92 views

I'm writing a plugin that uses a few third-party libraries (one from a long-abandoned repo that I'm modifying). Library A uses Library B, and my code uses both. In Library A are 50-odd files with ...
Stef Dawson's user avatar
0 votes
1 answer
133 views

I want to determine the class name of existing table TD elements (using the Chrome Javascript). My case is table rows all like <tr><td class="ns"><a href="a link">...
WayneF's user avatar
  • 264
2 votes
1 answer
110 views

I'm trying to write a function TypeNameEx which will return a string which, using a call to VarType(), effectively identifies the type of a a (variant) variable, eg VarType 2 returns integer and ...
SVCooper's user avatar
0 votes
1 answer
250 views

type TTestHelper = class helper for TStringList procedure Test; end; What is the actual implementation of Delphi class helpers? In the System unit, I can find the define of TClassHelperBase. ...
qgi's user avatar
  • 137
2 votes
1 answer
146 views

The classes works when separate, now, I want to create relationships between them. However, this has caused issues when I am trying to define the relationships. For example: sqlalchemy.exc....
hanna's user avatar
  • 21
0 votes
2 answers
263 views

In C++ I have variables in classes in classes. It often results in long dot operators to get to the variable. For example: int x = class1.class2.class3.variableName; Would it be possible to replace ...
GLnoob's user avatar
  • 35
0 votes
2 answers
162 views

I have a variable, value, declared in a class, input. I want to use it inside main. Here is my code. #include <iostream> #include <fstream> #include <chrono> #include <thread> #...
Niamh Driscoll's user avatar
0 votes
1 answer
64 views

I would like that method redefenition would result in failure and script execution stop. Like any other common error. In the following example I want to see that method print cannot be redefined. oo::...
Sterling7135's user avatar
-7 votes
1 answer
97 views

I have a situation where I have multiple csv files that I want to transform into various objects. So I have something like: #What works car = [] with open("car.csv") as csv_file: data = ...
James's user avatar
  • 1
0 votes
2 answers
171 views

I have a view, TimeEditView, that edits an object of an Item class I made. The class does not conform to ObservableObject, since if it does, then it will cause issues with using GRDB. I am currently ...
bk24z's user avatar
  • 1
0 votes
1 answer
85 views

I've done a lot of Googling and may have missed this, there's so many examples of using the new Attribute feature in PHP but none of them show if this is possible. What I would like to be able to do ...
ch1902's user avatar
  • 13
1 vote
2 answers
73 views

Solution requirements: Pre C++11 Statements: Function someFunction exists, that accepts 2D vector as vector of string vectors: vector2d. Class someClass exists, that contains 1D vector of strings: ...
KamilK's user avatar
  • 11
-1 votes
1 answer
108 views

I have a SwiftData class that I get with @Query private var items: [Item] in a SwiftUI view. Then I pass it to a sub view that passes it to other sub views. What is the best way to pass the class ...
Kitten Apps-Films's user avatar
1 vote
1 answer
67 views

This code creates an error: The slot COMMON-LISP-USER::NAME is unbound in the object #<THING {1002B830F3}>. I tried sbcl and clisp, both creating same problem. I can initialize instance of ash ...
nadirkazan's user avatar
-1 votes
1 answer
110 views

I'm a bit confused about how method overriding works in Python. Let's say I have a base class with a method, and I override that method in a subclass. When I call the method from the subclass, the ...
Rishabh Chauhan's user avatar
0 votes
3 answers
127 views

I am working on an ASP.NET project that uses Vue.js and jQuery. I have a JavaScript file (fields.js) that defines several classes (e.g., Users, Fields) and initializes a Vue instance. When I use the ...
kev's user avatar
  • 139
2 votes
1 answer
180 views

I have defined a struct in another file called file1.h (example) and when I declare an array using that struct in another file called File2.h, i get the error Message: "Incomplete Type "...
Lemtay's user avatar
  • 23
3 votes
1 answer
59 views

I define an array of 4 corners import numpy as np class Corner(): centres = np.zeros((3,2)) id=0 corners=np.empty((4)).astype(Corner) for i in range(4): corner=Corner() corner.id = ...
user1069353's user avatar
6 votes
0 answers
87 views

import sys class Vector: def __init__(self, x, y): self.x = x self.y = y v1 = Vector(1, 2) v2 = Vector(1, 2) print(f"v1 __dict__ : {sys.getsizeof(v1.__dict__)} bytes") ...
Johnson Francesca's user avatar
3 votes
1 answer
133 views

I've tried to recursively define variadic template classes, similar to various examples I saw for functions: class Network { public: template<int m> const void forward(const Matrix<m, ...
daniel creatd's user avatar
0 votes
0 answers
64 views

H I am trying to store my shopping cart variables using Classes/Objects for integration with Klarna. The following code works great on testing but I now need the Cart (products) to be dynamically ...
Scott's user avatar
  • 57
0 votes
0 answers
111 views

I have tested the following code and the run crashed at when the map does ~_Hashtable() and clear(). This case is simplified from my project. And I do need to use thread_local to describe map. I want ...
dioszz's user avatar
  • 1
0 votes
1 answer
78 views

I'm currently studying Java in general and inheritance in particular. When I run the code below in an online editor it throws an error related to the main method, however, when I modify it as ...
Robk29's user avatar
  • 23
0 votes
1 answer
77 views

This is going to be a bit hard to explain, but I'll try nevertheless: So, I'm a novice trying to turn a Kahoot Generator I made into a library to share on GitHub. After thinking about how I wanted the ...
Jediweirdo's user avatar
-1 votes
1 answer
112 views

Why doesn't javac generate a new .class file after renaming the class? My file name is Test.java. Case #1: class example { public static void main() {} } When I compiled this using javac Test....
Kunal_121's user avatar
0 votes
3 answers
85 views

I have a dictionary with course names and some info on each course. I want to dynamically create Courses() instances for each of the 4 courses in the dictionary. But I want to be able to reference ...
jpanknin's user avatar
  • 125

1
2 3 4 5
1598