0
votes
0answers
6 views

Improving My Java Object Oriented Program

I created a java class, "Date," in which I basically create date strings and set dates. Anything that I can do, besides adding comments to improve/shorten my code? Currently Commenting My Code I've ...
0
votes
0answers
7 views

Group By And Two Counts

I'd like to know if there's any better way to write this query: ...
0
votes
0answers
9 views

Simple SAT Solver In Python

I am interested in improving my coding standards in Python so I decided to post one my more recent and smaller "for fun" projects here for review. The code below implements a rather simple ...
1
vote
1answer
10 views

A source Code Counter

This is from my project codecount I use personally that is very similar to cloc.exe or SLOCCount. The part that I am questioning is where I am calculating when I am in a comment block and have deep ...
0
votes
1answer
12 views

Kings Cup drinking game

I'm working on a card game in Java that simulates the drinking game Kings Cup for a school project. I'm having trouble putting the pieces together, and was wondering if someone could tell me what I ...
0
votes
0answers
6 views

Transfer the format of an old string to a new string

First, I've extended the String class to detect uppercase and lowercase characters: ...
5
votes
3answers
52 views

Conditional statements relating to hospital management

It works just fine, but is there any other way to write this shorter? Nurses are only available to intensive care patients (room I) and TV's and telephones are only available to non intensive care ...
-1
votes
0answers
20 views

Program Settings using Adapter pattern [on hold]

I'm working on a program at work that is both a keyboard wedge and keyboard hook. I may have made a mistake on the two wedge configurations, but I have 1 wedge as a base which just takes a com port, ...
-3
votes
0answers
22 views

99 bottles of beer on the wall [on hold]

I am going through Chris Pine's Learn to Program Ruby Book. One of his chapter 6 exercises is to write a program for the 99 bottles of beer on the wall song. I was struggling so I googled for some ...
0
votes
0answers
7 views

Confused about unsigned in C [migrated]

#include <stdio.h> #include <stdlib.h> int main(void) { unsigned int i; i = -12; printf("%d\n" , i); system("pause"); return 0; } ...
0
votes
1answer
18 views

Would multiple joins boost performance, or are the nested queries an acceptable way to handle the situation?

I'm working on a directory that lists employee information. Each employee can belong to multiple departments and each employee can have multiple job titles. I have 5 ...
0
votes
0answers
14 views

Python for loop [on hold]

I have a basic for loop in python that I'm wanting to run whereby I call a function and pass in a parameter that is varying from 480 to 6000 in increments of one...thus... ...
7
votes
3answers
78 views

Simplifying many-indents-code

I have the following code, written in Python: ...
0
votes
0answers
16 views

how can i search text file in another text file? [on hold]

I have been trying to get two text files to search trough each other line by line. Once has a bunch of words (around 20 words, one per line). for example : "getting", "wake up" , "do not use" . And ...
3
votes
1answer
18 views

Little script to Caesar shift strings

I wrote a little Perl script to Caesar shift strings. Usage: ...
10
votes
2answers
88 views

Trading Card Game's Hand class and tests

As part of a Trading Card Game, I have created a Hand that will need to hold all cards that a player currently has in his hand. The code is built using Java 8. The ...
4
votes
3answers
225 views

Project Euler 18/67: Maximum Sum from Top to Bottom of the Triangle

This is my attempt at Project 18/67 of Project Euler. You can see the problem information, and obtain the needed txt file from here. I had some help with the split function, and help on how to use an ...
3
votes
1answer
34 views

How to provide best integrity for interfaces in C#?

I am trying to apply Interface principles into my code, learn by practice method. I have a CRM system that has Notes, Payments, DairyEvents and anything else that needs to be bolt on over time. I ...
5
votes
1answer
25 views

Convert list of parameters to a string that can be invoked

My PowerShell scripting skills are pretty poor, but I've managed to hobble together got this script: ...
6
votes
3answers
164 views

Notify user of upcoming expiration of subscription

Here is some VB code that is part of a major system of apps that I have been asked to maintain, one of the more fun things that I get to do is rewrite some code here and there, I have done a little ...
4
votes
2answers
56 views

Retrieve Tasks by Employee

I think I've done a decent job keeping this query simple and understandable, but I'd like to know if you have some more advice. My relevant entities are defined like this: ...
3
votes
1answer
54 views

Falling Rocks Game

I have implemented the Falling rocks game in C#. The instructions are simple: Don't get hit by rocks. The game is running quite well, however there are some bugs that occur and furthermore, I would ...
7
votes
3answers
208 views

2-player in a Python hangman game

This is a follow-up: Python Hangman Program I'm working on adding a few features to my hangman game, and I just implemented two-player gameplay, in the form of one player chooses the word to be ...
7
votes
3answers
142 views

Checking to see whether a document can be deleted

My code looks like this: ...
0
votes
1answer
22 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 ...
7
votes
3answers
206 views

Checking if file is within a directory for security

I have a security manager I'm writing for a Java program, and within the checkRead method, I wish to only allow reads to files within a given directory. The basis of it is that it will get a ...
0
votes
0answers
9 views

OO design choice and single responsibility principle [migrated]

I'm currently refactoring an application which periodically downloads content from various sources (http, ftp, sql, etc). There is a schedule which controls the times during which the application can ...
6
votes
1answer
36 views

Reading data from excel sheet with ExcelDataReader

Objective: I want to import an excel file, and read the rows of certain columns. For this, I use ExcelDataReader. I implemented a low-level class called ExcelData which uses the ExcelDataReader and ...
6
votes
1answer
36 views

Three layout Gallery

I have made a gallery function, this function handles three different types of gallery, one with horizontal nav, other vertical and last one vertical with no nav. ...
6
votes
1answer
18 views

Simple grid system made out of CSS columns

I have been researching and experimenting with HTML5 and CSS3. I was aiming to create a very simple but efficient tiled gallery / grids. So some sort of grid system that I can layout anything inside. ...
6
votes
3answers
78 views

SDL/C++ Pong clone

This is my first time writing a game in C++/SDL and I decided to post the code here so you can tell me what I am doing wrong. main.cpp ...
5
votes
1answer
35 views

Responsive jQuery restaurant menu system

I have a working restaurant menu system - as the user selects a menu it slides into view. The build is responsive, I've used the 'Debounced Resize() jQuery Plugin', however in implementing the ...
3
votes
2answers
29 views

Multicriteria sort array javascript

I have an array of objects that I must sort based on two criteria. I've come up with a solution but I'd like to know if there is a better way to do it. Assume a list of devices: ...
1
vote
2answers
70 views

Converting Anonymous To Dynamic [on hold]

I have a extension method like following that takes Anonymous type objects and returns it after converting into ExpandoObject which falls under ...
0
votes
0answers
18 views

json list dropdown selector for car shop [on hold]

I'm trying to do a listdown selector for choose a car model by the user of my shop. but not I access the models of the second trademark. Specifically do not work from the Audi A3 model. I don't know ...
1
vote
2answers
24 views

Comparing phone numbers across CSVs Python

(continuation from Speeding up and fixing phone numbers from CSVs with Regex) I'm pulling all of the phone numbers from all CSVs in two different directories, outputting them in a single simple ...
1
vote
1answer
39 views

Reading keyboard input

This is how I read the keyboard in my game: ...
2
votes
2answers
82 views

Speeding up and fixing phone numbers from CSVs with Regex

I've hodgepodged together an attempt to extract all phone numbers from all CSVs in a directory, regardless of where they are and what format they're in. I want all phone numbers to be printed to a ...
5
votes
2answers
49 views

Avoiding globals in gumball machine class

I'm planning to transition from years of forced procedural programming to OOP. I decided I'd start off small with a little gumball machine object to get my bearings. Everything seems to run ok, but I ...
3
votes
2answers
35 views

HTML/Attrs Tester Environment

I have a few objectives (which are working fine, but I want tips in case I can improve it). Let me try to make this as clear as possible, as this is a much larger project: There are three move ...
11
votes
3answers
550 views

C Makefile boilerplate

This is the current Makefile that I use with my C projects. Here is what I would like to be reviewed: Reusability - is this Makefile easy to use for multiple separate projects with minimal ...
6
votes
4answers
67 views

Optimize RecvData wrapper

How can I improve the string RecvData() function? ...
1
vote
0answers
24 views

Binary search with heurisitcs or something else

Currently I'm using a binary search algorithm to search an index of a tree that represents an XML file. Can I use heuristics to improve the search? What can I do to improve this search function? ...
8
votes
3answers
168 views

Insertion Sorting in C++

From Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, ...
11
votes
5answers
887 views

Longest palindrome in a string

Please be brutal, and judge my code as if it was written at a top 3 tech company, straight out of college. (The method signature, and input parameter is given by the problem, so don't worry about ...
9
votes
1answer
93 views

Automatically run doctest every time program is run

I would like this to happen every time I run a program from the command line. Is my approach Pythonic? I'm interested to know whether there is any problem with readability or correctness. Any general ...
21
votes
5answers
2k views

Conway's Game of Life in C++

This is my attempt at Conway's Game of Life. It works, and it's the most complicated program I've made to date. I'm sure it's pretty poorly done. Any ideas on how I can improve on it? ...
0
votes
0answers
31 views

Tic-Tac-Toe implementation where computer should not lose [on hold]

I have implemented Tic-Tac-Toe so that human can play with the computer, where the computer should never lose. I did a simple analysis before implementing, and I found out that there are certain ...
3
votes
1answer
46 views

Single Rotate Method

I just started coding a simulation-like application. It's about our solar system. Right now, I'm working on rotating the moon. I have this constructor ...
4
votes
1answer
83 views

Installing Mods With Python (v 2.0)

My original code is here. I made some changes to it based on your suggestions, but then I lost my flash drive and had to redo it. I have a suspicion that my second version was better than this one, so ...

15 30 50 per page