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 16 votes
answered by Mathias Ettinger 18 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 13 votes
answered by user2296177 12 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:

Different way of writing multiple click functions

I have the following .click() functions: $('.tab').click(function(){ $('.tab').removeClass('activeTab'); $(this).addClass('activeTab'); }); $('.edit').click(function(){ $(this).hide(); ...

javascript jquery html  
asked by Kris Hollenbeck 9 votes
answered by Flambino 20 votes

Design a chess game using object-oriented principles

I would like to know if my approach is correct and how could it could be improved? Also, is there a way to get rid of the relation between the Piece and the Board? At the moment, I am storing the ...

java oop design-patterns game chess  
asked by SummerCode 24 votes
answered by Kyle Hale 14 votes

Can you answer these?

Aligning your heterogenous uninitialized memory to make the processor happy

After learning more about memory alignment and how it can impact processor data access, I tried to find something in the standard that offers proper memory alignment inside blocks of raw memory that ...

c++ memory-management c++14  
asked by user2296177 7 votes

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

Exporting unread mail details for further processing

As the result of some expert procrastination I have over 4000 unread mail in my gmail box. While that does not hold a candle to what some people likely have I wanted to try and do something about it. ...

google-apps-script google-sheets  
asked by Matt 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