Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.
1
vote
0answers
6 views
Python exception handling class - Getting as much details printed
I'm trying to write a Exception Handling class in Python so that I can re-use. If you have any ideas on how I can improve this to output more detailed information I would appreciate it:
...
1
vote
0answers
115 views
Using a singleton for a collection of discounts to calculate?
I'm wondering if using a Singleton for a storage of discounts is the right way to go. This is because I will be looping over all added discounts in another class.
client code
...
-1
votes
1answer
48 views
Business logic parallelization engine
In my Java 8 application there are 3 different classes but each of them contains one similar method, which is dedicated to parallelization of the business logic ...
1
vote
0answers
37 views
Multiple Persons enter room simultaneously and exits after specific interval of time
Here is the link to git repo of my application I am currently implementing just to have better understanding of OOP as well as learning Concurrency (Atleast a try :D)
What is the whole ...
2
votes
1answer
74 views
C# data class with public auto-implemented properties with constructor that specifies each
I have a dll and an executable which both deal in configuring certain things for a much broader software solution, and the code below in particular is directly meant for database configuration. (Here ...
0
votes
0answers
22 views
Creating Mysql interaction/connection using OOP in PHP [on hold]
I'm very new to OOP and but am aware of the concepts after educating myself with some good resources despite this I want to get expert knowledge on the direction I'm taking for this project I've set ...
-1
votes
0answers
37 views
Is my implementation of String in C++ good? [on hold]
Following up on My implementation of String in C++.
I wrote my string class. The code works, but could anyone tell if I am doing anything wrong?
It is an exercise from the "Accelerated c++" book:
...
2
votes
2answers
40 views
User registration with Repository pattern
I have been developing a simple login registration page with PHP using the repository pattern. Following are the business rules :
During registration
Email must be unique.
Email must be a valid ...
2
votes
0answers
61 views
Tic Tac Toe C++ follow up
I have finally found some time to redo the last tic tac toe game I posted. I have gotten rid of "Magic Numbers" as well as any typos(if their are any please point them out but I think i rid myself of ...
4
votes
2answers
117 views
My implementation of String in C++
I wrote my string class. The code works, but could anyone tell if I am doing anything wrong?
It is an exercise from the "Accelerated c++" book:
Implement the Str class, but choose an ...
5
votes
1answer
60 views
A “pointless” animation program
The assignment description for this code is this:
Each time the user clicks the Circles button, randomly colored circles
flow into the display and continuously change their shapes.
Here is a ...
3
votes
1answer
54 views
Recording all instances of a class - Python
In a programme that I am writing, I need to loop through all the instances of a class, the way I got around this was by appending every class to a list like below:
...
0
votes
0answers
36 views
Feedback on Javascript OOP Quiz [closed]
I'm trying to build a Javascript quiz with OOP. This is my code so far but I feel it is probably breaking every eloquent code rule ever written. I am also stuck with how to get the user's selection in ...
6
votes
3answers
71 views
Capturing temperature information for a patient
I just finished writing a program that captures temperature information for a patient. I'm looking for suggestions on how to improve the code that I have. Although what I have compiles and does what I ...
4
votes
2answers
54 views
Using PHP PDO to Fetch Employee Details
Introduction
Hi, I am finally making the move to object oriented PHP.
This has been something I have been quite reluctant to do, but I now feel that it could benefit me, and bring me up-to-date with ...
5
votes
2answers
99 views
Single Linked-List Implementation in C++
I haven't done much C++ coding the last few years, so I've been reviewing in preparation for upcoming interviews. I wrote a minimally functional singly linked-list. I'm using my implementation for ...
2
votes
0answers
18 views
object.Menu.js - animates a Menu that morphs
Looking for general feedback on the code structure and not so much the naming conventions.
I have a single event bus and do not use namespaces and plan on adding additional menu items later and maybe ...
4
votes
1answer
37 views
Initializing characters in a visual novel game
I am making a visual novel game and I was wondering is there a better way of setting character attributes and initializing than the way that I have done down below. As you can see I did an abstract ...
-2
votes
0answers
26 views
Getting error Invalid Operand to binary expression [closed]
I am getting error related to Invalid Operand to Binary expression.
int main()
{
int j;
std::string n = std::to_string(j);
//j=atoi(j);
...
1
vote
0answers
20 views
Idiomatic abstract inheritance with Go
I am currently discovering Golang, and I try to implement some random variable generation functions similar to R functions.
To avoid code repetition, I'd like to use inheritance, which is quite ...
5
votes
2answers
54 views
Menu Model class using Model-View-Presenter
The following code is for my Object Oriented Programming class. My program simulate the cashier's machine to order food. The code uses Model View Presenter. This class is the model.
I have an ...
3
votes
2answers
70 views
Booking system for shows
Kindly accept my apologies as Java is something my mind cannot digest no matter what I do. At the moment I have an assignment and have written a piece of code and have used Constructor (I think so) ...
0
votes
3answers
95 views
Multilingual greeter object
After coming across Douglas Crockford's views on class-free OOP, and doing away with new and this in Javascript I tried defining an object with its own variable and function, and returning it in JSON, ...
2
votes
1answer
48 views
Texas Hold'em classes
I am working on a simple Texas Hold'Em dealing simulator. I am new to Python and was hoping to get some advice on my use of classes here. I feel like I am not using them as efficiently as possible, ...
3
votes
1answer
43 views
OOP and non-OOP versions of layout and page animation code
I am trying to learn how to write more object oriented javascript code, but I am having a hard time understanding the correct way to do it, and how it is useful for front end development. As you can ...
3
votes
1answer
47 views
Uploading multiple files using a class
Below I have implemented a class that will validate and upload files based on the specified rules.
...
2
votes
1answer
51 views
Stock performance app
I'm building an app that tells you a stock's percentage change in price between two dates by using Yahoo's API. Given a stock ticker and two dates, it currently outputs the percentage return to the ...
8
votes
1answer
99 views
Accessing the Stack Exchange API
Part of a project I'm getting started on requires access to the Stack Exchange API for certain data, as a result I built a .NET implementation to interact with it.
The implementation is pretty ...
-4
votes
0answers
20 views
C++ Superclass / subclass code [closed]
I am really not sure whether the code works perfectly. Would really appreciate if someone smarter than me would take a look and comment on it. Thank you a lot in advance. Here is the code:
...
2
votes
2answers
64 views
Tic Tac Toe C++ MVC design
This is my new version of my Tic Tac Toe game written in C++. I tried to follow community advice by separating I/O from the game logic and view (MCV). The code works great, and I am looking to see if ...
4
votes
3answers
37 views
User ranking system
I have written my first code of object oriented Python. Prior to this I have spent a week on learning the concepts and understanding the technique. I would appreciate it somebody reviews this and give ...
2
votes
2answers
46 views
Fetching a number of data tables from a stored procedure
Within a method, this code is calling a SPROC that is doing a 'select *' from 9 different views. This method then goes on to access the returned DataTableCollection ...
4
votes
2answers
70 views
Tic Tac Toe C++ with classes
After A ton of work I finally have a working Tic Tac Toe game that I am very proud of, and it works great. I would like some feedback on anything that can be improved/ needs to be changed.
I had a ...
4
votes
2answers
25 views
Window-size-dependent content toggler for an HTML form
I had to build a responsive component which allows the user to display specific content in a page. I called it the contentToggler.
Here is my component in action
...
1
vote
1answer
50 views
Mapping one JSON message format to another in Java
This code takes a JSONObject, passes it to another class which is responsible for mapping the data in the JSONObject to a different format (Still a JSONObject though).
I'd just like confirmation if ...
3
votes
3answers
138 views
Football game using factory and command patterns
I'm really confused about the interview I did with a firm. They told my code was not expert, but almost intermediate level java.
Requirements
Football Scoring Dashboard
Develop an application that ...
4
votes
2answers
87 views
Project Euler #23 Non-abundant sums
I'm having trouble optimizing the Project Euler problem number 23 :
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of ...
-1
votes
1answer
36 views
merging json object
Hi I am trying to merging json objects which has common value.
This is original JSON
...
1
vote
1answer
46 views
Custom C++ STL-like doubly linked-list(C++11)
This is the link list I just created. It works fine for now, but would want to know if I could make it better.
list.hpp
...
0
votes
1answer
35 views
Modbus connection over TCP and Serial port
I want to improve my code. In this code I don't like my contructor, but without it I keep getting an error while trying to connect NullPointerException.Any ...
5
votes
2answers
64 views
Determine playing card
I would like a code review on the coding I did for my assignment. The reason I have asked here is because my lecturer has no intention of going through (Don't ask me why, I asked before and he said ...
1
vote
2answers
77 views
HTTP Response/Request Class
This is just a simple class that you can you use to send requests and get the HTML code. I would like to get feedback on this.
For your request you can set:
URL
Request method: GET or POST
Request ...
1
vote
2answers
42 views
Game engine for 2D games in Java
I am writing a 2D game engine library that I can use for simple future games, and I've been told that it is written very procedural rather than objected oriented. I was wondering what I should do to ...
4
votes
2answers
190 views
Project Euler #11 Largest product in a grid
Question
Link to the exercise : https://projecteuler.net/problem=11
I'm currently working on the Project Euler exercise's and I just finished the eleven exercise. It's working fast enough it takes ...
4
votes
1answer
70 views
Printing the right diagonal of a matrix
I am solving a coding challenge whose objective is to print the right diagonal of a matrix. And below is my code to do that.
...
2
votes
1answer
36 views
Regrouping JSON object
I wrote a JavaScript source which regrouping by new key i.e. following JSON to the other:
...
4
votes
2answers
88 views
Parsing a string as fast as possible that is using comma delimiters
I have made a simple static parser for a bigger program. This parser takes a string that has comma deliminators and I need to separate the strings in to a vector for handling in a different section of ...
4
votes
0answers
33 views
A “policy-based” design for a generic CUDA kernel
I am faced with a design issue that has been discussed on SO several times, the most similar question being this one. Essentially, I want polymorphism for a CUDA kernel in the form of a "generic" ...
0
votes
1answer
40 views
Simple weighted directed graph in Python
I have this simplistic Python class for representing directed weighted graphs (digraphs for short):
Digraph.py
...
4
votes
1answer
55 views
A class to encapsulate a pair of ints with range-checking
The goal is to have a helper class to wrap the concept of a resolution safely,
encapsulating the range check into the class, since otherwise it can get lost by
a client not so cautious.
I think this ...