Core to Object-Oriented Programming (OOP), a class is a template for creating new objects that describes the common state(s) and behavior(s).
1
vote
0answers
14 views
Displaying a scrolling stock exchange ticker in a window
I've written my first OOP program (194 lines including docstring and comments) in Python that uses Tkinter as GUI and Threads. The program shows a window and displays a scrolling stock exchange ...
3
votes
2answers
163 views
Locate user of an Android device
I am new to oriented object paradigm and I work on Android using Java project for an internship.
I must be able to locate the user and some around buildings I read stuff about how to setup ...
3
votes
2answers
109 views
Eliminating duplicated code blocks
I have an abstract PersonDao class, extended by several other DAO classes, for example EmployeeDao, ...
6
votes
1answer
104 views
Creating C++ classes and objects
I'm brand new to programming (in general) and C++ (in particular). I'm learning the basics of classes and objects.
I'm trying to do the following:
Create a class called ...
6
votes
1answer
43 views
Sorted unidirectional list with add, delete and find
I am aware of the fact that a sorted unidirectional list has only very few use cases, but nevertheless, this python code feels fairly long for Python code. How can I improve it?
...
4
votes
1answer
87 views
First attempt at making a user class
I've just begun creating my first user class. First, I need some clarifications.
Am I using try and catch correctly?
To ...
3
votes
0answers
51 views
Fixed point iteration and cobweb plot
I'm using Python to find fixed points of a given function and then draw a cobweb plot to visualize it. Thanks to this question, I have the core of the code written and can accomplish the task, but I ...
1
vote
0answers
15 views
Application Class Security
Is my Application.php class secure for continuing development?
The Application.php acts as a registry for the whole application. I tried not to rewrite already working code that is being pulled from ...
2
votes
1answer
45 views
Generate the Norwegian equivalent to social security numbers
This is just a little hobby project I've been working on. I've been using it to learn/improve my knowledge of C++.
The program generate Norwegian personal-numbers (11 digits) for males born a given ...
3
votes
3answers
119 views
Best practices to create extended class
I have two class Task and Award which extends Task. I create this class objects according ...
6
votes
2answers
70 views
Planning a rather large refactoring of physics code in a good way?
I have a large file that I want to refactor. My idea is to make helper classes with helper methods so that I can modularize methods.
Is that a good idea? For instance before refactoring:
...
2
votes
2answers
52 views
Return custom assembly attribute variables
I have a custom attribute in my assembly called SemverAttribute, and I have a helper class called AppInfo that has a function to return a number called the Semver number. It accepts an id of null-6. ...
4
votes
1answer
95 views
My simple PDO wrapper class
I made a simple database class and I wanted to know if there are any improvements I could work on as far as readability, efficiency, methods and making it modular goes.
Any other suggestions are also ...
1
vote
0answers
34 views
2
votes
1answer
73 views
How can I optimize my insert function for the cuckoo hash table?
I'm working on class for a hash table where collisions are corrected using cuckoo hashing, I had difficulty writing the insert function, the function is supposed to insert the key if the ...
4
votes
1answer
98 views
Merging with different modules
We have an action merge for two projects. In the projects we have different modules like Feed, Files, Post etc....
...
4
votes
1answer
47 views
3
votes
2answers
99 views
Bad usage of classes in Python
I was recently working on a project where I had the following setup:
...
1
vote
1answer
19 views
Categorizing utilities into modules [closed]
I have two classes in my program, the one is PropertiesUtils and the other one FileUtils.
This is the general structure of ...
1
vote
1answer
75 views
Text-Based Simulator in C++/Qt with many commands
The following is an excerpt of a mostly text-based simulator of the iRobot Roomba robot vacuum. I made a class called Roomba that handles everything the roomba does. For those familiar with QT; There ...
3
votes
2answers
105 views
Validating C++ Time class objects
I created a Time class. Now I want to modify the code to perform input validation. Hour should be between 0-24, minutes and seconds between 0-59. If class need ...
3
votes
1answer
40 views
Handling an IRController
At the time I try to write some code to handle an IRController, I got this following classes:
...
1
vote
1answer
41 views
Putting in order my two packages and possibly merging them
I am making an application which fetches tweets for a specified amount of time, then inserts those tweets in a database and when the user presses another button the top ...
8
votes
3answers
699 views
C++ Student Class
Is this a good approach of designing a class or is there some other way that I am not aware of?
Student.h
specification file
...
1
vote
2answers
110 views
Classes for Facebook graph API and Twitter access
Given below is code which I wrote to provide an easy access to Facebook graph API.
...
0
votes
1answer
105 views
3
votes
1answer
59 views
advantage of using __call method
I have wrote simple class that allowing database selection and inserts.Could you please tell me does this a right way to use __call method with any useful advantage of it ?
...
2
votes
1answer
61 views
Creating an .rtf file with cards from a list of people
I have made 2 scripts in Ruby. The first program creates an .rtf file with cards (file with colored table with persons) from a list of people in text file. The second program does the same, but in ...
4
votes
1answer
61 views
Loop cleanly through different classes
If I have a number of different classes which manage certain tests. At the moment I have to launch each test individually which results in a lot of if statements.
...
4
votes
1answer
27 views
Character Sprint Spaghetti Code
I finally managed to get the code to work properly. It makes the player object move faster if the user double taps the arrow key with a few 'ticks' (new frames) after the 1st stroke. - User presses ...
1
vote
2answers
135 views
Creating a Party Game to learn OOP
I've been developing sites using Dreamweaver for the last 15 years, I do a lot of code editing manually so I have quite a good knowledge of the PHP language.
I'm diving into object orientated ...
8
votes
2answers
196 views
Tree Template Class Implementation for C++
I have not done any parameter checking, however I think the meat of the class is there. Let me know what you think.
...
1
vote
1answer
64 views
Optimized Form fields generating class
I am building an application full of forms and so I thought it is good idea to create a class to populate form fields.
Here is my class and I am sure it can be optimized more than now and could be ...
0
votes
1answer
40 views
Managing several payment means in my Rails 3.2 app
I'm trying to manage several means of payment in my Rails 3.2 application.
Let's say I have 2 means : Credit Cards & Bank Transfers (BIC), working with 2 different payment providers. Those means ...
2
votes
3answers
77 views
Raising error if method not overridden by sub-class
Background
I have a base (only 2 classes inherit from it, and only from it) abstract (meaning I don't want it to be used directly) class that implements some common functionality.
Some of it depends ...
7
votes
2answers
81 views
Python script to test music sight reading
I decided to write a program to test music theory, and, while it would've been much easier for me to make it elegant and perfect in Java, I thought I'd take the opportunity to get more familiar with ...
3
votes
1answer
138 views
Flat-file DB with CRUD
I just finished writing a flat-file DB class for PHP which supports selecting, updating, inserting and deleting.
I was wondering if there are any ways to make it faster or if I'm doing anything the ...
7
votes
2answers
202 views
Cleaning up and commenting on my code for Pong game
This post is a follow-up to When should I consider the number of my method arguments too big?
I took the some advice from previous post and I'm almost done with cleaning up the code.
I didn't make ...
4
votes
3answers
70 views
New Game - Am I going down the right path for DOM manipulation?
I find myself using a lot of .find functions within what I'm developing. The reason being that I need to run this same function on a TON of different characters ...
10
votes
1answer
322 views
When should I consider the number of my method arguments too big?
I'm writing a simple Pong game, I have a method bounce() that makes everything run: the ball, the paddles, score etc. and it uses 12 arguments: 3 counters, 2 ...
6
votes
2answers
229 views
Class for printing class hierarchy as text
I'm coding a little class hierarchy printing tool for easy show hierarchies of java classes.
This is my current code:
...
5
votes
3answers
515 views
Is there a better way to pass variables into a class?
Is there a better way to pass variables into a class?
...
4
votes
3answers
326 views
Nested class or two separate classes?
I am making this program that is going to calculate distance from randomly generated dots (with x and y coordinates) to 5 bigger ones and then its going to put each smaller dot into the group with ...
4
votes
2answers
290 views
Using threads to find max in array
I really do not have access to anyone, outside of professors, that is highly knowledgeable about Java so I figured I would post my stuff here to further my knowledge and improve my coding. This is ...
3
votes
1answer
91 views
Is this a complete PDO prepared class?
Is this class perfect for databases? All I want to know is what I should change to make it perfect.
...
7
votes
4answers
220 views
User search implementation
In my Java code I have these three classes. Basically I have a User class, and also a GUI class that holds TextViews and other things (GUI related) for the ...
6
votes
2answers
115 views
Proper use of class constants
This question specifically relates to the use of the class constants ABOVE and BELOW in the sample code below.
I have a few different classes that look like this:
...
2
votes
1answer
93 views
“Property Container” design-pattern
I've tried to write my Property Container design-pattern implementation.
Could anybody, please, tell me, if this code is really what I intended to write (follows ...
8
votes
2answers
117 views
Javascript/ECMAscript 6 classes organization
So I have been trying to wrap my head around all the new options in ECMAscript 6 and to do this I tried to develop a simple setup which would allow me to place absolutely positioned ...
6
votes
2answers
934 views
Empty Interface usage - is this a code smell?
I've recently made a set of interfaces/classes to work with converting a spreadsheet into an object but I utilise an empty interface in my design:
So first off I have my interface which defines what ...