« first day (3141 days earlier)      last day (43 days later) » 

12:00 AM
REFRESH! There are 7959 unanswered questions (89.2456 answered)
12:14 AM
Q: Hot Dog Cookout Calculator

Jims-RcHiii... Can you please check the code and see whether I might have done a mistake ? Beginner's eyes can be misleading quite easily. I feel like there's something wrong in this solution. I can't figure out what. so please check the solution and let me know. keep in mind i'm native sinhala speaker...

I like this and would suggest separating seach env into it's own file and then include them here, esp if you use git and code review system. Keeps things tidy. — Sgnl 11 secs ago
> I'll tell you what I'm doing. I want to buy eight hot dogs and eight hot dog buns to go with them. But no one sells eight hot dog buns. They only sell twelve hot dog buns. So I end up paying for four buns I don't need.
@SᴀᴍOnᴇᴌᴀ I like how he takes 3 packs of buns... he only needed 2 full ones
I've cut a hamburger patty in half and put it into a hot dog bun to use up the bun
12:32 AM
Yeah we're normally left with left over buns too. I think the film's being ironic here since 8 + 8 + 8 = 12 + 12
12:57 AM
This is not a code review site, so this question is off-topic, but your solution is not bad. — Selcuk 23 secs ago
Q: I can't get the value of the window dialog fields using GetDlgItemText

edw3I try to read values from fields of a window dialog. In the dialog configuration I have this: #define IDC_SYMBOL 8011 #define IDC_SHARES 8012 dialog snapshot picture this is my simple code tried: import win32gui,win32con wT="my_dialog" dlg=win32gui.Find...

1:16 AM
You are welcome. It is not a site to ask any question. There is a reason there are different sites in the Stack Exchange network for asking different types of questions (such as codereview.stackexchange.com). — Selcuk 46 secs ago
1:30 AM
Q: Efficiently calculating perfect powers in Haskell

jdkleuverI'm trying to calculate perfect powers to solve this code wars challenge: https://www.codewars.com/kata/55f4e56315a375c1ed000159/haskell The initial brute force approach where I check the digits sum for every number could only get up to the 11th term in the sequence in reasonable time. I was able...

1:55 AM
Q: Leetcode 322: Coin change with 2 programming languages produces 2 different results

Prashin JeevaganthI am trying to solve Leetcode Problem 322. Here's the description quoted from the site. You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the fewest number of coins that you need to make up that a...

2:42 AM
Yes, and you said you have working code that is slow, but you have working code. It is not a question about fixing code, it's a question about optimising it. Code optimisation is more on topic for Code Review. — Llama 38 secs ago
3:15 AM
possible answer invalidation by mrkgoh on question by mrkgoh: codereview.stackexchange.com/posts/270733/revisions
1 hour later…
4:40 AM
Q: Tic Tac Toe confusion

mixxiDI am just but a newbie to this coding world. sorry if my terminology is up to par. I’m still learning. I decided to embark on mastering Python and my first project is a tic tac toe game. Go figure:) I used a little of what I learned on youtube and from community boards to come up with the code. S...

5:29 AM
5:51 AM
2 hours later…
8:06 AM
Q: Output if a word is a palindrome or not in C++

Manya GargI'm a newbie programmer and was given a task to find if the input word is a palindrome or not. Now, I've written the program to my understandings but would like to know how y'all will solve it. Also, enlighten me if there are any errors in my program or any other way to make my program more effec...

Q: SQLite C/ADO VBA library with reflection

PChemGuySQLite C/ADO VBA library with reflection The SQLiteCAdo library is a VBA middleware facilitating access to SQLite databases. Its two subpackages provide alternative connectivity options: via ADODB/SQLiteODBC and directly via the C-language API. My earlier project, SQLiteDB, is the predecessor of ...

2 hours later…
9:52 AM
Q: Is it OK to ask for review on exercise solutions that have been asked previously?

user1984I'm learning Rust and solve the problems/exercises from the book of Rust which have been solved by thousands of learners and posted on here by quite a few. Last time I posted my code I received quite good feedback and learned a lot from it. But when I was posting my question, I noticed a lot of s...

10:34 AM
Q: Implementation of Dynamic Array with allocators and C++20

PavelDevTo train my skills in C++, I decided to implement the well-known "Dynamic array" data structure on my own. I realized early on that using pointers or smart pointers is wrong, as it leads to calling default constructor on reallocation. A naive approach for the push_back function would include: T* ...

11:26 AM
I’m voting to close this question because it belongs to codereview.stackexchange.comderpirscher 58 secs ago
11:57 AM
Welcome to Stack Overflow. Please take the tour and read How to Ask. What does "the code is breaking" mean? Note that open-ended code review is off-topic here. We need a specific question. — Chris 30 secs ago
12:12 PM
Q: array with random values between 1 – 20,Find and print the largest value in the array. Tip:

nahom estifanos/*Write a program that declares an integer array of size 100. Write for loops to carry out the following operations: i. Initialise the array with random values between 1 – 20 ii. Print all values in the array iii. Find and print the largest value in the array. Tip: assume the first value in the a...

12:23 PM
Requests for improvements to working code go to Code Review. One note is that your version allows a chain of readers to lock out a writer indefinitely. — Raymond Chen 5 secs ago
12:38 PM
If we see something like "*(*pps++ + i) + i" during a code review, the review session will be closed immediately and a note is send to HR... Even if it is funny to write such code,it is unreadable and operator precedence must not by fully in every developers brain. Typically compilers emit warnings to set braces... My hint: Stop coding this way! — Klaus 27 secs ago
1 hour later…
1:51 PM
Q: What is the correct way to utilise a function that returns JSX?

Utkarsh PantI wrote a function that returns some JSX, inside a class component, as follows: billingPendingMarker = () => { const { classes } = this.props; return ( <svg className={classes.marker} height="50px" width="8px"> <rect x="0" width="8" height="50" rx="4"...

Q: This is C# code of dice to switch turn between 2 players. How can I make this C# code from 2 Player to 4 Player?

Kapil KhatikThis code is for switching turn on 2 players dice play, I want to modify it for 4 players but I am unable to do it. Can anyone help public class Dice: MonoBehaviour { private Sprite[] diceSides; private SpriteRenderer rend; private int whosTurn = 1; private bool coroutineAllowed = true; // Use ...

2:16 PM
Q: Alternative/modified approach to the problem needed | Beginner level

zаѓатhᵾѕтѓаbelow is my approach to this problem: An automated teller machine (ATM) or cashpoint allows customers to withdraw money in £20, £10 and £5 notes. The machine always dispenses the minimum number of notes. Write a program that would control the actuators dispensing notes from a withdrawal request. ...

2:40 PM
Q: Wrapper around SignalR's implementation

nopI made a web socket client wrapper using SignalR's implementation, but there are some downsides that I want to improve. CancellationToken's implementation is wrong/incomplete ReadMultipleMessagesAsync is parsing messages ending with (byte)'}', which is kinda wrong, because it removes the precedi...

3:05 PM
Q: How to elegantly read string with delimiters?

LearpcsFirstly consider this code: #include <iostream> #include <set> using namespace std; int main() { const char delim = '\n'; char inp; int cnt = 0; multiset<char> m1; while (cin.get(inp) && cnt != 2) if (inp == delim) cnt++; else m1.insert...

3:36 PM
Eira May on December 09, 2021
How many bug fixes does it take to set a world record?
Perhaps this would be a better fit for Code Review (which is another Stack Exchange community). — John Coleman 34 secs ago
3:54 PM
Q: Python Library for Random Collections

Akash PatelI created a small library Python library to randomly create primitive types and collections. The primitive types are int, float, and string. The collections are tuples of 2, tuples of 3, a list, a 2d list, a set, and a dictionary. The odds are all equal in the random library. Notably, the collect...

Hi, your post should only contain one question, so you should probably remove the second two questions. I also second the suggestion to check out Code Review. Once your code is functional, you can post there about how to improve it — C_Z_ 21 secs ago
4:19 PM
Q: Web Scrapping data.cdc.gov for Covid-19 Data with Selenium in Python

NiniI'm attempting to scrape data.cdc.gov for their covid-19 information on cases and deaths. The problem that I'm having is that the code seems to be very inefficient. It takes an extremely long time for the code to work. For some reason the CDC's xml file doesn't work at all, and the api is incompl...

5:03 PM
Q: Maximizing Efficiency of Collatz Conjecture Program Python

GhullMy question is very simple. I wrote this program for pure entertainment. It takes a numerical input and finds the length of every Collatz Sequence up to and including that number. I want to make it faster algorithmically or mathematically (i.e. I know I could make it faster by running multiple ve...

Q: Set python variables for each property in a dictionary

David GardI'm fairly new to Python, and what I wish to do is parse a SemVer version and set major, minor and patch as variables. In this case, it's really not a hassle to explicitly define the three variables, but I'm wondering if there is a better or more efficient way to do this? In this example there ar...

2 hours later…
7:12 PM
Q: Dynamically allocating a 3D-array in c

AlfI want to use dynamically allocated data, corresponding to a 3D array in a C program. After using the data, I would like to properly deallocate the data again. My approach is as follows: #include <stdlib.h> #include <stdio.h> double ***arr3D_d( size_t dim1, size_t dim2, size_t dim3 ) { size_...

Hey @KashifFaraz , I'm excited that this 10yo post is still worthwhile for you. Thanks for the code review :) I would probably look for some ready made solution nowadays. — Rbjz 41 secs ago
7:34 PM
@CharlesDuffy. This is arguably not golf, and off-topic for code review. Improving transformation of datastructures seems on the right side of the on-topic threshold. — Mad Physicist 52 secs ago
Q: Eulerian Circuit for directed graphs

Inter VeridiumSummary It's been quite a while since I last touched algorithms and Python. This piece of code finds the eulerian circuit for the directed graph. A bit convoluted and its structure leaves much to be desired, but works well for small size directed graphs. I decided not to use NetworkX or other thi...

Q: Snip alias the Gnome Screenshot utility

Alex AngelOn windows, the screenshot utility is called Snip, but on ubuntu 21.10 it's called Screenshot. Because of muscle memory, I regularly type Snip in the gnome applications search and it fails to find the application I'm looking for. Below is the fix to make "Screenshot" appear when Snip is typed: s...

8:19 PM
Looks ok to me: f"{math.ceil(dt.day / 7)} {dt.strftime('%A')}". It's up to you to change the number (2) to a string (2nd). You can write up some code and when you get it working, post it on Code Review. — Johnny Mopp 15 secs ago
Q: Basic chess engine

jdtI'm playing around with a chess engine that I wanted it to know all the rules such as pawn promotion, en-passant, and castling. Currently, I'm using a basic Negamax for the AI but I plan to improve at a later stage. I have not spent too much effort on the interface as I plan to make it compatible...

8:36 PM
StackOverflow is not a Code Review site. There is a Code Review StackExchange site, but you'll have to read their rules before posting, unlike what you did here. — Random Davis 7 secs ago
8:55 PM
@RandomDavis If a user has not read rules when posting on SO why would you expect the user to read the rules of another site? Only suggest sites when you know the question would be a good fit - "Be familiar with the destination site". — Peilonrayz 15 mins ago
@Peilonrayz I did not say this question would be a good fit there. I implied that they might be able to get help at that site, but that they'd have to read the rules regardless, and follow them, unlike what they did here. I specifically said that they should read the rules, so I'm not sure what else I could say. I purposefully didn't link the site because, again, I'm not saying or implying that they should re-post this question there. — Random Davis 3 mins ago
2 hours later…
10:33 PM
I have not even used continue Your code works then maybe go to codereview ? If I had wrote what you did my IF would have flags and then I would build an pscustomobject with the flags and not have the continuedcaz 55 secs ago
Glad to hear you're not alone, hopefully you all can fix it. Also, I know this isn't Code Review and I'm no complete expert yet either. But I thought I would suggest a few things as you mentioned you're a first time programmer. Your Program.cs file is pretty cumbersome, consider refactoring your code and splitting up your methods into easier to manage classes. Also, I noticed you have some repetitive code, for example in your ReadItems(), ReadSales() and SaveItems(), SaveSales() methods. — The2Step 27 secs ago
@dcaz that link seems to just explain 'continue', there are more legit uses for it but it works in this example just fine and is being used correctly. Is there a site for code review I can use ? — Mike Q 56 secs ago
11:19 PM
Q: 'Continue' opposed to 'ElseIf' in some cases

Mike QI found the following more readable, opposed to trying to parse out if/elseif. What are your thoughts about this ? Is there a better way ? Example code where I want to check a bunch of things about an EXE on a remote system before replacing it with a different version: # Testing Section - Reachab...

11:54 PM
While questions about coding style are indeed better asked on [codereview], do note that you should only ever use continue (and break) inside a loop statement, a switch statement, or a trap statement - see this answer. — mklement0 8 secs ago
I’m voting to close this question because it should be asked on codereview.stackexchange.commklement0 51 secs ago

« first day (3141 days earlier)      last day (43 days later) »