64,942 questions
Score of -3
0 answers
72 views
Array groupBy property but then sort by a non alphabetical order
I have an array that looks like this:
[
{
"id": "4x4_Std",
"name": "4x4 Off-Road Driving - Standard",
"status": [
...
Score of 3
1 answer
147 views
Mapping entity objects to domain interface
I have an interface in domain and two string infrastructure that represent that interface. the problem is, the interface cannot initiate in mapper class so I don't know how to map entity to domain in ...
Advice
0
votes
3
replies
89
views
What are the differences between the class and struct keyword in C++
As we all know , we can use struct and class to define our type based on our usage and requirements of our project and we also use it in OOP . But my question is that , are there any significance ...
Advice
1
vote
2
replies
92
views
in Dart why does String start with capital letters and not the other types
in java the primitives types like int, boolean, double,... are in lowercase and String is an object that's why it start with a capital letter(from what I know). But why is it the case in dart, ...
Best practices
3
votes
1
replies
145
views
How do people handle naming for path strings versus path objects?
In any program, module, or object, one might need or encounter a file or folder path or partial path as a string or as an object, e.g. a pathlib object. Do you use a naming convention for ...
Advice
1
vote
10
replies
169
views
If a beginner asks you about the object, how do you explain it?
What if a beginner asks you a question about an object? How do you explain it? How does it work? What is the difference between a class and an object? Give a real-world example of an object.
Advice
2
votes
3
replies
215
views
Is DDD the "Final Form" of OOP, or a necessary abstraction to save us from it?
we’ve used Object-Oriented Programming (OOP) to model the world through encapsulation, inheritance, and polymorphism. However, in large-scale enterprise systems, we often see OOP devolve into "...
Score of -1
1 answer
144 views
Trouble with bounding box collisions in pygame [duplicate]
I'm trying to make a brick breaker game similar to google's block breaker and i'm having trouble with the ball colliding with the bricks, most times it ignores the collision at the side of the block ...
Advice
0
votes
3
replies
94
views
YOLO11m fine-tuned on SKU dataset hallucinating and missing DuoPack detections
I am working on a retail shelf product detection system using YOLO11m fine-tuned on a 110k SKU dataset with a single class `product`. The model performs well overall but I have two problems after ...
Score of 1
1 answer
55 views
In Racket, how can I access an object's field without knowing the field's name at compile time?
I'd like to write a function that can access an arbitrary field on an object, given the object and the name of the field:
#lang racket
(define (get-field* field-name obj)
(eval `(get-field ,field-...
Score of 1
1 answer
100 views
How to validate attribute relative to another when instantiating class
From this answer and similar blog posts I've used the decorator method to do data validation when creating a class. But now I need to validate one attribute relative to another. E.g.:
class Planet:
...
Advice
0
votes
2
replies
101
views
How many JSON objects can you nestle into each other?
Just started learning JSON with C# and i was wondering how many objects you could nestle into another object?
My best guess would be 255.
Also, is this a common practice in actual websites? I have not ...
Score of 4
2 answers
175 views
Get multiple indexes of an array at once, for comparison
I am working on a Tic_Tac_Toe project. I have an object (gameBoard) that contains an array, then I have another object that i want to create a player from to play on the board, then I have a function ...
Advice
0
votes
1
replies
89
views
Create an X word combination linked to a specific set of data
To start, here is an example:
When a messenger app wants you to share your contact information, they assign you a random 4-6 word combination (e.g. TIGER-TRUCK-FIRES-GHOST-TILES) that acts as a human ...
Score of -2
1 answer
154 views
Filtering array object that also returns indexes as well as the filtered result [closed]
I have the following code that contains an array of different book titles in subsequent objects. The code I have that filters the array is fine and returns the right information. However is there a ...