Code Review Weekly Newsletter
Code Review Weekly Newsletter

Top new questions this week:

Converting the weight of a potato into a letter grade

I've just started learning C# using Rob Miles' C# Programming Yellow Book and some related lab exercises from his website. I did one of them and produced a solution that works. In Miles' book, he says ...

c# beginner  
asked by S. Elliot Perez 18 votes
answered by EBrown 24 votes

How many days to Go?

Here's my first serious attempt at writing Go code. This program counts the number of days until a certain date and displays that in the system tray. To do that, it first reads the target date from ...

beginner datetime image io go  
asked by vvye 11 votes

Picking 10 distinct words 'randomly' from List of unique words

My goal is to pick 10 unique words randomly from a List containing 20 unique words. I would remove the duplicate word from the List whenever a duplicate word is added and decrement the for loop ...

java random  
asked by Zero 8 votes
answered by bowmore 11 votes

Calculate the number of palindrome numbers in the given ranges

I've written a program that calculates all of the palindrome numbers in the given range, but the code is slightly slower than needed. I've tried to improve algorithmic complexity to the best of my ...

performance algorithm c time-limit-exceeded palindrome  
asked by shubhendu 7 votes
answered by JS1 5 votes

Assembler for CPU

I recently put together an assembler for a CPU I designed. I'm looking for feedback on my program structure, formatting, or anything else. I'm self taught on all of this so I don't have opportunities ...

python beginner assembly compiler  
asked by Ben Burk 7 votes
answered by Mathias Ettinger 5 votes

Color substitution in a BufferedImage

The setPixelColor function below changes the color of pixels. I need some suggestions to optimize this function. Example: public static void main(String[] args) throws IOException { ...

java performance image  
asked by J.D 7 votes
answered by 200_success 4 votes

Method to return date ranges of 1 year

I made a method that takes 2 DateTimes as a parameter, a startDate and a stopDate. The routine should return a list of DateTime ranges by checking if the range in the parameters is above one year ...

c# datetime  
asked by user122455 7 votes
answered by t3chb0t 3 votes

Greatest hits from previous weeks:

Pong game in Java

I have recently written the following Pong game in Java: Pong class: import java.awt.Color; import javax.swing.JFrame; public class Pong extends JFrame { private final static int WIDTH = 700, ...

java game swing  
asked by LazySloth13 13 votes
answered by ZeroOne 13 votes

Determining triangle type from three integer inputs

The logic is simple, but I was wondering if anyone could help with rewriting the conditional logic. Also, the only error conditions I can think of are the sides should not be equal to or less than ...

java  
asked by Phoenix 7 votes
answered by codesparkle 5 votes

Can you answer these?

Simple home-brew filter design for a future GUI

I decided to make a small program for filter design, to practise C++. I intend to also add a GUI, later on (Qt, most probably), so I thought that the way the program would go in the main() should be ...

c++ beginner oop  
asked by a concerned citizen 3 votes

Diff for successive sorted slice

I wrote some code to determine the additions and deletions that happened to a sorted slice after each (sorted) update. Git repository (includes some tests) Godoc // Package slicediff is a utility ...

go  
asked by oliverpool 2 votes

Algebraic Effect Monad to separate pure and impure code

I want to write my C# code in a way which makes effects (state, I/O, etc) explicit in the type signature. I have started to understand monads, and have some acquaintance with algebraic effects, though ...

c# functional-programming stack monads  
asked by Kazark 3 votes
Subscribe to more Stack Exchange newsletters


Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on stackexchange.com.

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all stackexchange.com emails.

Stack Exchange, Inc. 110 William St, 28th Floor, NY NY 10038 <3