« first day (2305 days earlier)      last day (82 days later) » 

12:00 AM
RELOAD! There are 6214 unanswered questions (89.9136% answered)
12:57 AM
Code review details may be seen at: codereview.stackexchange.com/questions/226789/…J_H just now
1:25 AM
Q: LINQ for generating all possible permutations

Dmitry NoginPermutate() is supposed to generate all possible permutations of the source sequence: foreach(var s in "abc".Permutate()) Console.WriteLine(s); // abc // acb // bac // bca // cab ...

2:23 AM
This belongs on the code review stack exchange — Michael 50 secs ago
This question should be asked on codereview.stackexchange.comAndreas 24 secs ago
2:43 AM
Q: Could this solution be optimized? [DP problem]

John KimSo I completed an algorithm problem just as a personal study, and I can't help but feel like my solution is a bit needlessly complicated, although I can't figure out a better way to do it. Here's the problem : Given a number N, and a list of users currently on a stage, find out the failure ...

3:23 AM
Q: Code Improvement/Insight: Should I have approached these functions differently? Animations using Javascript

Jesus MoralesThis code works as it is intended. What I seek is a feedback on the quality of my code. Where should I have written it differently or how should have I approached instead of the way that I have? These functions will be moved to a separate file to be used on other pages as well. My goal is to hav...

2 hours later…
5:44 AM
Monking all
Monking Mast
6:17 AM
Q: How to handle a VTC as duplicate that goes the wrong way around?

MastI encountered this review today, where a question was to be closed as duplicate of another, older question. However, the dupe target was closed, at -5 and unanswered. The quality was much lower than that of the question in the review queue itself. What normally should've happened, is that the du...

7:09 AM
"So my question is hw can i do it better" - this leads me to believe this could be better off on Code ReviewJon P 45 secs ago
7:37 AM
Maybe a better forum for this Kind of question would be codereview.stackexchange.comUli Sotschok 26 secs ago
Q: JavaScript HTML DatePicker

PeterJoeI'm still new in javascript and learning. I want to create a date picker using html and javascript. Below is what I have tried and it's working, so my question is "how can I do it better?" My idea is to create a custom tag in HTML and allow multiple of these tags. The javascript part will then ha...

7:59 AM
Q: Make utility using LINQ

Dmitry NoginMake() takes projects with a list of tuples representing project references in the form of (Dependency, Dependent) and returns projects in the order to be build: static void Main(string[] args) { var projects = new[] { "a", "b", "c", "d", "e", "f" }; var dependencies = new[] { ("a", "b")...

Q: Time and space complexity of base conversion code

Dawn17I have an algorithm that performs the base conversion. The input is a string and two ints b1 and b2. The string represents an int in base b1 and converts it into base in b2. My code is: def convert_base(num_as_string, b1, b2): if num_as_string == '0' or num_as_string == '-0': return...

8:14 AM
This question is probably better suited for codereview.stackexchange.comMarkus Deibel 1 min ago
possible answer invalidation by Dmitry Nogin on question by Dmitry Nogin: codereview.stackexchange.com/posts/226804/revisions
8:58 AM
Q: How should a Work-in-Progress form should look like, using C#?

VeverkeI want to write my own Work-In-Progress form to use it throughout my app (for the time being, mostly as an exercise). I came up with the following code, I wonder if this is not the way to go or if it could be simpler or more generic. Main form: public partial class Form1 : Form { public Fo...

9:14 AM
@Duga Rolled back by dfh
9:38 AM
Q: Is using memcpy_s is correct in the below function?

John Paul CoderI replaced memcpy with memcpy_s as memcpy is a banned function or it is deprecated. Can someone please review the belo function where I replaced memcpy with memcpy_s? bool ERHttpClient::SetAdditionalDataToSend(BYTE *data, unsigned int dataSize) { if (data == NULL || dataSize < 0) { ...

9:57 AM
Q: Refactor method to O(N)

EpsilektI fetch a bunch of categories for a dropdow tree, and have to implement search in this dropdown. If there is a match in one of the elements, it should also get all parents to display in the dropdown hierarchy. I started with 2 foreach loops where I filtered out the matches, and one where I check...

poke @Peilonrayz your python performance review is getting the wrong kind of attention. You may want to reformulate a bit, just to be safe
10:17 AM
Q: Cardinal direction enum from range input

bskoolStill learning JS and I made the following method to convert degrees into cardinal directions respectively. My first iteration of the code was over 50 lines and I was able to get it down to 13 using a for loop. Is there a way to optimize or simplify the code down even more? Is my logic and imple...

Q: Simple Linear Regression in C++

VISWESWARAN NAGASIVAMPython has amazing sci-kit learn library but I am building some projects on C++ with involves some machine learning algorithms. I found machine learning libraries in C++ involves more dependencies so I have decided to implement a library without dependencies It would be nice if you could review t...

10:37 AM
Q: Create a zipmap function using javascript?

John HarrisonConsider this problem: Create a function zipmap that takes in two sequences, and creates a dictionary from the elements of the first sequence to the elements of the second. zipmap([1, 2, 3], [4, 5, 6]) => {1: 4, 2: 5, 3: 6} My solution is below, can anyone come up with a better way of doing i...

10:56 AM
Q: Loop to extract json from dataframe and storing in a new dataframe

Javier López TomásI have a dataframe (obtained from a csv saved from mysql) with several columns, and one of them consist of a string which is the representation of a json. The data looks like: id email_id provider raw_data ts 1 aa@gmail.com A {'a':'A', 2019-23-08 00:00:00 ...

11:12 AM
@Vogel612 Wow are SE folk touchy lol
some are, some aren't
And no, I'm not going to change it. If any of it is factually wrong then tell me, but I'm not going to appeal to this wacky utopian censorship people want.
I posted the question to codereview.stackexcange.com — Epsilekt 19 secs ago
11:30 AM
possible answer invalidation by User1973 on question by User1973: codereview.stackexchange.com/posts/226786/revisions
@Peilonrayz your choice. It's rather very glib and blunt and some people don't like that. It wouldn't hurt your point to make it less blunt...
@Vogel612 How is it glib and blunt? The only parts that I can see being misconstrued as 'rude/blunt' are "ridiculous" and "get over yourself". If you take those out no one would bat an eye. I think it only comes down to me saying "get over yourself", that people are being snowflakes.
that's kind of exactly what glib and blunt mean, isn't it?
I'm honestly not entirely convinced that the question in it's current state is even on-topic ...
11:50 AM
I don't know what glib means and I can't find a single definition that fits this. So IDK, what do you mean by it?
I'm using it in the sense of something close to "tonedeaf".
though apparently that's not really what the word stands for ..
@Vogel612 I feel like we may start going in circles here, do you mean something along the line of "Unable to appreciate or understand the concerns or difficulties of others; out-of-touch."?
that is something I would use the word for, but not in this case.
possible answer invalidation by mdfst13 on question by User1973: codereview.stackexchange.com/posts/226786/revisions
blunt is for the nuanceless part.
not that the question actually needs any nuance...
12:00 PM
@Vogel612 Sorry, I really don't understand you. I've been told that when situations like this happen I'm 'being unreasonably difficult'. So I'd rather disengage and say my post is staying as it is, then continue an almost definitely unfruitful discussion.
oh, I'm not trying to convince you to change your post.
I guess that really shows how little I understand you, lol
just trying to help you appreciate the cultural differences in tone in the audience :)
like... as a continental European (especially as a German), the tone seems okay...
but I learned that being this kind of straightforward can be considered very rude in other cultures
It comes across as yelling at someone for a misunderstanding. OP didn't appear to realise that it's not worth worrying about the overhead of making a variable.
Am I correct in thinking that only the second half of the last sentence contains this problem? ("Get over yourself") If that were removed would the problem still exists?
12:35 PM
I would certainly remove the 'get over yourself': it doesn't add anything, and is a statement that reflects on the OP, not his code or query.
1:14 PM
Q: Computational verification of Collatz conjecture

DaBlerPrerequisites The typedef name uint128_t designates an unsigned integer type with width exactly 128 bits. The UINT128_MAX is maximum value for an object of type uint128_t. Function int ctz(uint128_t n) returns the number of trailing 0-bits in n, starting at the least significant bit position. ...

Q: Improved p2 text adventure

Mikey AkamiheThis is a much-improved sequel to my first text adventure. It's three times as long but three times more efficient. The setting takes place where a majority of TWD: S3 takes place. LINK click link click link cannot fit the text here

Q: C to R equivalent conversion

beavis11111I would like to convert C code into R. Due to not have admin privilege, it prohibiting me from installing devtool and gcc for the time being. So, I am writing in R-equivalent. The goal is taking the C's output as array/vector in R terms. ie I want vector j, temp, E, Ds and sigma as my R output...

1:33 PM
Q: Merkle hash to determine unique trees

nz_21I am trying to solve this problem: Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a node in s and all of this node's descendants. The tree s could also be considered ...

Q: Another one to text adventures.py

Mikey AkamiheThis is a much-improved sequel to my first text adventure. It's three times as long but three times more efficient. The setting takes place where a majority of Telltale's TWD: A New Frontier takes place. LINK. click link click link cannot fit the text here

1:43 PM
2:13 PM
Q: Is this small bit of Javascript just bad, or is there a point?

Eike PierstorffI found the following function in the tracking code for an affiliate marketing vendor, and I am stumped, because to me this image loading function looks a little strange: var im = function(s) { if (typeof(ia) != 'object') { var ia = new Array(); } var i = i...

@CaptainObvious seems to be off-topic because it is someone else's code and OP doesn't understand why it was written in that manner
2:32 PM
Q: Converting key:object Object into a key:value Object

DinoLets imagine I have an object which has another object as an value: const rawObject = { data1: { id: 1, value: 444 }, data2: { id: 2, value: 555 }, data3: null, data4: { id: 4, value: 666 } }; What I would like to do is to convert that object to look like ...

Q: POSIX+ implementations of echo(1)

D. Ben KnobleEver wanted a strictly conformant echo(1) implementation on your system? Wait no more: I've built it! What is it? My first large-ish body of C code in a while. The code provides implementations of all of the following echo(1) descriptions from the Open Group POSIX specification. In summary: ...

2:45 PM
@Vogel612 Some of the best reviews I got were quite blunt, but I have no idea what specific answer you're referring to.
that's alright :)
@VisualMelon That's a good point really.
@Mast Meh, this one could go either way.
Talk about the code, not the OP.
Please ask this in another question. It's too much to do this in comments. When asking a new question make sure to paint the bigger picture: what are you trying to achieve in a wider sense? Maybe Code Review is a better place to ask such a question, if you have working code and are willing to share enough for a decent review. — Gert Arnold 22 secs ago
3:12 PM
Q: PDO wrapper throwing error when function is protected

David MachadoI'm using a pdo wrapper provided by @yourCommonSense here, and an error in thrown when function is protected instead of public can you tell me why? class MyPDO { protected static $instance; protected $pdo; // if changed to public works protected function __construct() { ...

3:22 PM
@Mast Not taken personally.
This does work, but does not give a different result from just creating a new image. I do not maintain the code that the vendor distributes, but I maintain the tracking code that goes into the website, so I intend to throw things out that are not necessary. I am now not sure if that makes it on topic, but I did assume it would when I wrote the question. — Eike Pierstorff 1 hour ago
Looks like the guy maintains the code?
@Peilonrayz While I think that might qualify as maintainer of the code, I would argue the OP clearly does not know why the code is written the way it is since that seems to be the question they are asking.
Unrelated, is anyone going to take pity and cast the fifth reopen vote on this question (which, full disclosure, I already answered): codereview.stackexchange.com/questions/226586/… The question has been edited since closure to contain more background information on what the code is supposed to do.
@Peilonrayz Thanks :)
3:50 PM
possible answer invalidation by haxor on question by haxor: codereview.stackexchange.com/posts/226797/revisions
@Duga looks okay - format fixing mostly
4:09 PM
@Peilonrayz Did you move your answer to a question in Meta? Your view was perfectly valid as far as I can tell.
Q: Simply and prettify function looking for max value in a list and modifying some underlying values within that list

JonBI'm hoping this function can be more simplified and prettified, logic works. Function needs to keep track of maxValue and if the maxValue is of type LOGICAL_SIZE private void checkForOverage(List<GoogleUsageMapping> records) { BigDecimal highestQuantity = new BigDecimal(0); GoogleUsageMa...

Do links to deleted comments work I wonder
> I don't have time to answer any questions on this post so I'm deleting it. – Peilonrayz 46 mins ago
@SᴀᴍOnᴇᴌᴀ The problem is not broken code it's authorship codereview.stackexchange.com/review/first-posts/120704
@pacmaninbw it looks like the OP took the code and modified it
4:34 PM
Yes. Only calculate the result for the operator you want. However, you should remove this post here and put it on Codereview since this code already works and you just want to improve it :) don't forget to add the beginner and C# tag over there. — Joelius 52 secs ago
4:50 PM
Q: Is there a better/shorter way to write this program? (simple calculator)

Cubey-BoiI created a simple calculator with multiplication, division, addition, and subtraction. Is there a way to write it shorter? I am a beginner so I do not know much about programming other than if...else statements and different data types. Console.WriteLine("Welcome to the simple calculato...

Q: Powershell script to stop and start services on demand

ZeExplorerThe purpose of below code is to stop/start a couple of windows services if they are running/not running, this will be called from a windows command line. The services could be either on a windows stand alone server or could be a bundled into a Windows Failover cluster Role on a clustered server. ...

5:04 PM
@Sugar For feedback, I'd suggest getting in touch with your local C++ expert for code reviews or your favourite, reputable, high quality, C++ project mailing list for feedback on your contributions. — Jesper Juhl 35 secs ago
Q: Making a custom data structure with random return values run faster?

LuminousNutriaI wanted a data structure that allowed me to set the chances of randomly returning each of it's elements. For example, suppose I have a Human class. Every Human has an attribute called eyeColor. I don't know what the actual percentages are, but let's say 60% of people have brown eyes, 30% have ...

Q: Javascript Tree Class 2

Alex FThis question is the second version of the code here. I'm writing a general tree class. Specifically, each node should have oen parent, some number of children, and hold a value. I'm looking for general advice on how to make this code more idiomatic. I'm also looking for thoughts on the travers...

@Peilonrayz Feel free to post a new answer once you got time.
5:25 PM
Q: Can questions request only specific kinds of review guidance?

ReinderienIn other words: if a CR question asks only for performance feedback, or only for OOP structure feedback, etc., is that valid? And would answers providing review feedback on other aspects of the code be off-topic? For example, Time and space complexity of base conversion code . Is it possible to ...

Q: Simple tokenizer v2 - reading all matching chars at once

t3chb0tI have rewritten my tokenizer according to most of the suggestions from the previous question here. API It now reads all chars as long as they match the pattern. I use three types of attributes to achieve this. Regex - reads by regular expressions; this one requires a single group that is t...

You may want to ask this in Code Review instead. — Zabuza 7 secs ago
6:06 PM
@Mast IDK if you got my ping, but I said not deleting the post is the correct way, but getting 4 almost 5 is the incorrect way to handle the post.
I'll look into my post later
6:26 PM
Telling the OP that this is not C++ or that it's implemented already is pointless, this clearly is an exercise. BTW: After fixing the code, get a codereview at codereview.stackexchange.com. — Ulrich Eckhardt 20 secs ago
6:45 PM
@Peilonrayz It's down to 3.
Looks like it's at 0?!
7:13 PM
I've seen a few answers in the low-quality posts queue today that look legitimate (including a post by one of our regulars in this room)... is there a user incorrectly flagging those?
oh I see now that one was commentary on another answer
7:58 PM
a) your code has serious security flaws or b) your credentials have been leaked. but: without any code, we. can. not. tell. additionally, a complete code review for security flaws is far, far, far outside the scope of stack overflow. — Franz Gleichmann 19 secs ago
Q: Quality Control Feedback, Making a "Mining Game" based on CSharp

Taylor SparkSo, A while back, I was working with a mining game, it is my literal FIRST ever video game (sorta) made in C# So I was having trouble with Upgrading Systems. Originally, I have a system that was VERY bulky that was similar to a concept like this: (Not really working code, just to give you the i...

8:23 PM
Q: If, and statement confusion when using == signs

user11975207Im trying to create a basic rock, paper, and scissors game. At first I was using == signs instead of in but a part of the code would not proceed after that step. I changed the == to in as someone did in another question, however, the rest of he code now doesnt work. For example, if I input rock a...

@RMunroe who needs files, anyway? meh...
8:51 PM
You can lead a horse to water but you can't make them drink codereview.stackexchange.com/questions/226847/…
@pacmaninbw and that question is 1 VTC away from being closed
9:05 PM
Q: LeetCode #1066 - Campus Bikes II

Andrew AuThe following code implements the Hungarian algorithm. The algorithm is used to find minimum cost perfect matching on a bipartite graph. Looking for comments on correctness, efficiency, clarity and idiomatic C++ usages. It passes all tests on LeetCode. class Solution { public: int assignBik...

Ohai @DmitryNogin welcome to the second monitor
2 hours later…
10:46 PM
Is your output what you expect? If so, consider positing on our sister site Code Review for feedback. — Code-Apprentice 5 secs ago
11:03 PM
Q: Minimize this IF statement

TreyI was going to post this in code golf, but I think it may be better suited here. I'm not really interested in scoring it beyond accepting the best answer. I'm wanting to minimize this series of IFS, if possible or necessary. I'm brand new to javascript/coding, but it just seems like there may ...


« first day (2305 days earlier)      last day (82 days later) »