Linked Questions

66
votes
8answers
9k views

Open, write and close a file

I have a small 10-liner function that writes some data to a file using an std::ofstream. I did not explicitly call .close() at ...
15
votes
5answers
3k views

One program using three functions to compare two double-precision numbers

I am currently learning C++ though Bjarne Stroustrup book Programming Principles and Practices using C++. Going through the drills, I am trying to purposefully write efficient and readable code (good ...
15
votes
3answers
25k views

Salt generation in C#

I have designed a small method to generate a salt for a password. All this does is create a random salt and does nothing to add it to the password. I have a few questions regarding my very simple ...
10
votes
3answers
222 views

Writing a program to read a maximum of 99 elements in an iteration from a list

I want to read a list of elements and pass a maximum of 99 elements to a function for some logical operations. I have tried this with an array as an example and this code was successful in achieving ...
5
votes
5answers
11k views

Checking if a given string is in alphabetical order

I wrote this function to check if a given string is in alphabetic order. How can I improve? ...
6
votes
7answers
6k views

Speech Synthesis to showcase how various voices sound with System.Speech.Synthesis

I was wondering if you would be willing to give me some suggestions on shortening this code. I feel as if the amount of if statements I have is a bit much. ...
5
votes
2answers
6k views

Read binary serial data and parse integers

I'm reading serial data in binary format from a stream, and I'm not happy with how I extract the data because it takes so much operations to extract the binary data from a simple line of binary data. ...
7
votes
3answers
3k views

Word separator and Pig Latin program - final edit

This is an updated version of my previous Java program that asks the user for a sentence and then separates the words and then converts the sentence into Pig Latin. My previous program was working, ...
6
votes
4answers
708 views

Educational website using ASP.NET webforms

Our team is developing an educational website using ASP.NET webforms. We designed DAL & BAL classes and now I have some questions: Are DAL & BAL designed well? Would it be better using ORM (...
4
votes
2answers
53k views

Connect Four game in Java

I was wondering if you guys could point out any mistakes I've made in this program, and how to improve the code. It's a simple console-based Connect Four game. You use 0-5 to place your piece in the ...
3
votes
4answers
2k views

Product Manager managing product listings and prices

For school we have to develop a product manager. The basic task is to add new products. A product has a name and a price. I know the one or other class is currently pretty empty but its planned to ...
5
votes
4answers
7k views

Simple BMI calculator in Java

A similar question must have been asked a thousand times, but for the life of me I can't figure this out. I am new to Java and I want to create a programme that asks a user for his or her height and ...
8
votes
5answers
428 views

Custom networked remote manager

I've spent my fair share of time criticizing other people's code on this site; but I'm finding out I'm kind of a hypocrite. Almost everything I've written so far has been some program whipped together ...
8
votes
1answer
4k views

Basic JavaScript template engine using replace, match and RegExp

To practice with regular expressions, I wrote this basic template engine in JavaScript in addition to a simple test case to make sure it works correctly. I am wondering if there is any improvements I ...
3
votes
3answers
10k views

Search in a 2D array to find if there is a row or a column that contains the word “error” in every cell of that row or column

Search in a 2D array to check if there is a column or a row in the 2D Array thats contains all the word “error”, if yes return the index of that row or column else return 0; Exception: if the row ...
5
votes
3answers
4k views

Shape Calculator in Java

This is my first time putting up a completed program onto the web and I was hoping to get some feedback on these areas: Commenting (Too much, not enough or do I need to simplify anything) Structure (...
8
votes
1answer
5k views

Encrypting strings in Golang

This is a an example application for testing some encryption and decryption functions in Golang. The functions encryptString(), ...
6
votes
3answers
2k views

Geometry Calculations - Cube, Sphere, and Tetrahedron

This is the first code I've written. It's for an intro to Java course. Could you look over it and let me know of things I could improve before handing it in? For reference, I've also provided what I'...
4
votes
1answer
4k views

Check if a String is a valid Double

For a class, I need to ask the user for a double. To verify that the number can be safely passed to Double.parseDouble, I wrote ...
5
votes
3answers
1k views

EncodingTranslatorStream - A stream object that translates character encoding

This class is a stream designed to perform character encoding translation. So you instantiate it, pass an input stream, and specify the input encoding and desired output encoding, so that when you ...
4
votes
1answer
2k views

Animal inheritance hierarchy

I'm trying to figure out if I'm doing superclasses right. Also, I welcome critique on Java structure/syntax etc. Animal.java: ...
4
votes
1answer
3k views

HND Java module (vending machine simulator)

As part of the distinction requirement, I am required to ask for testing/review of my code. There was no time allotted for this in class, and as such I am turning to the folks of StackExchange for ...
5
votes
3answers
152 views

Userform that calculates gas mileage

I created a project for a programming class that asks you to make a userform in Visual Studio that calculates mileage, given the user inputs of gallons of gas consumed and distance traveled. The code ...
4
votes
3answers
622 views

Right triangle side length calculation

My code compiles and executes. I would like to hear any comments or suggestions pertaining to my use of C++. ...
1
vote
2answers
2k views

Remove the occurences of an element from array if it occurs more than n times

I wanted to remove the occurrence of an element from an array if it occurs more than n times. For example: ...
4
votes
2answers
84 views

Posting accounting data to a report

I have some buttons on an Excel report. 2 in particular are for posting all Budget numbers to the report and posting the Actual numbers. I currently have 2 separate subs, one assigned to each button. ...
3
votes
1answer
534 views

Tic Tac Toe with Python and Kivy

Accomplishment: Tic Tac Toe game with Python & Kivy I have created a simple tic tac toe game with a random bot logic (really random after a user selects a mark). Next step would be to insert the ...
0
votes
1answer
181 views

Cleaning up 3D bin packing [closed]

This is a follow up question to 3D bin packing in Java I finished testing my code's result and started cleaning it up. Could anyone please tell me what I should do or fix to clean up this code more?...
4
votes
2answers
119 views

Accelerate the process of filling the quality control table

I'm working on a report of quality control. I've got a table, with all the points of control inside, and each time, when I get a new test result, Excel should fill this table. My code already works, ...
0
votes
1answer
184 views

Project Euler#18: Maximum Paths I: Brute Forced Depth First Search

Problem: Data: ...

15 30 50 per page