@bad_coder Did you close the question ? I have made the question more focussed to only a singular problem. I don't need my code reviewed. Please re-open it. — nerdyGuy33 secs ago
I have a React / node app that I took over and that I am trying to push to heroku.
I use the following commands to start my app locally:
cd react-web
sudo npm run postinstall
export REACT_APP_CUSTOMER_ENVIRONMENT=testenv
npm start
so, this starts the app. Now for heroku, in my root directory pac...
Exercise 1
Please implement code and data structures that read the files
src/test/java/resources/people.csv
src/test/java/resources/relationships.csv
and use them to build an in-memory data structure that represents the people in the file and their relationships with each other.
Exercise 2 - Vali...
In a few hours I threw together this little text-based java game. Pretty much you're managing a forest and have to try and keep it together while keeping enough of a profit to move forward.
package com.company;
import java.util.Arrays;
import java.util.Scanner;
import java.util.concurrent.Thread...
I am writing an API function using DRF where I want the API execution to stop if it fails in any of the steps and return an appropriate response. So I created a custom exception which takes an error code, and an error message like below.
class CustomException(Exception):
def __init__(self, status...
You need to give a criteria for "best"/"good". Otherwise, code review questions of working, complete code should be posted at codereview.stackexchange.com instead. — Lundin1 min ago
However, "doesn't work sometimes", makes it off-topic for Code Review. If you want to ask a question about why it doesn't work, please edit your question here and be more specific. — mkrieger159 secs ago
I am trying to write a C program that will create lines of code on the console window when the program is ran. I can then copy this code and use it to initialise RAM in my VHDL project code.
I have attached images below to show what I am trying to do.
The image of the C code and console show me t...
I want to share a approach for self-registering C++ classes. I'm interested especially on your opionions about the solution to overcome the static initialization order fiasco.
So I make s_testMap std::optional so that it will be initialized in the bss section which is zeroed out before calling th...
I'm working on a simple method that would censor emails (GPDR stuff) so they won't show the full name of a user, with 1st character, optional dot, 1st character after the dot and whatever is left after the @ to be left uncensored. So, the intent is like this:
Email to be censored: name.lastname@e...
In my opinion you have wrong test name, your test is checking if getAccountType returns response, not if it has been called. You can post your question here codereview.stackexchange.com and i guess there will be people that will provide you with adequate feedback — Християн Христовjust now
I want to write the test case for Service class.
My Service Class dynamic-form.service.ts
import { HttpClient, HttpBackend } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
@Injectable({
providedIn: 'root'
})
export class Dynam...
@pacmaninbw smacks pacmaninbw with the nasty-as-heck rubber-foam pool noodle with fungus, mold, moss, and bacteria all over it from the unmaintained hottub on his neighbor's property
caffeine and stimulants in people who have ADHD or certain disorders on the autism spectrum have been shown to have positive effects on control and focus.
As an impartial moderator (as in, I am not a CR moderator, but a moderator on another site in the SE network), and Code Review user myself, I don't think 'pro-Monica' or 'anti-Stallman' are issues that need to be brought up in this moderation election chat room regarding their worthiness for a moderator position.
I often come around a requirement where we have to perform a repetitive task on the user's screen (for eg, updating a counter like flash sale/ live class timer, autoscrolling the banner, etc) .
I have written this small file which performs a basic task of pressing a button every 2 seconds for a t...
My code is working fine...
but I want to remove below those lines code from my example code (JS Code)... if I remove those code a tag not working (a tag do not open link or href not working)...
Is it a good approach to done it by wring those code ( any problem will occur for ajax request etc ) ? &...
I have a text adventure game and I need to use OOP so I've chosen to use it when getting the player's name and age. I need to keep the OOP; but was wondering if there are any ways to clean up the code or simplify it while still getting the overall output.
class Player:
def __init__(self):
...
For example, given [10, 15, 3, 7] and a number k of 17, return True since 10 + 7 is 17.
How can I improve the below solution?
from itertools import combinations
def add_up_to(numbers, k):
c_k_2 = list(combinations(numbers, 2))
return any([True for pair in c_k_2 if sum(pair) == k])
This is a follow up to my previous post.
I've used a BCrypt library to create a key from the passed in password. I then separated out the salt from the hash. The encryption is done using the salt concatenated to the hash, but only the hash is returned to the user. The salt is prepended to the ...
I was seeing alot of machine learning applications calculate fitness via 1.0 / x. Division in computers is slow so I came up with a version that is about ~36% fast on my architecture (-march=x86-64).
#include <cmath> //std::exp2, std::log
#include <numbers> //std::numbers::log2e
#include <std...
As a practice in optimization I'm trying to get my memcpy re-creation as close in speed to the libc one as I can. I have used the following techniques to optimize my memcpy:
Casting the data to as big a datatype as possible for copying.
Unrolling the main loop 8 times.
For data <= 8 bytes I bypa...
I don't participate as often as I used to on this site. But I still have about 1k reviews on my account. So I was sort of surprised when I saw this pop-up today:
My questions are:
Is this a bug? Is this a new feature that everyone sees?
But more importantly, have I done something wrong during r...
I'm making my first card game with React.js and I'm stuck at one point.
How can I display the total win count?
For example, if in this game the computer scored 10 points and won, and in the next 15 more points the global counter should show 25.
App.js
import React from "react";
import './App.css'...