Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
92 views

I was debugging some legacy code and while doing that found some inconsistency in the address of this pointer in the class hierarchy like this: #include <cstdio> #include <vector> class ...
Ameya Babhulgaonkar's user avatar
2 votes
1 answer
181 views

I am confused about how to decide aggregation vs composition for Has-A relation. Let me explain my doubt with example of BookMyShow App(BMS) which is Show booking platform and assume a Show can be ...
AlwaysLearning's user avatar
2 votes
3 answers
1k views

I am trying to figure out where should the diamond be placed in this example, I understand its a has-a relationship and diamond should be placed to indicate the whole and part relationship. I have ...
gummyoreo's user avatar
0 votes
2 answers
561 views

In my class, I set the value of _owner indirectly in the constructor through the Owner property. However, the compiler still thinks that a value will not be assigned by the end of the constructor. The ...
user25109278's user avatar
-2 votes
1 answer
42 views

ps: I dont want to acess a parent class var but rather an actual child class How do I access the $table var from User class? I know it sounds silly but is there a way to access this child class var ...
Jeú Casulo's user avatar
-2 votes
1 answer
74 views

I am working on my research project. Let say I have a steel bar with predefined length of 6 m. I installed 3 sensor at location 0m, 3m, and 6m. The steel bar will be subjected to several test ...
Komaludim's user avatar
0 votes
1 answer
71 views

I have encountered this scenario several times but I couldn't find a definitive answer on the optimal way to manage it. Here's the issue. I have a Java 21 backend application that provides a React app ...
rossilor95's user avatar
-3 votes
1 answer
781 views

I am designing a use case diagram for a HRMS (Hotel Reservation Management System). I tried to capture properly all the requirements. But I am confused, as I did some research and I read in this ...
Nathan Budhuu's user avatar
-1 votes
1 answer
65 views

I have searched about this topic everywhere that what's the difference between abstraction and encapsulation , even one of the most voted stack overflow question , but at the end it seems confusing ...
RISHABH SHANDILYA's user avatar
2 votes
2 answers
131 views

I am trying to understand the dependency inversion principle (DIP) via some simple, but concrete codes and classes (implemented in python) from this tutorial. I am summarising it (with my own comments ...
Della's user avatar
  • 1,728
1 vote
1 answer
79 views

Is there any elegant and easy way to trace all the call stacks in Python of a library for debugging or code understanding purposes? Suppose there is a very big huge library that I'm importing and need ...
Abhas Kumar Sinha's user avatar
0 votes
0 answers
84 views

I have some questions from object oriented design. If I want to define a base class Path, which has two subclasses File and Dir, Path provides the validate method and the from_str method. For some ...
youthlic Ulic's user avatar
1 vote
1 answer
144 views

After a few years I'm trying to get back to programming and therefore i am trying to programm a relatively simple app in android studio. Im still at the part of thinking how the programm should be ...
Walter's user avatar
  • 11
1 vote
2 answers
62 views

I am developing a chess program, currently refactoring some classes, and was wondering if the followings are creating a circular dependency. Class A, depends on class B and C, and class C depends on ...
Santino Zanone's user avatar
0 votes
1 answer
329 views

With object-oriented programming in mind, how does the database come into play with objects? Like for example, let's say there is a Student class, with attributes like name, number, courses, etc The ...
Alexeia's user avatar
  • 33
-1 votes
2 answers
67 views

I am creating a class that is supposed to upload files to many a S3 Bucket with a presignedUrl. For now, I just have to upload files to a S3 Bucket. But in the future, i will have to upload files in ...
ismala's user avatar
  • 29
0 votes
1 answer
48 views

What's the name of the code smell committed by the following code. I try to google around to find the de-facto name of the following code smell to no avail. The reason why I'm searching for it is ...
caramel1995's user avatar
  • 3,065
2 votes
1 answer
349 views

I was asked below quesion in Amazon sde2 low level design interview recently and I have shown below my solution during the interview. I was rejected in this round. Can you help me with a solution of ...
sachin's user avatar
  • 147
0 votes
1 answer
38 views

I have a common reader for three different classes, but there is some code duplication because the reader has different methods for each of the classes A, B, and C. Is there anyway I can make the code ...
KII's user avatar
  • 1
0 votes
1 answer
896 views

class AccountClosureService( private val accountClosureRepository: AccountClosureRepository, private val userApplicationRepository: UserApplicationRepository, ){ // CRUD METHODS } interface ...
rahul.cs's user avatar
0 votes
2 answers
913 views

I am new to Salesforce Development/Apex and am running practice exercises. When I run this code thru the 'Anonymous Apex' window, it throws an error reading: "Unexpected token 'Public'. " ...
Lucious Jackson's user avatar
0 votes
1 answer
122 views

I'm having trouble writing the constructor for a class that inherits from tkinter's Toplevel dialog. I'm calling it from another class that itself inherits from Frame. The problem I'm getting is a ...
Chuck's user avatar
  • 201
1 vote
1 answer
81 views

I am trying to get all links with pagination. I am using selenium. Since there is more than ten thousand data, it will take time to get all links and some informations in it. I want to use pagination. ...
Kaan Turgay's user avatar
-1 votes
1 answer
62 views

I'm re-working an old procedural algorithm in object oriented programming, and I'm trying to design the different classes/objects. The algorithm is executing a couple of functions/methods. The output ...
Anna Setiva's user avatar
2 votes
1 answer
102 views

I declared a few geometric figures types such as: typedef struct s_sphere{ t_tuple origin; double radius; } t_sphere; typedef struct s_cylinder{ t_tuple origin; double height; ...
BobDeTunis's user avatar
0 votes
0 answers
278 views

Client needs me to provide two different classes Service1Transformer and Service2Transformer. Both classes need to implement the interface Transformer which only contains a transform() method. Now ...
A K's user avatar
  • 747
1 vote
1 answer
422 views

According to "Head First Object-Oriented Analysis and Design", Complex projects involves first finding a feature list -> drawing use case diagrams -> breaking into smaller modules ...
coderLane's user avatar
0 votes
0 answers
52 views

I wrote 2 codes for a task that asked for a code to be used for the deposit and charging functions, and I want to see if there is a way to improve my code; make it more generic, or use __init__ ...
Mery p.'s user avatar
  • 49
0 votes
0 answers
34 views

I am relatively new to python and I am struggling with building this speed type tester, I am not sure as to why I can seem to change the value of ''time_over'' from false to true in the first function,...
TwinkleTwinkle's user avatar
0 votes
1 answer
203 views

I've got the following question and the challenging part of for me is to calculate the wanted value without using panda. Question : Please download a CSV file containing the stock history of some ...
Mery p.'s user avatar
  • 49
0 votes
1 answer
180 views

class Airport: def __init__(self, code, city, country): self._code=code self._city=city self._country=country def __repr__(self): return "%s(%s,%s)"%(...
Maggie Lau's user avatar
2 votes
1 answer
2k views

I am currently drawing an activity diagram. There are several activities and end states, For example There is an end state 'display details' .After that activity is ended. Like this there are many ...
Malinsha Vithanage's user avatar
0 votes
0 answers
90 views

enter image description hereI have defined some classes and two of them Called "Global" &"GlobalFlag". All the classes are in one folder and same path. But in another related ...
Milad's user avatar
  • 1
1 vote
1 answer
5k views

I want to perform parallel processing of a class method. This method writes to a dict to save the data. Within threads it works, but once the method exits, the dict appears to be untouched. Here is a ...
ReduceProblems's user avatar
0 votes
0 answers
27 views

so i have a class phone where we find the attributes : brand --> str, model--> datetime, price--> float, quantity: int this is my code so far the class parent from datetime import datetime ...
proxyy's user avatar
  • 11
0 votes
2 answers
112 views

I apologize if this is a bit confusing to read, this is my first post. Please consider the following code: HTML: ... <form> <input type="text" id="to-do-...
Azaiah Johnson's user avatar
0 votes
1 answer
284 views

So, I have this code, and it calculates an OTP(value) each time I click on Button(OTP), and that value is showed on myLabel. However, when it is displayed the values are getting accumulated, E.g. if I ...
Anthony J. B.'s user avatar
-1 votes
1 answer
64 views

I have a code snippet. Can anyone tell me whether class.main calls the initi method automatically? I cannot find a main method defined here, but calling to main. What is TwitterStreamWarcIter.main ...
Adhithya Kiran's user avatar
0 votes
0 answers
84 views

I am learning Object Oriented Programming. I wrote the following simple program, but I don't follow why the call b->derived_function(); doesn't work. I understand the base class Base does not ...
R Karandikar's user avatar
1 vote
1 answer
207 views

I am designing a parking lot. Now I have three kinds of parking spots. I want to initialize my parking lot like this: Building({Size.SMALL: 5, Size.MEDIUM: 6, Size.LARGE: 7}) This means this parking ...
Hangji He's user avatar
4 votes
2 answers
207 views

In my project, I have this special function that does needs to evaluate the following: State -- represented by an enum -- and there are about 6 different states Left Argument Right Argument Left and ...
kohrhea's user avatar
  • 171
0 votes
1 answer
174 views

Context I'm building a 3 tier nested hierarchy dropdown to display the location of certain IoT devices within a building. The Floors are at the top of the hierarchy and grandparents of the Level ...
Liv's user avatar
  • 15
0 votes
0 answers
53 views

This is the result of Integration testing! Message: N/A Stack trace: org.opentest4j.AssertionFailedError: expected: <Songs Loaded successfully 1 Kiran Playlist ID - 1 Playlist ID - 2 Delete ...
ritik shrivastava's user avatar
-1 votes
1 answer
165 views

I would like to create class to find the missing values but below is my mistakes and how can I fix that please help? import pandas as pd data={'product':['A','B','C','D'],'sales':[100,None,...
melik's user avatar
  • 1,332
0 votes
0 answers
55 views

I have an event processing use case where I am using templates for various kinds of logic involved during event processing e.g transaction handling, processing template based on events e.g update, ...
user3239193's user avatar
2 votes
1 answer
69 views

check this sample code for backtracking, there are two ways I can append the variable i to curr before backtracking, the one here (not commented) updates the global ans array, whereas the other way ...
Mahavir's user avatar
  • 23
0 votes
0 answers
70 views

I am trying to make a videogame that is similar to "Turing Complete". In this game you are supposed to connect circuit pieces to create a computer by the end. So I have a question on ...
Photon Microscope's user avatar
0 votes
2 answers
218 views

Now i am working on a mmorpg server,Let's talk one scene that player drop something from inventory to world If I design the Drop with rich domain model,i will create code like this class Player { ...
ununion's user avatar
-1 votes
1 answer
56 views

This method I created public class Use { private String firstname; String lastname; public String output() { return "Hii my name is " + firstname + ...
Kartik Gulati's user avatar
0 votes
1 answer
235 views

I have a class (PlayerList) that contains Player objects (or subclasses) by inheriting from list builtin. I want each of the Player objects to use the container's attribute true_dice. The problem is ...
mteam88's user avatar
  • 103

1
2 3 4 5
12