« first day (2988 days earlier)      last day (1028 days later) » 

12:03 AM
REFRESH! There are 7680 unanswered questions (89.3948 answered)
 
 
1 hour later…
1:15 AM
possible answer invalidation by Reinderien on question by Banshee Prime: codereview.stackexchange.com/posts/263869/revisions
 
1:26 AM
0
Q: Which is better: session.clear() or session[] = None?

Arnon De PaulaThe question is that simple. I've been with this for some time and I know they both work. But I'm going to put some code here, after all we like a little code, isn't it? @app.route("/logout") def logout(): session["name"] = None session.clear() return redirect("/") Imagine that yo...

 
1:51 AM
0
Q: How can I parse out these arguments better?

CodeReview123123The input for price() would be STRINGS, as you see below. If the string starts with "-" I would like what follows to be stored in fiat_name and then retrieve the symbol from _KNOWN_FIAT_SYMBOLS. "--rub" (EXAMPLE) could be at any position in the list passed through price() If the optional fiat_nam...

 
 
3 hours later…
Monking
 
 
1 hour later…
5:59 AM
0
Q: What's the potential problems of this ReactJS code?

littlebird003hope you are doing well and stay safe during this pandemic. I am working on some front-end projects. The below is a front-end source file and this is the existing React code. I see some problems but not all, like the time should be changed, let changed to var, etc. Could you share your thought on...

 
6:49 AM
0
Q: Perfect Rectangle checker

Martin FrankWhile submitting this question i found that someone already made up this question in python, here is my java implementation of the Perfect-Rectangle-Challange challenge: Given an array rectangles where rectangles[i] = [xi, yi, ai, bi] represents an axis-aligned rectangle. The bottom-left point o...

 
7:38 AM
0
Q: Find number of ways to traverse matrix of 0's and 1's

John DoeI solved a Daily Coding Challenge, but i suspect my code could be optimised. The challenge is the following: You are given an N by M matrix of 0s and 1s. Starting from the top left corner, how many ways are there to reach the bottom right corner? You can only move right and down. 0 represents an ...

 
8:03 AM
0
Q: Why my code is not working (TLE error)

PrinceI am working on this code from 3 days from a website called Codechef, the code compiles, executes and even give correct results but my code is taking 1.01 sec, but the time limit for question is 1sec, I have tried various ways but neither of them is giving a result that can work within 1 sec. T...

 
8:18 AM
Welcome to The 2nd Monitor @ArnonDePaula
 
8:52 AM
0
Q: Am I not retrieving/sending data from/to API correctly? React.js front-end page won't display other fields than my JWT

vaahtlnirn1I posted about a similar problem yesterday, but wasn't specific enough, so this is my second attempt to make a satisfying question. This is the part of the back-end where login is handled: exports.signin = (req, res) => { User.findOne({ where: { email: req.body.email ...

 
9:17 AM
0
Q: Find Optimal Permutations Recursively in Java

Moritz WolffI'm asking for your feedback on my code. My specific concern is the simplicity of my implementation. My code is correct and the performance is ok, but I feel like that there must be an easier way to solve this. If you find any problems besides simplicity, I'll be happy if you point them out as we...

 
10:14 AM
@Mast Thanks.
 
 
2 hours later…
12:36 PM
0
Q: Is this method for loading data in a C# application recommended?

Squirrel.98Goal I'd like to understand if this current method, of loading data and inserting data into a database I currently use is to be avoided? Code I drafted a simple application that loads data and inserts data, simple as that. Model public class Person { public int PersonId { get; set; } publ...

 
1:01 PM
0
Q: Multiple tables in FROM vs INNER JOIN when using external ID

lax48I've seen several answers about the topic "Multiple Tables in FROM vs INNER JOIN" and all of them seems to say that there is no performance difference, but the INNER JOIN is newer, more readable and to be preferred. My issue is that, in my specific case, using INNER JOIN seems to be more difficul...

 
@CaptainObvious Really hypothetical. The OP agrees it is hypothetical.
 
@pacmaninbw Yeah, is MRC
 
@pacmaninbw Would you mind explaining your reasoning here?
@FMc Helping find missing edge cases is on-topic. If 26 of 36 test cases pass, it is a missing edge case. If only one or two test cases out of 10 passed this might be off-topic. — pacmaninbw Jul 5 at 12:29
As per the help center:
> To the best of my knowledge, does the code work as intended?

Code Review aims to help improve working code. If you are trying to figure out why your program crashes or produces a wrong result, ask on Stack Overflow instead. Code Review is also not the place to ask for implementing new features.
If a known case is known to fail, it's known not to work as intended.
If there are 20 test cases and it's not working on a not-tested 21st situation, that is allowed.
According to the (deleted) comments and the only answer posted, you confused the answerer as well.
 
1:52 PM
@Mast I used to close these types of questions as off-topic due to broken code. Then I was informed by someone that edge cases were allowed.
It may have been a moderator.
 
@pacmaninbw Either you or whoever provided you with that information got most of it right, but missed an important detail. Or something got lost in translation, I don't know. Some people tend to get offended if you close ML questions, but this wasn't ML.
 
What is ML?
 
Machine learning.
If 26 known tests run perfectly and a 27th untested scenario doesn't, that's an edge case worth pointing out in an answer.
Here, a known case is failing.
And yes, that means we kind-of reward people for not properly testing their code...
But that's how the rules are phrased, I'm afraid.
I can understand the frustration.
 
So you want me to delete my message to FMc? And be more careful about edge cases in the future? Remove the comment on this question as well?
@Mast ^^^
 
How many hidden test cases does it pass? If it is passing more than half the hidden test cases then this is a question of missing edge cases and the question is on-topic, if it is passing less than half the hidden test cases than the code could be considered broken and the question would be off-topic. Normally online challenges will specifically tell you if the failure is dues to exceeding the time limit. — pacmaninbw 38 mins ago
 
2:02 PM
We have 3 parts which make the reason a bit complicated. 1. Knowledge - is the OP aware of the issue? 2. Intent - Does the OP want the issue to be fixed? (Mast and myself have posted code which isn't 100% working) 3. Scalability - is the issue not due to our scalability rules (performance, memory, AI)? Then the question is off-topic.
 
> If it is passing more than half the hidden test cases then this is a question of missing edge cases and the question is on-topic, if it is passing less than half the hidden test cases than the code could be considered broken
I know of no basis for this.
@pacmaninbw ^
 
I was extrapolating.
 
Ok.
Unfortunate.
 
:) True.
Consider me properly chastised.
 
Nothing personal :-)
 
2:10 PM
I understand that. I try to keep in mind that neither you nor @Peilonrayz are trying to attack me personally.
I know I make mistakes.
@Mast @Peilonrayz ^^
I don't mind being corrected as long as it is here in the chat room.
I think all offending comments are gone now.
 
@pacmaninbw At first I misread your message, and I find the irony a little funny. You may too :) Since the "@Peilonrayz" is the start of a second line I read just "@Peilonrayz are you trying to attack me personally", and took your comment personally... Then I realised I completely misread your message :)
 
I have a colleague who claims to read only half of what's put in front of him.
 
I'm your colleague? :O
 
@Peilonrayz :)
Oh, the irony.
 
it's probably a much more easily understood descriptor compared to "my comoderator on codereview.se"
at least outside of SE that is
 
2:26 PM
@Mast That might explain a few things.
 
@Vogel612 Oh no. You've set me off and now all I can think is "well technically" D:<
 
sorry :D
if it helps: I've been struggling with JSON Schema validation for the last ... two hours and I'm about ready to say "Screw it, all programming ever is horrible and should never have been invented"
2
 
@Vogel612 Dang D: What's up with JSON Schema?
 
it has several standards in draft status that are partially mutually conflicting..
which is frankly insane, because it's not like this is the first or second or third time that we as a profession have tried to develop a data interchange format
I'm not even close to 30 and I'm a grumpy curmudgeon
 
Oh... I set up JSON Schema the other day, and keep getting warnings my schema standard isn't 'valid'. I started looking into what a valid standard is... and btfoed asap. I'll count my self lucky ;) tbf the setup for JSON Schema seems... pretty adhoc
 
2:42 PM
you probably want to generate your schema from types (instead of the other way round)
 
tbf, I've not built any types in my lovely untyped Python code ;)
@Vogel612 I can only imagine the level of enlightenment grumpyness well have when we turn 30 ;)
 
@Peilonrayz yea this is really just about getting config values that are not stringly typed
Because compiler checking for unused properties is really nice :)
 
@Vogel612 You are very correct here. I have a bug... which mypy (type checker) would have picked up :/ Much better when a program, rather than a user, finds a bug
 
@Peilonrayz At least you didn't say grumpy OLD men.
 
3:05 PM
1
Q: Efficient renaming of dict keys from another dict's values - Python

Noah BroylesI have a dictionary in Python (uglyDict) that has some really un-cool key names. I would like to rename them based on values from another dictionary (keyMapping). Here's an example of the dictionaries: uglyDict = { "Ship To - Name": "Noah", "Ship To - Location": "my crib" } keyMapping = ...

 
possible answer invalidation by Noah Broyles on question by Noah Broyles: codereview.stackexchange.com/posts/263904/revisions
 
@Duga looks okay - OP updated input and output but not code
 
3:29 PM
0
Q: Python script that get a web API

JGProgrammerI've written a program that gets the web API endpoint for some functions on a website. I'm just wondering if you guys see anything I could do to improve the code at all. import sys import requests import dateutil class KenoBase: ''' Methods that are to be inherented to 'KenoAPI' class. ...

 
3:48 PM
@pacmaninbw Wow, no need to bring the O word into here ;)
 
Monking
 
Monking
 
Turned 65 2 days ago.
 
@Vogel612 Nope. We do this every time all over again.
CSV, XML and JSON. All well-known standards. All not exactly as standard as you'd hope them to be.
And there are so many more where it went wrong as well.
@pacmaninbw Congratulations!
 
4:19 PM
0
Q: A recursive_transform template function for the binary operation cases with execution policy in C++

JimmyHuThis is a follow-up question for A recursive_transform template function for the binary operation cases in C++, A recursive_transform Template Function with Unwrap Level for Various Type Arbitrary Nested Iterable Implementation in C++, A recursive_transform Template Function Implementation with s...

 
@Mast Thanks. Celebrated with friends, 2 shots of good scotch and a steak.
 
4:44 PM
0
Q: Excel VBA Nested Loop Alternative

Jason RosatiI am not an advanced user of Excel and am VERY new to VBA. My only programming experience is 2 C# classes in college. That being said, go easy on me ;) I am working on a team that audits military bases for energy conservation projects. I am trying to revise a workbook that is currently used to do...

 
5:00 PM
@pacmaninbw oh yeah - I remember last year you mentioned the Beatles song
 
5:14 PM
I'm fed up. @Duga will be taking a break for some days.
7
I'm sick of having to maintain that machine, and restart it about once every week.
If anyone else wants to run @Duga, see Jenkinsfile in the repo. (AWS credentials not needed, replace github.com/Zomis/Duga/blob/main/duga-ktor/Dockerfile#L16 with stats-local or just ignore it completely)
 
@SimonForsberg No problem :) Thanks for maintaining her
 
The new duga-ktor project is significantly better and easier and more modern than the old one
I'm just so bloody f**king sick of the machine she's running on
 
@SimonForsberg status checked halted for now
I see it sent emails 9 minutes ago
 
@SᴀᴍOnᴇᴌᴀ Did you fix the spam every minute problem?
If you did then the status check can continue running, can it not?
but indeed no reason to keep it up now
 
@SimonForsberg I believe I have that fixed
 
 
2 hours later…
7:37 PM
0
Q: Error with na.locf and group_by

NoraIn trying to get NA values replaced by last non-NA value within groups, I've tried: df %>% group_by(stay_id) %>% mutate(AFnorphen, time_nor_start = na.locf2(time_nor_start)) where na.locf2 was previously defined as <-function (x) na.locf(x, na.rm =FALSE) I've also tried a number of other things ...

 
8:01 PM
0
Q: What's idiomatic Rust for recursion and memoization?

avamsiuse std::{cmp::max_by_key, collections::HashMap}; fn longest_common_subsequence(s1: Vec<u8>, s2: Vec<u8>) -> Vec<u8> { struct Helper { s1: Vec<u8>, s2: Vec<u8>, cache: HashMap<(usize, usize), Vec<u8>>, } impl Helper { fn helper(&mut self, i: usize, j: ...

 
 
2 hours later…
10:05 PM
1
Q: Faster For loop iteration and saving inside database

Jaskaran SinghI am looking for suggestion to make my for loop iterate faster. With about 2000 rows of data. Below code is taking lot of time to run. So far I have followed various Stack Overflow answers. For example reducing db queries and using Bulk insert to improve EF performance. It just improved marginall...

 
10:30 PM
0
Q: Round number to nearest non zero digit

CodeReview123123I have the following code to round a number down to the nearest non zero digit in a string, or if the digit is larger than 1 it would round to the second decimal place. I have yet to find a way to do this without converting the number to a string and then using regex. The end result of the number...

 
 
1 hour later…
11:44 PM
0
Q: Why does an image gets bigger when reloading web-page (SwiperJS)

MaxWhy does an image gets bigger when reloading browser and then gets back to normal (360px)? What's wrong in code? Copy CSS, JS, HTML in HTML file and the run, here you can't reload page? So you won't see big image when reloading. gallery = new Swiper('.swiper__container', { slidesPerView: 4,...

 

« first day (2988 days earlier)      last day (1028 days later) »