« first day (2813 days earlier)      last day (1195 days later) » 

12:00 AM
RELOAD! There are 7268 unanswered questions (89.6351% answered)
 
 
1 hour later…
1:16 AM
0
Q: Is it possible to do a realloc that does not deallocate an array first?

Luca ArgentiI have a simple utility to reallocate arrays of various kind and dimensions, an excerpt of which is reported below. I wonder however if one can avoid deallocate an array that just needs to be expanded, instead of deallocating it first. Also, I am interested in knowing what is a good strategy to a...

 
2:06 AM
The question got closed in code review, we're back to handling it over here unless you are able to reopen it there on the basis that I do have working code and but am trying to find ways of doing it better. — sunrise 1 min ago
 
 
2 hours later…
3:52 AM
If the code works, then this question may be better suited to codereview.stackexchange.comcybernetic.nomad 40 secs ago
 
4:02 AM
@John it is mostly defined... like ++x++ - ++x++ I believe allowed to be -1,0,1 based on phase of the moon in C/C++... Or change from OP's code to one shown in this post - just inlinining that x++ to the Write - pretty innocent and easy to overlook. There is also need to make sure it was not misplaced ] during code review - ch[x]++ vs. ch[x++] ... just not really worth learning all defined and more importantly undefined behaviors associated with return values. — Alexei Levenkov 59 secs ago
If your code works, but you just want to improve it, then your question is better suited for Code Review: codereview.stackexchange.combraX 6 secs ago
But to answer your question, you dont need to use Copy/Paste functions that are slow. You can assign values directly to cells instead. There are many better way to do this, but again, you can go thru them with someone at Code Review. — braX 1 min ago
 
4:35 AM
thanks a lot! I didn't know about code review! — Timonek 45 secs ago
 
4:53 AM
Monking
 
5:05 AM
0
Q: Is it possible to make this macro faster? Copy and paste when condition is met

TimonekI have a problem with macro running too slow and I guess it is just because of lack of my knowledge. I have a macro that is copying data from "database" and paste it to another sheet. Macro is taking the names from the list in Sheet1 and looks for matches in Sheet2. When the match is found is cop...

 
5:25 AM
possible answer invalidation by Yugenswitch on question by Yugenswitch: codereview.stackexchange.com/posts/254696/revisions
 
5:40 AM
possible answer invalidation by Yugenswitch on question by Yugenswitch: codereview.stackexchange.com/posts/254696/revisions
 
5:55 AM
0
Q: Is there a better way to search for and copy a range of data? VBA

Bob the BuilderI have the following code that works as intended, but I'm wondering if there's a better way to write it. Basically, this code searches for the word "Disbursements" and copies all of the rows with data below it, including the row with the specified word. After the rows are copied to a new sheet, t...

 
0
Q: Dwarf Fortress Clone - C++

Strahinja RadmanI have written a game. Its a very simple clone of the Dwarf Fortress. The game seems to be working fine at least from my testing. I would like to improve my programming game and fix all the bad design, bad practices and possible performance bottlenecks in my code. So any comment that would help m...

 
 
2 hours later…
8:02 AM
0
Q: Using (templated) function-scope static address as Unique ID

InKryptiontypedef const bool* const TypeID; template<typename> TypeID TypeIdOf() noexcept { static const bool idLoc(0); return &idLoc; } I'm using this function to return from some derived classes to differentiate them at runtime, by returning from this function, templated as the class. ie...

 
8:27 AM
0
Q: React functional components: Pattern for keeping parent aware of a value within a child

tarstevsAlthough case one and case two shown below both work, I have these two questions (the first question is why I'm here... I'm happy to ask the second one on Stack Overflow, but it seems like the second one might be worth considering vis a vis the ideal pattern for the situation that comes up below)...

 
 
1 hour later…
9:43 AM
0
Q: could you please criticize my shift register code (verilog module)

drakonofI am beginner in FPGAs and try to study verilog HDL. Could you please check quality of my code (a shift register). Any comments are welcome. The shift register serializes parallel from wr_data_i data to serial_data_o and has two variation of first serialized bit. It may be most significant bit or...

0
Q: Looping Array object with conditions and comparison the performance with ECMA VS Vanilla JS

Nɪsʜᴀɴᴛʜ ॐThe Plain vanilla JS needs to converted in to advanced ECMA. The below 3 snippets shown yields the correct result. Need to identify which among them is performance oriented this.allUserDetails.forEach((el, indx) => { if (type === 0 && flagResumeAll === false) { if (el.extensionTime ==...

 
10:22 AM
Hi, welcome to SO, I am afraid that this post is more suited for codereview.stackexchange.com. Stackoverflow is better suited for specific issues with your code. Thanks and good luck! — mandulaj 26 secs ago
I think what you want is split the the code into blocks that are common between the two sections and place them into their own functions. Then call those functions in the original section instead. You should group your code logically according to what it does and also to maximize the amount of potential reuse. Stackoverflow is meant for specific issues with yoru code. This might be more suited for codereview.stackexchange.com Good luck! — mandulaj 6 secs ago
 
11:21 AM
The goal of StackOverflow is to present minimal working example problems and get technical solution for them. Please also see stackoverflow.com/help/how-to-ask If you need code review please try codereview.stackexchange.comPrzemyslaw Szufel 34 secs ago
 
11:50 AM
0
Q: Create an analogue clock interface in Java using JavaFX

r0wletc0derThe app when works fine, but people are saying that the code is not written with good code style and following OOP principles. Can I improve on any parts of my code? Especially regarding: Code comments Variable naming Separation of concerns Single responsibility principle etc. import javafx.app...

 
12:16 PM
@AnthonyDa - You have to accept the answer. If you would like somebody to review your project you have to put your link in the Code Review forum. You can find it from top menu of this site ( in a list of all Stack Exchange sites). I or somebody else can review your code. Nobody will review your code at this forum. This forum only for the questions. — Sergey 32 secs ago
 
12:30 PM
Here's the post on stack exchange code review : codereview.stackexchange.com/questions/254742/…AnthonyDa 1 min ago
Sadly same result, I made a post on Stack Exchange Code Review if wanna take a look : codereview.stackexchange.com/questions/254742/…AnthonyDa 55 secs ago
 
12:41 PM
1
Q: Implementing dynamic array without STL

PoseydonFor my game engine that I'm trying to write without using STL I implemented dynamic array class(some kind of std::vector). I would like to know whether this code suits best practices. I'm also not enough knowledged about move semantics and all that stuff, so please tell if I should add them somew...

0
Q: Swagger doc and Entity Framework include not working

AnthonyDaI tried to create a .Net core API using Microsoft Documentation but I ran into some issues. The app is working but only for a "single" table. The includes are empty. var contact = await _context.Contacts .Include(c => c.ContactSkills) .ThenInclude(cs => cs.Skil...

 
possible answer invalidation by Yugenswitch on question by Yugenswitch: codereview.stackexchange.com/posts/254696/revisions
 
@Lurch Rolled back.
 
 
1 hour later…
1:57 PM
0
Q: How to convert traditional code to reusable function

Programming_crazyI have different function for different task below this function. To reduce the code, I have written following function. Is this the best way to apply OOPs? or any better way to do? Function def ML_algorithm(algo_name, y_train, y_test, y_pred_algoname, y_predtest_algoname): print(algo_name) p...

 
2:23 PM
0
Q: the quickest way to convert a bitarray to integer in Python

Al MastroI've been searching for methods to convert a bitarray into integer. Now I'm using this code: def bin2int(bin_array): int_ = 0 for bit in bin_array: int_ = (int_ << 1) | bit return int_ where bin_array is a bitarray randomly filled. I'm curios about other methods that you know...

 
The question is better suited for code reviewanurag 10 secs ago
 
Ryan Donovan on January 15, 2021
Welcome to ISSUE #56 of the Overflow! This newsletter is by developers, for developers, written and curated by the Stack Overflow team and Cassidy Williams at Netlify. This week, we say farewell to Winterbash 2020, look for evidence that a program is being emulated, and create a chess AI that matches the skill of a player instead of…
 
@anurag on codereview it would be closed as off-topic in a heartbeat. Code not working as intended is off-ttopic there. — Heslacher 39 secs ago
 
@Lurch comment gone ;-)
 
2:54 PM
Is there a problem or are you asking for a review? If there is a problem, can you state it, otherwise this is a better fit for codereview.stackexchange.comgilliduck 10 secs ago
 
3:25 PM
This may be more appropriately asked on codereview.stackexchange.com and you will probably get higher quality reviews there too. — Matt 1 min ago
 
3:39 PM
0
Q: Could you explain the use of this function as an input for a class?

AntIn the code below the function _hook_inner is placed as the second input of the class Hooks_0. The function _hook_inner simply checks the type of object passed into it and returns a list if it is not a torch tensor or a tuple. The position it is input into the Hooks_0 class doesn't look like it w...

0
Q: Revised: Counting subnumbers divisible by a given prime

Mohammad Ali NematollahiI asked this question, and due to the guidance, I improved my code as follows: from collections import Counter number = input() p = int(input()) ans = 0 if p != 2 and p != 5: res = (int(number[i:]) % p for i in range(len(number))) C = Counter(res) for c in C: if c == 0: ...

 
I’m voting to close this question because we are not the code review site — P__J supports women in Poland 59 secs ago
 
3:56 PM
@P__JsupportswomeninPoland please do, I'll move it to codeReview. — Thomas Doll-Datema 1 min ago
 
0
Q: New coder looking for feedback and improvements

Thomas Doll-DatemaI have just started a course on C and wanted to test what I have learned so far. I did so by making a small program that tells you how much you should charge for a shot of a spirit you put in. The code will ask your if you want to do a calculation. It will follow up with a question about the name...

 
4:15 PM
Thank God it's Friday.
 
Kaz
Double Mod
Mod ^2
@Mast Friday!
 
Friday best day of the week
* Only applies after end of workday
 
4:31 PM
@Kaz Cheats.
 
@Mast Is it Miller time yet?
 
@pacmaninbw Once I've finished dinner, absolutely.
 
No beer with dinner?
 
Not this time. Sauerkraut for dinner.
 
5:11 PM
 
If you have solved the problem, then this should be in codereview.stackexchange.comNomadMaker 1 min ago
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 1 min ago
 
5:34 PM
Monking
I'm glad to see some of the questions with bounties are getting answers - especially the JS bit buffer one
 
6:02 PM
I am definitely not familiar with binary, I am learning it as I go haha :) — Lance Pollard yesterday
How can you not be familiar with binary if the question is about bitwise manipulation?
 
Dec 8 '14 at 22:44, by Mat's Mug
There are 10 types of people, those that understand binary and those that don't: 01 is pee. 10 is poop. 11 is both. — user3321 2 hours ago
I hadn't seen/heard the part after colon
 
6:26 PM
Please be aware there is a dedicated site on StackExchange for CodeReview. — MisterMiyagi 47 secs ago
 
7:02 PM
0
Q: Writing a stable sorting algorithm that can sort a binary array in O(n) time complexity and O(1) auxiliary space complexity

MathphileSo I was able to write a stable sorting algorithm that can sort a binary array in O(n) time complexity and O(1) space complexity, but it works only if we assume that our array can store integers that are not only 0, 1. Here is the algorithm: void binarySort(int arr[], int arr_length) { int i, c...

 
Hello
Is there anything wrong with my post above?
 
@Mathphile can you please add a tag for the language?
 
sure
 
are there any header files that need to be referenced? if so, please include the #include statements
 
okay adding them
 
7:08 PM
75
Q: How to get the best value out of Code Review - Asking Questions

rolfl I have a project I am working on, and I would like some, or all of it reviewed, how can I ask for this review on Code Review in a way that produces the best possible value? This is not about a question being on-topic, or off topic. Rather, this is about making on-topic questions great questions...

 
7:25 PM
possible answer invalidation by Mathphile on question by Mathphile: codereview.stackexchange.com/posts/254760/revisions
 
I didn't add anything that would invalidate the one answer on my question though
I had always specified that I was looking for a stable sort
 
I’m voting to close this question because questions asking for how to improve working code should be asked on Code Review. — EJoshuaS - Reinstate Monica 58 secs ago
 
7:55 PM
Are @captainobvious and @Lurch bots?
 
yes
Lurch is a reincarnation of Duga
 
does SE make these bots?
 
Captain is actually a feed.
 
@Mast that makes sense
it doesn't seem to have a user profile
 
8:00 PM
It's not a user :-)
That's why it has a negative user-id.
 
user-id? where do you find that?
 
the link that the avatar and name points to
 
ah I see
 
8:44 PM
0
Q: Increment struct value using reflection

MedhatThe main idea is, I have a struct and I will get a struct field as a string from another function, which I shall increment its value by 1. Below is the code I used and I think it is memory consuming. How can I improve it? Is there a better way than the reflection from the start? Thanks package ma...

 
 
1 hour later…
9:55 PM
Welcome to SO, please read How to Ask and take a tour. Questions of the type how to improve my code are better suited for Code Review Stack Exchange. If you are facing a specific issue such as an error or unexpected output (which is reproducible), please feel free to share on Stack overflow! — Akshay Sehgal 1 min ago
 
 
1 hour later…
11:10 PM
Or, The stick an carrot approach. Every time someone fails this code review, they owe all the senior devs a beer... — 00110001 26 secs ago
@AkshaySehgal this post would not be on-topic on CR because it appear that the code is not working correctly. Please familiarize yourself with what is on-topic there before recommending users post there. See "Which Site?" and "Code Review or not?"Sᴀᴍ Onᴇᴌᴀ 23 secs ago
 
11:47 PM
Voting to close because this post lacks focus. Do you have a specific question? I believe there's a Code Review stack exchange as well. — Michael Litchard 35 secs ago
 

« first day (2813 days earlier)      last day (1195 days later) »