Code Review Weekly Newsletter
Code Review Weekly Newsletter

Top new questions this week:

Check if a Sudoku board is filled out correctly

The code below takes a filled out Sudoku board of size NxN, with sub-blocks of nxn, and checks if the solution is correct. main_function takes a board as input. This function calls check_rows and ...

python performance beginner python-2.7 sudoku  
asked by Stewie Griffin 20 votes
answered by Mathias Ettinger 23 votes

On-the-fly destructors

Due to my needing to use C libraries inside C++, I kept finding myself wanting to be able to ensure that the free function got called, even if an exception got thrown. UTILS_SCOPE_EXIT ensures that ...

c++ macros  
asked by Justin 14 votes
answered by user2296177 14 votes

Beep-beep I'm a car factory

I have implemented to following generic factory in C++11 using smart pointers and I would like to get some feedback about it. (Please note that I can't use C++14) Due to company policies I have to ...

c++ c++11 pointers factory-method  
asked by user695652 11 votes
answered by Zeta 7 votes

#TODO Remove duplication in XML parsing

I have to modify the number of points in this XML in order to test the performance of another program of mine. Here is an example of the XML I have to modify. performance.xml: <?xml ...

python beginner parsing python-2.7 xml  
asked by syb0rg 11 votes
answered by Joe Wallis 13 votes

Finding the cheapest hotel

I thought this question made a good excuse for some basic OOP code, so I whipped up a little bit of code to demonstrate it in VBA; the idea is to have tutorial-grade code, to show how interfaces and ...

oop vba  
asked by Mat's Mug 11 votes
answered by PeterT 2 votes

Java diamond with numbers

I have an assignment to code a method that will print values in a diamond pattern. For example, if the method is called like printNumberDiamond(2), then the results should look like: " 0 " " 010 " ...

java ascii-art  
asked by Chris Phillips 10 votes
answered by Abhinav Pandey 10 votes

Binary difference checker

My code needs to take two ints and then check those ints to see if their binary representations have any differences. The function convertBits returns the number of differences between the two binary ...

java performance  
asked by Simon Augustus 9 votes
answered by Peter Taylor 26 votes

Greatest hits from previous weeks:

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 12 votes
answered by Jerry Coffin 18 votes

Converting seconds to hours, minutes and seconds

The following question was taken from Absolute Java 5th ed. by Walter Savitch: Write a program that outputs the number of hours, minutes, and seconds that corresponds to 50,391 total seconds. The ...

java beginner datetime  
asked by Oompa Loompa 7 votes
answered by Martin R 13 votes

Can you answer these?

Easily add Accessibility to your app as an afterthought. Yes, as an afterthought

Accessible apps allow more users to use your app; however, it is usually an afterthought for developers, and it makes your XML layout files messy whether Accessibility was a forethought or ...

java android library fluent-interface  
asked by Christopher Rucinski 2 votes

Create archive webpage for newsletters based on nested array

I am creating a webpage for my newsletter archives. The archives are divided by year (currently there is only 1, but there could be many), then by topic, before listing each newsletter. There will ...

php html array  
asked by user1930608 3 votes

Fluid HTML email template

I created this as a template for our email marketing team to use when creating emails. For fluid/responsive behavior, I am using max-width and conditionals for clients that do not support it (e.g., ...

html email  
asked by districtdave 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