Code Review Stack Exchange Community Digest

Top new questions this week:

Chess game for my students

I teach programming, and I currently teach my class about inheritance, abstract classes, and mixins. I wrote this code as an example, and I want to be sure it is as good as possible before I release ...

python inheritance chess mixins abstract-factory  
asked by Infinity 21 votes
answered by spyr03 20 votes

Create a build order from a list of projects and their respective prerequisites

Another graph algorithm, this time to create a priority or build order. Provided with a starting List<Project> and List<ProjectWithPrerequisite> the algorithm will return the order to ...

c# algorithm graph  
asked by IvenBach 10 votes
answered by M.Doerner 8 votes

Red-Black Tree Implementation in Python

i'm wondering if there are better practices, and optimizations, i could make on my code, to do things easier/faster. I have added comments, in many places in the code, to make understanding easier. ...

python python-3.x tree binary-search-tree  
asked by Chlorox Bleach69 8 votes
answered by NChechulin 2 votes

Optimize function that returns length of a subarray

I did an exercise today on where the task is to write a function that returns the length of the longest subarray where the difference between the smallest and biggest value in the subarray is no more ...

python algorithm python-3.x array  
asked by hopla 8 votes
answered by RootTwo 6 votes

Calculating a unique count within a rolling time window

I have a Pandas DataFrame that contains a row per member per day, expressing member interaction with a website. Members interact only on some days, each member is identified with an ID. Here is a ...

python python-3.x pandas  
asked by smj 7 votes

Find the maximum price change over any 1 to 5 day rolling window

The code below solves the following task Find the maximum price change over any 1 to 5 day rolling window, over a 1000 day period. To be clear "any 1 to 5 day rolling window" means t[i:i + ...

python numpy  
asked by Jan Stuller 6 votes
answered by Peilonrayz 3 votes

My Graph Implementation In Python

I have implemented a graph based on theory, and I'd like some advice regarding best practice, and thoughts about what i didn't implement that would make it even more useful, along with ideas that are ...

python python-3.x graph  
asked by RocknRollDelta 6 votes
answered by Reinderien 7 votes

Greatest hits from previous weeks:

Fast way of searching for a string in a text file

I have written this code to search for a string in a .txt file. Is it possible to optimize the code so that it searches for the string in fastest manner possible? Assuming the text file would be a ...

java algorithm strings search file  
asked by Allen Savio 25 votes
answered by rolfl 21 votes

Changing color on button click

I have an html button that when the user clicks the button it will change color from blue to red and back. Is there a better way to do this in jQuery? HTML/jQuery <html> <head> ...

jquery html  
asked by Aaron 5 votes
answered by Malachi 8 votes

Snake game in C++

This is my version of the Snake game, written in C++. How could it be improved, and what general advice would be useful for future projects? #include <iostream> #include <conio.h> void ...

c++ beginner game snake-game  
asked by Funky 40 votes
answered by Yann 30 votes

Generic Null/Empty check for each property of a class

I have created a method to check for null/empty values of class properties and if any null property is found I'm stopping the checking process and returning the result as true. I've used a solution ...

c# object-oriented reflection null wcf  
asked by iSahilSharma 13 votes
answered by Adriano Repetti 18 votes

Sudoku Solver in C

I had this code lying around, so I figured I would submit this as my first attempt at a weekend-challenge. I would prefer if reviews contained suggestions on how to improve the algorithm, but all ...

c weekend-challenge sudoku  
asked by syb0rg 38 votes
answered by David Harkness 19 votes

Stack implementation using linked list

This is a working stack implementation using a linked list. I'm just curious to know if this is a good way of doing it. Any suggestions are welcome. Can we keep track of the number of elements in ...

c++ linked-list stack  
asked by Software Engineer 14 votes
answered by Jamal 10 votes

Basic Memory Match Game in Java

I'm relatively new to Java and decided to make a Memory Match game. import javax.swing.JButton; @SuppressWarnings("serial") public class Card extends JButton{ private int id; ...

java game  
asked by swnet 7 votes

Can you answer these questions?

Correct flow between Kotlin, Realm and ViewModels using Coroutines

I'm stepping back into Android after being away from it for about a year. Trying to get an out of date app of mine back on its feet, and continuing work on it. The app was written using Java, MVP, ...

android kotlin  
asked by BHogan 1 vote

events countdown OOP app

I wrote a JavaScript app with allows the user to add events and get countdown for every event. Also the events and their dates are stored in localStorage. I want a general review and I think that ...

javascript object-oriented  
asked by mohamed saad 1 vote

Better way to Read /Write Memory<byte> to/from POCO

I am communicating with a machine that sends/received structured binary data to my netcore service. The machine supplier's new library uses Memory in their library's API. I have written the following ...

c# serialization .net-core  
asked by Mark Lazz 1 vote
You're receiving this message because you subscribed to the Code Review community digest.
Unsubscribe from this community digest       Edit email settings       Leave feedback       Privacy
Stack Overflow

Stack Overflow, 110 William Street, 28th floor, New York, NY 10038