Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.

10
votes
4answers
315 views

Processing XYZ data from a large file

I'm new to programming (1.5 years experience at university), and I'm working on my first computer vision related project! My goal is to take a file which might have CSV (comma separated) or txt format ...
1
vote
0answers
20 views

Python GUI Calculator - Passing Variables Between Classes [on hold]

I've recently come across this code that another user submitted for their python calculator using tkinter and have a few questions regarding it if anyone can help. I fully understand how they made ...
1
vote
0answers
9 views

Simple ruby program for AWS ruby SDK

I wrote a simple ruby program for interacting with one of my temporary AWS S3 using Ruby SDK. Below is the program I've written. Since I learned ruby by myself I need help/suggestions in following ...
1
vote
1answer
42 views

Image processing using Python OOP library

I am trying to learn OOP by refactoring my existing code (functions only). This example works but I am not sure whether it is pythonic and good practice. I have a shared library which consist of ...
6
votes
0answers
47 views

Using decorated methods in a subclass of deque to dump its state to a JSON file

I am sub-classing an object in python and I need to overload a bunch of the methods with very similar logic, essentially a call to super() and then some additional operations. I want to avoid ...
1
vote
1answer
42 views

Unit of measure class for mass in java

I was looking at this answer on SO to handle units in java. The concept was interesting to me, except I didn't like that it had to be per object that had mass, instead of encapsulating a ...
4
votes
1answer
37 views

Tic Tac Toe in Browser Console

Anyone remember "War games?" I have a very long way to go, but I thought it would be interesting to make a version of Tic Tac Toe which plays itself. At present the AI is "choose a random available ...
-2
votes
0answers
25 views

PHP: Object for HTML hyperlink [on hold]

I have a function that generates HTML for hyperlinks. It's arguments may be string literals or variables read from the database. An example call to this function looks like: ...
0
votes
1answer
56 views

Performing actions on the properties of a JSON object [on hold]

I wanted to make a class that helps me perform actions on the properties of a JSON object. I wanted to be able to use that class in this way: ...
-5
votes
0answers
32 views

how to create stopwatch for microcontroller atmega328p [closed]

How can I create stopwatch a assembly code for Atmega328p micro controller is there any one providing this code?
4
votes
2answers
83 views

Minimum difference between numbers in a file

I'm learning Java and I created a simple solution for the following problem: Given a file [filename].txt such that each line has the format ...
3
votes
1answer
31 views

Searching Online English Dictionaries - follow-up

This is a follow-up to Searching online English dictionaries: ...
4
votes
3answers
101 views

Java RPG battle simulator

I'm coding a turn-based RPG battle simulator (text based) in Java. I'm doing this as an exercise/project to learn OOP design. I've coded something similar in C, but just porting that code over to ...
0
votes
1answer
33 views

PHP OOP registration with User class and singleton Database class [closed]

I created registration system with PHP. I have User class that will handle all the input and insert the user input into database, and i created Database class with Singleton pattern that will connect ...
-3
votes
0answers
30 views

How to add 14 based numbers in instance method? [closed]

So I'm having trouble with creating an instance method to add two 14-based numbers and I was wondering if anyone could help? I'm a bit new to java and still sort of confused on the whole thing. So ...
8
votes
2answers
1k views

Python Output Class

I have the following Python output class that I'm planning to use across a number of modules in a terminal application: ...
0
votes
1answer
27 views

Should I add the “fetch_group” method to my user class or should I create a separate class for group

I have a table of users, where each user has a group (or multiple groups) he/she is part of. Currently I'm handling the users group via a Users class: ...
0
votes
3answers
66 views

“Human” interfaces with two implementation classes

The Helloworld class executes all of the methods. Human is the interface, and Nate & <...
0
votes
2answers
61 views

Implementing many-to-many

I'm looking for advice on implementing many-to-many. I'm modeling a site such as stack exchange: each Member has many Groups, each Group has many Members. I've introduce a Membership class. This class ...
4
votes
4answers
343 views

Initialized Array Template Class (C++)

The problem We want to use a very large array for some computations. When created, all the elements of this array have to be initialized to some value. We'll only use a few values from the array1,...
0
votes
0answers
25 views

Pomodoro timer in React

I created a simple Pomodoro timer using React JS. In my example: Timer should count down seconds until it reaches 00:00 Timers should switch between 25 and 5 minutes Timer should be able to start, ...
7
votes
2answers
87 views

A game of automated tag

This game has 4 people moving randomly, one unit in one of the four directions (up, down, left, right), with a fifth person as a designated tagger. If this fifth person tags someone, the person is out....
0
votes
0answers
21 views

Rails mixin to handle address fields

I'm currently working on a Rails 5.2 application where I'm trying to parse users data into a PDF form. The data from the user is received via a JSON object. The fields of the form are as follow: <...
4
votes
1answer
126 views

Macau Card Game (with graphics)

I've already made a version of this game which was supposed to be played on the console. I got it reviewed and applied almost all of the recommendations I received in that topic. Thus you can consider ...
0
votes
2answers
140 views

Fetching data from your database in a constructor

I have this item (an item is an object linked to a xml view), to build it I need 2 things, get labels from codes, and get text from the strings.xml android file. please ignore the long to int and int ...
1
vote
0answers
45 views

DDD Best practices [closed]

I'm developing some test web-project for my self to learn DDD and good architectural practice at all. So application, basically, is a simple photo manager. I'm developing 3-tier architecture and for ...
4
votes
1answer
61 views

Supermarket app using OOP

I am going in a circle over and over trying to write a "supermarket" application using OOP. The app should be useful for the employees of a supermarket. The app reads data from a CSV file which looks ...
5
votes
1answer
143 views

Traversing the parent-child relationship between objects

I wrote this code because I was often annoyed that I couldn't get the parent object. This class allows you to traverse the parent-child relationship between objects, in both directions. It also ...
4
votes
2answers
152 views

Java Conway's Game Game of Life

I have implemented Conway's Game of Life simulation. What can I improve? How could I structure my programme better? All suggestions would be appreciated. World.java: ...
2
votes
1answer
45 views

Collision detection on Android

This is the same game code from my previous question. I split the code into smaller "logical units". The runnable code "Moon Buggy" is available in beta from the google playstore. It was previously ...
1
vote
1answer
130 views

Connecting 2 databases: one for admins and one for customers

I am working with 2 databases. One for admins ('backoffice') and one for users. Account managers: Use the 'backoffice' database to manage customer accounts. Customers: Whenever a users connects ...
2
votes
0answers
160 views

Netflix-like video recommendation system

I want to make my own Netflix in C#, without using sql, only using dynamic memory (omitting video-streaming support). I thought about this class diagram. What do you think? In my main program I have ...
5
votes
2answers
297 views

DSP-Quantizer class in C++

I have written a class to quantize values to arbitrary bit depths within a specified amplitude. It is meant to process one value at a time, and has two ways of quantizing values. I wrote the class so ...
0
votes
2answers
80 views

PHP DRY my code

I want to DRY up my code, but i can't think of a way to do this properly, mainly because of CASE 3,I don't have any idea what to do if i have muliple field inputs (all of these are user inputs ...
2
votes
1answer
26 views

Implement metaclass for Maximumlikelihood estimator

For the purpose of defining a lot of Maximum Likelihood estimators, I think I need a metaclass. At the moment I have to copy/paste a lot of code for every new class definition and just substitute the ...
-3
votes
1answer
62 views

Use key as object in map C++: Check if the less operator is implemented correcty [closed]

Hello I wrote the following code. It allows me to use objects as keys in a map. I have a constraint though: In addElement function both arguments must be pointers ...
1
vote
1answer
59 views

Javascript Snake

I have implemented a little snake game with Javascript and Html. This is my first game with Javascript. I use a Linkedlist to represent the snake. Both code snippets are in snake.js file. It would be ...
5
votes
2answers
186 views

Tetris game demonstrating OOP principles

I've designed a basic Tetris game, and implemented it in Java language. I'll use it for demonstrating software engineering, designing. I'll re-implement it in many different programming languages, in ...
6
votes
0answers
107 views

Python class for organizing images for machine learning

I built a class to help me handle image data to use in machine learning. I thought that there would be a pre-existing package that did what I wanted but I couldn't find it so I wrote this. I am not ...
1
vote
1answer
82 views

Models for analysing Twitter data (*which based on tweepy package)

I have three modules here models.py, functionals.py, and adjustment.py. These three may be ...
3
votes
1answer
51 views

A Ruby script to generate random “people”

I'm working on developing a small Ruby program to generate random data for a Neo4J database, including people, addresses, phone numbers, etc. I'm a total beginner to Ruby, so I wanted to post my ...
0
votes
1answer
76 views

Object oriented design of chess game [closed]

I was trying to design a chess game in Java. I have just started learning design patterns and am not sure if my approach here is right. Could you please suggest ways to better this design ? Below is ...
5
votes
3answers
221 views

Python lexicon class

First time around Code Review so please be gentle (and I am happy for comments on which angles of this post are a good fit and which less so). I'm not pretty much used to software engineering in ...
1
vote
1answer
41 views

Write a class for Team which should have function to prints players details

I have written it using aggregation but i feel its not the best way we can do this. Please suggest is there any other way to do this. I think we can also built this without using player class, just ...
6
votes
2answers
63 views

Abstracting OpenGL shaders and uniforms into objects for ease of use

I am following an OpenGL tutorial series and it got to the point where the program needed some code abstraction. I followed the tutorial on the abstraction of VBOs, IBOs and the like and when it got ...
5
votes
1answer
88 views

Beginnings of a neuron simulation

I have 2 classes that do extremely similar things. The only differences are that they draw using different colors, and that one draws in the back. The classes ...
1
vote
1answer
102 views

Basic object-oriented PHP login, logout, and registration scripts

I am new to OOP in general and have recently started trying to develop object-oriented PHP code instead of relying on a primarily procedural style, as this is a requirement for my studies. One part of ...
2
votes
0answers
54 views

JavaScript attempt at an aspect oriented logger using proxies and reflect

I've been playing around with AOP in JavaScript to create a Logger that I can attach to classes and output what is going on (mainly instantiation, calling of functions and the results from functions). ...
1
vote
1answer
83 views

PDO Dynamic query builder

I'm trying to improve my php oop programming skills. As an exercise I wrote this class that will generate and execute dynamic sql queries. I've also writed a class to call various sanitization filters ...
2
votes
1answer
52 views

Appending data to a web page from a form using a JavaScript class

Recently I've been reading about classes in JavaScript and decided to code this simple form to test them out. Even if the code works I am still pretty sure I lack understanding of classes and other ...