Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
6 votes
2 answers
334 views

Reorganize a maze game from one large class into smaller classes

I'm new to Java and I really don't understand how to make more classes work like one. So if anybody could explain and help me divide my large code into smaller classes (like Player.java, Main.java, ...
Jollyfreak's user avatar
1 vote
1 answer
70 views

Autoloading Class files and instantiating a class - Admin backend

At the moment I am auto loading my classes with: spl_autoload_register(function ($class) { require_once 'classes/class.'. $class .'.php'; }); And ...
CodeX's user avatar
  • 1,063
4 votes
1 answer
171 views

HttpSession Wrapper Class

Are there any aspects I could improve of my HttpSession wrapper class? Other suggestions are also welcome. ...
Kid Diamond's user avatar
  • 2,591
2 votes
2 answers
97 views

Simple class, solely for setting "globals"

I'm aiming for the best and simplest way to access "global" variables set in the config file for my website. So I can use them anywhere, even inside functions It's for file versioning, and I use ...
mowgli's user avatar
  • 121
3 votes
3 answers
182 views

Calling a method outside class statically, passing other method's output as parameter

I have this class: ...
Jolly Roger's user avatar
3 votes
1 answer
308 views

Simple IRC bot with plugin support

I'm looking to see if there is anything in this I could have done better or see if could have structured the code better. Here is the project on GitHub. ...
desg's user avatar
  • 31
1 vote
1 answer
195 views

Should this container be a struct or a class?

I have a class that serves purely as a data container for passing values from a parsing class to a class responsible for saving the data. I have been wondering whether it would be more appropriate as ...
Michael Richardson's user avatar
3 votes
2 answers
3k views

Validating basic data objects

I'm playing around with trying to do things in a better way, and in a class I have for sending emails, I have the concept of a recipient. This gets passed into my other classes essentially as a struct ...
Rich Bradshaw's user avatar
3 votes
1 answer
1k views

Simple Javascript state management class

So I needed very basic state management and notification for a small game-like thing I'm building. I decided to implement something like a finite state machine (but not quite, it doesn't transition ...
cemulate's user avatar
  • 131
5 votes
1 answer
1k views

Class for RegQueryInfoKey pinvoke

I'd like to make sure I'm following some basic coding best practices since I've had only little practice creating my own classes and using pinvoke. I've found this class to be pretty useful and I'd ...
Kevin Denham's user avatar
11 votes
2 answers
1k views

Too many objects, too "deep" class structure?

I have a pretty large model library I'm working on and it's turning out quite complex, or so I believe at least and I could use a second opinion. The basic idea is that the user should only have to ...
Hjalmar Z's user avatar
  • 245
6 votes
2 answers
7k views

Blackjack game with classes instead of functions [closed]

To try out the concepts and tools I've been learning, I decided to write a Blackjack game. I wrote it entirely with functions, so it hasn't helped me at all with the concept I really lack ...
User1996's user avatar
  • 221
3 votes
3 answers
105 views

Working with Classes (inheriting), @ properties and Initialization

I'm working on this Objective C programming assignment I found online. I'm not sure if I have met all the requirements, especially part C. Any help or suggestion will be appreciated. Part 6 a)...
Christopher Palmer's user avatar
5 votes
2 answers
254 views

Initiating class objects and arrays

I have a class that always has 14 instances. I'm just wondering if there is a better or more effective way of doing this. In this class I also have an array that is filled by calling 4 functions ...
Josh Kirkpatrick's user avatar
2 votes
2 answers
132 views

Generate the Norwegian equivalent to social security numbers - follow-up

First of, here is my previous post. That should explain a fair bit. The reason I'm posting one more time, is I have changed a lot. Using more classes, let them do all the work, and the overall ...
Nilzone-'s user avatar
  • 1,426
7 votes
2 answers
6k 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 ...
Trimax's user avatar
  • 123
3 votes
2 answers
461 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 ...
Swann's user avatar
  • 133
8 votes
1 answer
4k 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 ...
user3814362's user avatar
8 votes
1 answer
182 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? ...
chaosflaws's user avatar
4 votes
1 answer
140 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 ...
r3wt's user avatar
  • 472
5 votes
1 answer
5k 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 ...
eeyore's user avatar
  • 53
2 votes
0 answers
77 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 ...
Traven's user avatar
  • 173
3 votes
1 answer
833 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 ...
Nilzone-'s user avatar
  • 1,426
4 votes
3 answers
2k views

Best practices to create extended class

I have two class Task and Award which extends Task. I create this class objects according ...
Błażej's user avatar
  • 589
2 votes
2 answers
705 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. ...
aaronmallen's user avatar
5 votes
1 answer
879 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 ...
Kid Diamond's user avatar
  • 2,591
2 votes
1 answer
984 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 ...
user3369309's user avatar
4 votes
1 answer
129 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.... ...
krunal shah's user avatar
4 votes
1 answer
86 views

Blog engine or somesuch

Would someone tell how I can improve this piece of code? ...
Jean's user avatar
  • 71
1 vote
1 answer
341 views

Text-Based Simulator 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 ...
mmphilips's user avatar
3 votes
2 answers
5k 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 ...
Deepak Singh's user avatar
3 votes
1 answer
51 views

Handling an IRController

At the time I try to write some code to handle an IRController, I got this following classes: ...
user42350's user avatar
1 vote
1 answer
1k 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 ...
Aki K's user avatar
  • 1,329
14 votes
4 answers
94k 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 ...
Deepak Singh's user avatar
1 vote
2 answers
2k 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. ...
Pranav Raj's user avatar
2 votes
1 answer
6k views

Get data from some SOAP resources

...
Rijalul fikri's user avatar
4 votes
1 answer
181 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 ? ...
underscore's user avatar
2 votes
1 answer
597 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 ...
user3462189's user avatar
3 votes
1 answer
94 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. ...
Gerhard's user avatar
  • 141
4 votes
1 answer
51 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 ...
RAO's user avatar
  • 173
1 vote
2 answers
1k 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 ...
Dizzy Bryan High's user avatar
12 votes
2 answers
20k 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. ...
Joe's user avatar
  • 123
1 vote
1 answer
131 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 ...
pixelngrain's user avatar
0 votes
1 answer
86 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 ...
Jejekeny's user avatar
9 votes
3 answers
14k 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 ...
Yatharth Agarwal's user avatar
4 votes
1 answer
2k 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 ...
Chosen Wann's user avatar
7 votes
2 answers
314 views

Cleaning up and commenting on my code for Pong game

This post is a follow-up to Simple Pong game I took the some advice from the previous post and I'm almost done with cleaning up the code. I didn't make any wrapper classes, because my game is already ...
Asalas77's user avatar
  • 357
4 votes
3 answers
107 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 ...
Nicholas Hazel's user avatar
8 votes
2 answers
7k 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: ...
bobbel's user avatar
  • 358
4 votes
3 answers
2k 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 ...
Qwert's user avatar
  • 41

1
5
6
7 8 9