« first day (3302 days earlier)      last day (698 days later) » 

12:01 AM
REFRESH! There are 8076 unanswered questions (89.3052 answered)
 
12:59 AM
@SᴀᴍOnᴇᴌᴀ Santa Says you are welcome. However, that was answered by a current moderator.
 
1:54 AM
0
Q: Is it better to extend from EventTarget or implement EventTarget?

Chris_FI guess this really just boils down to a question of inheritance vs composition. I've typically heard people advocate for composition more, but I am wondering if that holds true in an example like this. The example is a basic type that will accept DOM events including a custom "poke" event. Setup...

 
2:44 AM
0
Q: Simple non balancing indexed binary search tree

ha1234The following code represents a simple indexed binary search tree of integers. The insert method inserts an int. The indexed lookup looks up the ith smallest element (0 indexed). I'm trying to write C++ that is idiomatic, clean, modern, and efficient in that order. Can people give me pointers? #i...

 
 
2 hours later…
4:17 AM
 
4:43 AM
Monking
 
 
2 hours later…
6:23 AM
I may also consider asking on Code Review. The folks over there love to review code as well. As you continue in your coding endeavors, I think you may find their forums a useful addition to your toolbox. — Take That 101 40 secs ago
Welcome to Stack Overflow. We don't take questions about code style or elegance here; please try Code Review instead. See How to Ask and stackoverflow.com/help/on-topic and stackoverflow.com/help/dont-ask for details. — Karl Knechtel 9 secs ago
 
0
Q: Show/hide depending on ID and Class

Liv StrawbridgeI have written some code that shows a div class, based on what ID is clicked. I'm a beginner, so not sure how to make this code compact, it seems way too long at the moment. Can anyone suggest a better way to write it please? Thank you in advance. $("#Thumb1").on("click", function() { $('.v1')....

 
7:21 AM
0
Q: Implementation of Concurrent List in .NET

AnonymousI would appreciate review of this implementation of the concurrent list that is, to my knowledge, currently missing in .NET Core. Requirements Thread safe Lock free Ordered Supports get and set by index Implements generic IList Acceptable performance and time complexity compared to regular IList...

 
7:47 AM
0
Q: Any tips for a Python beginner on this project? (outputting a variable based on the values of other variables)

EduardoPosted this on Stack Overflow and got recommended over here. I have, so far, found no errors in the code but it looks a bit complicated and I would like some feedback. This is my second project in my first ever programming course at college so my knowledge is very limited. You'll see that the cod...

 
8:02 AM
This question is better suited for codereview.stackexchange.com. — Chayim Friedman 43 secs ago
 
0
Q: Optimal algorithm for solving `subsequence with highest win rate`

Hamza ZubairProblem Inputs: 1. min length of subsequence 2. binary sequence outputs: 1. starting index of sequence 2. subsequence length The task is to find a subsequence from the given binary sequence with highest win rate. The subsequence should be at least of given min length. 1 = win, 0 = loss win rate...

 
8:28 AM
(a) It wasn't this way in the first revision; you just said "here's my config for people that will need it. (b) "How can I improve this config" is not a valid question for StackOverflow. Maybe for codereview.stackexchange.com. I'd suggest you to read How to Ask. — Chayim Friedman just now
C++ does not natively support reflection, so doesn't provide such a thing. Some frameworks (e.g. CORBA implementations) do support reflection, but depend on capabilities outside realms of C++ (e.g. automatic code generators) to provide a basis for that. In the end, you probably need to fall back on documentation (e.g. which says "if you add a member to this struct, change the serialize() function), trust in other developers to follow that guidance, and possibly administrative controls (code review, etc). — Peter just now
 
8:43 AM
(Re-asked on CR.) — greybeard 47 secs ago
 
9:02 AM
0
Q: CommonPrimeDivisors task from codility

Karol BorkowskiI'm working on the following task from Codility: A prime is a positive integer X that has exactly two distinct divisors: 1 and X. The first few prime integers are 2, 3, 5, 7, 11 and 13. A prime D is called a prime divisor of a positive integer P if there exists a positive integer K such that D *...

 
9:45 AM
possible answer invalidation by 200_success on question by Liv Strawbridge: codereview.stackexchange.com/posts/276669/revisions
 
10:18 AM
0
Q: email HTML in Gmail app on iOS 15.4 is rendering wrong

RebecaI have a table in my email and on every device and email providers works well, but on newest iOS gmail app the table is transformed. What could I change to improve this table? My code: <link rel="stylesheet" type="text/css" media="screen and (max-device-width: 480px)" href="shetland.css"> <!...

 
10:35 AM
possible answer invalidation by Joao Tavora on question by Joao Tavora: codereview.stackexchange.com/posts/276627/revisions
 
 
1 hour later…
11:50 AM
It works fine. Is it a good design? I don't think you've included enough details to be able to say. However, your snippet does not do: I place a child class reference into the object of parent class anywhere. Regardless, 'is this proper design' is inappropriate for StackOverflow; there are sibling sites for code review, though, you might want to paste a little more and ask over there :) — rzwitserloot 42 secs ago
 
12:24 PM
0
Q: Python function that shears image by n degrees while keeping the relationship between height and width

Ξένη ΓήινοςI am trying to find a method to shear/skew an image horizontally or vertically by n degrees (n ranges from -90 to 90 excluding the terminals) so that the result would meet the following conditions: The result would keep the size of the dimension that is not sheared, it means if you shear the ima...

 
1:14 PM
0
Q: Returning the other value of boolean enum

JayI have a class with a "mode" state. There are currently two modes and we are not likley to add more in the future. The class has a CurrentMode property, and a function to swap to the other mode. I have implimented this using another property called ModeNotInUse which returns the oposite value of ...

 
1:39 PM
0
Q: Creating a generic base class for singletons in Unity

JaySingletons can be very tricky to work with in Unity, especially when you dont want to give up on Monobehaviour features. Most examples I've seen make use of Awake to initialise, but this requires careful managing of script execution order, here is my attempt at a "lazy instantiated" (kind-of) sin...

0
Q: Is it possible to get the reference of the original variable in the frozenset according to the key?

Mechanic PigThere are frozenset in Python, but no frozendict or frozenmap. I tried to implement it (Don't care too much about class naming, because I want to try to imitate the standard library) with frozenset, which is almost perfect: from typing import Any, NamedTuple from collections.abc import Hashable, ...

 
2:12 PM
Guest Post on May 19, 2022
While the future may be a mystery, you can design software to accommodate future changes. But how much future-proofing gets in the way of good design?
 
2:24 PM
If the code works and you're seeking improvements, it's probably a better fit on Code ReviewDamien_The_Unbeliever 56 secs ago
 
3:11 PM
Monking
@Duga thats okay - code fence
@Duga rolled back
 
0
Q: Group list of objects into smallest possible number of sublists without exceeding maximum sum

XtremeBaumerI have converted my Java answer from this question into Rust. As I am new to Rust, I would like to know about what I could improve in my code. Mostly I would guess that I could improve on borrowing, references and ownership / lifetime. The original question aimed to "group objects into the minimu...

 
4:15 PM
Monking
 
 
2 hours later…
5:53 PM
0
Q: Asking for C++ advice based on a radix sort function

t1mur4trCan someone point out what possible edge cases/leaks/inefficiencies my code has and how they could be avoided/fixed. Basically, I want to know what mistakes I make so I can avoid making them in the future. I chose an LSD radix sort function as a sample for no particular reason. The function: //ar...

 
6:18 PM
0
Q: VBA custom functions run very slowly when used over a few thousand rows

hidp123I have the following VBA code (across three modules) to make UDFs to calculate sun & moon position data. The issue I'm facing is that they are very slow to run as I have over 6000 rows (over 10 years of sun/moon position data for multiple locations), and a sheet calculation takes ages when openin...

 
6:32 PM
If you are looking for ways to improve your code, rather than make it work, then codereview.stackexchange.com might be a better place. Trying to create a concise question for an open-ended goal is probably not going to give you all info you want. Make sure you read the site guidelines there first though, they are a bit different from those here. — Ulrich Eckhardt 1 min ago
Should we send Matt to Code Review so they can enjoy the joke, too? — Barmar 12 secs ago
 
7:08 PM
0
Q: static_new, is it any good or just to amaze?

user1095108Do you think this could be useful in some use-case? Maybe there's a better way to do this? #include <new> #include <type_traits> template <typename A, std::size_t N = 128> class static_new { A* p_; template <auto> static constinit inline A storage_; static constinit inline std::size_t ...

 
7:33 PM
0
Q: Generates all pairs(combinations of 2) up to a limit(exclusive) C#

Javier MunozAny improvements on this combination generator. Seen a lot of combination generators online, but none like this. Found pseudocode at: https://www.baeldung.com/cs/generate-k-combinations Fastest I could make, make it FASTER if you can. Also appreciate improvements in code structure and oop, fairly...

 
9:07 PM
FYI, this type of question is better served in Code ReviewCyanCoding 26 secs ago
 
9:42 PM
@pacmaninbw right - that is why I used the phrase "a similar category" (as opposed to "the same category"
 
9:56 PM
:D
 
10:52 PM
This is off topic for stack overflow. See what is on-topic in the help center. Perhaps try Code Review but check their posting guidelines first. — Peter Wood 28 secs ago
 
0
Q: Best way to plot a 2D vector field with radial symmetry in Python

MaxI computed a 2D vector field U = (u(x,y), v(x,y)) with radial symmetry, parametrized as (u,v) = a(r) (x,y) + b(r) (-y,x), where a(r), b(r) are given as solution of an IVP which I solved using Y = scipy.integrate.solve_ivp(..., dense_output=True), which yields a solution function Y.sol: r ↦ array(...

 
11:46 PM
0
Q: Text-based game combat function python. Are inner functions good practices compared to methods?

Jordan804I made a text-based game to learn python, since then I have tried to implement what I have found online to be "good practices", does this follow good practices? Also is there a way to escape the repetition of? requestAndValidateUserInput() if endCombat: return I need the retu...

 

« first day (3302 days earlier)      last day (698 days later) »