Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.
3
votes
1answer
24 views
ProductManager: a basic CRUD for products with SQLite
I would like to have a review of this basic CRUD application so I can improve and learn from your experience. The code can be found here.
Design pattern/coding principles improvement that could be ...
1
vote
0answers
13 views
Python GUI for cropping and saving images quickly
I wrote a simple GUI applications to help me select 'positive' regions of a bunch of photos for the purpose of training an object detectir using OpenCV Haar Cascades.
For training purposes, you need ...
2
votes
2answers
13 views
Passing JSON object through loop to be used in jQuery Dialog
I'm wondering if there is a better (cleaner?) method than my current implementation. I'm currently encoding a PHP SimpleXMLObject (USPS Tracking API) to JSON and ...
2
votes
0answers
13 views
Boarding cards route finder
Recently I had an interview project, which I did and sent, so this question is not for avoiding thinking. I am just struggling to build my own opinion about it so I decided to ask in public.
My ...
3
votes
2answers
62 views
Simple object oriented design for a patient system
I want to model this scenario in object oriented language:
A hospital has number of patients
A patient can have zero or more medical conditions
A medical condition is identified by name and date
...
4
votes
2answers
57 views
Modeling rainwater collection and cost
The following is a function that takes an area as an input and outputs some resulting calculations.
I thought an object was useful for creating multiple instances with different custom properties ...
2
votes
3answers
106 views
Music collection with lyric songs and instrumental pieces
I have problems with dealing with derived classes that inherit from the same base class.
I have 2 types of songs:
Songs with lyrics that have: Title, Tags (sad, happy etc.), lyrics (one line), ...
5
votes
2answers
146 views
Rock, Paper, Scissors, Lizard and Spock with OOP
Today I saw an extremely interesting question on the Rock, Paper, Scissors, Lizard and Spock game. I've decided to take my swing at it and I've written the following OOP implementation:
...
3
votes
1answer
54 views
Simple Vector2 structures (and interface)
I built a couple Vector2 structures (Vector2 and Vector2F) for use with a particular ...
4
votes
0answers
118 views
Small PHP-MVC system (for personal learning / use)
I've made an "simple" / "small" MVC-like PHP system. I've used some code of an project I used before and ask questions about it back then to.
The thing is, it works (the admin part to begin with), ...
3
votes
1answer
74 views
Solving Project Euler problem #60 in C++
I have implemented a solution to Project Euler problem #60. In summary, the problem asks to find the smallest sum of a set of five prime numbers such that the decimal strings of any two numbers in the ...
2
votes
1answer
39 views
Get K most frequent tokens from a token stream
This is an interview problem:
Given a token stream, find the K most frequent tokens in real time (the order of these k tokens does not matter).
My approach:
Use a hash table (...
5
votes
0answers
54 views
Find all the primes less or equal than N
This is not a novel interview problem. But I want to address it with the following points:
Implement the algorithm with Object-Oriented Design principles in mind.
Optimize the solution, if there are ...
6
votes
1answer
70 views
Avoiding code repetition while handling exceptions
For my application, I need to use two slightly different algorithms for persisting an entity:
...
5
votes
1answer
81 views
Inventories, Containers and Filters
Coming off a comment on this question, I figure it cannot hurt to post my Inventory work here as well.
Basically, I have Item, ...
4
votes
1answer
41 views
Sorting a linked list using mergesort
This sorts a linked list using mergegort. Can you please critique my code and provide your thoughts on where I should improve my code?
...
5
votes
0answers
70 views
Multiple inheritance pattern for vehicle information
I wanted an easy way to augment objects, by adding functionality from any other object(s). More importantly, I needed a way to augment the object from multiple sources in a clean one-line solution.
...
7
votes
2answers
100 views
Tic Tac T-OO: Design and Implementation
I want to learn OO design and as a start, I implemented Tic Tac Toe. I'd like to hear your thoughts on the design and implementation.
Classes:
Player - Has just ...
5
votes
1answer
111 views
Simple hotel reservation system
This is a reservations software for hotel and restaurant management, allowing you to add and delete rooms, show available rooms, keep track of reservations etc. I am looking to trim my code a bit and ...
1
vote
1answer
52 views
JavaScript accordion
I'm trying to refactor some code I wrote months ago when I used to use lots of anonymous functions. The way I'm trying to do it now is by taking all those functions and rewrite them within Object ...
1
vote
2answers
30 views
Cameras and ITrackableObjects
The purpose of these two classes (and hence why I am including them together) is to allow you to create a Camera, that indicates a "render zone", and track an ...
0
votes
0answers
50 views
Simple Router class
I made a simple routing class that I like to get reviews for, mostly because I do not know how to make it SOLID, since I even made this class separate from the HTTP response, request ... for the sake ...
11
votes
1answer
118 views
Ultimate Tic Tac Toe A.K.A. Tic Tactics
My attempt at this challenge., incorporating lessons from this question, which turned out into a much bigger project than I anticipated, but it works. I'll definitely be refactoring most of this in ...
7
votes
1answer
72 views
Designing yet another coffee machine, Lombok style
After reading Designing a coffee machine, I decided to implement the same problem as an exercise to get to know Guava and Lombok.
I used the problem statement from the given question:
Design ...
6
votes
2answers
116 views
Simple Mastermind game in OOP form
I'm currently learning Java. I'm trying to get a good grasp on determining what becomes a class. I've started translating old games in to simple Java programs.
I'm looking for any critique of use ...
2
votes
2answers
77 views
Immutable subclass of a Set class
If I'm creating an immutable class from an existing class, should I override methods that mutate the property or have an instance of it and write my own methods to read from the property?
I have an ...
6
votes
4answers
303 views
Artillery game C++ practice project
I've completed a program as a learning experience to make sure I've got the concepts down. I found a practice project online and decided to try it out. The program compiles and runs exactly how it ...
3
votes
0answers
26 views
Search Class with Static Methods
Most of my programming experience is in PHP, and I have always been a bit wary of JavaScript.
I have a JavaScript class to manage executing, caching and displaying search results.
...
2
votes
3answers
161 views
XML serialization helper class
Yesterday was JSON serialization, today is XML serialization.
I've taken some of the suggestions from there and made modifications, as well as making other modifications that were not suggested but ...
2
votes
1answer
66 views
JSON serialization helper class
I wrote this class to one-line all my JSON serialization, and I'm curious of any input on it.
It's only responsible for serializing/deserializing any type to/from JSON.
The comments and code are ...
1
vote
2answers
67 views
Float.Parse issue
I have telerik radgrid that has an SQL backend. What this function is doing is conditionally formatting the cells with in the radgrid. It checks each column to see if the min and max values are within ...
1
vote
1answer
30 views
Input field that dynamically monitors model value
This question is regarding my approach to the following implementation requirement. Can you suggest a better alternative that doesn't suffer from the issues I'll point out in my implementation?
...
2
votes
2answers
66 views
Framerate Measurement Utility
As part of a project I'm working on, I need to measure FPS. In the past, I would do this within the actual project itself, but recently I've been trying to implement more abstract (and reusable) ...
3
votes
1answer
51 views
Google reCAPTCHA Validator
This entire class came out of a chat discussion, and I'm curious on how it looks. (This is like literally 30 minutes of development time.)
The idea is to allow very easy, quick implementations of ...
5
votes
1answer
58 views
Listing Books nicely - a tour through a webapp
In this exercise, I do not want to use any container such as Spring or Glassfish. I am deploying my application to Tomcat. I only use JPA. What I want to achieve is to follow best practices and OOP ...
1
vote
1answer
156 views
Simple PHP session handler class (using MySQL for session data storage)
I have tried to write a small light weighted php session handling class that use PHP's session_set_save_handler() function to overwrite the default session handling ...
2
votes
1answer
54 views
Poker deck class /w generator function and list comprehensions
There are multiple aspects in the code I do not really like. [card for card in ...] looks really lame, also ...
2
votes
1answer
88 views
Lockable linked list
The existing design of class DList and DListNode is taken. The main criteria is to do successive updates in \$O(1)\$ time.
Part ...
3
votes
1answer
23 views
Exception Handler on a Switch
I am working on rewriting an application in Laravel 5.1. I am new to the exception handling technique introduced in 5.0. I have overlooked taking advantage of throwing/catching exceptions frequently ...
1
vote
0answers
15 views
Web Scraping class schedules
I just want some advice regarding code style and best practices. Also I want to know if I'm using constant declaration and closures properly.
This code is used to get the data from here ...
4
votes
1answer
58 views
Descriptor class with advanced (inspect/metaclass) functionality
Having answered this question over on Programmers.SE, I found myself wondering how much effort it would be to write a descriptor that can automatically figure out what the 'destination' attribute ...
5
votes
1answer
100 views
Robot arm manipulation library
I have created a DLL library that controls an robotic arm. Could you tell me if my design is correct? The robot communicates over serial port. The code works but I would like to receive a feedback ...
2
votes
2answers
84 views
Sharepoint Authentication Helpers
I'm working on a rather large SharePoint project that's going to contain helper classes for a variety of item levels (sites, webs, lists, items, etc').
When writing code I'm expecting that the same ...
1
vote
1answer
50 views
Implementing a linked list as practice for a coding interview
I am practicing LinkedList problems. How do I make it production level code as is mostly expected in a coding interview? Any other Suggestions?
...
2
votes
2answers
65 views
DataStream interface for reading and writing data
I am writing a C++ library which will interact on files, memory buffers and remote files accessible with the HTTP protocol.
To handle that, I've decided to create some classes that will use the ...
1
vote
1answer
30 views
Selecting orders submitted by a user, segregated by status
I have recently started using Laravel as my chosen framework. It is my first time using a framework. As I have made progress through my project, my controller methods have started to increase in size. ...
7
votes
2answers
143 views
Color structure with single field for multiple properties
This struct is used a lot throughout my programme. This struct is responsible for only things regarding colour, not anything else.
I'm largely concerned of the ...
3
votes
3answers
88 views
Linked list implementation - follow-up
Follow-up to this question as recommended.
Can this code be improved from an OOP paradigm perspective?
...
1
vote
1answer
71 views
OOP paradigm implementation of a linked list
Can this code be improved from an OOP paradigm perspective?
...
4
votes
3answers
199 views
Free Code Camp - Pairwise
I'm working through the Free Code Camp syllabus and I'm on to Intermediate JavaScript Algorithms. This Pairwise problem was the last challenge in that section. The section came just after "Object ...