Code Review Weekly Newsletter
Code Review Weekly Newsletter

Top new questions this week:

Modularise Project and Deduplicate Code By Loading External Modules On Startup

Starting point I kind-of inherited a VBA project at work that consists of a bunch of Word document templates that provide users with the tools they need to create documents according to company ...

vba ms-word  
asked by Chris 13 votes
answered by Raystafarian 5 votes

Caffeine-Driven FizzBuzz

I have been given following problem to solve: If the integer is divisible by 3, return the string "Java". If the integer is divisible by 3 and divisible by 4, return the string "Coffee" If the ...

java fizzbuzz  
asked by Sarang Shinde 12 votes
answered by MT0 2 votes

Simple C# HashTable Implementation

Haven't put one of these together since college. How does this look overall? public class HashTable<T, TU> { private LinkedList<Tuple<T, TU>>[] _items; private ...

c# algorithm data-structures reinventing-the-wheel hash-table  
asked by Scott 9 votes
answered by Eric Lippert 11 votes

Drawing the flag of Liberia

I am working on this assignment to draw the flag of Liberia for my essentials of computer programming class. I finished it but had extra time to kill and noticed that a couple similar blocks of ...

java loop homework graphics  
asked by Smarticles101 7 votes
answered by StardustGogeta 8 votes

Repository Pattern without an ORM

I'm trying to learn the Repository pattern, and I have some questions regarding my current understanding of it. All the examples I've been able to find of database repositories use ORMs, but for a ...

php design-patterns repository  
asked by jpt 7 votes
answered by lilobase 2 votes

C++: multi-function memoizator and multi-type container

I'm trying to write a multiple functions memoizator, I talked about it here. The main problem is to create a container containing different and heterogenous functions. I found a working solution, ...

c++ collections type-safety memoization  
asked by user6321 6 votes
answered by MORTAL 0 votes

Generic extension method that will attempt to parse a string and return it's value or default(T)

So I got sick of several things about the way TryParse works. I implemented a generic ParseOrDefault function using reflection. It appears to work as expected, but I'm not fool enough to say my code ...

c# reflection duck-typing  
asked by Sidney 6 votes
answered by Konrad Morawski 6 votes

Greatest hits from previous weeks:

Checking whether a number is a power of 10

Is there a better way to check whether a number is a power of 10? This is what I've implemented: public class PowersOfTen { public static boolean isPowerOfTen(long input) { if ...

java  
asked by jcm 21 votes
answered by Mark Reed 36 votes

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 16 votes

Can you answer these?

Wrapping a non-unique handle with additional information

I have a situation where I'd like to wrap up some plain C handles into a class, with a destructor and other niceties, in C++. I would like the wrapper class to have the exact same size as the handle, ...

c++ c++11 wrapper  
asked by Andrew Williamson 2 votes

Async Task with multiple requests in android

I am using this AsyncTask class to update two different tables on SQL Server. So far this code works fine, I'm interested in a better and more sufficient code structure for this class, specially in ...

java android  
asked by Osama Aftab 3 votes

Inserting nodes into a trie data structure

I have a recursive algorithm that inserts nodes into a trie data structure but it seems to be running not well and takes over 10 mins to complete on a data set of about 1 million. All nodes contain a ...

c++ performance trie  
asked by searay330 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