« first day (2475 days earlier)      last day (1546 days later) » 

12:00 AM
RELOAD! There are 6401 unanswered questions (90.0829% answered)
 
12:21 AM
@Duga hmm... the only answer that it would have invalidated has since been deleted by the reviewer, and now there are two subsequent reviews that are keyed off the updated code...
 
12:55 AM
possible answer invalidation by Sᴀᴍ Onᴇᴌᴀ on question by Tobi Alafin: codereview.stackexchange.com/posts/235344/revisions
 
@Duga darnit - order of operations fail...
 
1:33 AM
Stack Overflow isn't meant for open-ended "how can this be improved" questions; if the code works and you want general feedback, ask on codereview.stackexchange.com . — kaya3 22 secs ago
 
0
Q: Message Broadcaster

M2tMI've written a basic event messenger broadcasting service. This is meant to allow for broadcasting events between loosely coupled areas of code where you may not have or care about a direct reference to the specific broadcast source (as you might if using Signals/Slots for example), and the broad...

 
2:15 AM
0
Q: Convert JPG to PNG code optimization( Python )

Praguru 1I had a task to convert some JPG images into PNG format using Python. I successfully did it but I was wondering if somehow I could make my code better than my current one. Code - #Python Code import os from PIL import Image path1 = sys.argv[1] path2 = sys.argv[2] if not os.path.exis...

 
2:56 AM
0
Q: The optimized way to find the top k leading candidates from a unsorted hash map in python

kgangadharI need to write a method that will accept a timestamp and takes an array of votes, I need to return the k leading candidates within that timestamp duration. I came up with the following solution, Here is the input to the methods: votes = [{'candidate':'a', 'timestamp':2},{'candidate':'c', 'tim...

 
 
1 hour later…
4:10 AM
possible answer invalidation by Praguru 1 on question by Praguru 1: codereview.stackexchange.com/posts/237118/revisions
 
0
Q: Hangman in c++ Is this too many includes?

SAJWI wonder wether i included too many libraries, also can you point out obvious beginner mistakes? Is the while-loop the best for what I intent or is there a better way? Also, is it possible to put more into functions such that the main() looks like this: int main() { call function1 call func...

0
Q: Find anagrams in a list using C#

Reza AfraI am new to C# and would appreciate it if you review my code. This code finds the anagrams in a list of string. Where can I be more efficient in my code? is there any way I can save memory? using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; usi...

 
4:52 AM
Monking
@CaptainObvious broken
@Duga rolled back
 
 
2 hours later…
7:20 AM
@user12810368, I'm afraid not, you know, there's no direct permission set for code review. Every security has its corresponding secure model, but it does not contain code review. My suggestion a work around which can get the same work. Also, as the error you meet, it is caused by pipeline is using service accounts to do corresponding operation. But here we restrict its permission. Can I know, you want service accounts has no code review ability? Or just some collection level service account. — Merlin Liang - MSFT 6 secs ago
 
-1
Q: Cool text based adventure game

Ender_The_XenocideI am looking for general critique of my code and notice of any bugs or errors. I have included the main file and the class files. Also, I'm wondering where would I need comments. Sorry it is such a monster ;). // Ian Herman // A Magical Adventure // Approx. line count: 638 // Updated 1/27/2020 9...

 
8:00 AM
Maybe a question for codereview.stackexchange.com? — Jir 1 min ago
 
8:21 AM
0
Q: Get list and default value of columns of table with Eloquent

abkrimI use this code for get lista of columns of tables, and assign default value to protected var $attributes in a Laravel Model. In code use DB because I don't know how to made the same with Eloquent Model.php protected $attributes = []; public function __construct(array $attributes = array()) {...

 
@Peilonrayz It's usually because the comment is added first and then "Code Review" is added afterwards. Only explanation I can think of. Or that @Duga had a temporary failure in either retrieving or posting the comment. It can happen every once in a while.
 
8:50 AM
This is offtopic for stackoverflow. There is another site for this kind of questions — vasily.sib 17 secs ago
 
9:47 AM
Are you looking for a code review? Maybe should close this question and repost on codereview.stackexchange.comaloisdg moving to codidact.com 41 secs ago
 
10:04 AM
@SimonForsberg Ah ok, I can see that happening - the comment being edited, and Duga having a little nap on the AI
Monking
 
10:22 AM
0
Q: Project Euler #47 Python

EugeneProutProject Euler Problem 47 Find the first four consecutive integers to have four distinct prime factors each. What is the first of these numbers? This is my solution for problem 47 on Project Euler. def primes2(n): """ Input n>=6, Returns a list of primes, 2 <= p < n """ n, correcti...

-1
Q: Python - can't find the issue

Adrian_Gwhy does the following code not work? I have a list of words and want to detect these words in an example sentence. Sentence = 'This could be a sentence' with open('Badwords_conjunctive.txt') as file: if any(word in Sentence for word in file.readlines()): print('Conjunctive should r...

0
Q: Are the arguments to hash method reasonable?

bratSince hashing algorithms isnt something to mess around with as a beginner. Several howto's explain that one should use already made solutions. Example of such a pages: https://crackstation.net/hashing-security.htm https://owasp.org/www-project-cheat-sheets/cheatsheets/Password_Storage_Cheat_Sheet...

 
This question should be posted in Code Review, another site in the Stack exchange network. — AndrewL64 41 secs ago
 
10:40 AM
possible answer invalidation by Toby Speight on question by SAJW: codereview.stackexchange.com/posts/237122/revisions
 
0
Q: C++ generic task interface for delayed execution

PiodoI want to rework my current game-server engine to use some global queue of tasks which will be distributed through all the working threads. I started with task interface. I want it to be able to accept any kind of method and store it under queue for later execution. I'd like to hear your opinion...

 
 
1 hour later…
11:43 AM
0
Q: Python Max/Average Pooling Class

Doğukan ÖzdemirI am writing a simple module that performs CNN steps to get a deeper understanding of how it works. I have here written a class that performs average and max pooling to a given image import cv2 import numpy as np import math import time import datetime class Pooling(): def __init__(self,ver...

 
12:21 PM
 
12:44 PM
0
Q: Flutter: Issue with combining code and make a slideshow

Momshad DinuryI want to download Image/PDF from a URL and save those Images/PDFs in a directory. Then use the Carousel Slider Dart Code Snippet below to display images/PDFs slide show. I just started flutter and can't seem to make it work the way I want. In my Code Snapshot I am downloading two images and sav...

 
1:07 PM
@Peilonrayz I don't think there is an API to check comment edits even. Option would be to wait 5 minutes or so before checking each comment, but not worth it IMO
 
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comNicktar 5 secs ago
 
Does anyone ever use UTF-16? I've been looking into a conversion problem for more than a day before I thought "Oh no they didn't, it can't be this simple..."
@Heslacher OP claims it works.
 
1:23 PM
Perhaps more on-topic at codereview? — mplungjan 25 secs ago
 
1:39 PM
@Mast I think I answered a UTF-8/16/32 validator before. It seemed fairly simple IIRC. What you doing?
Ah it was a UTF-8 only validator
 
0
Q: Part one of blackjack game

Aaron PlylerI had to make this blackjack game for school, but this is only the first part. We only had to use a random value between 2 and 11 to generate the cards, as we will have a library of cards later, and the dealer will keep pulling cards until their total value is at or equal to 17. The player needs ...

 
@Peilonrayz I was wondering why the data of my UTF-16 file was incorrectly imported in an application that only accepts UTF-8, not knowing it was exported as UTF-16 instead of 8. It renders the same, should've checked sooner...
The flow goes like this: app1 => app2 => back to app1 where 1 only exports as 16 and 2 only imports as 8.
Can't control 1, so I'll have to hammer 2 into submission and use an UTF that I thought nobody else used.
Ran the thing through pandas CSV reader to debug, became clear enough what the problem was.
 
@Mast thanks for the notice. I rechecked it and commented
Ok, it seems to be a visualisation issue then. You should place a Console.WriteLine() after printing a sublist. Remove Close Vote. — Heslacher 45 secs ago
 
1:56 PM
Oh, that's funky.
 
0
Q: Elevator Java Exercise

SpartanHedgeyI'm a graduate developer, and have been assigned a small task to write a Elevator program that takes a starting floor, a direction and a sequence of destination floors and then works out the sequence in which the floors should be visited. While there is the option to use Collections.sort() on an ...

 
2:25 PM
@PeterB TBF you'd ensure it just the same way that you ensure that every programmer uses parameters every time for every query...by someone experienced doing a code review. But like you say, if you're going to enforce something, you might as well enforce the proper approach. — ADyson 30 secs ago
 
1
Q: R-P-S Code Improvements, Rules, Design

רועי לויI built a simple Rock Paper Scissors game in Python as my first "project", and I want a feedback from you. I want your opinion on how I write my code, is it okay and readable enough? PEP8 laws, things to improve or preserve? Computer Choice - Generating a random choice with the random module and...

0
Q: C++ determinant calculator - 2nd follow-up

chrysaetos99After following the suggestions you can find here, I'd like to show the result again (but I did not change the algorithm): #include <iostream> #include <string> #include <vector> #include <iomanip> int getDimension(); void getUserInput(std::vector<std::vector<double>>& vect, int i, int dimensi...

 
3:03 PM
There are no magic rules that make code good or bad. Is splitting a big method into smaller private method accepted? Yes. But what you really need here is a code review and stackoverflow is not the site for that. codereview.stackexchange.commax 51 secs ago
 
0
Q: Python - SMS Messaging Integration Program

boogI had to create an 'integration' program, to integrate this sms messaging platform (Kenect SMS) api with our case management system (law firm). They wanted to be able to send sms messages to clients via the 'message' feature in the cms. This basically boils down to pulling the messages from the c...

 
@Peilonrayz Yes. Naturally, Joel saw this all coming back in 2003.
If you got the time to spare, that's a good read by the way.
And it's probably even more important for a real developer than for me.
 
I think I've read it before, but it's been a long while.
Also "real developer" 🤔
 
Breanne Boland on February 12, 2020
DevOps job posts often ask for automation skills, which is a positive way of asking for someone who’s professionally lazy in a way that results in efficiency. The good news is that developers can also learn a few tricks from the land of ops to make their days easier and their work better.
 
> Anyway, what does the poor reader of this website, which was written in Bulgarian but appears to be Korean (and not even cohesive Korean), do? He uses the View | Encoding menu and tries a bunch of different encodings (there are at least a dozen for Eastern European languages) until the picture comes in clearer. If he knew to do that, which most people don’t.
See, that's more or less how I figured it out.
@Peilonrayz Anyone doing more dev-stuff than the 4 hours I average on a week.
 
3:16 PM
@Vogel612 @SimonForsberg @AnyJAVAuser does anybody know if SimpleDateFormat.applyLocalizedPattern() behaves different between java 7 and java 8 ?
 
that's outside of my expertise, but it seems possible.
 
Now Python seems to think it's encoded as cp1252, wat...
Uh uh, can't properly tokenize as that.
TextIOWrapper is borked...
fun
 
@Mast Haha, I was doing something with encoding the other day and it was like "you want cp1252, yes?" I swear it just goes of the system, or terminal, encoding or something
 
@Vogel612 got a report from a customer that the time in his reports are 12 hours only. I didn't touch the sources since 2015.
 
@Peilonrayz Encodings are like timezones. If you're lucky you'll never have to bother with them and it starts to become a mess real quickly the moment you do.
 
4:10 PM
@Heslacher If you're using Java 8, don't use SimpleDateFormat. Use java.time. classes.
Any Linux expert in the house? I want to do a CNAME dig lookup for abc.mydomain.net to get the "real" machine name and I'm hoping that there's a oneliner for this
abc.mydomain.net --> def.myotherdomain.com
 
Open-ended questions about improving existing code belong on codereview.stackexchange.com — chepner 29 secs ago
 
4:26 PM
0
Q: Refactoring using Java Generics

DinukI am in the middle of refactoring a large body of code, and within it I am currently in the middle of trying to make the following a bit neater. Is there a way to extract a function common to submitEventV2 and submitEventV3 which accepts a Request and TypeRefernece to return the intended retur...

 
@SimonForsberg dig +noall +short -t CNAME abc.mydomain.net <-- thanks, coworker.
 
4:41 PM
hehe
 
posted on February 12, 2020 by CommitStrip

 
M nk ng
 
@skiwi Monking :)
 
5:07 PM
-1
Q: Python beginner here, programming style

casandra9Q: The code below works fast and delivers the result expected. Since I am a beginner in Python I am curious if there's a smarter way to solve the riddle. File (GPX), extract (non-fixed version)... <?xml version="1.0" encoding="UTF-8" standalone="no"?><gpx xmlns="http://www.topografix.com/GPX/1/...

 
Code Review is a more appropriate place to ask. — Andy Turner 16 secs ago
Hi, welcome to Stack Overflow. Please read stackoverflow.com/help/minimal-reproducible-example and stackoverflow.com/help/how-to-ask. In this example, it doesn't seem like you have a programming problem per se, but more so, an optimization problem. I suggest you head over to Code Review (codereview.stackexchange.com) and attempt to see what improvements can be made. If you have a specific question about optimizing one particular function or piece, we can help, but an overall evaluation is outside of the scope of Stack Overflow. — wundermahn 55 secs ago
@wundermahn is it possible to move the thread to codereview ? — Mo7art 35 secs ago
Do not move this to codereview. Code review is for completed programs that may need optimization help. If your accuracy is that low the problem isn't your parameters but the data/how you trained the model, which we can't help with unless we see the data and know why you designed the NN as you did — Edeki Okoh 55 secs ago
 
5:27 PM
0
Q: Simplifying nested if else loops Cognitive complexity in Java

jasmeet24I've a method which is used to build a native sql query. I've 4 String builder as input and based on different conditions, I need to build my query. Here is the code private void appendConditions(StringBuilder query, StringBuilder condition, StringBuilder condition2, StringBuilder condition...

 
5:47 PM
-1
Q: Delete all the nodes that are repeated more than x times

awwwwwI cannot understand why this function returns something wrong, it has to taken in input the head of a list and an integer. This function has to remove all the nodes that are repeated >= x times, so 1->2->2->2->3->3->4 should return just 1->4 if x=2; node_t *modificaLista(node_t *head, int x)...

 
6:26 PM
You should post this on our sister site Code Review. Be sure to include fully functional code that anyone can copy/paste and run. Specifically, you'll need to put your function inside a class and include a main() function to show how it is called. — Code-Apprentice 13 secs ago
 
6:42 PM
This, ladies and gentlemen, is how you simplify code:
0
A: Simplifying nested if else loops Cognitive complexity in Java

Simon ForsbergLet's look for some patterns in your code: First of all, we notice that you have three parameters with similar names. condition, condition2 and condition3. These names indicates a code smell, that we should use an array or list instead. Taking one step at a time, we see this code is repeated mu...

 
6:53 PM
@DerKommissar nice to see you.
 
I'm in and out regularly
This is the default tab on Chrome on both my phones so whenever I open it I show back up lol
I usually read the transcript when I pop in though
Sometimes respond to stuff, but that's going to happen less and less
 
@SimonForsberg You do realize that someone voted to close this question.
 
7:31 PM
@pacmaninbw I know. See the comments. But honestly, I don't see a reason to close that question. We shouldn't just blindly "follow rules", we should close questions because we don't think we can provide a good answer to them. This one is clearly answerable.
@DerKommissar Not even if we ping you!? o_O
@pacmaninbw It's probably Toby and πάντα that VTC'd, would be my guess.
 
@SimonForsberg I voted to leave it open.
 
0
Q: Could I please get my question deleted

Ender_The_XenocideI would like my question to be deleted. I made a mistake in posting it, it is at Cool text based adventure game

 
@Feeds This is a shame, they would be a good member of the community.
13 year old freshman at the university of Hawaii
 
Yea, whipping up an answer.
Should've been finished by now, except I can't find the appropriate meta. grmbl
 
@Feeds If I would still be a mod, I would search for "delete" in the mod room, realize that I wouldn't find what I was looking for and then I would ironically search for "search" and there is a message nearby where I have a frequently-used-decline-reason that links to a relevant network-wide meta post.
349
A: How does deleting work? What can cause a post to be deleted, and what does that actually mean? What are the criteria for deletion?

jjnguyHow can a post be deleted? By a user: The author can typically delete their own posts at will; for exceptions, see When can't I delete my own post? below. To delete a post, just use the delete link below it, on the left (only available from a browser, not the SE/SO app). Moderators can delete ...

 
7:45 PM
Found it
I was actually looking for rolfl's answer to an election.
 
@Mast Of course you did, I just linked it half a second before you wrote that :P
@Mast Oh...
 
Actually, both.
Thanks.
Than answer is more thorough than I expected.
 
0
Q: Is it a good idea to implement Spring GrantedAuthority in UserRole Model?

Александр Сергеевич ДжусI am trying to implement an authentication via Spring Security. In all tutorials people build a List of GrantedAuthority records from the List of UserRole records . I feel uncomfortable to re-create this list on a fly each time when I need it, even if I know that it contains 2-3 records. My sol...

 
@Feeds @Mast the comments there almost look like you are having a one-way conversation
@SimonForsberg avatar reminds me of the vlogger who asked about daddy long legs
 
@SᴀᴍOnᴇᴌᴀ A lot of them are removed.
 
7:53 PM
that was my perception
 
Answer is up. If anyone has suggestions for improvements, feel free to share/shoot/etc.
@SimonForsberg What I pointed out in my answer is policy. However, I know in the past exceptions have been made. Do you happen to know the current stance on that?
@Vogel612 Opinion? ^^
 
TBQH, I don't think policy has any leeway here
 
That's my understanding as well, yet, history shows different.
That's not a critique by the way, I'm just curious. There's a reason I didn't link to that meta in my answer.
 
I would need to look at why 200 bent policy there.
I doubt it applies here.
Note that some of the info given by that user seems to be ... questionable
 
It was actually removed by rolfl if you look in the edit history of the meta.
Links back to the original question on main.
Suspect a team effort.
And yes, I accept "that's none of your business" as a valid answer here.
 
8:00 PM
AFAICT the score of the answer(s) is the limiting factor here
I'm not going to go around and upvote 5 posts because someone couldn't think twice before posting something
Especially not if the consequences are questionable in nature
 
@Mast Pretty sure mods had a good reason for doing that. Normally, it's just rejected.
 
Like ... "I got in trouble because someone copied my code" just sounds fishy
 
possible answer invalidation by Ender_The_Xenocide on question by Ender_The_Xenocide: codereview.stackexchange.com/posts/237126/revisions
 
@Duga sigh
 
@SimonForsberg I respond to pings usually
 
8:07 PM
NotEnoughCoffeeError
It's just comments.
I mean, it doesn't fix anything, but hey, if that's how they want it.
 
yea, that's what I also thought :)
 
Perhaps it's more of a TooMuchCoffeeError, a bit trigger happy...
 
@DerKommissar pong
 
I like my software with an undo button.
 
by the by, that flag counts as handled by community :)
 
8:10 PM
@Mast I was considering flagging for moderator edit redactions
 
@Vogel612 It counts as self-removed in my list.
Both are technically correct.
 
yea, I see it as handled by community with the reason SelfClear
 
Heh, that's marvellously clearly stated by the system then.
 
yea, the info that is exposed by SE is usually pretty clearly formulated
nothing of the sort can be said of the company policies though ~sigh
 
@SimonForsberg I can relate, but I'm not 100% sure it would be appropriate.
 
8:16 PM
@Mast PII is PII and I can totally see why they would want to remove that.
 
Even though it's perfectly clear that would be in line with the desired outcome.
 
SO is supposed to be about helping resolve a problem with specific code. The code ether works until a certain point and then crashes, or it does not crash but does not get the expected result. Code Review (CR) is where you ask for suggestions to improve working code. — SmileyFtW 15 secs ago
Ay, sorry for this, I am going to ask about it in code review, thanks for the replies — Max 6 secs ago
int g = *(&a + 1) - a; - do that in a code review == instant fail! — Jesper Juhl 15 secs ago
 
8:49 PM
-1
Q: build recurrent Neural networks in python for flood prediction

Ala H HawamdehI am new at the field of Neural networks. I am going to build neural networks for flash flood prediction using python. please, could you guide me: how to write a code correctly, I read about the steps but could you show me a written codes regarding this topic how can I get built neural networks...

-1
Q: Division algorithm returning odd result with decimals

VirxECI'm making an algorithm that increases the max number Javascript can understand from 264 to 10264 by treating the number like a string/string array (for storage in memory). It then does the calculations like a human would, by lining it up and then going digit by digit and doing tons of small calc...

 
9:10 PM
-1
Q: VBA to retrieve/display information of cells in excel

MaxI am working as a validation technician for excel spreadsheets in a pharma company. Sadly & interestingly I don't know much about VBA and Excel. To validate those excel spreadsheet, I developped with macro-recording the following code, which helps me identifying the cell properties. The goal is...

 
I think this question is better suited for codereview.stackexchange.comMike 34 secs ago
 
9:30 PM
-1
Q: I can't figure out how to add taxes to the results of my reciept

KrissygoooI can't figure out how to add the taxes to the berry banana price. Would I need to use math.pow or is there a specific way to add fraction results to an decimal number? Probably such a silly question but I can't figure out it, my teacher wants me to use constants for everything. Please let me kno...

 
9:47 PM
@Feeds Coming to that now is rather bizarre. It's like @Mast answered a different post
 
0
Q: Simplifying Javascript which adds an "active" class according to URL (DRY)

David AlfordI usually write in Python on the back-end and am not seasoned on JS. This code looks pretty nasty to me as it repeats itself a lot. If I were writing in Python I think I would make a list of objects then loop over the list of objects to add the active class if one of the objects matches the URL. ...

 
@Peilonrayz Looks odd without the now removed comments, absolutely.
 
10:03 PM
@SimonForsberg NGL I'm starting to wonder if there's any benefit to Code Review in enforcing UWYA. (I'm not talking about LCC, or MRC, as it's known now) It's just a headache, and nearly every time I see it I just feel disappointment.
 
@Peilonrayz NGL?
 
Not going to lie / Not gunna lie
 
@Peilonrayz I definitely think we shouldn't be this strict on it. We shouldn't enforce it just because it's just a little bit unclear about why the code is written the way it is.
I think this is why Oliver created that recent meta about LCC (although the meta itself was a bit unclear). Sadly though, Oliver gave up and left.
 
Like it's making me improve the quality of the site, 'cause I'm like; I don't wanna see the "your title sucks" comment or "is this working" comments, and accompanying CVs. But it's like every question gets one now
 
@Peilonrayz Is it really that many questions that get those?
 
10:11 PM
New thought: Once you are happy with your array class, and if you have time, see what running it through Code Review turns up. Bring thick skin. The reviewers are polite, but something about people combing over your code and finding things that could be better always grates no matter how nice folks are about it. I've linked to the help page because the code requirements for a well-received question are, by necessity, fairly specific. — user4581301 8 secs ago
 
It might be different where you browse; but it seems like lots of Python questions do.
 
I honestly don't visit many questions at all these days.
I have too many other more important things to do.
 
lol
 
10:43 PM
 
0
Q: Array indexing with copy constructor and assignment operator

Darnoc ElocI modified the code as such to include an explicit default constructor and copy constructor, also included the std::out_of_range exception but am not sure if the latter is properly implemented. The code below is a custom This was done as an exercise in handling arrays without utilizing the vect...

 

« first day (2475 days earlier)      last day (1546 days later) »