« first day (3054 days earlier)      last day (1041 days later) » 

12:03 AM
REFRESH! There are 7810 unanswered questions (89.3176 answered)
Q: Advice on how to make code more efficient

NewWalkerI have just recently picked up coding and am trying to improve my coding. I've written this bit of code to create a little adventure world. I haven't completed the code, everything runs how I want it too but I'm aware this code isn't efficient. I would like some advice and some help on how I woul...

Q: Create an application that calculates and displays the amount of a homeowner’s property tax

JohnHaving problems with some Visual Basic for school. can someone overlook the code? Also the tax is 1.35% of the property’s assessed value, which will be entered by the user. Imports System.Windows.Forms.VisualStyles.VisualStyleElement Public Class Form1 Private Sub btnStart_Click(sender As Object,...

4 hours later…
3:51 AM
Q: Implement word iterator

Abhijit Sarkar Given a file or directory, create an iterator that returns the non-empty words from the file or from all files in the directory. class WordIterable: def __init__(self, path: str): root = Path(path) self._walker: Optional[Iterator[Path]] = None if root.is_dir(): ...

1 hour later…
5:07 AM
Q: I coded a prime number program generation in Python

Aryanlst = [y for y in range(1000)] for i in range(0,len(lst)): #i = 1 and i is traversal print("iterate - " + str(i)) for j in range(i,0,-1): #divisor range print(j) if j != 1 and j < lst[i] and lst[i]%j == 0: if j in lst: lst[i] = 0 ...

2 hours later…
6:55 AM
Thanks for your answer @MarkTolonen. I'm trying to store related information about a not-extendible set of values, and python enums seem perfect for that. I do get your point - feel free to comment on my actual use caseElRudi 17 secs ago
7:13 AM
Q: Using python enums to define physical units

ElRudiI'm using python Enum to define the physical units in which a value is expressed. Eventually, I want to add them as an attribute to my pandas.Series and pandas.DataFrame instances, so that this information does not need to be stored in the variable name or in comments in the code. Also, it allows...

8:03 AM
Q: Fuzzy Matching Optimizations and Score Punishment Ideas

Δημήτρης ΣπανάκηςIntroduction to the problem Hey everyone, I have started working as an intern, and my first project is to come up with an implementation of company names matching. Customers send a form with the manufacturers that they want to get their products from, and as the Manufacturers are many, we need a ...

2 hours later…
9:50 AM
A better place to post this if you are looking for code review is: codereview.stackexchange.comKevin 22 secs ago
2 hours later…
11:42 AM
@Andreas. Thanks. Your code review will help — Navnath Jadhav 5 secs ago
Hi There, We have been struggling to get clarity from the DBA as to the nature of the crashes, and so the cursor setting recommendation has been borne from a code review. An example of — Steve 54 secs ago
Q: Include new method VerifyAllSubmitsAsserted for unit tests in C#

41 72 6cI want to include a new method in which I can catch all fired Submits. This is the previous state. [NotNull] public static TMessage AssertSubmitAndRemoveFromQueue<TMessage>(this SagaMockContext context) where TMessage : MessageBase { var mock = context.GetMock<MessageSubmitMock>(); ...

Q: Implementing a unique_ptr - PPP Stroustrup exercise

bobintheboxI'm doing the following exercise from PPP - Bjarne Stroustrup, Chapter 19, ex.10. Implement a simple unique_ptr supporting only a constructor, destructor,->, * and release(). In particular, don't try to implement an assignment or a copy constructor Here's what I've done so far, for which I'd li...

Q: Python Trivia game let the player roll the dice again after they finished 1 round

Lam NguyenI'm trying to create a trivia game for 2 players. However, I've no idea how to let them roll the dice again after they finished 1 round of the game. Does anyone have some suggestions? Here is the game rule: Both of them will roll the dice and the one who has higher score will play first. Then th...

2 hours later…
1:56 PM
Q: Node.js Dumbserver

gaazkamDumbserver, or the simplest workable HTTP server. It is supposed to operate in the 'traditional' way, that is, mapping paths in requests to the directory structure. Why did I write it: I needed a simple development server for a website I'm trying to make. Instead of using Express or something lik...

Ryan Donovan on September 13, 2021
At this point, most software engineers see the value of testing their software regularly. But are you testing your data engineering as well?
2:54 PM
@L3n Where do you create your A and B dependencies? Where do you create your factory? Where do you bootstrap your entire application?
@L3n As a complicated example, you can check how I initialize dependencies here: github.com/Zomis/Games/blob/main/games-server/src/main/kotlin/… . Everything that is needed is somehow passed into other classes. Passing both the A and B dependencies to the factory would make sense if that's all that's needed to create the other commands.
However, I would also like to ask how/when/where these commands are used? Are they created and used at the same time, or are they created much much earlier than being used? Or what happens? My impression is that it's some kind of console commands, i.e. write something in stdin and it gets interpreted as a command which is then executed?
3:11 PM
Q: To scale or not to scale in regression and classification algorithms

Nad DebI'm a new DS student, and I get the basic concept of Standardisation, whilst I was learning we used StandardScaler in some algorithms, and not in others on the same dataset, and I'm still confused as where and to use it. I have other categorical features selected for the classifiers. Could you p...

Q: placing store and update logic in laravel 8 form request

Zikri MunandarI want some opinion about my code that placed store and update in laravel 8 form request make function is for storing the data and the update function is for updating the data <?php namespace App\Http\Requests; use App\Models\Admin; use Illuminate\Foundation\Http\FormRequest; class AdminReques...

3:36 PM
Q: Bad performance of a Graph Algorithm

myTest532 myTest532I implemented a solution for the problem below, but its performance is not good. I know I can find the solution online, I'm trying to understand what is causing the bad performance in my code Problem: You have an undirected, connected graph of n nodes labeled from 0 to n - 1. You are given an arr...

Q: Java grouping based on date and counting

Sandeep NairI have an use case where I want to see how many slots have been used for a date in a restaurant. The slot can be deducted based either number of diners or per booking. Also I have to cater a case where a booking is made for multiple dates and then i have to consider those dates as well when check...

Q: Best Practice for Button Event Handler

AustinI have a button btnSearch and the event handler btnSearch_Click inside my asp.net web application. (certain variables/controls have been renamed to generic variables) protected void btnSearch_Click(object sender, EventArgs e) { string log, tow, vin; n1 = txtNum1.Text; n2 = txtNum2.Tex...

3:50 PM
4:25 PM
I just saw a link at the end of this answer to a list of words, which I hadn't seen before. I wasn't familiar with the domain so I checked out the main page - it has some great animated gifs
I noticed this humorous list of quotes from children (perhaps from exams?) and used my in-browser Google Translate plugin - it did fairly well
> There are four symptoms of a cold. Two of them I forgot and the other two are too famous to name.
5:21 PM
possible answer invalidation by bobinthebox on question by bobinthebox: codereview.stackexchange.com/posts/267957/revisions
Code Reviews? .. — Robert Harvey 28 secs ago
@Duga rolled back
5:42 PM
Q: Improving my implementation of a unique_ptr - PPP Stroustrup book

bobintheboxThis question is an improvement of this one here: Implementing a unique_ptr - PPP Stroustrup exercise Here's my new code, following the suggestions by @JDługosz. I agree with the fact that T* operator is much better than T *operator, but the code formatter of VSCode does this automatically, I'll...

6:32 PM
Q: Typescript Maybe functor

samfrancesI have been trying to implement a version of the Maybe functor in Typescript. I'm looking for feedback on whether I can improve the type safety of my implementation. I'm not particularly happy that types like Just<void> or Nothing<number> are not ruled out by the type-system, but I can't see any ...

1 hour later…
7:57 PM
If you are looking for suggestions to improve working code, try codereview.stackexchange.com. — chepner 53 secs ago
@CodeMaster If there's nothing wrong with you're code and you're just looking for a code review, then codereview.stackexchange.com is the site to go to (as long as you follow their rules). — Random Davis 12 secs ago
3 hours later…
11:17 PM
@Dijkgraaf - yea, I checked for atag on codereview and didn't see one. I basically just wanted a sanity check on my idea. — Jeremy just now

« first day (3054 days earlier)      last day (1041 days later) »