« first day (2884 days earlier)      last day (1431 days later) » 

00:01
RELOAD! There are 7470 unanswered questions (89.4940% answered)
0
Q: A recursive_transform Template Function with Unwrap Level for Various Type Arbitrary Nested Iterable Implementation in C++

JimmyHuThis is a follow-up question for A recursive_transform Template Function Implementation with std::invocable concept in C++ and A recursive_transform Template Function Implementation with recursive_invoke_result_t and std::ranges::transform in C++. Besides the version using std::invocable, I am at...

Related: Snake in assembly , what datastructure to use? - I wrote up some ideas for algorithms / data structures for keeping track of the tail, and which order to "pick up" squares in the order you moved. (Possibly separate from collision detection with wall or snake). Beginner's snake game using PyGame has the interesting idea of growing the snake by adding a new element to a queue (e.g. circular buffer) at the same coordinates as the current tail. — Peter Cordes 38 secs ago
 
3 hours later…
03:25
0
Q: How to remove elements with same id?

Dean Yankee Jabiliimport java.util.Scanner; import java.util.*; import java.io.*; import java.util.ArrayList; import java.util.Arrays; public class Account{ private int id; private String bc; private String bd; private String customerName; private String customerAddress; ...

03:51
0
Q: A Stateless Immutable Event-Driven DDD Pattern in Kotlin

ZymusI've been interested in making fully repeatable, reproducible game states. This led me into the world of DDD, and specifically, the concept of Aggregates + Event Sourcing (although that's not necessarily a DDD concept). In this context, the state of the Aggregate is reconstituted from a sequence ...

 
5 hours later…
08:55
0
Q: MySQL Query That Calculates Recipe Nutrition

tharveysterI have a working query that returns the nutrition information for recipes in a database. Since I'm fairly new to MySQL/PDO, I was wondering if this query is using best practices, or if there was a better way it should be implemented. $query = $con->prepare("SELECT * ,SUM(((((b.amount + b.frac_amo...

 
1 hour later…
09:59
This question might work better on our sister site, [Code Review Stack Exchange](codereview.stackexchange.com). Off the top of my head, you can probably combine most of those printf calls. — Tim Biegeleisen 45 secs ago
Read about what questions are appropriate for Stack Overflow. Your code already works as expected, so I would ask it on the Code Review Stack Exchange. — Andy Sukowski-Bang 30 secs ago
10:34
I would post this question on the Code Review Stack Exchange, because your code already works as expected. — Andy Sukowski-Bang 13 secs ago
0
Q: How to merge two lists (NOT array) in Pascal

LenaaI want to write a program in Pascal which would merge two lists. I know that I have to implement both lists first and then add one to the other, but I don't know how to. program liste(input, output); {edits a list} type tRefListe = ^tListe; tListe = record zahl:integer; ...

11:27
0
Q: Scraping game data from web

PyNoobMy code currently: import os import pandas as pd from selenium import webdriver from tabulate import tabulate from datetime import datetime import time from bs4 import BeautifulSoup as bs start = datetime.now() browser = webdriver.Chrome() class GameData: def __init__(self): self...

11:53
-1
Q: based on the class and struct with pointers

Aryan SaxenaWrite the following class called ‘Student-Data’ that uses a pointer to store personal data of a student who studies in a University. The class has two types of information: common data to all the students like name of the University and name of the section. For each student there is a personal da...

0
Q: Tokenize arithmetic expression in C

Andy Sukowski-BangThis program tokenizes an arithmetic expression specified in infix notation. It is one of my personal projects and I would love to receive expert advice. After compiling, you can run the program with one command-line argument: $ tokenize <arith_expr> This is an example of running the program: $ ...

@CaptainObvious Asking us to code their homework for them.
12:27
In case anyone is interested in this question, with the advice of Andy, I asked the same question in Code reviewAmirhosein Rezaee 19 secs ago
12:43
0
Q: Asking advice on optimizing a while loop

Amirhosein RezaeeThis is part of an algorithm regarding the RKF method: t = self.a x = np.array(self.x0) h = self.hmax T = np.array( [t] ) X = np.array( [x] ) k= [0]*6 while t < self.b: if t + h > self.b: h = self.b - t k[0] = h * self.f(t, x) k[1] = h * self.f(t + a2 * h, x + b21 * k[0...

0
Q: Python: separation of concern User Model and User DB

Pierre-AlexandreI am working on a small side-project since a couple of weeks, I am using Flask but trying to use as less as possible libraries and no ORMs (for learning purposes. I am currently working on the User service on my application and currently stuck in the registration email confirmation part regarding...

13:07
I’m voting to close this question because it might belong to another Stack Exchange site - codereviewbaduker 33 secs ago
What you're effectively asking for here is to review your code and suggest improvements. This is off-topic here on stackoverflow. Please visit codereview and do another round of How to Ask. — baduker 30 secs ago
14:02
Monkinh
 
2 hours later…
15:41
0
Q: Python/Mongo - Generating dummy data

AviCI wrote below piece of code generating dummy data loaded to MongoDB. 2 issues : 1.customer class has subscriber class so it nested with one level customer--> subsciber. I think i'm not doing right: self.subscriber = Subscriber().returnJson() it does working , but what if need to add another clas...

 
2 hours later…
17:23
1
Q: fgets without the line return

Antonin GAVRELWhat do you think of the following function to offer an alternative to fgets, looking for insights about portability, safety, readability and performance: #include <stdio.h> #include <errno.h> int sc_gets(char *buf, int n) { int count = 0; char c; if (__glibc_unlikely(n <= 0)) ...

0
Q: Function for checking if a string is a path or an URL be improved

ProgrammerI made myself a function to check if a string is a path or an URL: import os def isPath(s): """ @param s string containing a path or url @return True if it's a path, False if it's an url' """ if os.path.exists(s): # if a file with name s exists, we don't check any further and...

17:43
I just posted a function to have fgets without the new line if you want to avoid parsing your string twice: codereview.stackexchange.com/questions/258772/… your insights are welcome! @MikeCAT and anastaciu — Antonin GAVREL 9 secs ago
0
Q: My First Tic Tac Toe

user9829609I made this game and it seems to works except the part that checks if all cells are filled. I just don't know how to write it. Also I know that this game can be written much better but due to lack of experience I don't know any better way to code this game def start_game(table, i): cor = int(...

18:29
"Feel right", "recommend", and "better" are extremely opinionated; but if this current implementation is working, perhaps you're looking for a codereview.stackexchange.com. — jaco0646 27 secs ago
There's quite a bit of room for improvement in your code. Don't #include <bits/stdc++.h>, unnecessary use of this->, lang should be longitude, avoid std::endl, in gen_random() you should call resize() instead of reserve(), and so on. Once you get a working program, consider posting it on Code Review. — G. Sliepen 54 secs ago
If it does work but you like to have a code review, you'd better post it on CodeReviewJeroen van Langen 15 secs ago
19:04
0
Q: Print receipt from cash register in Python

OmarProblem Output a receipt of purchased items. Inputs: products_text_path: Products are found in a text file in <barcode>:<name>:<price> line format. purchased_items_set: The purchased items are given as a list of integer barcodes. Same item be found several times. discount_rules_text_path: There ...

Thanks, I didn't know CodeReview existed, i will post there! — Frivolimous just now
19:55
0
Q: Am I correctly implementing the Factory Design Pattern?

FrivolimousI'm trying to use correct design patterns and naming schemes to improve my formal coding abilities. I have a situation I could use some help with. I'm trying to make a Global Factory Service that constructs various Models based on data that is organized in various Database files. I'd love some ...

20:20
0
Q: C fgets_line of arbitrary length

AnotraThis is meant to be a drop in replacement for getline as it's not crossplatform. I am trying to do as minimal work as possible in here including only calling strlen once at the very end to calculate the size of the final block. returns -1 for error, 0 for EOF, 1 for success The way it works it by...

20:46
0
Q: JS Mandelbort Set Viewer

TeiemI am coding a JS Mandelbrot Set viewer and am looking for suggestions on how to improve my code. I already did some cleanup and got the execution time from 7s to about 160ms on my computer. Some info about my Code: Complex numbers are stored as an array where the first number is the real part an...

21:11
0
Q: Redux Toolkit Structure with TS

AlexanderI've just taken the leap over to RTK instead of 'vanilla' redux and am blown away by how much less code I need to write. I'm not entirely sure how to structure my slices, however, and figured I'd ask for a small code review so I do not accidentally start breaking conventions from the start. This ...

21:58
If you want feedback on complete and working code, you might want to post it over at Code Review. — jwvh 10 secs ago
22:27
0
Q: Tetris in python

dylanSo i've been working on Tetris in python. The code is not finished but it does run some basic tests. I have showed several people my code on Disocrd and one person had a a lot to say about my code. He was confused as to why i have two classes for Tetris pieces. He didn't understand my wall-kic...


« first day (2884 days earlier)      last day (1431 days later) »