« first day (2735 days earlier)      last day (38 days later) » 

12:00 AM
RELOAD! There are 7082 unanswered questions (89.7318% answered)
12:57 AM
Q: Refactoring my hangman game

Phinn Galacticaanswer = input("what's the word") answer_list = list(answer) #list version of the original word presentation = [] for i in range(len(answer_list)): presentation.append("_") #makes a list that shows the progress of the player during the game incorrect = 0 #number of allowed guesses completion...

Seems like a good question for the code review community? — Michael Welch 43 secs ago
1:12 AM
Q: Thread Synchronization - CPU Usage exceeds 200 - C program

user232489I have a working program that reads user input keys and echoes them back to the screen using the producer/consumer paradigm (the project requires you to use threads). While this program does work, it is unfortunately very inefficient. When I run the 'top' command, the CPU usage is over 200. Any s...

1 hour later…
2:34 AM
Q: Getting Stack overflow Exception while sorting an array with 15000+ elements

Mahmudul HasanThis is my quick sort algorithm implementation. I'm getting System.StackOverflowException with the message 'Exception of type 'System.StackOverflowException' was thrown.' while trying to sort an array larger than 15k elements. I actually checked with 15000, 19000, 20000, 30000 elements, and the e...

3 hours later…
5:28 AM
First, you should insert a minimal reproducible example, not a link from an external source. Second thing, SO is not a code reviewing site. If you are having some issues in your code or want to solve a problem then you are welcome to SO. — Praneet Dixit 49 secs ago
5:56 AM
6:16 AM
Q: I'm trying to write a function that returns the remainder of polynomial long division

Renzo EspinozaHow can I perform long polynomial division in python, returning the remainder and when both polynomials are dictionaries where the key is the power of the term and the value is the coefficient of the term? There is already a function that multiplies terms. This is all within the Polynomial class....

7:05 AM
Q: Feeding stateful and stateful-effectful computations into each other

CactusI am writing code that runs a simulation in an interactive way. The building blocks are: runStep :: I -> State S O runWorld :: World m -> O -> StateT W m I Note that the world has some state W but is also allowed to have effects of type m. My question is about the function that feeds runStep and...

7:25 AM
This should be posted in Code Review not here. Also there is no point in making claims of how good your code is without metrics for proof. — freeflow 41 secs ago
8:05 AM
possible answer invalidation by Enrico on question by Enrico: codereview.stackexchange.com/posts/251269/revisions
1 hour later…
9:16 AM
If it does the job, then this is not the place for this question. You might be looking for Code ReviewTomerikoo 14 secs ago
9:29 AM
@Feeds No problem
9:56 AM
Q: Deleting a child of aggregate root in DDD

AhmadConsider this code, that uses EF Core wrapped inside the unitOfWork to manage the database: Route("{aggregateRootId}/child/{childId}")] public async Task<IActionResult> Delete([FromRoute] int aggregateRootId, [FromRoute]int childId, CancellationToken cancellationToken) { var aggregateRoot = a...

10:20 AM
Q: A Summation Function For Boost.MultiArray in C++

JimmyHuThis is a follow-up question for A Summation Function For Arbitrary Nested Vector Implementation In C++ and A Summation Function For Various Type Arbitrary Nested Iterable Implementation in C++. I am trying to implement a recursive_sum function for the Boost Multidimensional Array Library. The pu...

11:15 AM
@DavidDale I had the same doubt! So I asked if it was correct implementation of bahdanau attention on Code Review: HereNITIN AGARWAL just now
11:44 AM
@CaptainObvious MRC.
12:06 PM
Never mind.
Yea, that's much better.
Ok, I thought unitOfWork is a well defined concept for you, but if is not I will describe it. — Ahmad 20 mins ago
Fresh users and their assumptions, nothing new.
12:29 PM
for reviews of working code there is codereview.stackexchange.com. Asking for "the best way" is a bit too vague and too broad — idclev 463035818 10 secs ago
@Mast I think that it still isn't all the code but they tried.
@pacmaninbw Yea, well, that risk is theirs.
Can't save everyone 100%
1:01 PM
I’m voting to close this question because this belongs on codereview.stackexchange.comRandy Casburn 26 secs ago
1:52 PM
Yes, the if statement is better - if you provided that feedback in a code review I would certainly refactor this. On the other hand, not all side effects are disasters - this code is completely isolated. — Randy Casburn 28 secs ago
2:23 PM
Maybe codereview.stackexchange.com would be a better place to find this help? This is quite a general problem for StackOverflow and a longer, more in-depth answer might help you more. — Druckles 31 secs ago
2:49 PM
Q: Is it possible to make it more readable and easy to understand?

dftd dftdHere is method to calculate age given the birth date in the format YYYYMMDD. function getAge(dateString) { var today = new Date(); var birthDate = new Date(dateString); var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if...

Q: Check if we find new value from a request

ProtractorNewbieI have created a script where I add a timestamp to each value that has been found with a code that I have written: import random from datetime import datetime, timedelta from typing import Dict, List import time class RequestFilter: """Tracks requests and filters them to prevent hammering."""...

Q: Collision between two Images

innominateArtI'm making a game. There is a turtle and lots of platforms it can walk on. It walks on its own and you can change the direction it is walking. However, some problems are occuring with the logic I implemented. I had to make 2 classes (one for the turtle and one for the platforms). class Turtle { ...

> However, some problems are occuring with the logic I implemented.
I have asked the OP if the code is working as expected.
@pacmaninbw Yeah pretty much
I also work from home permanently now so I got an old CR-V that's been in my family since '99 to drive when I need groceries / etc.
Got a raise with my new job and don't go out to lunch as much, nor spend as much on gas, and I'm gonna ditch the car too lol
Then I need to sell my bikes and make space in the garage
Q: Code that lists and inserts data to database

Petter HauglandI'm trying to make some methods more reusable and have now three classes that work together: AbstractDao (the superclass), MemberDao (extends AbstractDao) and ProjectTaskDao (extendsAbstractDao). The method insert is very similar in both subclasses with some minor differences: insert method in Me...

@DerKommissar Isn't it a little early for spring cleaning?
They go up for sale in the spring
March or so
I need to finish restoring the one
Then paint and sell it
Motorcycles or bicycles?
3:20 PM
Good minds think alike.
Two '88 Yamaha Venture Royale's
Only have enough good body parts to restore 1
But I'll probably build a custom out of the other
Do you make money on this kind of thing?
No but it's fun
I've had these for 4 years, time to get them going
Last time I saw a picture of your garage those weren't there.
One space had room for a car.
Yeah I still have the car in the garage, and the two bikes
3:25 PM
You may want to ask this on Code Review instead. — usr2564301 59 secs ago
@pacmaninbw ^^^
Is the Honda the car you are selling?
he said "CR-V" - that is an SUV, not a sedan (e.g. that Accord)
head slap
Yeah, the Accord is the one I'm selling
It's a 2018 with 12k miles, the CR-V is a 1999 with 286k miles...there's a reason one is in the garage and the other is not lol
3:32 PM
man - I haven't looked at late-model Accords and Civics enough to be able to distinguish between the two
I need to start looking at trucks next winter
@SᴀᴍOnᴇᴌᴀ Difference is basically the Civic looks more "playful" than the Accord.
Accord looks more aggressive
That's what the Civic of my era looks like
I love the Accord (it's a Hybid and the fuel economy is awesome) but I don't need one anymore
I've left the house on average once a week for the last 2 months
I had an '89 accord from 2004 - 2006
I need to verify towing capacity on the Ridgeline, but when I get my truck I might get one of those. Honda's are great cars, I love all of mine.
Yeah Ridgeline is too small for what I need, I need a 13k towing capacity, Ridgeline caps at 5k. :(
What will you be towing?
3:36 PM
Probably gonna end up with an F250/Chevrolet 2500 or F350/3500.
The BMW?
28' race trailer with BMW 330i
Trailer is ~5k lbs, car is about the same, plus equipment and "wiggle room".
My Z4 is less than 2300 lbs.
Course I wouldn't want to tow anything with it. :)
I had a 94 ford explorer for towing.
I mean the BMW is 3200lbs, but I plan for bigger because we plan to have spare chassis
Realistically I could probably get away with 8k towing cap, but that pushes it tight.
I was going to suggest the LandCruiser, but the towing cap is 8100 lbs.
3:46 PM
I'm not really a Toyota person, I think they all look awful
Won't argue that one.
I forgot the Ridgeline is ~ Ranger, I thought it was comparable to the F150, kinda bummed.
I could get my old '85 F350 running, that would be a good trailer hauler lol
4:26 PM
@Muska, all code needs to be improved, if I look at my old code in a code review and my name is not on it I'm also thinking "what the... " google.com/…Walter Vehoeven 9 secs ago
Q: Distinguish between handwritten subtraction and compound fraction

Dhaval BothraI am working in a project name "Handwritten Math Evaluation" SO what basically happen in this is that there are 11 classes of (0 - 9) and (+,-) each containing 50 clean handwritten digits in them. Then I trained a CNN model for it with 80 % of data used in training and 20 % using in testing of mo...

If you can put together a complete, working example of the design you're trying to improve, I would suggest posting it to codereview.stackexchange.com for feedback. — jaco0646 18 secs ago
3 hours later…
7:39 PM
This is completely off-topic for StackOverflow, you should know that by now. This might be on-topic on Code Review, but it sounds more like a blog post than a question, and the formers aren't on-topic anywhere on Stack Exchange. — Camilo Terevinto 44 secs ago
7:59 PM
@SᴀᴍOnᴇᴌᴀ The meta question you pointed to for this refactoring question does apply, the OP specifically stated he wanted to refactor it with functions. You might note that I didn't vote to close when I posted my comment because I wanted to wait and see if the OP would change the question to a review. I might VTC tomorrow. Do you agree with what I'm saying?
Q: Making code elegant, clean and optimized

O B.I have some piece of code that I already optimized, however I found that there is an edge case that I should handle and I am unable to make it elegant. char* data = get_data_from_queue(data); Album album; get_album(data, &album); if (get_album_vals(album) <= 0) { printf("Album doesn't exist, ...

8:21 PM
@pacmaninbw yes I agree with that
8:38 PM
Does your current code work? If so, and you're willing to provide the code in the question (not just a link to code), please consult the help center to see if your question might be on-topic for Code Review. — Heretic Monkey 22 secs ago
9:21 PM
Q: Parse backslash-delimited hierarchy path into separate columns

User1973I have rows in a database with a hierarchypath column. The values in the column are hierarchy paths with up to four levels: HIERARCHYPATH --------------------------------------------------- FACILITIES \ FIREHALL \ PLUMBING FACILITIES \ PARK ROADS \ GRASS/TURF BLVD MAINTENANCE ROADS \ SIDEWALKS \...

Q: Implemented z score functions that seems not give the correct answers

Paulo Sergio SchloglI have looking for some implementation of a z score function and found out this paper: article According to the paper the variance is like that: def get_variance(kmer_list, kmer_counts, kmer_exected): variance = defaultdict(float) for kmer in kmer_list: suffix = float(kmer_counts[...

9:50 PM
@CaptainObvious CNWAI
10:20 PM
It's interesting, about a quarter of my VTCs are directly from this chat room and not from the Close Queue.
10:34 PM
Q: defining global constants in c++

Tom GebelLets say I wrote this little globals.h file with the intention of including it in all the .cpp files in my project that need the constants. #ifndef GLOBALS_H #define GLOBALS_H #include <string> constexpr float GLOBAL = 5; constexpr int GLOBAL_2 = 10; const std::string GLOBALSTRING = "fdsf"; #en...

1 hour later…
11:47 PM
Q: Using .text or .value for a TextBox in VBA

AlbinVBA hast to two ways of reading the value of a TextBox: result1 = UserForm1.TextBox1.Value result2 = UserForm1.TextBox1.Text I assume .Text will always return a string, but what exactly is going on with .Value? Since the content of a textbox is (presumably) a string it would just returns...


« first day (2735 days earlier)      last day (38 days later) »