Code Review Weekly Newsletter

Code Review newsletter

Top new questions this week:

List with no sequential repeats (where possible)

Assume I have the following list (List<string>) G G M T I'd like this to be in an order where the same letter will not occur twice, such as G M G T (I appreciate other variations would also …

c#  
asked by Dave Rook 14 votes
answered by Tim S. 7 votes

Finding average of eight immediate neighbors of a matrix

I have this basic Java code to find average of eight immediate neighbors of a matrix. Is there any way to simplify or merge any part of it, or can I refactor it? I'm a beginner in Java programming …

java beginner oop matrix  
asked by user41918 10 votes
answered by Jeroen Vannevel 14 votes

HTML5 / JavaScript Tic-Tac-Toe

As an exercise, I decided to create a simple Tic-Tac-Toe game. It is Ruby on Rails based, but as for now I'm not using the server side for anything (I intend to build up on it in the future, though). …

javascript jquery game css html5  
asked by Lasooch 10 votes
answered by bjb568 6 votes

Matrix multiplication

Below is the code that I've written for matrix multiplication: import java.text.DecimalFormat; import java.util.InputMismatchException; import java.util.Scanner; public class MatrixMultiplication { …

java optimization algorithm matrix  
asked by Gokul Nath 10 votes
answered by Simon André Forsberg 17 votes

Count number of words in a text file

Is this a good approach or is there some other solution that I am not aware of? //C++ program to count number of words in text file #include<fstream> #include<iostream> …

c++ file  
asked by Deepak Singh 9 votes
answered by Jerry Coffin 10 votes

Can people understand my form validation code?

I've just finished creating this form validation but I want to make it public for beginner 'contact us forms'. I was wondering if I can have some peoples' input on if they can understand/read my …

javascript readability form validation  
asked by Salata 8 votes
answered by RedGrittyBrick 13 votes

Simple Postfix Calculator using Java 8

Inspired by some older questions, I decided to create my own postfix calculator using Java 8. I'd like to have all aspects reviewed. public enum Operator implements DoubleBinaryOperator { PLUS …

java  
asked by skiwi 8 votes
answered by rolfl 3 votes

Greatest hits from previous weeks:

Better Approach to Using the C# SerialPort Class

I've been working a lot recently with SerialPort in C# and I've come up with the following class as part of a class library I'm working on for another program. My question is, are there any more …

c# serial-port  
asked by DanteTheEgregore 6 votes
answered by Jesse C. Slicer 4 votes

Dynamic programming solution to knapsack problem

I wrote a solution to the Knapsack problem in Python, using a bottom-up dynamic programming algorithm. It correctly computes the optimal value, given a list of items with values and weights, and a …

python algorithm best-practice style  
asked by voithos 6 votes
answered by Gareth Rees 18 votes

Can you answer these?

How to copy files as fast as possible?

I am running my shell script on machineA which copies the files from machineB and machineC to machineA. If the file is not there in machineB, then it should be there in machineC for sure. So I will …

optimization bash linux scp  
asked by Webby 3 votes

Hmm, a thoughtful library

I've been writing far too many routines in JavaScript that get a record from a an object or array based off a matching property, much like jQuery does with DOM elements. Since all the good names are …

javascript search query-selector  
asked by konijn 7 votes

Saving a sales order - too many repositories?

I am wondering if I have overdone it with repositories in the following code, which is to save a sales order. I understand that the purpose of a repository is to decouple the domain layer from the …

c# entity-framework repository  
asked by kirsten g 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