« first day (3820 days earlier)      last day (219 days later) » 

04:37
@KenWhite is there a non-programming reason that someone might need that information?
(genuine question; I don't really do embedded stuff, but my impression is that only a programmer would need this information)
@RyanM Maybe not, but is SO really intended to be a hardware specification site?
I think specific, objectively answerable programming-specific questions about hardware specifications are reasonable. Certainly more useful to programmers researching specific issues than a lot of questions we get...
I can't immediately find an MSO discussion on the topic
(input, as always, is welcome)
@RyanM But doesn't that open the door to general hardware spec questions? (Genuine question, not arguing.)
And isn't there a better site on SE for hardware spec questions, like electronics?
04:54
Yeah, maaaaaybe electronics.SE would take questions like this? It feels more focused on building of physical things than programming microcontrollers, though it does include "the writing of firmware for bare-metal or RTOS applications", which might be close enough?
I also pinged one of their mods in TL for a opinion on if it'd fit better there
Valid point that general hardware spec questions are probably off-topic and it might be a hard line to draw (memory alignment questions are probably fine; TDP probably isn't; is clock speed fine? who knows...)
@EJoshuaS-StandwithUkraine question will roomba
 
1 hour later…
06:59
Can someone review this answer and see if it adds anything to the existing answers or actually answer the question asked. by OP The question is c++ tagged btw.
07:13
Am I right in thinking that it's probably fruitless trying to roll back edits by a user who appears to be methodically vandalizing their previous answers. I've mod-flagged one.
@DavidBuck rule of thumb: don't roll back more than once ("Don't get into a rollback war"). For continued/habitual behaviour: flag for mod attention.
Well, they might stop. However, a modflag would be appropriate either way.
Also, they might not stop.
@DavidBuck you could both rollback and flag, if that user vandalized multiple answers, the former will save moderators some time, as they won't have to do the rollback when handling the flag
07:40
^^ also arguably not about programming
07:56
@mickmackusa not yet eligible
08:21
@Adriaan why wasn't that caught by smokey? Seems pretty typical spam to me (long post, words like "country", "visa" and 6 times the same link)
@Adriaan none of those words are watched specifically in Smokey, we have a long list of phrases like "legal services in Noida" but it didn't trigger any of them
I watched "visa consultant" now but feel free to suggest other phrases to add
@tripleee thanks, good call :)
and "visa agent"
jps
jps
How about "student visa", "visa consultant"?
@VLAZ probably needs to be restricted to SO; on other SE sites it is a viable question topic apparently
AFAIK, Smokey watches can't be restricted per-site.
jps
jps
@VLAZ ah, ok, I didn't consider other SE sites.
Many other SE sites share the feeling that often only SO is considered.
09:30
Is this an answer or a comment?
@Gugu72 Is there a good duplicate target? Seems a commun error
Duplicate? I don't know any duplicate target for that one, but it's clearly a typo (2 should be changed to 3, don't even know why there's a 2 in the first place if there's a 3 after)
@Gugu72 Making an error on the index of an array is not a new topic, but Ok, I voted 'typo'
Never encountered such typo but I trust what you say. And thanks!
09:46
@Vega it is an answer that comments on two answers. I think it has value on its own, so it is an answer.
Thank you @rene!
:57330120 third post by that user with barely more than a link. I've flagged the lot of them
@Adriaan I am sure neither of the questions is on-topic
 
3 hours later…
14:20
@Chris The answer was also nonsense.
 
2 hours later…
19:23
@CPlus wow, it's so nice and refreshing to see sane remarks on goto for once
19:36
@TylerH My take is, when used appropriately, goto can be incredibly useful. And just rote avoiding it because 'goto bad' and using 'alternate solutions' that turn out less readable than goto would anyway, is not a helpful mindset.
Yes, I'm surprised so many people who are such doomsayers re: goto have clearly never dealt with code with nested loops
chances are if you've ever dealt with nested loops you've also dealt with needing a way to jump out of all of them from some point more than one loop deep
goto is the premier, elegant way to do so
Like yeah, 1 goto, 1 label, vs moving all the code to a new function, making a new bool variable and adding an if statement or && statement to the condition of every loop, like no thanks, I will take the goto
Java's labeled break/continue is a nice solution, though
Yeah but, C++ doesn't have that (unfortunately?)
fun fact: goto is a reserved keyword in Java. It doesn't do anything, but it's reserved nonetheless.
You can also validly label arbitrary lines, which, again, doesn't do anything, but is legal syntax.
19:41
It could be implemented in C++ probably without breaking legacy code, by making break label; mean 'if the statement following the label is a loop, break the loop' etc.
@RyanM that's rather annoying
glad I don't use Java
I don't use Java often, but I occasionally use it.
@TylerH It comes up virtually never; the only implication is that you can't name a member "goto" (just name it goTo, which is better camelCase anyway)
I think Java should totally just add it, since they already reserved a word for it. It is a useful tool to have in my opinion, even though, when abused, can be used to create truly disgusting things.
Ehhhhh, it's certainly not straightforward to do so, and the most compelling case (jumping out of nested loops) is already well-handled by labeled break/continue
19:54
Are there any other compelling use cases in your opinion? For me, the only time was skipping some unnecessary stuff in a particular edge case.
That's definitely one. Cleanup from errors is another one, though try/finally goes a good ways toward addressing that.
Oh, I remember doing that. Allocating multiple items, and then using goto to free() the correct number of items if one malloc() in the middle failed. But now if I am allocating multiple items at once and they would all be deallocated at once, I just use one malloc() call. But I suppose you would not do any of that in Java, which has little/no manual memory management.
20:15
there are other things you need to clean up, though, like closing file handles and such (try-with-resources helps a lot here, also)
Something annoying is having to error check every little file operation and act accordingly. Sometimes I wish file APIs accepted batch-style instructions where I encode a list of operations, submit them to be executed, and they either all succeed or all fail. Probably some technical limitations to that, but would simplify file I/O handling code greatly.
yeah atomic stuff is tricky. if I wanted to do a series of I/O operations that need to either all succeed or all fail, I'd strongly consider just using a SQLite database if at all possible.
Even for a config file? Like game settings?
P.S. encoding a list of operations and submitting them for execution, that is how Metal rendering on the GPU works.
@CPlus I'd be sorely tempted (eliminates the possibility of, say, a failure partway through resulting in you having no settings). Does have the downside of making it somewhat less editable by hand, though.
@CPlus sounds like SQL
And I find it rather annoying behavior, actually (though I rarely need to do batch operations these days). I'd much rather it work up until it doesn't, skip the operation on that line, and then do the rest. I can fix one row of data easily enough
20:27
1. Open file 2. Write to file 3. Close file. What if 1. Succeeds and 2. Fails? Delete the file? What if the delete fails? And what if 2. Succeeds and 3. Fails?
The correct answer is something like "1. open new file, 2. write new data to that file, 3. swap the files"
PS @RyanM any chance you could re-view this when you have a moment? meta.stackoverflow.com/questions/430012/…
Swap meaning, delete old and rename old to new, presumably.
I forget whether 3 is typically doable atomically, but if it's not, you can delete, then rename, and then check before reading whether the new filename exists and do the renaming then
@CPlus we're probably talking about different scenarios. You're talking about sequential, dependent operations. I'm talking about a dataset that you repetitively apply the same operation to
20:31
A dataset where you repetitively apply the same operation to? Like a transformation matrix to a bunch of 3-d vectors? Sounds like a GPU shader to me.
@CPlus No like a list of 50,000 rows that you want to import
but there's an error in the data on row 23,581 so the whole operation fails
where it could have just imported the other 49,999 rows of data just fine
Ah, so there is a problem with the data? Or is like by some anomaly the I/O function responsible for importing a single line of data failed at that seemingly random point?
@TylerH done, thanks
SQL (at least, SQL Server. I assume MySQL and other flavors are exactly the same in this regard) handles operations like this in batch format. It will try to apply any transformations or data type conversion operations you request, before actually doing it. If the "check" fails for any step or for any row of data in any of the steps, the whole procedure fails
(nitpick: "one and the same")
20:35
@RyanM thanks, fixed. Was quite late in the day when I wrote that answer :-)
@M-- I think that's a poorly written answer; I edited it
I don't see how it answers the question
M--
M--
@RyanM same as Tyler, even as a poorly written answer, it should be deleted
@CPlus Should we delete a working solution that is simply subpar?
> You will have to work it out by using a boolean that you set to false prior to the loop, set to true in the loop if you want to break, plus a conditional break after the nested loop, checking if the boolean was set to true and break if yes.
That seems like a solution
It has been suggested in other answers. So duplicate.
20:42
fair enough, although were the other answers posted at the same time? Or significantly before?
You didn't post any links to the answer(s) it duplicates, so it's hard to tell...
The highest answer I can find that suggests the same idea was posted at basically the same time, just 3 minutes apart
It appears to just be coincidence that one is at a score of -1 and the one from 3 minutes before is at a score of 297 (!) and accepted
Unless there's another older one (like, at least a day older), I'm not sure we should punish the other answer via deletion just because, in essence, their fingers moved a bit slower that day
The accepted one mentions the up-to-par solution alongside the subpar one. The -1 one only mentions the subpar one, and not only that but says 'you will have to' implying that the subpar one is the only solution, which is straight up wrong.
20:57
@miken32 I think that is on-topic, because Stack Overflow allows questions about specific software algorithms.
21:07
@CPlus Ah ok I thought it looked more like math.
Can an RO bin the request above please?
@miken32 → 1 message moved to SOCVR /dev/null, by request
Some more information is needed though, like what languages are valid
we currently have javascript and swift answers which obviously is a bit conflicting
Yeah, I mean, you can describe the algorithm at a high level/in pseudocode, I think, but it can quickly spiral into "post an answer for every language", which is ... bad
(would love a "how to ask and answer language-agnostic algorithm questions" guide)
5
@RyanM Maybe that's worth a Meta post, I'll think about it
21:33
Regarding this question, Find how many persons can deliver to a location, the OP posts working code but desires to reduce the "time complexity". Is this on-topic, or does it belong on the code-review site? Or even the CS site? Thanks!
21:45
@RyanM the answer is probably 'ask on softwareengineering.SE instead'
or math.se
SO is a programming site. If the question isn't in a programming context, or about a given programming language or even a set of languages to choose from, how can it be a "programming" question? If it's not at all about any programming language or paradigm, just about a set of operations, that's a math question or maybe comp sci/software engineering question (if the intent is to enter a programming context somewhere down the line in the future)
otherwise questions about efficient Rubik's cube algorithms you can solve with your hands are also on-topic here
@HovercraftFullOfEels looks like something better suited for codereview.se

« first day (3820 days earlier)      last day (219 days later) »