Code Review Weekly Newsletter
Code Review Weekly Newsletter

Top new questions this week:

Implement rate limiting by cookie ID

I want to develop a simple in-memory web request rate limiting module, I am allowed to have 50 requests from each unique cookie ID every 60 seconds. I am wondering if the following code is an optimal ...

java  
asked by jcm 11 votes
answered by Mat's Mug 8 votes

n-queens puzzle in Python

I want to increase the efficiency and reduce the time complexity for the n-queen problem in n*n matrix chess. I am able to run only still (11*11) in normal time otherwise for the big number it is ...

python performance algorithm python-3.x n-queens  
asked by Pooshan Vyas 9 votes

"Magic Squares" assignment

The assignment is to take a "Magic Square" .txt file (where the horizontal lines, vertical lines and diagonal line all add up to the same number), read it and prove that they are in fact magic ...

java beginner  
asked by Cormack 8 votes
answered by coderodde 5 votes

ToyVM - a small and simple virtual machine in C - follow-up

(See the previous and initial iteration) Now I have refactored the code in order to conform to the suggestions made in the answers to the first iteration. I have this: toyvm.h: #ifndef TOYVM_H ...

c assembly virtual-machine  
asked by coderodde 8 votes
answered by Edward 7 votes

Chrome extension that marks Reddit entries with clickbait sources

So, I've created my first Chrome extension! What this does is it highlights every post on Reddit that comes from a source of dubious quality. It provides a few sources by default and allows the user ...

javascript html css google-chrome reddit  
asked by Jeroen Vannevel 8 votes
answered by Joseph the Dreamer 3 votes

Setting up a development environment

I'm looking for feedback on improving the structure of this code. Also, I could not find the command line executable for Chrome. General feedback is also requested. # # # # Divider - configures ...

bash  
asked by cade galt 0 8 votes
answered by janos 12 votes

Program to index a book

Indexing a book. Write a program that reads in a text file from standard input and compiles an alphabetical index of which words appear on which lines, as in the following input. Ignore case ...

java beginner hash-map  
asked by In78 7 votes
answered by Tunaki 9 votes

Greatest hits from previous weeks:

Count number of each char in a String

I know there is a simpler way of doing this, but I just really can't think of it right now. Can you please help me out? String sample = "hello world"; char arraysample[] = sample.toCharArray(); int ...

java strings  
asked by statius 14 votes
answered by Marco Acierno 23 votes

Stack implementation using an array

I am trying a stack implementation using an array. I want to know if this approach is OK or if there is a logical problem. This program is working fine. #include <stdio.h> #define MAXSIZE 5 ...

c array stack  
asked by Ace 7 votes
answered by Edward 13 votes

Can you answer these?

Shortest path navigation across a grid using Best First Search

The code below is an implementation of the Best First Search algorithm for navigation of the shortest path across a 2D NxN matrix. As a heuristic for the search I use the standard distance formula. ...

java performance algorithm search  
asked by G. Skrbic 4 votes

Copy files mentioned in an Excel sheet

Please help me in reducing the time complexity of this code as it is taking a long time to read its Excel input. # -*- coding: utf-8 -*- """ Created on Wed Mar 9 14:26:22 2016 @author: DalalNS """ ...

python performance file-system excel  
asked by Navin Dalal 5 votes

Pokemon stats calculator

I have a simple working (so it's not a hypothetical stub) framework for calculating Pokemon stats that will later be incorporated in a game. It uses the LCRNG from the first game in order to be as ...

c++ beginner c++11 design-patterns data-structures  
asked by user100191 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