« first day (3500 days earlier)      last day (511 days later) » 

12:07 AM
REFRESH! There are 7627 unanswered questions (90.0107 answered)
 
 
2 hours later…
1:42 AM
 
 
3 hours later…
5:08 AM
Questions about improving working code are better suited for the Code Review SE. You'll definitely need to show the code there. — sj95126 46 secs ago
 
 
4 hours later…
8:54 AM
0
Q: Reusability of react (native) components : pass styles as props to child for selection trigger button or define trigger outside of child component?

juliascodingMy question is about good practise & reusability. I have a component thats currently has a button that triggers opening of a selection (where you select items from). I have that button inside same component as opening/closing of the selection seems like it should be together. However now when I w...

 
 
2 hours later…
10:36 AM
0
Q: OOP Design Pattern for Dispatching Tailored **kwargs

alphamuAt first, I wrote a lot of functions to read specific data sources stored either on Web or on my hard drives. After a series of refactoring sessions, all those boiled down to the collection of functions which merely form the source specific **kwargs and pass them over to either pandas.read_csv or...

0
Q: Get an `Object` that is the difference between O & O1

johnThere was this type challenge: Get an Object that is the difference between O & O1 I came up with such solution but I wonder if you have advice to simplify my approach? My solution: type Diff<O extends object, O1 extends object, tmp extends object ={[k in keyof O]: k extends keyof O1 ? never:O[...

 
 
1 hour later…
11:54 AM
Hi and welcome to SO. The first quality problem here IMO is a function named f and variables named a,b, c..., all of this without any documentation. Meanwhile, if you are looking for a code review, I suggest you try codereview.stackexchange.com. Asking for recommendation for tools, libs and more is also off-topic on SO. — Zeitounator 24 secs ago
Difficult to say with a small piece of code (see also codereview - for working code). Just a tips : don't forget to add return type to function (ex here, : array) to enforce the data-type flow and avoid coding errors ;) — Syscall 33 secs ago
 
 
1 hour later…
1:09 PM
0
Q: Get priority of trucks (Advent of Code 2022: Day 3)

Infinityfrom collections.abc import Iterator import itertools import pathlib import string PRIORITY = {v: i for i, v in enumerate(string.ascii_letters, start=1)} def parse(f: pathlib.Path) -> Iterator[str]: yield from f.read_text().splitlines() def parse_line_blocks(f: pathlib.Path, block_size:...

 
Welcome to Stack Overflow. Please read about what is on topic in the help center. Questions that are primarily opinion-based, like open-ended code review requests, are explicitly off-topic. You might have better luck on Code Review. — Chris 22 secs ago
 
1:34 PM
0
Q: Is this is a pythonic way to make URL constructor like this? And if not, what is?

Ray JamesonThis is my first question on Stack Eschange, so please bear with me. I wanted to create some URL constructor to use it in some requests calls so im curious if my solution considered the Pythonic way. I feel like it could be done more elegant, using, for example StrEnum but I don't know how to con...

 
 
3 hours later…
4:46 PM
If it works but you want to know how you could have written it better, you are posting on the wrong site. SO is for fixing problems in short code. Improving large and working code is the job for Code Review a different site on the Stack Exchange network. You could get extensive and in depth reviews there. — Serge Ballesta 26 secs ago
 
5:45 PM
Monking
 
6:43 PM
Perhaps (as the code reviewer) ask the developer what an octal value is being used. If the line is really as simple as the example posted, there’s really no (obvious) need to use an octal base. — S3DEV 7 secs ago
 
7:05 PM
0
Q: Multithreading program - multiplying matrix by vector

Alisa LibonI have code that multiply matrix A to a vector b, c = Ab for the task with the number thread_num of the total number of total_threads. n is the size of matrix matrix and vector initialization void matrix_init(double *matrix, int n){ int i, j; double *a = matrix; for(i = 0; i < n;...

 
7:31 PM
0
Q: Using a static field for cache in a multi thread application

Vanderlei MoraisI have a .NET 6 web API that does some requests to another third party API, this third API have a token that expires after a few hours, so I want to cache this token and reuse in the requests. Here how a implemented it: public class TokenInformation { public string Token { get; set; } pub...

 
7:56 PM
0
Q: A maybe type in Python. Which implementation is best?

schuelermineThese are five implementations I’ve come up with for an equivalent for Haskell’s Maybe in Python. It’s not called Optional because typing.Optional already exists. Here’s a simple monolithic class. The benefit of this one is that it can be inherited from: from __future__ import annotations from ty...

 
8:22 PM
0
Q: Creating a bookingsystem in in c++

MerikssonnI have these six files: Reservation.hpp; #ifndef RESERVATION_HPP #define RESERVATION_HPP #include <string> #include "Date.hpp" class Reservation { std::string referenceID; Date startDate; Date endDate; public: Reservation(const std::string& referenceID, const Date& start, con...

 
 
1 hour later…
9:26 PM
Since this question is about improving working code, it is generally considered off-topic on Stack Overflow. It may be better suited for Code Review instead. Please read A guide to Code Review for Stack Overflow users first to ensure that your question is on-topic and appropriate for that site. Cross-posting is not allowed on the Stack Exchange network, so please delete this question before posting elsewhere. — MattDMo 56 secs ago
this is more suitable for another Stack Exchange site codereview.stackexchange.com, but you could trivially change instances where you expressly make a new list and leave it as or convert it to a generator (ie. zip() instead of list(zip()) or ()) — ti7 16 secs ago
 
9:38 PM
0
Q: Advent of Code 2022 - Day 3

NebriBelow is my attempt at Advent of Code 2022 - Day 3 - Part 1. That link will bring you to the problem description. I'd like to get some feedback on this. I'm new to Python, started working with it for this years challenge in order to learn. I'm quite certain there are better ways to solve this par...

 
10:14 PM
It seems to me this question is more suited to be asked in the Code Review Forum. Code Review is a question and answer site for peer programmer code reviews. Please read the relevant guidance related to how to properly ask questions on this site before posting your question. — itprorh66 52 secs ago
 
10:40 PM
what you need is a code review platform, not git. — Bagus Tesa 30 secs ago
 
11:02 PM
question needs more focus. for code reviews, go there: codereview.stackexchange.comChristoph Rackwitz 6 secs ago
 

« first day (3500 days earlier)      last day (511 days later) »