Code Review Weekly Newsletter
Code Review Weekly Newsletter

Top new questions this week:

Elementary, Dr. Watson; it's a console adventure

How can I make this code shorter? The code I am using is so long. Just making one simple level is taking about 100 lines of code. public class Sister_age_guesser { public static void ...

java beginner number-guessing-game  
asked by TheEliteAlien 13 votes
answered by wiktor.wandachowicz 4 votes

Constructors for a class to represent a price in € or $

I'm using a method to make initialize the attributes of my objects, and this method is called from both constructor. What it does is, if no correct currency has been passed, choose € by default. I'm ...

c# constructor  
asked by Yassin Hajaj 12 votes
answered by Oguz Ozgul 16 votes

Detecting arithmetic overflow in C with NASM

This snippet is about detecting whether the carry flag is set or cleared. I work on Mac OSX, so my snippet supports Mac only. First, we need a routine that does the job: func.s: global ...

c integer assembly  
asked by coderodde 10 votes
answered by JS1 11 votes

Solving Project Euler Problem 1 using extension methods

As a self taught developer I never did any of the Project Euler problems, so I decided to just start with Problem 1 which states If we list all the natural numbers below 10 that are multiples of ...

c# programming-challenge extension-methods  
asked by Heslacher 10 votes
answered by Edward 8 votes

SortedStack implementation in Java

This is a data structure that supports the push(), pop() and isEmpty() operations and returns the least element on every pop(). In a sense, this works like a PriorityQueue, only in \$O(n)\$ runtime ...

java stack priority-queue  
asked by Zeus 10 votes
answered by rolfl 10 votes

Sum even fibonacci numbers up to a limit

After I have tackled the first problem I come to Project Euler Problem 2 which states Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 ...

c# programming-challenge  
asked by Heslacher 9 votes
answered by Jaime 9 votes

Markdown Markup Editor: MK2

Following on from this question I have added some more functionality to Markdown Markup, and made it more WPF idiomatic. It now supports saving data from any of the four boxes, and loading Markdown ...

c# .net wpf xaml markdown  
asked by EBrown 9 votes
answered by Heslacher 4 votes

Greatest hits from previous weeks:

Sorting an HTML table with JavaScript

The following code sorts an HTML table with JavaScript (without using any external libraries like jQuery). Are there any shortcomings or possible improvements I could make? <html> ...

javascript html sorting  
asked by Sharanya Dutta 8 votes
answered by ProGM 6 votes

Non-AI Tic-Tac-Toe program

I'm fairly new to C++ and to game programming itself. Today I decided to build a multiplayer Tic Tac Toe program using only elemental C++ syntax/data structures. I also implemented a text interface ...

c++ beginner game console tic-tac-toe  
asked by leansie 20 votes
answered by GraniteRobert 16 votes

Can you answer these?

Unit Testing With Dependency Injection and MOQ

I'm just learning how dependency injection and mocking work, but I'd like some feedback on how I'm setting up a couple of tests. I can get them to pass, but I'm not sure this is all I need. This is ...

unit-testing asp.net-mvc moq unity  
asked by madvora 2 votes

CIDR Notation parser

I created the following code to better understand CIDR notation. Also to learn some of the Stream features in Java8. I posted my unit tests too. I'm interested in ways it might be improved ...

java parsing unit-testing ip-address  
asked by mcgyver5 3 votes

Algorithm to categorize episode-file names efficiently

I'm trying to categorize file names of anime episodes (for now) into appropriate title based categories. The algorithm works fine for files with straightforward names but not for others, and sometimes ...

c# beginner file-system  
asked by Paras D Pain 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