« first day (3480 days earlier)      last day (835 days later) » 

00:07
REFRESH! There are 7748 unanswered questions (89.8540 answered)
 
1 hour later…
01:13
@Mast When we get back over 90% that will be the first time since?
 
2 hours later…
03:33
1
Q: Is there any possibility to make the class design generic?

Learning-Overthinker-ConfusedI have a console application which has a fixed steps and each of the steps has N number of tasks. Each of this task is a concrete implementation which executes as a part of Schedular in a sequential manner. This implementation meaning name of class is stored in the database(SchedularTasks table) ...

 
2 hours later…
06:01
See Checking if a number is prime in NASM Win64 Assembly on codereview. Also, if you have a conditional branch inside the loop, normally more efficient to lay it out so it's not-taken in the normal case. i.e. you should lay it out like if(remainder == 0) return 0, so test edx,edx / jz .prime. Also, it's called "isprime", but it returns 0 (false) for prime numbers, true for composite? — Peter Cordes 42 secs ago
Yeah, there are lots of things to improve. Even more after your proposed changes, unfortunately: you put the push/pop inside the loop, instead of around the whole function. And instead of just using a different register, you made the loop code even more clunky. You achieved correctness, but not in a way I'd recommend anyone learn from. (See my codereview answer Checking if a number is prime in NASM Win64 Assembly for a function that sucks as little as possible, given that it's doing trial division) — Peter Cordes 39 secs ago
In that codereview answer, look at the code starting from mov r8d, [rsp+32] which loads a scanf result. It doesn't touch any call-preserved registers the whole function. (And for Windows x64, that means avoiding ESI / EDI, unlike in x86-64 SysV. We have more low / legacy registers to play with here.) — Peter Cordes 16 secs ago
06:55
0
Q: Multidimensional array in Java

coderoddeI have this multidimensional array that generalizes vectors and matrices: com.github.coderodde.util.MultidimensionalArray.java: package com.github.coderodde.util; /** * This class implements a multidimensional array. * * @author Rodion "rodde" Efremov * @version 1.6 (Nov 13, 2022) * @since...

May 19, 2020 at 0:00, by Duga
RELOAD! There are 6632 unanswered questions (90.0005% answered)
A day later we dropped under 90.
07:09
@TobySpeight In your answer here, the test fails due to an invalid read. I suspect this is due to undefined behaviour taking place which fails on your compiler which is probably more strict than the one OP is using. However, the line "The code really needs to be working before it's reviewable" implies the code should not have been reviewed how it currently was. Making it a premature answer. Could you shed some light on what's going on here?
Maybe we can salvage the situation.
 
1 hour later…
08:36
0
Q: Asynchronous file writer : queue, mutex, condition variable

rafooAs we know, it is better to write to a disk in a separate thread because the bottleneck may be the disk, which is slower than the CPU (at the condition only one thread writes to the disk). So I have implemented a "Consumer - Producer". In fact, I realize I think it could be used for any generic t...

possible answer invalidation by Casm on question by Casm: codereview.stackexchange.com/posts/281167/revisions
possible answer invalidation by Casm on question by Casm: codereview.stackexchange.com/posts/281167/revisions
@Duga Commented but not rolled back (answer unaffected)
@Mast That's true. I don't think it really is a premature answer, and I should have been less strident with that remark. I uncovered a latent bug which I guess was unknown to the asker (who probably wasn't running under Valgrind). And that's one of the goals of review.
I've edited the answer to make that clearer.
08:56
Please commit this to Code ReviewKooiInc 13 secs ago
@TobySpeight Thank you.
09:26
0
Q: Function to format time, from seconds to a particular expresion

Leandro TabakFrom an integer X representing a time duration in seconds produce a simplified string representation. For example, given X=100, you should output: "1m40s" Use the following abbreviations w,d,h,m,s to represent : *1w is 1 week 1d is 1 day 1h is 1 hour 1m is 1 minute 1s is 1 second Only the two l...

09:51
@LeandroTabak Your code is working (according to your statement) and you ask for thougths about it. @Code Review is more suitable fot this kind of questions and will enhance the chance that you receive a sensible answer. — KooiInc 32 secs ago
 
2 hours later…
11:45
It's interesting that reopening that question means we have two identically-titled questions now, which we wouldn't ordinarily have. Not a problem really; just interesting.
12:22
@TobySpeight Indeed.
To be sure, I've added a version to the newer question.
Somewhat cleaner this way.
12:47
-2
Q: How to remove duplicates of code inside loop?

user266862There is a function that filters data and return array: return productcategories.reduce((acc, productcategory: any) => { const { key, hs_code, units } = productcategory; const footnote = footnotesProductType.get(key); const group = { groupname: { units, code: hs_...

 
2 hours later…
14:26
Monking
Someone please add the final nail to the coffin for this question.
MRC as well as code not working as intended
14:47
Closed.
 
1 hour later…
16:10
It is a typo that you should have seen in a code review, in k2y = h*f2(t+h/2, +k1x/2, +k1y/2, 0.5, 0.01) you left out the base points. — Lutz Lehmann 5 secs ago
16:36
0
Q: Find center of an undirected graph

average math enjoyerTask: implement an algorithm to find graph center \$Z(G)\$ given undirected tree \$G\$. This is my first time programming in C++ so any (elementary) feedback is appreciated. The way I did it is: Run BFS from any node \$v_0\$ in \$G\$. Find node \$v_1\$ with \$\max_{v_1\in V(G)} \text{dist} (v_0,...

 
2 hours later…
18:48
This likely will get a better chance at codereview — mplungjan 53 secs ago
19:31
More of a minor code review comment, but if you do return [list2[0]] only when the length of the list is 1, then you might as well just do a return list2ChatterOne 35 secs ago
1
Q: Speed up my algorithm for finding the 4 squares that sums up to a given number

AhmadI wrote this algorithm in JS with the main goal that it will give an answer for 10^750-10^1000 in 2-3 seconds but it solves 10^150 in 2-3 seconds so I am a little far from my goal, the problem is that I sieved through the algorithm couple of times, but nothing I do seems to speed the algorithm s...

0
Q: Wordle game in C++

cold10I am a programmer who likes making clones of games. Having completed a version of Wordle in Python, I challenged myself with making a version of it in C++. I used ANSI escape codes to create coloring and an interactive experience. However, this might be MacOS only, please advise about this. Here ...

20:25
0
Q: Remove text from array when checkbox remove

EdvardThis script adds the text to the array once the checkbox is selected. How do I remove specifically the text which was added once I disable this exact checkbox? So that this textarea can have a max of 2 words in total. // Cache the elements let text = document.querySelector('#text'); const gro...

20:49
@0___________ The idea is that you have both the definition and the declaration in one place in a single file. No need to rummage through a bunch of .c looking for the definition. You can just do int x; in the .h. This is a common symbol (nm reports as type C in all .o). Then, it's both declaration and definition at the same time (resolved by the linker). Fairly easy until gcc 12.0.0 where you need -fcommon. This construct has endured many code reviews. You're the first to ever complain. I guess we'll just have to disagree and leave it at that. — Craig Estey 51 secs ago
 
1 hour later…
22:11
possible answer invalidation by Ahmad on question by Ahmad: codereview.stackexchange.com/posts/281193/revisions
possible answer invalidation by Ahmad on question by Ahmad: codereview.stackexchange.com/posts/281193/revisions
possible answer invalidation by Ahmad on question by Ahmad: codereview.stackexchange.com/posts/281193/revisions
22:32
1
Q: Golang HTTPS certificate expiry checking CLI tool

preetpalSI am a beginner at using Golang, I would like advice about the following program. It is a CLI tool that can check the expiration dates of HTTPS certificates concurrently. I have only used the standard library and would appreciate any feedback that I can learn from. package main import ( "con...


« first day (3480 days earlier)      last day (835 days later) »