@Borgleader I'd hold off until @Mysticial replies. I believe he recently posted that Seagate was doing well again (and HGST was no longer doing nearly as well), so it'd be best to wait for a reply (or do other research) before spending money.
I haven't bought hard drives in a long time. My last bulk purchase was over 2 years ago which was 16 x 2TB Toshibas. But I haven't really stressed them. And they're all healthy.
And uh yeah... was watching the super bowl with some friends.
NVIDIA's NPP library has a image resizing function that take a scale factor instead of final size as an argument. For example (0.5) instead of 512 when resizing a 1024 image. Due to floating point rounding error, the resulting image can be less than the expected size, with no obvious remed. Who the hell thought this was a good idea?
Looks like the change happened in CUDA 9. When I try to multiply the scale factor in my own code (vs the result from the library), I get the right answer. FML, time to write a for loop that adds epsilons to the scale factor until NPP gives me the desired image output size...
they just keep putting out infuriating low quality shit, for example under known issues it says CUDA-GDB. The version information reported by CUDA gdbserver is "9.0" when it should be "9.1".
My usual key sequence is:
quit()
quit
exit()
exit
q
q()
!q
^C
help
Alt + Tab
google.com
Quit PSQL
\q
I think veterans of the psql command line usually shorten that to just:
\q
@LucDanton a co-process even :) Coroutines can be nice sugar, but I have two objections: 1. that's just replacing the parts that were already rangey 2. the fact that "it's the same code (...nearly)" is a problem. I'm trying to word the one_off hack more elegantly.
@sehe mind you, in that approach it becomes trivially more reasonable to have intersperse instead. But coliru.stacked-crooked.com/a/5e848db2569f5369 really underscores that the problem is elsewhere. I'll keep turd polishing this
A problem with both push/pull coros, we're stuck with monomorphic element type
This basically breaks down any attempt to even abstract away interperse(", ") for an int-container - in a generic, composable way
It's not dissimilar from the fact that std::cout << std::quoted("hello") << "\n" works. but not std::cout << std::quote(my_object)". It's really a shame though. It would be kinda nice to be able to quote arbitrary "sub-streams"
tuple is a class, not a struct. I had to look it up to be sure (line 224), but there's no way you can make a struct do what a class does. Period. — Neil4 mins ago
2
/cc @Mysticial there's no way you can make a struct do what a class does. Period.
@LucDanton making some progress w.r.t. heterogenous push model: coliru.stacked-crooked.com/a/911fd94bc46d192c (of course, now it still lacks any "compositing" of stateful decorations, but I don't have more time right now)
> Hi, In this parser, the assumption is we already now the general structure of the input ,is not it ? . just wondering how does this parser will be implemented when we don't know the input structure at first
I don't understand the question. Of course it's impossible to parse something without knowing the structure...? Am I missing something?
@ScarletAmaranth Which leads to an obvious question: If they sell out quickly anyway, why would the put it on sale? Seems silly to put it on sale if they sell quickly at the regular price... :-)
@nwp I think the wording is awkward, we are getting failure modes that austensibly should be covered, since these are hardware faults its a little more reliable of a metric than software unit testing
Basically, thought there was some crazy test corner case, but really the test was not a test
and at the same time it’s hard to say why it’s hard to express with range functions, save for talking about implementation details (with state being a recurring topic)
that’s where I was last time
@sehe I brought up coroutines to demonstrate that any loop can be turned into a range function; but at the same time I can personally say that doing it that way is still somewhat unsatisfying
you ran into some of that yourself when you brought up e.g. the loss of static information/structure re: the element type, but imo that’s a bit narrow in focus
in the larger picture I really want to turn the attention to the fact that we are relying on a coroutine implementation, which I consider is not innocent
so my take on the original question (it’s really a matter of opinion) is that coroutines whether implemented by someone’s library/compiler/language/ecosystem or hand-rolled represent a baseline level that you don’t want to stoop down to
I might - in the end - forget about combining such "interacting" cases from primitives (if I conclude it doesn't get more elegant than the equivalent coro implementation), but that's it
@LucDanton I'd rather express the combination in a type (with state), where some "execution logic" may have the permission to do cross-decorator intervention
It is. So, that's the essence of the question. "Does anyone has even tried" and maybe reached some good practice about this kind of thing
I suppose I can make up some of these primitives myself, but it will be a tabula-rasa idea and, like these things go, they're never quite right the first (few) time(s)
@sehe I think the more mutability/close interaction an approach exhibits, the better to implement it as a loop because it plays nicer with e.g. traditional scoping—again, it’s an opinion thing
I agree there, which is why in the coro approach you showed, I would not bother with the "one_off" thing. I'd just accept stateful loop (hidden nicely in the coro anyways)
The point is, when I do need such a loop, I don't want the state to be in my view (scope) at the usage site.
If I'm writing the loops inside a coro, I'd accept the duplication. That's not user-facing anyways and the invididual range function ought not be too complicated anyways.
So, while the abstraction is fine, I'd prefer not to have the "cost" of both the range functions and the helper abstractions
My latest offering actually showed my preferred method. I also >abused< your max_aggregate_arity helper (really ought to be max_destructuring_arity I guess, but I didn't want to waste time figuring out how to write that)
A bit of terminology first: we can argue that you are not so much looking for the aggregate initialization arity but the maximum aggregate initialization arity. E.g. the aptly named A2 can be aggregate initialized from 0, 1, and 2 arguments so its maximum arity is 2.
Let’s turn 'is aggregate ini...
@LucDanton This is what I concluded as well (limitations of expression sfinae, doesn't support declarations)
@LucDanton When I looked at this the first time, I had assumed that std::tuple_size<T> would magically work for destructurables (using compiler-instrinsics)
yeah 'range function' is a handwave for range functionality to avoid being too formal and define lots of things—a function which takes one or more ranges and produces a range is actually a good enough shortcut for informal discussion
@sehe Oh, another final note: I pointedly avoided talking about Haskell (which you brought up early) because all of our discussion is from a decidedly imperative, C++-t(a)inted perspective
You're telling me that non-local returns should be a way to do this...
@LucDanton @sehe I see what you're talking about now
I think it would be nice if you could leverage a delimited continuation pattern combined with an interface or specification for allowing for mutation of sequences while iterating over things
In fact, deferring things makes it easier to thing of evaluating the state at any given moment absolutely. This is what I expect would be the best thing I can aim for: make a "type language" that can express all the combinations of stuff, and then have an "output function" that can simply calculate the "current state" from those definitions in any given point of the stream.
The only thing that still requires dynamic state is when accomodating sub-sequences of unknown length
@sehe for my money with just forward iteration ranges are completely boring and a non-topic; obviously that’s just external iteration though and you’re possibly thinking of something less narrow in focus
yes, and the thing is they need to know about each other (the inner iterator changes its inner state each time the outer one trigers). But you know, I'm more than busy with it as it is