I wrote this login system in the evening and i would like to know what should I fix / change, if should I use classes and, about readability, if this code is OK.
I'm a begginer in coding so made this small project only for exercising, but good to know wether if i'm things doing right or wrong.
im...
Mind that this is my first actual program in C++ and I tried to prepare for any possible input. Also the reason I included static_cast<void>(generator(range)) is to throw away the first random value because I read on LearnCpp.com that throwing away the first is a common practice to produce more ...
There isn't an issue of "simplification". The only difference is the amount of information displayed to the user after they enter a number. CodeReview is the place to have working code reviewed. — David C. Rankin41 secs ago
I solved this exercise on jshero.com but I know the solution can be written more cleanly, I just don't know how.
Here are the directions:
Write a function addWithSurcharge that adds two amounts with surcharge. For each amount less than or equal to 10, the surcharge is 1. For each amount greater t...
This is my code, which chooses a random number from 0 to 10 for the user to guess.
//guess the number game
//my code
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
unsigned int secretNumber;
int guess;
int maxNumber = 10;
int...
I’m voting to close this question because it belongs on Code Review. Code Review is a question and answer site for seeking peer review of your code. — Trenton McKinney29 secs ago
I reimplemented cat(1) for fun. I followed the Open Group Base Specifications (Issue 7, 2018 edition), not the GNU variant and its command line arguments.
Buffered and -unbuffered behaviour
While the specification defines the behaviour for -u, it doesn't define how the arguments should be concate...
I want to reference a prompt input in the column name in the code. I’m unsure if The syntax is wrong or it’s just not possible.
Here’s what doesn’t work:
CREATE TABLE new AS
SELECT columnname1,
&promptinputvalue
FROM sourcetable
Instead of printing the column with the p...
Goal
Return a deep copy of a double LinkedList.
Each node also contains an additional random pointer, potentially to any node or null.
Code to start
data class Node<T>(
var data: T?,
var previous: Node<T>? = null,
var next: Node<T>? = null,
var random: Node<T>? = null
class Lin...
I'm finding it difficult to decide on the best architectural pattern for a SwiftUI app but, for the moment, I'm sticking with MVVM as I found this a good fit conceptually.
I'm trying to avoid the SwiftUI layer knowing too much about the business logic and navigation structure but am struggling to...
I have written the following method that allows me to import from another API all the items stored there using Feign.
The only issue is that the external API provides a size limit of 2000 and therefore I need to take pagination into account to get all the records.
I think that my solution is not ...
This code uses CERN's ROOT Data Analysis framework, however the bit I'm most interested in simplifying, and hopefully speeding up, is the algorithm for finding the closest triplet from three vectors. The code produces three sorted vectors, passes them to the algorithm which finds the closest trip...
I'm using NumPy to find out langrage polynomial interpolation. I'm using 2 for loop to find out langrage polynomial, but I want to reduce 2nd for loop so that my code time complexity can be less. Can you guys please suggest me how I can cut a for loop to increase my time complexity.
import numpy ...
Can some help me am trying to retrieve a list of images from s3 bucket below is my code but it's not compiling.
images = imageResults.toArray(images); am getting compilation error:
Cannot resolve method 'toArray(byte[])',
@Override
public byte[] downloadUserGalleryImages(String email) {
User...
I would like to get any feedback about my implementation of Dijkstra algorithm in Rust following this youtube video.
Please be aware that this my first code in Rust as well as my first Dijkstra implementation in any language.
type Vertex = char;
#[derive(Debug)]
struct Connection {
peers :...
I am still learning PowerShell and I would like your opinion on my log writing function. It creates a log entry with timestamp and message passed thru a parameter Message or thru pipeline, and saves the log entry to log file, to report log file, and writes the same entry to console. In Configurat...
I made a project, that scrapes images asynchronously and saves them in container. I have access to them through volume. Scrapy finds images on given web page.
Any tips will be good. But first I would like to focus on docker-compose I would appreciate tips on how to improve it.
files tree
My proje...
This is a typical case on something I'd remark on during code review. "Why did you write 0 here? If you can give a sensible rationale, you may keep the code as it is." They can't. Same category as similar dumb stuff like return (0); or int x = {0};. Writing superfluous stuff like that is almost always an indication of an insecure programmer who aren't quite certain how the language works. — Lundin42 secs ago
I am doing a hangman game with React and wanted to separate the Keyboard component (which itself returns KeyboardLetter components) with the rest of the game logic (just so you know I only use functional components, no classes).
What I want to do is to get the clicked button inner text (= the let...
@Mast Turns out my edit was just a rewrite. But rather than "filter" they mean itertools.groupby. But the rest of the description is about what I'd expect.
I would like to compute cycle times for some manipulator movements. These movements consist of different phases. I have a class that models these phases and this is its constructor to give an idea:
/**
* \brief Creates a new instance.
*
* \param name phase name
* \param startIndex phase start...
Codereview. I am more fine with child knows its parent and calling Parent.Delete(this) rather than this.Delete(), though commonly events are preferable approach, where child doesn't know parent, but simply rise event. — Sinatr45 secs ago
I have a pivot table of approximately 2 millions lines coming from a dataframe with the same structure as below :
raw = pd.DataFrame([[123456,datetime(2020,7,1),'A',10 ],
[123456,datetime(2020,7,1),'B',25 ],
[123456,datetime(2020,7,1),'C',0 ],
...
This is my first ever c# script. I have played around a little and I think this is some proper c# code. Since it's my very first c# ever, I'm assuming there's a few mistakes, things that could be better, bad conventions and such. If you see any, please let me know so I can improve!
using System.C...
@EmanuelVintilă If I saw that code in a code review I would question the programmer's ability to continue on my project. Using reflection to set a private property just to display something different? No. — Heretic Monkeyjust now
I come to this forum to ask for your help and your knowledge to help me review a code that I made in PHP and JavaScript. I need you to help me review the code, and help me find errors, since in my opinion it is well written.
Anyone interested in helping me with this task, write me a comment to se...
If you've noticed something from a specific user, and they have at least one post, you can flag any of their posts and explain the situation. It's not a big deal on a low-activity site like this, but doing so anyway can keep you anonymous and also give moderators a better starting point.
but what should the note/custom flag be?
just that it appears that the user upvoted a NAA post?
If I were to flag the user, I'm not cause I'd prefer more than one datapoint. Then I'd say "Reporting robo-reviewer. I have noticed user has had some reviewing abnormalities, here is one such case."
@SᴀᴍOnᴇᴌᴀ Could you change the following part of your auto-comment? To me it sounds quite impolite. "Maybe you missed the text on the right side when asking"
Suggestion: "The right side when asking your question said"
Recursion is a perfectly reasonable way to handle possible nested dictionaries that require the same treatment as the original dict. Maybe ask on CodeReview.SE for a more detailed review of your code? — Pranav Hosangadi42 secs ago
> You voted to close this question yesterday You retracted your vote 5 hours ago
I had left a comment and the OP updated the post
then I flagged the post for mod intervention, indicating that outdated comments could be removed, since I know some people don't like a wall of comments, but perhaps I should have waited until the close review was completed
This question is 1 vote away from being closed. I think it's a bit iffy whether they actually want a review or a request, but haven't voted on it. Feel free to do so if you have an opinion.
@Peilonrayz I vaguely recall 3 to desynonymize, but I honestly can't recall where I got that number from.
After that we could simply boost a couple of answers to +5, but that would reek like gaming the system. I'd much prefer to get a mod aboard and get it over with.
This program will ask for user to insert summoner and base from the last 20 games of said summoner, it will give avg stats and see if good or not by wins in last 20 games(a simple grading system).
import requests
from getId import idcollect
from games import GAME
from wins import win_calc
#Key f...