« first day (2817 days earlier)      last day (38 days later) » 

12:00 AM
RELOAD! There are 7270 unanswered questions (89.6418% answered)
12:22 AM
Sorry about that. I am ok with closing & moving to codereview.stackexchange.com — luckman212 34 secs ago
12:44 AM
Q: make this iteration functional

manuelBetancurtI have 2 dictionaries that I have to compare, if an element of one dictionary exists in the other dictionary, then add the element to an array but only one time... here the working code const getFavouriteShows = (graphql, favouriteShows) => { const arraya = []; //iterate trough favourite...

12:55 AM
possible answer invalidation by UnknownError on question by UnknownError: codereview.stackexchange.com/posts/254554/revisions
1:53 AM
Sure. Main problem here is that the intent of what you're doing isn't very clear. codereview.stackexchange.com — CertainPerformance 1 min ago
2:25 AM
Q: Speed up updating column in SQL command

LzypenguinI am trying to speed this code up. I have a table (Table1) that has over 2.5 million lines in it. I am trying to use regex to extract a specific value from the NoteText column. If it finds a match, it then pulls the rest of the info, and searches through another and then updates the value in that...

3 hours later…
4:55 AM
Q: Is there a term or pattern / anti-pattern related to explicitly returning an object within a constructor?

J.ToddIs this design choice good or bad? Interested in any patterns / anti-patterns involved in writing code like this. Let's say I've written an Element class that helps me flesh out DOM elements and behavior dynamically and I want to define an instance of Element in its own separate file for code org...

1 hour later…
6:55 AM
possible answer invalidation by user3378165 on question by user3378165: codereview.stackexchange.com/posts/254553/revisions
Q: Why Google Sheets Crud/ search form is not working if has more than 5 columns?

TimonekI am working on a simple app that will display search window and the results based on the range in google sheets. However I have a problem that I cannot understand at all. The code is working perfect till I have 5 columns to display (search.html). If it is more than 5 it is not displaying anythin...

7:54 AM
"In terms of best practices is there anything I could improve on?" is not a specific enough question for Stack Overflow. If you are looking for general feedback on code which there is nothing specifically wrong with, you can ask on codereview.stackexchange.comkaya3 27 secs ago
8:16 AM
Your question is properly better suited for code reviewberend 31 secs ago
Q: Want to release the stable version on github

Mayank GuptaRecently i made a project posted on github and thats a beta release i am the solo devloper for that Github Link i want someone to review my code and library and suggest me something so i can release the final stable version. Programming language used is Python3 (3.6, 3.7, 3.8, 3.9) and Pasting th...

8:50 AM
possible answer invalidation by Peter Csala on question by Happy: codereview.stackexchange.com/posts/254914/revisions
9:07 AM
Q: Project Structure for crystal structure generation for scientific software

SuslikI am not sure if Code Review is the correct platform to ask my question. I have a project where I calculate various material properties. Therefor, I have on the one hand a C++ program for generating different material structures on the other hand I use a DFT software to optimize the structure and...

9:23 AM
@Lurch Can someone rollback this? I wrote an answer there
Q: Is there a functional approach to this solution using scala?

dexter2305I ran into a question on leetcode and could solve it with the following solution. def countVowelStrings(n: Int): Int = { val out: Array[Int] = Array.fill[Int](5)(1) for (i <- 1 until n; j <- 3 to 0 by -1) { out(j) = out(j) + out(j + 1) //println(s"at i: $i & ${out.mkString(" ")}"...

10:23 AM
Q: How to make this code follow Solid Principle C#

GauravsaCurrently I have this code: private async Task<(List<SomeModel> data1, List<string> data2)> ProcessFileAsync(IEnumerable<FileInfo> filesInDirectory) { var data1 = new List<SomeModel>(); var data2 = new List<string>(); var inDirectory = filesInDirectory as Fil...

Q: Discord bot using puppeteer application hosted on Heroku unable to access website, but works locally

Swag SnagsI am trying to make a discord bot using Node.js that, when typing a command, will give the top players for some leaderboard. My local version works, but my discord bot that is hosted on Heroku doesn't work. I have looked at the other posts on here and the tutorial on the puppeteer github, yet it ...

10:48 AM
Q: grouping people with the same score

ExcanatorGamesI made the code underneath to sort my array and group people with the same score to show who all got 1st, 2nd and 3rd. the "points" variable looks like this points: { '204255221017214977': 3, '208993609255485441': 5, '382197942762602496': 4, '664606841409634324': 5, '779857709155090432'...

@Caleth thanks for the advice. I was planning on putting this on Code Reviews anyway once it was bugs/unexpected_behaviours free. — Barnercart 1 min ago
11:04 AM
Hi Ash, I have just looked at RelayCommand, is there anywhere you'd be able to review my code I have just implemented using RelayCommand.. maybe on Code Review? :) — LV98 7 secs ago
Q: Design of Experiments data structure with C++17

BarnercartI've defined a data structure which represents a doe_model, providing two maps with a configuration_id as key and a configuration_model as value. The configuration_model is an unordered_map which has a knob_name as key and a knob_value as value. There are things I don't like very much about this ...

12:06 PM
Working solutions that need refactoring are a better fit for Code Review. — El_Vanja 1 min ago
12:46 PM
You may want to ask your question at Code Review instead, since your code works, and you're asking about suggestions for some form of optimisation. — 0 0 26 secs ago
1:14 PM
I’m voting to close this question because this question belongs on Code Review — ControlAltDel 24 secs ago
If it is working code, maybe Stack CodeReview might be of help? — user213544 56 secs ago
Hello and welcome to Stack Overflow! Your request for review is more applicable in StackExchange site: "Code Review". Please think about reposting there and deleting your question here — ControlAltDel 13 secs ago
1:37 PM
I’m voting to close this question because it belongs on Code Review instead. — EJoshuaS - Reinstate Monica 38 secs ago
2:10 PM
For help with code that works but needs improvement try asking at Code Review. Stack Overflow is for help with code that doesn't work at all. — John Kugelman 13 secs ago
@D.M.J. StackOverflow is for specific questions/problems, if you're looking for a code review head over to codereview.stackexchange.com. — Adrian 1 min ago
2:33 PM
I’m voting to close this question because it might be better suited for codereview. — baduker 10 secs ago
Yes, you understand it correctly. Both functions appear to do the right thing. This is definitely appropriate for Code Review. — John Kugelman 18 secs ago
Q: Website SEO Optimization

Aleksa RisticI have developed website for one company and it is working good for year but my SEO is problem. Products are not displayed on first page of google and for same keyword other sites are simple wordpress ones without advertisements or anything and haven't been changed for long period. You can access...

@mods: I have reposted this on codereview: codereview.stackexchange.com/questions/254952/…luckman212 22 secs ago
2:54 PM
@baduker, I have come to believe that over at codereview too this will be closed in a heartbeat. — anurag 57 secs ago
Q: macOS: resetting balance to center (0.5) using Swift

luckman212(moved from https://stackoverflow.com/questions/65780543/macos-resetting-balance-to-center-0-5-using-swift) Due to some bug somewhere, my speaker balance kept moving off-center and it was getting annoying. So I cobbled together the code below (based on this question) which—to my surprise—does com...

possible answer invalidation by L3sek on question by L3sek: codereview.stackexchange.com/posts/254850/revisions
Please move your question to Code Review. We're not supposed to offer opinions here; it's off topic. I do have an opinion, but I'd prefer you ask on the correct site. I can answer you over there. — John Kugelman 6 secs ago
Ryan Donovan on January 19, 2021
When people say “CI/CD,” they are only talking about continuous integration. Nobody is talking about (or practicing) continuous deployment. AT ALL. It’s like we have all forgotten it exists. It’s time to change that.
3:25 PM
possible answer invalidation by L3sek on question by L3sek: codereview.stackexchange.com/posts/254850/revisions
Q: Check if an input stream contains a particular byte, two solutions

JavaI have solved two different solutions to one task. Which one do you find better? Maybe the code is not so elegant, but i'm doing my best. Implement a method boolean have(InputStream, byte) that indicates whether the passed input stream contains the passed byte value. declare throwing exceptions i...

Q: How to apply multiple filters in one statement

Thanasis KWhile trying to grasp the potentials of the collection features in F#, I encountered this one: let needSpecialDocument country = (not country.IsEea) && (not country.IsInSchengen) // could also be: not (country.IsEea || country.IsInSchengen) let wantToMoveTo country = country.Name = "CC" let pot...

3:44 PM
Hello? Anyone here? (besides Mr Lurch and Mr Obvious)
@SimonForsberg @Mast can you help out?
@SimonForsberg Why not do it yourself?
I prefer to avoid doing moderational work for posts I have an otherwise interest in. In this case I have an answer
Simply because I don't think it looks good if I both answer and then rollback an edit
hmm ... which makes you uniquely qualified to understand where to roll back to :)
either way: rolled back and commented
@Vogel612 that's a fair point...
@Vogel612 thanks
Also, I'm missing the auto-comments (again again again)
@SimonForsberg Whatcha need?
Ah, already taken care of.
Can't rollback while driving.
@SimonForsberg I understand the sentiment though, it's more impartial if someone else does it.
4:07 PM
@Mast don't rollback and drive
@SᴀᴍOnᴇᴌᴀ Also known as stack-and-drive.
@Lurch appears to be an update in response to request in comments - see comments, though header files referenced in implementation files changed... answer doesn't appear to speak to those header names specifically so I would not worry about it
Greetings, Programs.
@SᴀᴍOnᴇᴌᴀ Yea, that edit is fine.
It's a lot harder to review without the proper headings too.
Greetings @Donald
@Mast yeah - I know I'd see that before- perhaps mostly just in the Memes listing
4:36 PM
@Mast Exactly :)
4:51 PM
What idiot at Microsoft decided that emails now need to be deleted 3 bloody times before they're actually deleted.
If you delete an Outlook email, it goes to your 'deleted' inbox. If you delete it from that mailbox it goes into your 'recoverable items'. You then have to purge it from your recoverable items before it is actually deleted.
@Kaz The same one that decided to always send emails when adding meetings to Microsoft Teams
@Kaz Do you have the clear deleted items on log out turned on?
@pacmaninbw I didn't know that setting even existed.
It shouldn't have to exist.
It has been there for decades.
4:58 PM
@Kaz perhaps a support team member/group that heard from a large number of users that were frustrated they couldn't recover items deleted accidentally
The other problem is that you save mails to an archive and then delete things from the archive you then have to move the items from the archive deleted items to the main deleted items.
@SᴀᴍOnᴇᴌᴀ Hard to delete an item accidentally twice
It doesn't account for the situation where someone accidentally deletes an item thrice now though
At a certain point, you either need to actually delete the thing, or just never actually delete anything.
5:01 PM
Under options => Advanced Settings Empty Deleted Folder.
That is for the outlook app on my computer, latest version of office.
5:14 PM
@pacmaninbw I don't mind deleting things from a recycle bin, or deleted folder. It's the third, hidden layer of recovery I take issue with.
My hard drive grows faster than I receive mail, so I've resigned myself to loads of mail.
@Mast I don't ever really delete things. I just archive them.
Except today, when an internal email got sent with an attachment that shouldn't have been included, so I had to rush around purging it from peoples' mailboxes.
That's nice.
5:33 PM
=IF(ISBLANK([@[Sale price]]), "", [@Game] & " " & SUBSTITUTE([@Set], " - ", " ") & " " & IF([@Language] = "English", "", [@Language] & " ") & IF(ISBLANK([@Variants]), "", [@Variants] & " ") & [@Name] & " " & [@Number] & " CGC " & SUBSTITUTE([@Grade], ".0", ""))
I see a distinct lack of VBA.
Isn't it easier to just code it in Excel functions though?
No macros, etc.
For some values of easier.
Easier to set-up? Sure. Easier to maintain? Not if you want to change anything later on...
Q: 2020: a year in moderation

JNat As we say goodbye to the old year and welcome the new one, we have a tradition of sharing moderation stats for the past 12 months. As most of you here are aware, sites on the Stack Exchange network are moderated somewhat differently to other sites on the web: We designed the Stack Exchange netw...

@Mast Hey now that is future-me's problem
5:42 PM
@skiwi I used to think like that. Current me hates past me.
@Mast maybe that was just past-Mast
Code Review Stack Exchange would be a better place for this question. — Zac Anger 18 secs ago
6:31 PM
@RMunroe noice right-hand rule
6:47 PM
Q: Coin-flipping game

dank soirstI'm 13 years old and turning 14 years soon! I Coded this simple text game in around 30 minutes, can someone rate it? and give some feedback import random import time current_coin = 500 def play(): computer2 = random.choice(['r','p','s']) computer1 = random.choice(['r','p','s']) if com...

Q: Are these Unit tests OK or am I implementing an antipattern or not following best practices

user2094257I am testing a Spring boot service using JUnit 5 and Mockito. I haven't spent much time on unit testing in the past so I'm not sure if I'm accidentally implementing an anti-pattern or not following best practices. I read multiple times that it's good practice to have one assertion per test, I ha...

Hmm I may be pulling a stupid one here.. but how do I calculate the % of profit based on solely the profit and total cost?
Profit being salesprice minus total cost?
No, that's stupid.
Say you sell something for 1,5x cost, do you want your profit to say 50% or 150%?
I thought it should be dividing the profit by the total cost
@Mast 50%
6:56 PM
You'd have to do a bit of subtracting too then.
The annoying part is that I only have the profit and cost in euros, rest is dollars and converting them all the time annoys me
Since salesprice-cost = profit.
Profit percentage is basically profit/cost.
Hmm so it is correct after all, then my bug is somewhere else
So say you sell for a buck while it cost you four, you're -75%
While selling for four when it costs you a buck, is +300%
Ah.. I think I see it now, these are like my estimates, so now I'm doing it for the real thing as well, and there I'm taking like 1K profit on 20K = 5% profit
but that whole second calculation is wrong because it takes all purchases into account, while only using the profit of the actually sold ones
7:00 PM
Selling for 21 at a cost of 20 is indeed 5% profit.
It's just the other formulas that are wrong then :D
Looks like it's time to play with SUMIFS
7:41 PM
@Kaz Is this company email or personal email. If it is company the problem you're having may be in the settings on the Exchange server.
8:02 PM
Q: Feedback on Design

Martin YorkContext As many of you may know I have a library that allows C++ objects to be converted into JSON/YAML/BSON automatically with a single declaration (see previous code reviews). I am now (trying) using this to connect and send data to Mongo without the developer having to write any specific code ...

8:20 PM
If this is working code you think could be improved, see Code Review. If not, please edit to clarify the problem. — jonrsharpe 42 secs ago
Q: generating stochastic coloured noise for many oscillators

Iwan PhillipsI have a system of n oscillators which oscillate with time. To each of these oscillators I am adding a fluctuating coloured noise term with a different seed for each oscillator. Here is my code for the generation of this noise: #include <math.h> #include <stdio.h> #include <stddef.h> #include <st...

8:38 PM
Please repeat on topic and how to ask from the intro tour. You're asking for an opinion-based code review. — Prune 1 min ago
1 hour later…
9:51 PM
@Mast That's a little simplistic, it leaves out taxes, labor involved in sales, storage. Unless those are included in the cost.
Q: Why is my question showing a 404 error?

J.ToddIt was brought to my attention that an old question of mine I recently linked in reference to a continuation of a review of the code is gone. I just pulled it up in order to link it yesterday, so this just happened. Manifest.JS: A lightweight front-end structural framework An archive can be seen ...

@Feeds link doubled-up (-‸ლ)
> woww. big facepalm – J.Todd
So... What is your question? I think you should go to codereview.stackexchange.comlier wu 32 secs ago
10:08 PM
Q: Method to randomise a string's case

RawnsI'm an amateur at programming and have created the following method with which I pass a lowercase string with the idea it is then returned either in it's original lowercase format, Capitalised or UPPERCASE. I'm not sure this is the best way or is truly "random" but does work up to a point but wou...

Q: PHP percentage arrays for each combination

PaulI am attempting to create a function that allows the creation of arrays with every number combination from 0 to 100 for each variable. $keys = ['key1' => 0, 'key2' => 0, 'key3' => 0]; This array could hold any number of variables and the end result would be something to the flavour of: ['key1' =>...

10:19 PM
@CaptainObvious no code to review
10:33 PM
Q: Parsing overly complex JSON

CoupcoupThe Merriam-Webster Dictionary API at some point discontinued the use of XML in favor of exclusively returning JSON. This had the unfortunate effect of finding a definition listed by sense number (i.e. definition 1 a (2)) much more complicated because they're trying to force a semi-arbitrary docu...

10:47 PM
A Future is like an asynchronous Try so, in general, it doesn't make much sense to have one inside another. A Future also has a concept of success and failure and equally to Try all failures are Exceptions. So that is why, sometimes tho it makes sense to have a notion of domain errors vs exceptions, but for that, it is common to use Future[Either[DomainError, A]] where DomainError is usually ADT, also on those cases it is common to use EitherT from cats. - In any case, you should be asking this to whoever code review you :) — Luis Miguel Mejía Suárez 49 secs ago
Thanks @LuisMiguelMejíaSuárez. I have not understood the code review and was comments were harsh :-( So trying to do my due diligence. — Exploring 50 secs ago
11:18 PM
Probably better question for codereview.stackexchange.com — max pleaner 14 secs ago
Q: Still learning, looking for general advice about a 4-function calculator I programmed using java

Jacobhere's some code I wrote in java SE to get use to if statements and scanning. just looking for suggestions that will improve this program or/and teach me techniques that I should get use to using. import java.util.Scanner; public class Calculator { public static void main(String[] args) { ...

@skiwi The way profit/cost is supposed to be calculated is [Revenue - Costs = Profits], and [profits / revenue = % profit].
Revenue = profits + costs so your % would be profits / [revenue] = profits / [profits + costs]
If you’re doing it for individual items, it would usually be revenue = assumed sales price, costs = cost per unit.
11:49 PM
Q: A Generic Two Dimensional Data Plane with SubPlane Method in C#

JimmyHuThis is a follow-up question for Generic Two Dimensional Data Plane with Manipulation Methods For C# and A SubPlane Method for Generic Two Dimensional Data Plane in C#. Based on iSR5's suggestion, in SubPlane method, Array.Copy is used instead of regular for loop in order to improve performance. ...


« first day (2817 days earlier)      last day (38 days later) »