Code Review Weekly Newsletter

Code Review newsletter

Top new questions this week:

python: design of a simple game

I am trying to code Battleship. It should be a text one-player game against computer where computer and human player take turns in shooting at opponent's ships. I decided to start implementation with …

python design  
asked by clime 6 votes
answered by Janne Karila 2 votes

Speed up solution to Project Euler problem 75

I've been programming for a few months now, and have used Stack Overflow a great deal, but this is my first post. Anyway, I wrote this code for Project Euler problem 75, and was curious if anyone knew …

python performance project-euler  
asked by user2312505 6 votes
answered by Gareth Rees 14 votes

LINQ Group query - simplifying

Is there a way of writing this correctly working query more efficiently? I'm asking only to learn LINQ better: var cpuInfo = edgeLPs .GroupBy(k => k.CPU.ID, e => e.CPU) …

c# linq  
asked by IanC 5 votes
answered by Jeff Mercado 3 votes

Code Review for Hangman in C++

I have the following C++ program: #include <iostream> #include <cstdlib> #include <ctime> #include <vector> void printVector (std::vector<int>& vec) { for (int …

c++ optimization  
asked by Lewis 5 votes
answered by Piotr99 5 votes

Using ref for value types - Is this the right usage or is it weird at multiple levels

I chanced upon this code written by the Solution Architect for a MS CRM project and I am lost for words. Am I going crazy or is this code OK? string returnedOptionSetStringValue=string.Empty; int …

c# best-practice  
asked by Kanini 4 votes
answered by Enrique Medina 2 votes

How can I memoize or otherwise optimize this code?

The code checks many more conditions like the one below. I was thinking to memoize it, but I can't think about how (writers block). How else could I optimize this? I know it seems silly, but my code …

python optimization performance  
asked by angrymonkey 4 votes
answered by Gareth Rees 1 vote

Python line condenser function

This is a function I just wrote that tries to condense a set of strings into grouped lines. It actually works, but looks ugly. Is there a better way to achieve the same thing? Take 4 filtering empty …

python iteration  
asked by Inaimathi 4 votes
answered by Nick Burns 3 votes

Greatest hits from previous weeks:

c code to solve sudoku

Below is a C code to solve a sudoku using Backtracking. #include <stdio.h> int isAvailable(int sudoku[][9], int row, int col, int num) { int i, j; for(i=0; i<9; ++i) if( …

optimization c  
asked by user1526667 4 votes
answered by Loki Astari 4 votes

File Browser GUI

FileBro is a basic GUI based File Browser. FileBro Functionality Directory tree - shows the file system roots at start-up, but is otherwise built lazily as the user browses around the file …

swing java  
asked by Andrew Thompson 29 votes
answered by Hovercraft Full Of Eels 12 votes

Can you answer these?

Delos MVC PHP Framework

I 've been working in PHP since almost three years ago. In these time i builded a framework as base for my projects. I want it to be improved, and which other best option there are that use …

php mvc  
asked by Ciro Pedrini 1 vote

Go: stream chaining

My goal is to have a reusable pattern for doing concurrent stream processing in Go. The stream has to be closable from any node. Errors should cleanly close the stream and forward the error to the …

api go stream  
asked by ilia choly 1 vote

API wrapper for Clojure, idiomatic style for libraries?

I wanted to wrap the jkeymaster library in a Clojure wrapper (for my own use, but perhaps also to save others some time). I'm just learning Clojure so I'm still not quite sure what "idiomatic …

java clojure  
asked by Stian Håklev 1 vote
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