« first day (2086 days earlier)   

12:00 AM
RELOAD! There are 5852 unanswered questions (89.8184% answered)
12:31 AM
I'm voting to close this question as off-topic because 1. Refactoring belongs to CodeReview.StackExchange 2. This is an X,Y Problem, you're asking people to refactor your code when you should be modifying your architecture instead. — johnny 5 1 min ago
1:23 AM
There is an exact answer to that, given the language definition, but on the other hand, if I saw that in a code review (unless as part of your compiler test suite!), you'd be rewriting it for clarity! — another-dave 6 secs ago
1 hour later…
2:36 AM
If you have working code that you would like reviewed the question could/should be put on codereview.stackexchange.com. — august 10 secs ago
1 hour later…
3:39 AM
I'm voting to close this question as off-topic because it is asking for a code review try Code ReviewDaniel A. White 22 secs ago
3:50 AM
Q: Implement system to get most traded stocks in C#

AkshayPPlease suggest way to solve a coding question, I came across. Question is as follows: Implement a class StockMarket that has the two following functions: class StockMarket { public: void addTrade(string stockName, int share); - This function keeps track the number of shares transacted for...

Q: D3v4 force layout transition from clustered layout to one node

jhjanickiI was wondering if I could get some input on how to make my code more concise, since I think in particular with the force simulation sections I have some repetition. And any other input to make my code more readable would be great. I have a mixing of jQuery and D3 but that is just a quick demo fo...

4:09 AM
Q: Basic orbiting planets in P5.js

ClepsydI started studying Javascript about a week ago and I would like some opinions and advice on my code. This program just creates a canvas and instanciates 5 planets that orbit around a sun, giving them each a different speed, color, and size. It uses the p5.js library, the code can be run in the p...

4:25 AM
Q: Simple online algorithm to calculate the mean and variance in Python

EJoshuaSI've worked in Python in the past, but it's admittedly been quite awhile, so I'm a little rusty. The basic idea of this assignment is to compute the sample mean and variance with a simple online algorithm using the following formula for the mean: $$\bar{x_n} = \bar{x_{n-1}} + \frac{x_n - \bar{x...

2 hours later…
5:59 AM
Q: WxPython GUI to display data from Adafruit IO

Parth Sarthi SharmaI need to create a GUI using WxPython in the form of a Speedometer to display 9 different data values fetched from Adafruit IO. My code is shown below: import wx import wx.lib.agw.speedmeter as SM import time from math import pi import numpy as np from Adafruit_IO import Client aio = Client(NAM...

1 hour later…
7:18 AM
Q: C# Unity Object Pooling (for a shooter game)

KaynnI am currently developing a Bullet Hell (shoot-em-up) game for my school project. I have implemented Object Pooling for my game to recycle mainly bullets. (Though I could use it to recycle enemies in the future if I do need to.) Currently I have tested this object pooling on bullet and it has wo...

7:35 AM
Please describe where is your SOLID issue. Or are you asking for a code review? Then you are asking in the wrong place — Sir Rufo 8 secs ago
8:21 AM
Q: Given a string S and a set of words D, find the longest word in D that is a subsequence of S

YedhinI'm trying to improve my code and algorithm to find out the longest word from a dictionary occurring as the sub-sequence in the given string. Example : For example, given the input of S = "abppplee" and D = {"able", "ale", "apple", "bale", "kangaroo"} the correct output would be "apple". Cu...

8:47 AM
I'm voting to close this question as off-topic because this belongs to codereview.stackexchange.comSir Rufo 25 secs ago
Q: Update employee method in python

HailstormHere I want to add update method which can update the employees based on their id so if anyone can help me with this? Here is my code which I had written till now Employee.py #this is an employee class class Employee: def __init__(self): self.employee_dict={} #It creates empty dic...

Impossible to tell which test cases are applied to your code by SPOJ, since these aren't disclosed. If you think your program works properly with all your test cases you tried, you may ask for improvement at SE Code Review. Here you are required to show a Minimal, Complete, and Verifiable example along with the problem you observe exactly. — πάντα ῥεῖ 10 secs ago
9:23 AM
Q: Repository Pattern and SOLID principles

MarcosF8I have the following Repository wrote in C#, I am using NetCore 2.2 and EF Core. I was thinking how to write properly the Search method according to the SOLID principles. This code gives a null reference exception when "Title" or "Genre" property is null. It means I will need to put an if to ch...

I already gave you the link where to post it codereview.stackexchange.comSir Rufo just now
1 hour later…
10:31 AM
This question would be better suited for codereview.stackexchange.comaduguid 33 secs ago
11:13 AM
Q: Storing computed values in an array

SturmIn several places I need to compute the next value, given a N: double size = 1.0 / Math.Pow(2, N); Since I won't be computing this value for N > 15 I have thought of the following performance optimization: public static readonly double[] RegionSizes = { 1, 0.5, 0.25, 0.125, 0.0625, 0....

An even better approach than Parallel.ForEach might be to take advantage of async/await to avoid the need to spin up new threads/tasks. Note in particular the last code sample at codereview.stackexchange.com/a/161210 . You could do the same thing, but assign the tasks inside a loop and add them to a List. Then await Task.WhenAll the list. This allows you to do multiple concurrent web requests without the overhead of spinning up threads/tasks. — mjwills 21 secs ago
11:28 AM
Q: PHP http request class

devI would like to get you opinion on this class, which is used to send http request (at that moment only POST method ). It is working ok, but I would like to get response on : maintainability, reusability, security, code formatting, etc... Class HttpRequest{ private $POST = 'POST'; priv...

1 hour later…
12:50 PM
1 hour later…
1:57 PM
then its not you but the code that tries to be fancy, still such code is only good for trick questions but shouldnt pass a code review imho — user463035818 28 secs ago
Q: Repository to update flights

Ehouarn PerretI have the Repository below, but I have noticed that there is a recurrent pattern try / catch which does not seem to be that clean, is there a better way to achieve or to extract that sort logic elsewhere? public class FlightRepository : IFlightRepository { private readonly FlightManagerDbCo...

2:52 PM
Q: My python code is not returning anything even when there are no blockages inside the function, upon function call

paridhi singhHere is my code: class Solution: def searchInsert(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ flag = 0 mid = int(len(nums)/2) if (target == nums[mid]): print("entered here") # ...

I'm voting to close this question as off-topic because it is asking for a code review (and this thus too broad / opinion based). It could probably be adjusted to be on topic for the code review stackexchange. — Quentin just now
Q: C++ Updated Stack Code - Any further improvements?

Samueljh1Updated Code The original question can be seen here: Stack implementation in C++ using linked list Changes (with the help of Martin): Added copy constructor and assignment operator overload Changed return type of peek() to const T& rather than T (this prevents unnecessary copying of data) Cha...

3:39 PM
Q: Store interface

David WhiteI've written classes Store, Cart that manages methods that allow the user to add/remove products from a shopping cart, as well as being able to query different descriptions about the item (id, price, quantity). I'm wondering if there is any way to make this more compact/efficient? I use some recu...

3:54 PM
Q: Is this a good use of Javascript ES6 import / export?

Matthew Pagefirst question here, hope it fits the requirements. I am experimenting with Javascrip ES6 import and export and wanted to achieve the following : Use the import / export style of including Javascript files. Import a class file and create an instance Import a class file that extends another cla...

4:30 PM
possible answer invalidation by Aivaras Kazakevičius on question by Aivaras Kazakevičius: codereview.stackexchange.com/posts/211766/revisions
4:41 PM
Welcome to Stack Overflow! You are using query parameters for all your queries, so no, you are not vulnerable to SQL injections for the code you posted. However, SO is not really the place for security or code reviews, sorry. — Martijn Pieters ♦ 29 secs ago
Q: Best Practice on REST POST endpoint resource ID (Path Params V.S. Body Param)

WiredCoderI am currently working on designing an API for a core banking system integration, the main theme is that whenever an action is triggered (e.g. account is created on the core banking system), another system gets notified (Through the REST API I am working on) and executes an action, example is bel...

5:29 PM
Q: Python/Django Filter with Datetime and extra options

Myzel394I'm creating a filter in python/django. I want to make a datetime human-readable. You have multiple options: Plain Datetime ("04. Februar 2018, 18:18") (bools="False,False"), sentence Datetime ("am 04. Februar 2018 um 18:18") (bools="True,False"), onlydate Datetime ("04. Februar 2018") (...

1 hour later…
6:32 PM
Q: Exception Handling in Class

Eddie C.I have read a few sites on how to handle exceptions and I think I understand it better. Here is how I plan to handle it going forward. I used a lot of the guidelines here, https://isocpp.org/wiki/faq/exceptions. Is this a sensible to handle it with c++14 as I'm using visual studio 2015. Would i...

7:15 PM
possible answer invalidation by Kaynn on question by Kaynn: codereview.stackexchange.com/posts/211800/revisions
@Duga Rolled back.
7:47 PM
I'm voting to close this question as off-topic because this question belongs on Code ReviewG5W 22 secs ago
8:03 PM
Review Disproving Euler proposition by brute force in C for efficient alternative.ideas to a similar, but more complex problem. — chux 50 secs ago
8:52 PM
Q: Code to read and write CSV files

BenBelow is my code that 1) writes a CSV file with three columns of integer data (plus column names on the first line) and 2) reads the CSV file. I'm new to C++ and would appreciate some code review. Also, I'm bothered by the fact that my technique requires all of the data to be integers. I'd appr...

Q: Refactoring JavaScript for Etch-A-Sketch from The Odin Project

BookDisorderI'm working through the curriculum at The Odin Project. Recently completed the Etch-A-Sketch project and looking for some help/feedback regarding my code. Specifically, I feel that the functions in my JavaScript contain too much repeat code. But, I'm having trouble understanding how to refactor t...

9:08 PM
Q: How to determine whether a string is an integer or not?

ZacharyConsider this example: public int numberValue(String str){ return Integer.parseInt(str); } When giving a word that does not represent a number, we'll get back an exception of type NumberFormatException. How can I rewrite this short fragment to make sure that in this case, I'll get 0 back?

9:32 PM
should move your question at codereview.stackexchange.comTDK 43 secs ago
9:55 PM
Q: Is a string a bit string

MisterCameronNew to the C language. Which design mistakes have I made in my first C program? Or what can I improve? Any little detail is appreciated. char str[100]; fgets(str, 100, stdin); int len = strlen(str); int len2 = len - 1; int count = 0; //loop through string for(int i = 0; i < len2; i++) { sw...

I'm voting to close this question as off-topic because the code functions correctly, but is better-suited for codereview.stackexchange.comJacob G. 12 secs ago
10:58 PM
Q: Modeling the Aggregates in the following Bounded Context - Domain Driven Design

Jose A I'm currently developing an application in ASP.NET Core 2.2 with Domain Driven Design. What you see in here is a Unit Creation page. A Unit is composed of competences. A unit must have at least one competence and its name must not be in blank. A Competence must have a descriptor, at least on...

Hello JayD, it seems like this question is asking for an opinion. I would suggest looking at our help center (button in top-right corner) to find out questions are allowed here. It seems like this question may be better received in the Code Review website, which is also part of Stack Exchange. — LuminousNutria 8 secs ago

« first day (2086 days earlier)