Code Review Weekly Newsletter
Code Review Weekly Newsletter

Top new questions this week:

Simple math quiz in C#

I am only a beginner when it comes to programming, but after reading tons of tutorials on and offline, I have been able to create this simple math quiz. It does work as intended, and I'm really just ...

c# beginner quiz  
asked by Clol7 11 votes
answered by asibahi 12 votes

List of all possible monetary totals from a set of cash

This code prints out a list of all the possible sums that can be made from a set of cash. For example, say you have 2 fives and 2 tens in your wallet. With these, you can make exact change for $0, ...

python beginner python-3.x  
asked by Vermillion 8 votes
answered by Gareth Rees 7 votes

3n + 1 programming challenge in Python

I am trying to find a efficient solution for the 3n + 1 problem on uvaonlinejudge. The code I have uses memoization using a dictionary. I am getting a 'Time limit Exceeded' error when I submit the ...

python programming-challenge time-limit-exceeded collatz-sequence  
asked by Omar Khan 7 votes
answered by Graipher 6 votes

Inserting a DBNull value into a database

I have code which works pretty well. I just need some of your opinions on how to write it better with fewer line of code. I want to use a ternary operator but I couldn't make it work so I did an if ...

c# database null  
asked by Dikong Prigm 7 votes
answered by t3chb0t 6 votes

Search in a JSON structure after a key

This code is supposed to search for a specific key in a object or an array or a mix between both. Is there anything I can improve? function getAllObjectsIn(key, data, casesensitive){ var ...

javascript oop array search  
asked by Kastel 6 votes
answered by Mike Brant 4 votes

mini-(Docker)-shell

I was given an assignment to write a mini-shell: To write your own shell, you will need to start with a C program that will prompt the user for input and accept in a number of arguments from a ...

c homework linux shell namespaces  
asked by syb0rg 6 votes
answered by vnp 2 votes

Python! (Snake)

This is now an Iterative Review. Next Iteration Nowhere near a full game yet. Just a basic overview and initialisation of a Snake() class. Thoughts? Snake.py import numpy ''' Game Board: ...

python beginner python-3.x numpy snake-game  
asked by Kaz 6 votes
answered by Thomas Ward 7 votes

Greatest hits from previous weeks:

Determining triangle type from three integer inputs

The logic is simple, but I was wondering if anyone could help with rewriting the conditional logic. Also, the only error conditions I can think of are the sides should not be equal to or less than ...

java  
asked by Phoenix 6 votes
answered by codesparkle 5 votes

Generating all combinations of an array

I'm generating all combinations of an array, so for instance, ["a", "b", "c", "d"] will generate: [ "a", "b", "ab", "c", "ac", "bc", "abc", "d", "ad", "bd", "abd", "cd", ...

javascript combinatorics  
asked by Incognito 37 votes
answered by Wayne Burkett 31 votes

Can you answer these?

React Image component that loads and blurs an image onto a canvas

My react.js Image component will load an image from a URL or base64 string, do some processing on it and put it on a canvas. The "preload" prop is a 10x10 pixel image that is blurred just a little bit ...

javascript performance image canvas react.js  
asked by Sebastian Olsen 2 votes

Glossary Lookup Function

I'm looking to identify any weak points and unnecessarily slow/expensive operations to optimize this function: https://jsfiddle.net/vkoc22kh/24/ Any help is much appreciated!!! Thank you!!! ...

javascript performance jquery  
asked by j-man86 2 votes

Simple factory pattern for cooking a pizza

I have developed a command line application which prompts the user to initially select an oven and then requests that they cook a pizza. The oven affects the pizzas cooking time. The pizzas ...

php factory-method  
asked by ExohJosh 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