Questions tagged [classes]

Core to Object-Oriented Programming (OOP), a class is a template for creating new objects that describes the common state(s) and behavior(s).

Filter by
Sorted by
Tagged with
0 votes
0 answers
57 views

football team results in python

The program is taken on the standard input a list of football team games with the result of the match and displays on the standard output a summary table of the results of all matches. A team is ...
0 votes
0 answers
51 views

Java pathfinding in general trees - Part 1/4: model classes

Java pathfinding in general trees - Part 1/4: model classes (this post) Java pathfinding in general trees - Part 2/4: algorithms Java pathfinding in general trees - Part 3/4: demonstration Java ...
  • 26.4k
1 vote
0 answers
41 views

Powershell Outlook Email Security custom classes

This provides custom classes to work with Outlook 2016's email security settings in trust center. Included are some top level functions to list outlook profiles, retrieve the data from a given profile,...
0 votes
1 answer
53 views

Fetch data from two exchange (Python)

I'm trying to fetch the latest price from two exchange and do further action base on the prices. exchanges.py: ...
  • 53
0 votes
0 answers
48 views

Investment capital calculator(Python)

The program is simulate a situation where my goal is to lose money in Corresponding exchange, however I will win max_lose times ...
  • 53
1 vote
1 answer
33 views

Sparse String Matrix Storage Class C++

Introduction I implemented a class to store a matrix with entries at positions (i,j) that are strings. The matrices I would like to efficiently store in this class have strings as entries and it ...
  • 113
2 votes
1 answer
127 views

Create a string "Build" number for procedures and module

The class assigns various strings to the build number. So the build might look like 3.4.5.1 which would be of the format ...
  • 121
1 vote
1 answer
91 views

A greedy approach to the Knapsack problem with C++ templates

The assignment is to be implemented on the following instructions: You are to write a Knapsack class and the main() to support and demonstrate the functionality required here. A function generate(int)...
user avatar
3 votes
0 answers
51 views

Movie app using fetch API

The code will create a new Movie class and then with the response of the API call, will render html using the data. Although the code works, I imagine it will get quite convoluted, now that everything ...
2 votes
2 answers
54 views

Object Oriented Hangman in Python (version 1.0)

As always, I am looking for as much criticism as possible. Forums and exchanges like this are where I have received my most solid feedback. Enjoy! Github hangman repository The code that I import is ...
2 votes
2 answers
91 views

Python: Sorting Marbles with switch and rotate - Need help in optimizing a working solution

I have made a couple modifications to the switch/rotate routine for the classic Marbles game. The modifications are Using a random_select method that can help pick either switch or rotate Create a ...
0 votes
1 answer
110 views

What can I do better in my C++ serialization implementation?

I want to serialize a class Mango recursively. ...
4 votes
1 answer
115 views

Alpha finance trader singleton

I used to write singleton in Python, which actually Alpha only need to initialize once and the trading bot will run forever. For example in main.py: ...
  • 53
0 votes
0 answers
98 views

Function block diagram code in CPP to program Arduino

I have created a processing program (Java) with which a programmer can use a GUI to make a program for an Arduino using logic function blocks. It looks like this: Ofcourse it still needs some work. I ...
  • 136
4 votes
2 answers
81 views

A simple and fast library/code to store & manage variable data

I've been searching through the different ways to store data and found some helpful and actually great libs like: JSON XML And some neh: text file basic write and read some binary type data storing?...
2 votes
1 answer
73 views

Generating random number of randomly sized Squares/Rectangles using numpy arrays

I made classes to use in generating square/rectangular shapes on a texture. ...
  • 21
2 votes
2 answers
50 views

Template Complex class

I have created a class Complex which represents a complex number of any arbitrary arithmetic type. Overloads are given for the 4 common functions, addition, ...
8 votes
5 answers
2k views

ReversibleList: a list that is "reversed" in O(1) time

UPDATE: Thanks everyone for the suggestions! I made a follow up version here which fixes the bugs, incorporates the feedback, and has more tests. A ReversibleList ...
  • 422
2 votes
1 answer
68 views

Object-oriented Snake game in HTML without using canvas

I wanted to try out classes in Javascript and implemented a snake game. You can control the snake by using the arrow keys. I would be interested to know if the source code can be improved in terms of ...
  • 2,102
0 votes
1 answer
77 views

Equation calculator

Function Calculates values for user defined equations. Just a concept right now. I plan to add many more equations. Equations in code Density: $$ p = \frac{m}{v} $$ Speed: $$ s = u + a \cdot t $$ <...
  • 301
3 votes
2 answers
127 views

MP3 Playlist Class in Python

Background Info I am an intermediate level Python programmer. This is my implementation of a MP3 Playlist class challenge that was hosted on 101 Computing.Net. The ...
  • 131
0 votes
1 answer
87 views

Common interface for fixed-length and variable-length lists in C#

I am working on library project in which I am reading and writing binary files that have own file format structure. In that structure there are variable-length and fixed-length elements. My approach ...
  • 185
1 vote
1 answer
72 views

Monster Maker application in Tkinter

I have a program that works okay (not fully completed) however, I would like to simplify things and create some classes and different .py files for my tkinter app as I feel that would help organize ...
3 votes
1 answer
113 views

Topological Sort C++

Comments on optimizing the code or improving the code are requested. The input parameters to the class constructor are a one dimensional array of job ID's and the second argument is a list of vectors ...
2 votes
1 answer
102 views

Sudoku Tkinter generator

I made OOP sudoku generator - at this moment it generates only valid table. You can clear it and then generate over. The case is I struggled with calling "fill_board" and "clear_board&...
1 vote
3 answers
310 views

Saving Multiple Lists to Database - C# Forms

I am trying to store multiple lists to a database but I'm struggling on finding a better way of doing it, as the way I am doing it now, seems to be incorrect. On my form, I have 6 different legs. Each ...
2 votes
1 answer
70 views

UpdateCustomer - implementation in C++

I am trying to write a program that does the following: The application will read the customer and book orders data from a data file “BookOrders.txt” and load them in a customer linked list, each ...
1 vote
1 answer
125 views

ASCII game in console [closed]

Overall, I want to make a game in console, something Pokemon-like but with typical rpg scenery - swords, magic and all that. I want to make player able to move around the map, find dungeons, fight ...
2 votes
2 answers
507 views

Input validation that verifies a boolean assignment using a Boolean object

Taking online college course and I'm new to Java. We just learned about input validation. I've used input validation pretty comfortably for strings, ints, and whatnot. But I had to validate a boolean ...
1 vote
1 answer
62 views

Tiny Validity class

Here is a part of my new code replacing the old and deprecated old-school one. Let's get to business right away: I document everything with Documentation comments, which are proving very useful so ...
1 vote
1 answer
104 views

Python password generator with Tkinter

I program in Python as a hobby and this week I decided to write a program that generates 16 character long passwords. I wrote this program as a class, which i rarely do. Because of this I think I ...
0 votes
1 answer
42 views

Comparing custom Geometry classes (Lines and Planes): How to increase the accuracy of the __eq__ method

I'm creating custom classes to represent Planes and Lines on a 3d graph. To help improve the performance of my process I've started implementing __eq__ so that I ...
0 votes
1 answer
26 views

JavaScript Class with a Fixed Set of Instances

I am looking to write a JavaScript class BasicType with five fixed instances INT, FLOAT, <...
  • 765
1 vote
0 answers
341 views

deprecated strftime in PHP 8.1

I saw that strftime is deprecated in PHP 8.1. I saw I can use a class include in intl but I'm not sure to understand how to use It. On my site I use this function with the array $datesToConvert{020222,...
-1 votes
1 answer
342 views

Vending Machine give changes after they select the menu [closed]

The program offers items, has the user pay for items, 'gives' the items. It seems to work more or less. I have 2 questions: I don't know how to deduct the cash from cash it is deposited and when they ...
10 votes
1 answer
847 views

High performance physics simulation - core class design

Below is some stripped down code from a physics simulation. The classes Vector2, Line and ...
4 votes
2 answers
596 views

Contact management system

I have created a contact management class for practicing, and I want to know your opinion about it. I know there are a lot of example of contact management class, but I tried to make this one a bit ...
-1 votes
1 answer
40 views

Class method instantiates another class while passing its self as an argument [closed]

I have the following code. I have made a complicated approach to calculate apple's price. Thus, I put this approach in a separate class called PriceUtl. The code ...
  • 251
1 vote
1 answer
275 views

Creating an argument parser using 'argparse', with groups and arguments are defined as classes

I have a Python module that will accept many arguments. Rather than having to have a big long list, I've decided to use classes to represent argument groups and arguments When initialised, the ...
1 vote
0 answers
36 views

How was this python code analyze these classes with class diagram

Anyone please review my code and give some improvement suggestions. I wrote code but not to the best standards. I think this site give some valuable suggestions this code is for extracting xlsx or csv ...
4 votes
1 answer
111 views

Let's get random, extending Python's base random class

So Python's base random class uses the Mersenne Twister as its base for seeded random number generation. If available, it can use /urandom/, but that is beside the ...
2 votes
2 answers
176 views

Checking image size in C++

This is a follow-up question for 3D Inverse Discrete Cosine Transformation Implementation in C++. After checking G. Sliepen's answer, I am trying to update the part of width and height checking of <...
  • 3,646
2 votes
2 answers
235 views

Graph Implementation with Dijkstra's Algorithm

Graph Interface: ...
  • 51
6 votes
5 answers
1k views

TString - An implementation of std::string

I wanted to make a feature rich string in C++. Similar to one in python. I am using C++14. I have not added much yet, I just want to get my code reviewed to ensure I am going the right way. Features: ...
4 votes
3 answers
546 views

C++ Vector3d class

As part of a physics simulation written in C++ using SFML I needed a vector3d class. Here is my implementation: ...
4 votes
2 answers
446 views

C++ simple 2D vector

I'm brand new to cpp and tried implementing a simple Vector class that supports abs(), equality and addition operators. I just wanted a quick set of eyes to tell me if I'm doing anything egregious in ...
4 votes
3 answers
176 views

Barebones C++ Matrix class

I have implemented a C++ Matrix class using std::vector and a number for rows/cols. The implementation works decently from the QA I've done. I have implemented a Vector class as a derived class but I'...
2 votes
1 answer
133 views

Operator overloading in Image class implementation in C++

This is a follow-up question for Dictionary based non-local mean implementation in C++. There are some issues about operators (operator+ and ...
  • 3,646
0 votes
3 answers
120 views

A Class that creates a unit of Stock or a collection of Stocks

I have a dataclass of a single class object 'AStock' as such: ...
  • 1
2 votes
1 answer
103 views

Gallery template class

I have created a template class Gallery which is intended to be used as a container for objects. I used a private member of type...

1
2 3 4 5
8