« first day (2930 days earlier)      last day (1070 days later) » 

12:02 AM
RELOAD! There are 7561 unanswered questions (89.4514% answered)
 
12:30 AM
0
Q: How do I avoid repetition of variables and toFixed?

Arnon RodriguesI am looking to improve the performance of my code through best practices and cleaner code. My goal here is just to perform a conversion whenever there is a keyup. But I noticed that my code looks very repetitive. In your view, what should I do to simplify it? window.oninput = function(event)...

 
 
2 hours later…
2:16 AM
You might also be interested in CSS keyframe animation codereview.stackexchange.com/a/187054Phil 24 secs ago
 
2:58 AM
2
Q: React component to render price change

Penny LiuI've written this Card component which is composed of thumbnail image, name, symbol, total_volume, current_price, and price_change_percentage_24h. I want to refactor my renderPriceChange function since it's using the same pattern. const renderPriceChange = (price) => { if (price > 0) { ret...

 
 
5 hours later…
7:31 AM
Monking
 
 
1 hour later…
8:42 AM
I think it would be good to post this question on codereview.stackexchange.comGautham M 11 secs ago
 
9:38 AM
This might be a bad place to ask as well, since you have working code that you want to get reviewed, at least to some extent. A better place for that would be to use codereview.stackexchange.com. There are lots of things in your code which you could improve, even if they are already working. — Ulrich Eckhardt 21 secs ago
 
9:52 AM
0
Q: Working React App to display public Github Repositories of a user

ryanDescription of the App:- A React app that shows the public Github repositories of a user. The app shows an input field where we can enter a Github username and a submit button. {It provides users the feedback while getting the data in the background.} The repositories are shown as a list and for...

0
Q: Robot OOP Class in Python

Daro1234451Hello everyone! Here is the thing. So I wanted at first to create Robot class, I want him to move around some board. Maybe 10x10 or something like that, then i wanted to invent a Robot fights class, I want to add class players (becuase i want to play between player 1 and player 2) but here it is ...

 
10:17 AM
Suggest posting this on codereview.stackexchange if your code is working in this form — shree.pat18 5 secs ago
I agree with MisterMiyagi. It would also be to your benefit to show us an example code that more closely represents your case, because the current one was trivial. It also sounds this is an appropriate question for CodeReview SE if your code already works and you just want to improve some aspects of it. — Reti43 15 secs ago
If this is a working solution where you're looking for some improvement, then this might be a better fit over at Code Review. — El_Vanja 49 secs ago
I’m voting to close this question because it is asking for improve working code which is off-topic on stackoverflow and better fits on codereview.stackexchange.comTim Schmelter 31 secs ago
 
11:05 AM
1
Q: PHP Sort Associative Array first by relativity of value then by other value desc

Aurélien PitautI am trying to sort an associative array by following this scheme: Sort by 'qt': positives first, negatives after In positive part: sort by sa DESC In negative part: sort by sa DESC I managed to have the desired result but by tinkering : $array = [ [ "id" => 1, "qt" => 1000,...

0
Q: How can I save strings appended to a list in python?

Vedagya JhaI want to know if I can add values to a list and they will be saved the next time I run the code. For example: Available_Usernames = [] Username = input('Type a Username') mylist.append(Username) After I run the code i want all the usernames people have typed and the value of Available_Usernames...

 
11:29 AM
0
Q: Box Blur algorithm

uberThis is a challenge from CodeSignal. For image = [[1, 1, 1], [1, 7, 1], [1, 1, 1]] the output should be boxBlur(image) = [[1]]. To get the value of the middle pixel in the input 3 × 3 square: (1 + 1 + 1 + 1 + 7 + 1 + 1 + 1 + 1) = 15 / 9 = 1.66666 = 1. The border pixels are cr...

 
 
1 hour later…
12:57 PM
Heheh, can you tell I'm in a code review mode? — Martijn 16 secs ago
 
0
Q: convert GCCRandom(Mersenne Twister by Takuji Nishimura and Makoto Matsumoto) to stl random

GreckI am trying to translate the book Game Coding Complete by Mike McShaffry 4E to modern C++17 standard and faced with the code of Mersenne Twister by Takuji Nishimura and Makoto Matsumoto. Is it right to convert random generator code from book like that: from: #include <ctime> #define CMATH_N 624 #...

0
Q: Race Condition in ScheduledExecutorService.scheduleAtFixedRate

daniel.chanIm planning to use Strategy design pattern to put it in ScheduledExecutorService.scheduleAtFixedRate. I can use create as many scheduleAtFixedrate depends on the data to be pulled. Will this cause a race condition? public abstract class DefaultStrategy { protected Map<String, String

 
1:17 PM
If your code performs what you want it to, the question is off-topic here and should be asked on https://codereview.stackexchange.com/. If it doesn't perform what you want it to, you have to specify what are the differences between expected results and actual results, as well as any errors your code might output. — tao 35 secs ago
 
1:38 PM
If you want help improving working code, you should post this on CodeReview.SE. If you do decide to do so, please delete the question here. — NathanOliver 1 min ago
 
1:55 PM
0
Q: convert ID3DXMatrixStack to DirectXMath

GreckIs it right ti convert ID3DXMatrixStack to DirectXMath like that: #include <stack> #include <iostream> #include <DirectXMath.h> class MatrixStack { std::deque<DirectX::XMFLOAT4X4> m_MatrixStack; public: MatrixStack() { DirectX::XMFLOAT4X4 identity; DirectX::XMStoreFloat4x4(

 
Ben Popper on May 11, 2021
We’ve talked about the engineers who write the code that operates SpaceX spaceships. Now let’s talk about the people who build and maintain the tools and processes that enable the developers and ultimately, help accomplish the mission of flying astronauts to space. Stack Overflow talked with Erin Ishimoticha, an engineer in the Software Delivery Engineering…
 
2:19 PM
0
Q: Code queues music and plays it (discord.py bot...), the workflow is too heavy and crashes, so how can I code the queue and play more efficiant?

AceodI've been coding a discord.py bot and have gotten my hands to the music bot section and I finished my queue part. It's logically correct and should be working but the code is way too inefficient so the bot crashes when someone adds another song to the queue. This way I can't run the bot as I want...

 
2:44 PM
0
Q: Go - keep installation status for multiple installations process

Jenny MIm fairly new to Golang and I appreciate some feedback about how to make the code cleaner The code is called by go-routine and should update status (fail/success etc) of several installation process. package avss import ( "context" "sync" "helm.sh/helm/v3/pkg/release" "sigs.k8s...

0
Q: Fitbit dashboard with Python

54657 from tkinter import * from tk_tools import * from tkinter.ttk import * from tkinter import messagebox root=Tk() def add_alarm(): if not hrEntry.get()=='' and not minEntry.get()=='': messagebox.showinfo('Success', 'Successfully added alarm') pass #What should I use to add the ...

0
Q: Filtering what strategy to use in strategy pattern

RDAxRoadkillI have a situation where I've used the strategy pattern but got many different strategies that are available to the client code that needs to select the appropriate strategy, this is because there's a lot of different usages to the strategy depending on the machine that's being calculated, becaus...

 
@CaptainObvious Not working as intended?
 
3:01 PM
@Donald.McLean Depends on why it crashes, if it is running into some kind of time limit then it is on topic.
 
> It's logically correct and should be working but the code is way too inefficient so the bot crashes when someone adds another song to the queue. This way I can't run the bot as I want to
We don't get cases like that a lot.
 
0
Q: HOW TO DISABLE OR UNBLOCK A CERTAIN EXTENTION my code is aimbot that i cant run thats what it does

Christian WadeTAMPERMONKEY ON SCHOOL COMPUTER I THINK ITS UBLOCK OR SOMTHING I TRYED EVERYTHING I NEED A SCRIPT MANAGE i need a a step by step solution.const BLOCKING_MODE = "WHITELIST_ALLOW_TOP_LEVEL"// ==UserScript== // @name [NEW 2021] Shell Shockers Aimbot (shellshock.io) // @version 1 // @des...

 
@pacmaninbw I wasn't prepared to say that it is categorically off topic, and I don't know enough Python to be able to tell if it is actually logically correct, or if there was a subtle threading issue or something like that.
 
Where is our resident py expert when we need then?
@Donald.McLean Agreed
 
3:30 PM
In case of working code where you're only looking to refactor/optimize, Code Review would be a better option. — El_Vanja 47 secs ago
 
3
Q: Implementation of std::atomic<std::shared_ptr<T>> for C++20

AfshinAs you may know, C++20 has added std::atomic<std::shared_ptr<T>> specialization to the standard, but sadly, most compilers have not implemented it yet. So I decided to implement it myself. I want to know if I can improve this code or not. In addition, I'm not sure if my implementations of wait(),...

 
@Donald.McLean I can somewhat understand the code - don't know discord.py. Can't really see where the issue is, so getting a traceback will show if the question is on or off-topic
 
@AadvikVashist--understand and agree it's okay for the purpose you describe. Just wanted to give a heads up for submitting code for a job interview or a code review for an existing job rather than a course. — DarrylG 45 secs ago
And this is how a usefull answer and comments become a Code Review process ;-) — Mauricio Gracia Gutierrez 15 secs ago
 
3:51 PM
@CaptainObvious Garbage.
 
If the code works and you're looking for advice on improving it, Code Review is the appropriate place. But see codereview.meta.stackexchange.com/questions/5777/… first. — Barmar 52 secs ago
 
4:21 PM
0
Q: Print a hierarchy tree that visualizes the bosses of employee groups

LukI am stuck with the following problem: I am given an Employee-class with a variable boss which is another Employee-class, but it is representing the boss of the respective employee. I am also given an ArrayList with all employees of the company. Now, I want to print out a hierarchy tree, i.e. all...

 
5:05 PM
Stack Overflow doesn't do general code review; our scope is limited to answering questions about narrow, specific problems, with only the shortest code that reproduces those problems. Think of us like a huge FAQ -- questions should be about a problem other people might also encounter, not about your code individually. — Charles Duffy 43 secs ago
If the code works and you want some advice: Code Review. — Johnny Mopp 24 secs ago
 
5:34 PM
0
Q: Trie class help in python

AAM07I am working on a Trie class in python and have gotten some error on my iter and prefix_iter methods and am not sure why. My insert method is also not working as intended If c is not in children I do make and new node and go down to the next node, but if c is in the children I'm still stuck at th...

 
5:58 PM
0
Q: addition of two list elementwise with abortion if condition satisfied python

sosI have a function that sums two arrays elementwise and stops if the sum at a certain index is greater strictly than 1. This function is called several times and though is not the bottleneck of my code, it takes quite lot of time and believe can be optimized further. def add_lis(lis1, lis2): ...

0
Q: SQL query to group data by week, summing income by country and state

aucamortI have the following table in sqlite: 2021-05-03|10|CA|USA 2021-05-03|15|WY|USA 2021-05-04|10|WY|USA 2021-05-06|15|CA|USA 2021-05-06|15|CA|USA 2021-05-06|15|CA|USA 2021-05-10|5|CA|USA 2021-05-11|5|TX|USA 2021-05-11|5|Albania|Canada 2020-01-01|20|WA|USA 2020-01-02|10|WA|USA The column names: dat...

 
6:47 PM
0
Q: Updating Multiple Collections In ViewModel Based On A Single ListView Selection - WPF

Joshua White-I have a ListView, and its SelectedItem property is bound to EmployeeModel SelectedEmployee in my VM, and it implements the Set method from MVVM Light. (Basically, OnPropertyChanged, but the MVVM Light version.) -I have three more ListViews (more, but for simplicity's sake, we'll say three.) T...

 
7:35 PM
0
Q: Inquiring possible alternatives to custom hierarchy-aware smart pointer

MatGI have a medium sized project that uses a class hierarchy that essentially boils down to: class Mach { public: virtual ~Mach(); //... virtual void common_action() =0; //... A lot of common actions //... }; class MachStrato : public Mach { public: //... // ...Implementat...

 
7:55 PM
Stack Overflow is for asking and answering specific technical questions. "Help me make my program better" isn't quite specific. We're not here to make design decisions for you, but rather, to explain why some particular mechanism works the way it does. You might get more support for this type of query at codereview.stackexchange.com. You'll also want to review the SO help file section covering what's on topic for this site. — MarsAtomic 41 secs ago
 
0
Q: Are such unit test sufficient?

ostojanI'm struggling with strategy for my tests and I'm testing different approaches. As some part of my application needs connection to database I wanted to create tests that use mocks to avoid running special instance of database just for testing. That gave me a glimpse of how can I use mocks and I p...

0
Q: Properly structuring a TypeScript library

Ian H.This question is more architecture than code related. Context I'm currently working on a fairly large web-targeted library, which I'm writing using TypeScript for my own convenience during development. Now that I'm close to wrapping up a release, I'm wondering what the ideal way to structure the ...

 
@MarsAtomic: Codereview is for having people suggest improvements to working code. This code is not working, because it doesn't do what it should. OP is asking how to do a non-blocking read from System.in. That is a "specific technical question", and on topic here. — meriton 43 secs ago
If the code works, and you are just trying to optimize it now, then this should be asked on CodeReview instead of StackOverflow. — Remy Lebeau 43 secs ago
 
8:24 PM
0
Q: Access object initialized within try block afterwards if no exception occured

Richard NeumannI have a use case where I try to initialize a Player object within a try block. The relevant excerpt of the current, working code looks as follows: string GameServer::processMapRequest(MapRequest const &request) const { MapResponse response; response.header.playerId = request.header.playe...

 
8:48 PM
0
Q: Console Game "Epic Dungeon"

TuleKr1sMade a console game in C ++ "Epic dungeon", which my friend did a year ago in JS. I decided to do it in order to gain experience (in fact, I did it because I would have stopped learning c ++ if I hadn't done something, because studying for so long and not doing anything can quickly get bored) I d...

 
9:02 PM
possible answer invalidation by Reinderien on question by TuleKr1s: codereview.stackexchange.com/posts/260673/revisions
 
0
Q: I refactored code to be more functional and not sure if I made it better or worse

Alex l.I had a piece of code that solved really simple problem - it formated two dates to look better on a webpage. It looked like this: function formatDateRange( days: { firstDay: string, lastDay: string } ): string { let first, last; first = dayjs(days.firstDay); //dayjs parses string that for...

 
10:01 PM
0
Q: (FOLLOW-UP) Header-only bigint library written in c++20

ThePirate42This question is a follow up of Header only bigint library written in c++20. I've made all (or almost all) the corrections suggested in the answers, plus some minor change here and there and a modification in the division algorithm. Instead of a lot of constructors, now there are only two templat...

 
@Duga that's okay - code fence
 
 
1 hour later…
11:14 PM
0
Q: Cannot insert a vertex into a graph

Sandra SilvaI'm trying to create a graph for a kind of social network analysis and I cannot use Networkx library (it is for an academic project). I have a csv file with data like this: Column1, Column 2 1563,133 171316,2 1563,924 I've created a method to read the content of the csv file and create the Verte...

 
11:46 PM
What is the exact issue? Please don't make us guess or having to run the code and look for the value that seems off. Is all of this code failing? If not, please reduce it down to a minimal reproducible example. Finding a cleaner/smoother/shorter way to do all of this should be a separate question for Code Review. Please try to focus on just one specific issue. — El_Vanja 7 secs ago
 

« first day (2930 days earlier)      last day (1070 days later) »