« first day (3070 days earlier)      last day (954 days later) » 

12:02 AM
REFRESH! There are 7854 unanswered questions (89.2838 answered)
 
 
5 hours later…
4:44 AM
codereview.stackexchange.com might better site for this question. — Karthikeyan Vaithilingam just now
@KarthikeyanVaithilingam My question isn't a code review, is it? — Abhijit Sarkar just now
 
5:07 AM
Monking
 
Your code works and you want to improve it, aren't you? I think it will be better suited in codereview.stackexchange.com . That's my opinion. — Karthikeyan Vaithilingam 20 secs ago
 
0
Q: Spring boot: better way to handle response and exceptions

benjamin cI am working on a quite a big Spring Boot web service and I wanted a standardized and simplified way to handle responses and exceptions by following fluent API design. So this is what I did and it works as I expected. For handling responses, first i created an interface like this, public interfac...

 
5:42 AM
0
Q: How to deal with nested callbacks in a clean way?

anup Hi guy's I am currently migrating some code from class-based components to function components using hooks in react. Where I have come across a piece of code that works as expected but there are 3 Axios calls that are dependent on input from the first Axios call. First Axios call returns order...

 
 
2 hours later…
7:45 AM
possible answer invalidation by anup on question by anup: codereview.stackexchange.com/posts/268494/revisions
 
 
1 hour later…
8:48 AM
This may be better suited for codereview.stackexchange.com but in any case check How to Ask and post all relevant information in the question, not as links to external sites. — buran 50 secs ago
 
9:23 AM
0
Q: Custom Vector3D class - member variables

Alex TaylorI'm implementing a 3D vector class which stores the x, y and z coordinates as doubles: class Vector3D { public: double m_X, m_Y, m_Z; } Would it be better for performance to store these in an array of doubles as shown below, or would performance not be affected significantly enough to matter...

 
9:43 AM
Monking
 
10:12 AM
0
Q: Collecting all instances of an Office application (Excel, PowerPoint, Word)

TinManA project of mine required me to search for certain workbooks in open instances of Excel. I found this article Code to get Excel, Word, PowerPoint from window handle which returns the applications for all the open Excel windows. Close to what I want but not exactly what I needed. The problem w...

 
 
1 hour later…
11:16 AM
Hello ^^ Long time no see! Anyone any ideas why this is happening in mypy? mypy-play.net/… I'm getting: main.py:20: error: "T" has no attribute "field" but am not sure why or how to get rid of it. @Peilonrayz ?
 
11:41 AM
@EmpressSvetlana while csv is good for OPs use case, I'm not trying to do a full code review here. There are a lot of fixes, really this whole thing could be boiled down to random.choice(fh).split(',') to grab a random line — C.Nivs 51 secs ago
 
12:15 PM
0
Q: Shortening a method which returns the document name after the id

AdamKI'm just getting to know the possibilities of Kotlin and mongoDB. I am writing a method that returns the name of the street after the ID. Everything works, but I find it quite sloppy. Empty String initialization, returning more data from the collection than I would like. How do I straighten it? C...

 
12:39 PM
0
Q: How to Split date range based on start and end date

Rahul VaidyaI need to form multiple records JSON from one row JSON based on date criteria, and the criteria are that when start date and end date have a difference of more than 1 year, it should have multiple rows for each year date as mentioned below: (python solution is appreciable) Input : ``[ { "ID": 1,

 
1:04 PM
0
Q: Processing and then uploading images submitted through a form using .NET 5 and Azure Storage

FullerPrimeI've created some code in my API which will take a form, process the attached images, upload them and then save the record to the database. Controller Action [HttpPost("api/CreateDraftPost")] public async Task<ActionResult<DraftPost>> CreateDraftPost([FromForm]CreateDraftPostDto draftPostDto) { ...

 
1:26 PM
@GrajdeanuAlex That's some hard to read code. Regardless your types don't seem to be matching; reveal_type(load) -> typing.Coroutine[Any, Any, __main__.Response@13], reveal_type(cache(load)) -> typing.Awaitable[T`-1]]. You probably need to figure out how to make a Coroutine look like an Awaitable.
 
Look, this is easier to read :p mypy-play.net/…
 
0
Q: Overly complex code for a seemingly simple idea. Fulfilled promises returned instead of values

Melvin IdemaI have a React hook "useFetchSales" that fetches all documents from the "sales" collection in Firestore: import { useState, useEffect } from 'react'; import db from "../firebase.config"; import { collection, query, onSnapshot, orderBy } from "firebase/firestore"; function useFetchSales() { c...

 
I'm probably going insane with all these type hints and trying to make them work together.
 
1:57 PM
Please ask your "which is better?" questions on Code Review Stack ExchangeRojo 36 secs ago
Please take the tour and read about How to Ask. This question is way too broad for this site. You might try Code Review, but again - please read their help center and how to ask page — Tomerikoo 21 secs ago
 
2:18 PM
0
Q: Best way to log on the fly in python

avansI'm using the logging module in python and i would like to create a function or class method which logs only if some condition is false, similar to assert but with logging a msg instead of raising an exception. In order to still be able to use the condition in if, while, any, all etc., i would li...

0
Q: optimization csv from url analyzer

Alex D'agoI was messing around with the csv package and I tried to implement a class that returns csv objects whenever I need to open a csv file directly from a url(and occasionally prints out something).I am still very green and I would like to know if there is something I can do to optimize this code.You...

 
2:42 PM
0
Q: Compare row values that are lists with each other in the same column under some criteria Pandas

user249899I have posted this question on stackoverflow, but realised that this might be a more appropriate place for it. I have a big dataframe (> 30 mil rows) and a column containing lists of string values. I need to for example, to compare the first row list values with every other value in the same colu...

 
2:58 PM
Welcome to Stack Overflow! Before you post at Code Review, make sure to read A guide to Code Review for Stack Overflow users, as some things are done differently over there - e.g. question titles should simply say what the code does, as the question is always, "How can I improve this?". Be sure that the code works correctly; include your unit tests if possible. You'll likely get some suggestions on making it more efficient, easier to read, and better tested. — Toby Speight 25 secs ago
 
Monking
@Duga rolled back
 
3:57 PM
Monking
 
0
Q: Staff Manager Windows APP -Python

JakubBelow there is a full code for my app Staff Manager. The app does allow basic staff management, like adding, removing or changing details of employees. As it is one of my first GUI apps and I am self-taught (I have been learning for about 6 months now, a couple of hours every day after work) I wo...

 
4:38 PM
This question would be better asked in code reviewJohn Wu 13 secs ago
 
0
Q: Here's my attempt at a Volumetric Weight Calculator (in cm). How did I do?

BeaniieSo, I've written this small calculator for computing the volumetric weight of a parcel. I've been trying to kick some bad habits to the kerb lately so I was wondering if I could get a code review. Specifically, I'm hoping you lovely people could point out/correct my pitfalls in this example. Here...

 
5:12 PM
-2
Q: What are best resource to learn Online Excel Version Macros Not Desktop Excel App Macros

Mani233I have experience in creating Macros in Desktop Excel Macros using VBA. The client is asking me to do Web excel automation. For Ex: A excel file is saved in SharePoint and I need to create a form as per their requirement and do some data transformations. If I create macros using Desktop Excel and...

 
Also, this question is more suited for codereview than here IMO. — Xiddoc 35 secs ago
 
5:37 PM
0
Q: ZigZag conversion function

Tim_Jarvis99This is a solution for Leetcode #6, linked: https://leetcode.com/problems/zigzag-conversion/. Essentially I am given two parameters, a string and an int for number of rows. How it works is if the string is: "PAYPALISHIRING" I need to write a program in such a way that it can be read as if it is d...

 
6:05 PM
possible answer invalidation by greybeard on question by CoderTang: codereview.stackexchange.com/posts/268416/revisions
 
6:35 PM
You might want to take a look at [Code Review Stack Exchange][codereview.stackexchange.com/]. — Alan Bagel 40 secs ago
Welcome to Stack Overflow! if you post on Code Review please read the help center pages like How do I ask a good question? - in its current form this post would be considered off-topic because there is little context about what the code does and how the function is used. — Sᴀᴍ Onᴇᴌᴀ just now
 
6:50 PM
0
Q: Efficiently parsing http request in python

Josh BoneI'm using this API to get information on sports-betting odds. I am then processing it in Python to discard the irrelevant information. Here's what the response looks like: [ { "id": "9eec062ad8ed334517ab3a4be8362739", "sport_key": "americanfootball_nfl", "sport_title": "...

0
Q: How can I refactor my DiscountManager class?

MD. RAKIB HASANclass1 which is responsible for calculating a discount for the customer. How can I improve my code readability... public class Class1 { public decimal Calculate(decimal amount, int type, int years) { decimal result = 0; decimal disc = (years > 5) ? (decimal)5/100 : (decimal)years/100;...

 
 
1 hour later…
8:04 PM
0
Q: Word Matching Exercise Game

Evan GertisI have a simple program that matches words with descriptions. The program should do the following. Allow a user to enter a set of inputs: keys and descriptions. When the user clicks generate html a textarea should be created with html to be rendered in the word matching exercise. When the user c...

 
8:25 PM
explain to me the reason? , do you recommend posting my question on codereview.stackexchange.com? — db151 just now
 
8:44 PM
This question is more suitable for Code Review, but please check their rules for good questions. — trincot just now
 
0
Q: Added custom woocommerce product page hook

db151I inserted this code snippet in the functions.php of my child theme, to create the woocommerce single product page in the hook woocommerce_after_single_variation of the custom icons in line centered on the text, without using css, everything works, but I ask you much more experienced if that's ok...

0
Q: C++ Mine Sweeper Attempt

Martin YorkSaw this question and though I wanted to try. So my version of reading Mine Sweeper: For the Online Judge #include <memory> #include <iostream> #include <vector> // Each member of the grid is either a mine // which is printed as a '*' or empty which is represented by a number. struct MineCount ...

 
9:45 PM
Welcome to StackOverflow - if you are struggling with a specific problem, please point it out and make your question specific to it. If you are more looking for a code review, SO is not the right place and you should ask this question on codereview.stackexchange.comGrismar 57 secs ago
possible answer invalidation by Deduplicator on question by Nayuki: codereview.stackexchange.com/posts/268461/revisions
possible answer invalidation by Deduplicator on question by Nayuki: codereview.stackexchange.com/posts/268461/revisions
 
10:15 PM
0
Q: Is it possible to get a better performance using memoization? Array algorithm

myTest532 myTest532I have a working solution for the problem below. I have the feeling that it could be improved using memoization, but I cannot see how to do it. The problem: You are given an array arr of N integers. For each index i, you are required to determine the number of contiguous subarrays that fulfill th...

0
Q: Hide your text with colorful blocks in secret(-mode)

ZetaMotivation While working on a completely unrelated task, I wanted to share a screenshot of my current Emacs frame, but not of the actual text contents. And while GIMP's pixelate filter did the job, I didn't want to fire up my image manipulation program just to share a picture of a custom theme or...

 
 
1 hour later…
11:28 PM
0
Q: How can I refactor my javascript code to have less jquery for everytime a menu item is clicked on to change the array used for my chess quiz website?

jawncopperI'm working on a personal project to build a website that quizzes users on chess opening theory moves. I know my code is not very object-oriented but I am working on refactoring it right now. I just wanted to get the basics of it working before I started to restructure everything. Here is the lin...

 
11:53 PM
0
Q: Error in output of Dynamic Programming in Maximum Scheduling Problem (Python)

Cindy PhilipI'm working on a dynamic programming problem and actually, I'm not quite sure whether it is dynamic programming since moving average M is based on previous M. No need to consider the efficiency. The problem requires selling a product over T time periods and maximizing the total actual sale amount...

 

« first day (3070 days earlier)      last day (954 days later) »