« first day (3499 days earlier)      last day (526 days later) » 

12:07 AM
REFRESH! There are 7631 unanswered questions (90.0051 answered)
 
 
2 hours later…
1:38 AM
If you have working code that you want to have peer reviewed for improvements, your question belongs on Code Review, which was created for exactly that purpose. — Ken White 58 secs ago
 
2:16 AM
0
Q: ATM updating balance

Natalia JamiolkowskiI am still a beginner in Python yet I would like to set up my code so that the user in this simulation can use more than one feature and have their account balances updated. So far, I just have it so 5 set users would utilize one feature. Any suggestions? def main(): CUSTOMERS = 5 for use...

 
3:07 AM
0
Q: Random Name Selection from a "Hat" in Python

Christian RBackground/context: This program randomly selects predefined items ("Names" as strings) according to 2 rules: #Rule 1: Each name/item in the list can only be selected once. #Rule 2: Single item exclusion cases for all random selections such that a person cannot select themselves. This program ser...

 
 
2 hours later…
5:17 AM
Monking
 
Hello and welcome to StackOverflow! Please take your time to follow the tour, read How to Ask and review the checklist, but most importantly keep in mind that this is not a debugging or code reviewing service, and we will certainly not go through more than 500 lines of code for you. By the way, I suggest you to get more acquainted with event-driven programming, which is the base of almost any UI based toolkit as Qt is, considering that anything that locks/blocks the program flow will prevent its usage. — musicamante 1 min ago
 
5:35 AM
Monking
 
6:00 AM
The program seems to work. What's the problem? If you want a code review, I'm afraid this isn't the right site. Try codereview.stackexchange.com. Although, I need to say something about s.empty()?true:false. You don't need to convert true to true and false to false. They already are true and false. — Piotr Siupa 36 secs ago
 
 
3 hours later…
9:29 AM
0
Q: Advent of Code: Day 2 in Python

InfinityAdvent of code, Day 2. Here is my code. Less verbose version of the question follows. import itertools import pathlib from typing import TypeAlias Shape: TypeAlias = str WinStatus: TypeAlias = str RPS = Rock, Paper, Scissors = "RPS" WLD = Win, Lose, Draw = "WLD" shape = dict(zip("ABCXYZ", (*RPS...

 
I think your question is slightly off-topic here and leads to opinion based answers. However, I also do think that there is nothing wrong with a condition above your business logic. For once that is what they made for, control flow and as topping all your other condition won't be compared to, will save resources and time. You might think about sharing a working example to Code Review, if you feel comfortable with it. — Thingamabobs 33 secs ago
 
 
1 hour later…
10:40 AM
@CaptainObvious I'm tempted to cut out the feature request and answer it. That's truly terrifying code.
 
@Mast Yes, it looks like it needs a good review, with the feature request removed. Look at that duplication!
 
 
2 hours later…
 
1 hour later…
2:00 PM
@CaptainObvious MRI - when prompted to add more code poster asked what happened to minimal reproducible case.
 
2:35 PM
0
Q: C Macro Generic Linked List

404 Name Not FoundFor a recent project of mine I had to create various data structures in pure C with no external libraries (in other words, code I've written by myself), which lacks the templating and OOP capabilities of C++. However, I figured a macro might be easier than a void*-based solution, so here it is. I...

 
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 38 secs ago
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 42 secs ago
 
3:25 PM
Hi @Nikolay, Thank you very much for your support. I tested with_capacity, and time increased by ~15%. I agree that the approach could be different, and your second comments shed light on where to go. This will require a new code. I am also thinking of using integers instead of strings. string -> integer -> make several operations -> strings back again. I will post the new approach in Code Review; I hope you are also there. Thanks — Carlos_G 21 secs ago
 
3:36 PM
Note that on Code Review, you can ask for comparative-review using tags. I recommend you 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 just now
 
4:14 PM
@TobySpeight I hope they'll clarify the situation so we can help, but there currently is no spec.
While the code has very serious problems, it's complete enough that I can do a piece-by-piece rewrite of it to fix most of the issues (which just so happens to remove the need for a customers variable entirely) and introduce lots of concepts useful to a beginner.
 
4:30 PM
Monking
@Mast and henceforth it will soon be time for the bashing of winter
 
5:08 PM
Monking
 
@SᴀᴍOnᴇᴌᴀ @Mast Oh boy, hats. Do I have to wear one?
 
Hats have always been optional.
 
6:26 PM
0
Q: How to handle optional date parameters?

ARNONWhen creating a function to be reusable throughout the project I came across something strange. After looking at this function it looks very much like it could be refactored. The function should only return the short month and day, in that order. If it receives a parameter, it will be a Firestore...

 
6:52 PM
0
Q: Eager loading using microservices

DeveloperXI am not quite sure if this is the best approach when fetching relationships, I have this: LinkController.php <?php class LinkController { /// is this correct? public function show($code) { $link = Link::where('code', $code)->first(); ...

0
Q: A better way to write a simple c# function

Simone SpagnaClosed. This question is opinion-based. It is not currently accepting answers. Update the question so it can be answered with facts and citations. This will help others answer the question. You can edit the question or post a new one. Closed 15 mins ago. I wrote the following simple C# function t...

0
Q: Further optimizing the ISING model

Amirhossein RezaeiI've implemented the 2D ISING model in Python, using NumPy and Numba's JIT: from timeit import default_timer as timer import matplotlib.pyplot as plt import numba as nb import numpy as np # TODO for Dict optimization. # from numba import types # from numba.typed import Dict @nb.njit(nogil=True...

 
@CaptainObvious yay for close notice text from SO getting pasted with the rest of the text
 
7:34 PM
As a final word, I would say that you might to the code review stackexchange as your request does not require to fix bug or help you with any problem you face.. — Jib 52 secs ago
 
-1
Q: Refactoring a simple c# function using regex

Simone SpagnaI wrote the following simple C# function to remove the country code from full phone number. The function works but I want to refactor it using regex: public static string GetPhoneNumber(string fullPhoneNumber) { var phoneNumber = fullPhoneNumber.Replace("+", string.Empty); var countryCode...

 
8:16 PM
If it's not already using all the resources you have, then adding resources won't help. Maybe have someone review your code over at codereview.stackexchange.comGabriel Luci 13 secs ago
 

« first day (3499 days earlier)      last day (526 days later) »