Code Review Weekly Newsletter

Code Review newsletter

Top new questions this week:

Split string in half and change case accordingly

I found the following challenge online: Create a function that takes a string and returns that string with the first half lowercased and the last half uppercased. eg: foobar == fooBAR ...

python strings programming-challenge  
asked by Seth 12 votes
answered by rolfl 15 votes

Greatest Common Factor

I wrote this program to determine the Greatest Common Factor of any 2 given numbers, and would like to know of any improvements that can be made. I have tested it using a loop and 2 randomly generated ...

java performance  
asked by user3189142 10 votes
answered by Legato 13 votes

Printing a pyramid

Can you please review this code to determine if it's good or can be improved? #include "stdafx.h" #include <iostream> #include <string> using namespace std; int _tmain(int argc, _TCHAR* ...

c++ beginner formatting  
asked by user70827 8 votes
answered by Hosch250 5 votes

Brute Force N Body Implementation in C++

I have wrote the following code in C++ for the n-body problem. This code is sequential as later on I am planning to parallelize it using OpenMP. I want to know whether I have wrote the correct ...

c++ simulation physics  
asked by Jamal Hussain 8 votes
answered by Edward 13 votes

Fastest sum of absolute values of 32 differences

A long should be treated as a list of 32 unsigned numbers, each of them just two bit long. So 0x1234F... represents {0, 1, 0, 2, 0, 3, 1, 0, 3, 3, ...} and 0x55AA0... represents {1, 1, 1, 1, 2, 2, ...

java performance bitwise integer  
asked by maaartinus 8 votes
answered by rolfl 4 votes

Simple comparison of sorting algorithms in C++

I know this has been done a million times before, but this is my implementation of bubble-sort, insertion-sort, merge-sort, heap-sort, and quicksort. Any feedback on how to make it better would be ...

c++ algorithm c++11 sorting  
asked by Jason B 8 votes
answered by Loki Astari 13 votes

JPaint (Java painting app)

I have this painting app called JPaint in Java and I'm wondering if it could be improved. The variable declaration seems repetitive and long, and I think it might be able to be improved. public class ...

java swing event-handling graphics  
asked by thecoder16 7 votes
answered by maaartinus 10 votes

Greatest hits from previous weeks:

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've implemented a low-level class called ExcelData which uses the ExcelDataReader ...

c# exception-handling io excel  
asked by user3488442 6 votes
answered by BenVlodgi 4 votes

Minesweeper Code

I created some code for Minesweeper but I need help going over it. I would like if someone could go over it and point out anything (repeating code, code being called multiple times when not needed, ...

java game minesweeper  
asked by Exikle 4 votes
answered by MrLore 6 votes

Can you answer these?

Merging multiple JSON files using Python

I have multiple (1000+) JSON files each of which contain a JSON array. I want to merge all these files into a single file. I came up with the following, which reads each of those files and creates a ...

python json file io  
asked by Alagappan Ramu 3 votes

Button presses counter

I'm moving on to graphics, picking Pyglet and Cocos2D. This is my first program in Python with GUI. Introducing: Two distinct high definition button sprites Satisfying high quality button pressing ...

python beginner game python3 user-interface  
asked by Xis88 5 votes

Neural Network Simulator with OpenMP

I wrote a simple neural network simulator (the biophysical kind) from scratch, and was hoping to get some feedback on how I can speed things up, or any C++ / compilation best practices that I can ...

c++ multithreading openmp  
asked by ejang 2 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