Code Review Stack Exchange Community Digest

Top new questions this week:

Authenticate users based on both user role, and requested operation

I have a function that checks if a user can perform an operation based on access to a specific URL. The function parameters are the requested URL: url, and user level: lv. The conf object has stored ...

javascript beginner  
asked by sirzento 16 votes
answered by Flater 25 votes

Stack data structure in Python 3

I have implemented a stack in Python 3, and it works well. If anything needs to be improved, I would appreciate the criticism. class Stack: def __init__(self): self.stack = [] ...

python algorithm python-3.x stack  
asked by Logwin Tech 16 votes
answered by Right leg 32 votes

Match blood types in C

I have written a solution to the blood-type matching problem, as described at https://projectlovelace.net/problems/blood-types/. The problem is to determine whether a given recipient (in this case, ...

c  
asked by oleskiewicz 11 votes
answered by AJNeufeld 18 votes

Minesweeper Javascript (yes, another one)- JS Beginner, fully functional incl HTML and CSS

I created my first JavaScript program and I feel it's all over the place. I just started it without thinking too much about it. Now, I am quite sure I should have used OO style. Also, it seems there ...

javascript beginner minesweeper  
asked by dan-el 10 votes
answered by Blindman67 5 votes

Hough transform algorithm - Idiomatic c++

I've got some working code to compute the Hough transform for circles: #include <stdio.h> #include <opencv/cv.hpp> #include <math.h> #include <string> #include ...

c++ image  
asked by nz_21 10 votes
answered by Edward 11 votes

Python's .split() implemented in C

I'm new to the C programming language and I just made a basic version of Python's split() function using C. Note: A major functionality I chose not to implement is the usage of optional delimiters. ...

beginner c strings reinventing-the-wheel memory-management  
asked by Dewamuval 10 votes
answered by chux - Reinstate Monica 13 votes

Counting without zeroes

Below is a python script that generates the sequence ['a', 'b' .. 'z', 'aa', 'ab' .. 'az', 'ba', 'bb' .. 'zz', 'aaa', 'aab', ..] This is essentially counting in base 27, replacing every digit with ...

python performance  
asked by Grismar 9 votes
answered by Graipher 16 votes

Greatest hits from previous weeks:

Simple Java calculator

I am a beginner in Java programming. Here is my simple calculator. I hope you could scan through my coding and let me know if there is any error in my coding or how I could simplify the code. import ...

java beginner calculator  
asked by Isaac 12 votes
answered by Vojta 14 votes

Python calculator script

Are there any ways to make this calculator script for Python better or simpler? thelist = ["Add", "add", "Multiply", "multiply", "Divide", "divide","Subtract", "subtract"] def Multiply(x,y): z = x * ...

python python-3.x calculator  
asked by TheSuds13 3 votes
answered by Vedran Ĺ ego 4 votes

Snake game with canvas element code

I created a classic snake game in the canvas element. I have not considered best practices when doing this, I just wanted to finish it first. Now it's time to improve the coding practice. You can ...

javascript html5 canvas snake-game  
asked by Vignesh 16 votes
answered by konijn 9 votes

Python username and password program

Can the following code be simplified? I think that the program that I have created is very excessive and quite slow. The program runs fine, but I would like to understand if this could actually be ...

python beginner python-3.x authentication  
asked by Greg 10 votes
answered by Quintec 11 votes

Removing duplicates from an array quickly

Array.prototype.unique = function() { var a = [], // uniques get placed into here b = 0; // counter to test if value is already in array 'a' for ( i = 0; i < this.length; i++ ) { ...

javascript array  
asked by eddie 25 votes
answered by Stop ongoing harm to Monica 21 votes

Very basic calculator using methods

I have made a basic calculator using methods. This is my first attempt at using methods and would like to see if I can improve on this as there is a lot of repeated code. import java.util.Scanner; ...

java beginner calculator  
asked by Niall Szalkai 15 votes
answered by asteri 13 votes

Text-based Tetris game

How can I improve this game? #include <iomanip> #include <iostream> #include <vector> #include <random> #include <conio.h> struct Random { Random(int min, int max) ...

c++ c++11 game tetris  
asked by MORTAL 10 votes
answered by Edward 11 votes

Can you answer these questions?

Manage independent script component architecture in unity

I have different set of objects where I have to show Name UI and Menu UI using OnMouseDown and on OnMouseEnter. Remember Both are optional, the one object may contain(attach) both option(script) or ...

c# unity3d  
asked by Muhammad Faizan Khan 1 vote

ES6 Class for getting GitHub PR info

I was learning some DOM manipulation and interaction with third-party APIs by building a simple interface to get the people who commented on a PR on GitHub. I got great feedback for my initial ...

javascript object-oriented ecmascript-6  
asked by Mauricio Robayo 2 votes

Bracketing multiple onEdit functions

I have multiple onEdit app script functions in my Google Spreadsheet which work individually but I cannot work out where to put the brackets to nest them. This is my code which is a little messy and ...

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

<3