« first day (2671 days earlier)      last day (1644 days later) » 

00:00
RELOAD! There are 6952 unanswered questions (89.7762% answered)
00:30
possible answer invalidation by Martin York on question by Martin York: codereview.stackexchange.com/posts/248416/revisions
01:27
@Duga fixes a closing brace
01:53
@Duga Martin York also answered the question.
0
Q: Calculate 1-based index after making certain operations on a Queue

user6123723Here's the problem statement You're given a list of n integers arr, which represent elements in a queue (in order from front to back). You're also given an integer x, and must perform x iterations of the following 3-step process: Pop x elements from the front of queue (or, if it contains fewer t...

02:10
@Duga Sounds like we need to try and get some questions answered.
Though some of the questions, I read the code and I'm like "huh?".
4
Q: Checking membership of object in set without pattern matching

Alen MujezinovicI'm curious in how to best structure code that checks for membership of an instance of an ADT in a set of elements without using pattern matching. Given the following ADT, methods and functions, which would be seen as the idiomatic way to check for membership in Scala? sealed trait Code { def...

02:45
possible answer invalidation by Martin York on question by Martin York: codereview.stackexchange.com/posts/248416/revisions
 
1 hour later…
03:57
Monking
 
2 hours later…
05:41
0
Q: Discord bot file requirement and object instantiation d20pfsrd follow-up

jasonmadesomethingI have written a series of parsers for a discord bot that each reside in classes in their own files. Each parser class has 3 functions, 2 of them are for generating the response to the discord message based on the data received from an axios get call, (1 is an embedded link the other is a text fa...

06:06
0
Q: Improving a Medicare Beneficiary Identifier (MBI) generator

LostAsHeatI am new to coding and looking for a few pointers on how I can improve my first project. At work, I often need to create Medicare Beneficiary Identifiers (MBI) when creating test patients with Medicare coverage, and have to look up the format every time. I thought creating an MBI generator would ...

06:58
@Donald.McLean Yes.
@Donald.McLean Also yes.
@Duga It's his own thread, shrug.
07:33
just a code review then post it in codereview.stackexchange.comPavel Anikhouski 59 secs ago
@V.Kovpak the link into CodeReviewComments is about putting normal code path at minimal indentation. I think the question is about elses in general. Also, assuming b.good is normal flow your example does the opposite to what the link says. — Andreas 59 secs ago
I am agree with @PavelAnikhouski, deleting my answer as it is related to code review. — Prasad Telkikar 32 secs ago
I’m voting to close this question because it belongs on codereview.stackexchange.com — Pavel Anikhouski 58 secs ago
0
Q: concatenate string, with different first and last iteration

VonnCCGood day, basically this is just a code review. It works but I think there is a better way to do this. Like string pattern or string manipulation. I'm not yet familiar with both terms. The goal is to get "=A1-A2-B3-D4-n=". From array of strings. The code is : string[] arr = { "A1", "A2", "B3", "D4"...

07:51
Side note: reviews for working code ... might better go to codereview.stackexchange.com (but read their help center carefully before posting there). And side note: learn about java naming conventions. Method names go getPrice()... the _ is only for SOME_CONSTANT. — GhostCat 39 secs ago
08:10
-1
Q: Hard coded cascading Drop down List item in asp.net core MVC always showing undefined while selecting second drop down list

JackI am working on Asp.Net Core 3.1 MVC web application Project, so looking forward simple Hard coded cascading Drop down List item in asp.net core 3.1 MVC. I have two drop down select , if first drop down selected then second drop down should be enabled with respective of first drop down value. Al...

09:00
-1
Q: Search Last Name of Employee (Minimum 2 Char) through button click event and list all matching Last Name in the list box using ASP.NET CORE 3.1 MVC

JackI am working on asp.net core 3.1 MVC web Application project, and looking forward below help to my project: Step 1 : Index view Page => Click on a Browse Button (no input required) Step 2 : Button Click should be redirect to Partial view from Index view Step 3 : Partial view text box should get i...

09:25
1
Q: Set id in constructor, or generate it when asked for?

Miguel StevensI'm using PHP, I have a class that generates an id based on the calling class, so the id of the class won't change after it has been initialised, now I'm wondering which of my two methods is preferrable. Set the id in the constructor Generate the id when asked for /* Set the id in the construc...

09:45
@Mast Interesting, didn't notify me of it being closed... I'm guessing it's only for comments which makes it significantly less useful
Interesting we're getting a new HTML frontend to Markdown
44
Q: New post formatting

Aaron ShekeyWe’re doing a bit of refactoring on our post formatting. Currently, we apply a single class with both layout and styling called .post-text. Our first goal is to separate layout from our text styles. Simple enough! However, our current post styling has a few missing spots and areas for improvement...

10:15
0
Q: Troubles to set data architecture for an application

UtopionI am working on a python app and I want my app architecture to be intuitive. I consider that in an app, there is multiple page and in each page, there is multiple element. So I created a big dictionnary containing all the key and this is used by multiple modules. I want this dictionnary to be a r...

0
Q: Typescript design pattern for rendering different objects with similarities

JhonIt's a web project. The question is a design pattern question to write code that's more elegant, you know. I created a css grid WITHOUT using 'grid' but using float and clear. I know such project works better written in React but it's just a try. The grid I'm creating is entirely recreated when c...

10:37
Then stackoverflow is the wrong site for you since this site is for debugging problems. Try posting on CodeReview for improvements to working code. — takendarkk 10 secs ago
11:29
0
Q: Priority Queue implementation for top k frequent elements leetcode in Ruby

Steven AguilarWhile working on the following leetcode problem: https://leetcode.com/problems/top-k-frequent-elements/ I used a Priority Queu implementation in Ruby. I have learned how to implement a Priority Queu in Java in Robert Sedgewick's Algorithms book. When inserting Hashes into the Priority Queue for ...

12:19
0
Q: Why the tree dictionnary is more use than the flat dictionnary?

Utopiond_tree = { "date": "", "author": "", "version": "", "france": { "population": "", "city_dict": { "paris": { "area": "", "middle_age": "" }, "lille": { "area": "", ...

12:35
For Codereviews switz to Code ReviewJens 13 secs ago
What is the actual question here? Does the code not compile, or does it not work as expected - or are you just looking for code review? It would help if you described the actual problem you want solved rather than a completely abstract pattern like "entity component system", which might not map well to Rust, and might not even be needed for what you're working on. — user4815162342 44 secs ago
I’m voting to close this question because it belongs on codereview — Michael 41 secs ago
0
Q: Implement Strategy pattern for 1. Print Report. 2. Movie type

garima gargI need to know whether I have implemented Strategy pattern correctly for below 3 classes provided to me for 2 tasks.1) Report Generation 2) Movie Type. Below 3 classes were provided to me Rental.java Movie.java Customer.java public class Rental { private Movie _movie; private int _daysRented; ...

13:07
Because this is perfectly functioning code, I think it would fit well as a question posted to Code Review, where questions of this kind are commonly asked. This forum is more focused on questions as defined here. — ryyker 35 secs ago
0
Q: Map/Reduce multi level JSON object

Jim JimsonFirst post, so please be gentle.. I have a list of rescues for ambulance drivers in different states that are displayed on a kanban board. My JSON object is divided by the status of the rescues, and then grouped by driver. The structure is like this: --Status (unassigned/assigned/arrived/rescued)...

13:35
0
Q: Selection Sort Java and Analysis

gssI have written a selection sort code in java. I know its very elementary algorithm, but since i am learning, so wanted your input about the quality of the code. Please have a look at the code: package selection_sort; import java.util.Scanner; public class SelectionSort { int [] arrayToBeSorted;...

13:49
@NateEldredge I thought about that, but then seeing the github and github-codereviews tags here led me to believe it would be appropriate on SE. — Miroslav Policki 51 secs ago
@Peilonrayz Indeed.
@Peilonrayz Does this mean we're finally getting real headers?
Linkables?
@NateEldredge I thought about that, but then seeing the github and github-codereviews tags here led me to believe it would be appropriate on SO. — Miroslav Policki 37 secs ago
@Mast Honestly IDK. It'd be great if it does, but I wouldn't be surprised if it's "supported" but not enabled
lol
Yea.
None of the headers on this demo page are linkable AFAIK so... possibly not even supported
13:58
At least the extra features provide more options for people augmenting SE with userscripts.
0
Q: Enum and flags enum data type makers in JavaScript

HydroperI've a standard enum and flags enum maker using Proxy for in operator. Enum instances are objects wrapping a number. (In an ideal scripting language they'd be primitive classes, but I got what I want anyway.) The example below works as follows: Associates: E.CONST_0 with 'const0' and 0 E.CONST_...

14:49
-1
Q: OpenMP Multithreading: Will this code have weird side effects?

catalogue_numberI have a piece of code that tries to speed up the expensive process of populating a large, multidimensional array of double coefficients. For full context, the remainder of the code is available here, however I believe i've included all relevant parts. state_type::num_atoms() and state_type::P_si...

15:03
@CaptainObvious Can someone who knows C++ add a comment for the DVs and CVs?
@Peilonrayz Some will close it because it doesn't have a main function, others because it appears (if you squint your eyes just right) to be asking for an explanation of the code instead of a review.
Question 1 and 2 could be problematic.
@Mast Thanks Mast
15:19
Ryan Donovan on August 26, 2020
Lasty week, JetBrains released Kotlin 1.4 to the programming community. The update added some new language features but also put a strong focus on improving quality-of-life and performance, especially when paired with JetBrain’s own IntelliJ IDEA IDE.  Kotlin is a programming language best known as “Java without the warts.” It can compile both  to Java…
15:38
@pacmaninbw FWIW as the final voter I chose Code Not Implemented Or Not Working Correctly as; 1) Code not inline in the question, to me, has an implication it even exists in the first place 2) The code doesn't seem implemented - the names match and descriptions do too. 3) Having to explain this on Meta would be far easier if the user contests the close reason.
0
Q: CRUD integration test, is it ok?

SilentRage47I want to test my CRUD operation to a MySql database (I use dapper as my ORM). This is what I wrote with xUnit: private IPaymentRepository paymentRepository; private Payment testPayment; private string connectionString = "Database=..."; //Test DB public PaymentRepositoryTest() ...

16:00
Monkin
16:29
I think, this question should be posted at CodeReview. — Olvin Roght 55 secs ago
0
Q: Create map query for each unique value in column

User1973I have a Python 3.6.8 script that does the following: Takes the unique values in a column in a spatial table. Creates map queries/layers for each unique value. Each query/layer has a where clause that isolates the unique values. The script uses a proprietary/OOB Python site package called Arc...

16:49
@Peilonrayz It's also missing all includes and thus relevant type declarations/definitions.
@Zeta Historically that doesn't make it MRC. Additionally many Python questions don't have includes, and I can figure it out
It's missing third-party includes. Q_eii_t and Q_tbr_t are not standard library types.
@Zeta And?
@Peilonrayz "And?"?
-3
Q: Why does this program take too much memory?

Hinko Pih PihI'm running a program on a school server and I'm getting a memory limit exceeded error because the program allegedely takes more than 300 MiB of memory. Here is the program: #include <stdio.h> char a[3010][3010]; int degree[3010][3010]; bool visited[3010][3010]; int h, w; void searchSame(int x,...

16:55
How does that relate to it being a bad question?
A type in C++ shows certain behaviour. The question "OpenMP Multithreading: Will this code have weird side effects?" cannot get answered at all without the type's definition, because the used types may have all kinds of "weird side effects", especially since C++ allows operator overloading.
The standard library has certain restrictions on types. Most well-documented libraries also do, but you need to know which library has been used. As Q_eii_t isn't searchable on the web, you cannot reason about the behaviour of the code at all.
Furthermore, the GitHub repository isn't searchable either, as it's a fork.
It's probably some Eigen-wrapper. But probably isn't enough for a proper code review in a multi-threaded/multi-program environment.
If something "probably" works in C++, there is a good chance it's just waiting to shoot you into your foot when you glance on something else for 10µs.
Thanks for the info. If they add Q_eii_t then won't you just complain that something else isn't included if it's not std:lib? Additionally could you post a shortened version of that as a comment?
> If they add Q_eii_t then won't you just complain that something else isn't included if it's not std:lib?

Probably :P. However, I'll add a comment. Note that I didn't downvote, by the way.
Heh. I just noticed that it won't compile.
@Peilonrayz Added a comment.
17:12
@Zeta Thank you, solid comment - even if I disagree with the includes part :)
Why?
possible answer invalidation by Daniel on question by Daniel: codereview.stackexchange.com/posts/248395/revisions
Includes themselves are not needed. If you need an internal class having an #include InternalClass isn't going to help. If they're std lib or 3rd party they are helpful but not needed
17:26
Isn't this question more suited for codereview.stackexchange.com ? — pawello2222 36 secs ago
17:43
I refuse to review a question if it doesn't have the necessary includes or imports listed.
I'm not about to take a bloody guess.
-2
Q: Confusion on boolean variable naming convention

Sazzad Hissain KhanOne of my team mates declared a boolean variable name like, var isSupportDataType = true In code review, I suggested to change it into willSupportDataType or doesSupportDataType. But he does not agree on that. I was trying to convince him that boolean variable should be in participle or continu...

But I barely write answers anyway, so...
I know the site's stance, not everybody likes it so it's a grey area depending on who's doing the review queues...
@Duga Rolled back.
We need those includes and types for a real review, or there will be suggestions that simply don't make sense.
MRC exists for a reason.
I've only ever needed to ask an OP "what is {foo}" a handful of times over a ton of answers. So I don't understand the need for a blanket rule "we need all the imports". Maybe I have some curse of knowledge, cause I don't see it.
18:03
Could be.
I try not to close questions over it, after all, it's not policy, but IMO a good question is complete.
And I understand that gets silly with Java GUI programs and their 200 lines of imports, I'm not talking about that.
But if you use a library, tell us you're using a library. It's not that hard, and prevents miscommunication.
Especially in languages that don't have a shared repository of packages like Python and JavaScript do.
In C++, it's a lot trickier because everyone does what they darn-well please.
@Mast Certainly - a good question is complete, or well, reasonably complete.
0
Q: IntMatrix implementation

Mathew CartelI need to write a CustomBasicMatrix class implementation for college. This includes basic operations such as int and CustomBasicMatrix addition and subtraction, Transposition and iterations / const iterations. I would like to know if there are coding conventions, or more importantly, Memory Leak ...

There is a Stack Exchange site specifically for asking for code review : codereview.stackexchange.comFrançois Andrieux 18 secs ago
18:19
@Peilonrayz It's highly dependent on the language.
For example, Result in Rust may be one of four types in the standard library, and many libraries re-use it with the same name. Without the "includes" (use ... declarations) I have to guess. I can usually default on std::result::Result, which is available by default, but self-defined Result types might differ completely from that one.
Similarly in Haskell, Parser might be one of four (five?) popular Parser implementations. They all have a similar interface, but their performance and behaviour differs.
And even if the questions says parsec, I won't know whether they use type Parser = Parsec Text () or type Parser = Parsec String () or type Parser = Parsec ByteString (), which might be very relevant to the review. The type completely depends on the import declaration.
18:36
@Zeta I'm sure you're are certainly right in those examples. Your argument that there are a handful (or at least that's how I think it's being portrayed) of situations that need an import doesn't mean that all imports are needed.
I think that question is better asked at Code ReviewJens 28 secs ago
@Peilonrayz Ah, yes, there are situations where it's fine to leave them out.
@CaptainObvious This question is a great example. Dimension's definition is missing. But the code provides enough context about the usage.
18:59
0
Q: Palindrome Algorithm and JUnit 5 Tests

Lucifer UchihaI have a "Palindrome" class that has some functions for verifying if certain things are Palindromes. For the verification, I have 2 different algorithms, one being recursive and the other iterative. I'm happy with the algorithms however I'm unsure whether the way that I do the overloading and eve...

0
Q: How to optimize the Sieving portion of the Quadratic Sieve algorithm

Ilya GazmanIn my quadratic sieve implementation, the sieving part takes 40% of the overall performances, I wonder if you could think of a way to improve it. // that loop takes 40% of the performance for (Wheel wheel : wheels) { wheel.update(logs); } // Wheel update method public void update(byte[] log...

19:27
codereview.stackexchange.com is the right place for this question I think — Rono 37 secs ago
 
2 hours later…
21:03
1
Q: Optimal Caching - "Farthest in Future" Algorithm

America AlversonI'm looking for someone to really tear apart the following code I wrote for my graduate-level algorithms class. The problem was Optimal Caching, and the algorithm I'm implementing is called "Farthest in Future", which looks to see which cache item is either NOT in the request, or one who's first ...

21:28
0
Q: Finding All Modified/Overwritten Files in Directory using PHP

bbrumanAttempting to find human-modified files in the wp-content/plugins folder of my wordpress installation to determine if any core plug-in files have been modified by the user. I am using a Windows machine (therefore getCTime() is createdtime I believe?) <?php $dir = 'F:\www\jp\wp-content\plugins'; ...

 
1 hour later…
22:58
0
Q: How to eliminate repetitive serializers and API Viewsets in Django Rest Framework

creyDI built an backend using Django and the django-rest-framework and realized that a lot of the code snippets (mainly classes) are similar. Is there any better way? I tried to wrap them into a very generic class, but didn't succeed yet. This is what I mean by "similar serializers": ... class DeviceS...


« first day (2671 days earlier)      last day (1644 days later) »