« first day (2595 days earlier)      last day (2355 days later) » 

12:07 AM
Hi there gals and guys o/
 
@sehe Am I too late for a live session? Disregard that. I'm an idiot.
 
I want to shape a c++ question more into a canonical, to have a hammer for unclear, silly academical restricted homework questions (as these are useless mostly IMO):
Any tips to improve regarding that? (feel free to edit anyways)
 
nwp
C arrays had advantages over std::array before C++17 made std::array a = {1, 2, 3}; compilable.
 
@nwp That's c++11 isn't it? Right, template params =)...
 
@nwp You mean the brace initalizer syntax? Isn't that covered well with std::nitializer_list?
 
nwp
12:17 AM
In C++11 you not only have to specify the type, you also have to manually count and maintain the number of elements.
 
@nwp Feel free to write another comprehensible answer at that mentioned question. Gathering that stuff (and judging its significance) is the whole goal of it.
 
nwp
The custom allocator answer should be expanded upon. You can make an allocator that deallocates everything at once and gains performance at the cost of not supporting deallocating single elements. In that case you just want to new stuff up and a unique_ptr would be weird.
But I fear you want to get the point across that there is basically no reason to use new and delete in modern C++, but people will be seeing a long list of valid use cases which doesn't help your point.
 
@nwp I tried to explicitly exclude these kind of answers.
@nwp Probably mentioning Every Day Use Cases isn't restrictive enough. I'm pretty sure you get my point though.
 
nwp
12:46 AM
@user0042 Well, you challenged SO to come up with good normal use cases for new and delete, and there are enough smart people to rule-bend their way to victory. Maybe you should have phrased it like "What are the greatest or most surprising advantages of avoiding new and delete?" and find a way for it not to be too broad. I would expect that to produce much more convincing arguments.
 
@nwp "and find a way for it not to be too broad" Yeah, that's why I've been coming for advice to improve here. I noticed there are too many answers going into the wrong direction.
Not to mention that I've had put a bounty on that question, which even attracted more not really helpful answers regarding my intend.
 
nwp
I don't know what you expected though. The best outcome would have been no answers, and that wouldn't serve the intended purpose.
 
@nwp Well, the purpose was to (somehow) start a canonical Q&A for poorly asked homework questions to figure out how these low level language features work, while no one would seriously consider to use that in regular production code.
 
nwp
1:12 AM
This reminds me: You are forced to leak memory into Qt functions in Qt-C++. You can also use std::make_unique<T>().release() but that doesn't make it much better.
 
1:40 AM
@nwp what do you mean?
by "forced to leak memory"?
 
nwp
It was badly phrased. I meant forced to pass raw owning pointers.
 
yeah, cause the parent is responsible for free-ing the resource
 
2:03 AM
is it possible for a single processor to run two threads at the EXACT SAME TIME?
 
obligatory joke about clock skew
 
2:27 AM
@Trey No??
@Trey At least there would be a single CPU instruction cycle delay for starting zhose threads (very theoretically)
@Trey "EXACT SAME TIME?" Terms like exact time are merely confusing with so called realtime and parallel computing. All what you can gain with a certainly configured operating system, is to approximately guarantee a best TIME DELAY FRAME any operations are executed within.
 
 
3 hours later…
5:36 AM
Hey there
anyone here?
 
6:07 AM
@VermillionAzure I guess that's a no.
 
just got back ...
 
@Telkitty From?
 
from a site owned by my parents - a neighbour did demolition and excavation but dug all the way to the fence and caused fence to collapse
 
6:50 AM
> Igor Bogdanoff en garde à vue après s’être introduit chez son ex-petite amie
@ArkadiuszKoćma popcorn.ocx
 
7:31 AM
you know your life is not going forwards when most of the issues you have to deal with are things that used to function have stopped working
 
7:51 AM
welcome to real life
@LucDanton that's a throwback (does minitel use ocx these days?)
 
@Telkitty I think that is exactly life going forward. Things break over time.
 
8:05 AM
time going forward != life going forward
life is more or less going around in cycles for many people
 
Have you guys ever used coroutines? Whats the use case? It seems like one pattern is to have a main loop that invokes functions that process as much as they can and thrn yield...
 
@Telkitty many people... on many sides!
@Mikhail coroutines aid in asynchrony (without necessarily concurrency)
 
8:23 AM
@StackedCrooked it finally happened. This is the first time someone spontaneously inquired:
in Discussion between Markus and sehe, 10 mins ago, by Markus
do you have Special priiviliges on coliru .. always get expired while compile or run ?
 
8:50 AM
status: blacklisted
 
9:14 AM
ITT sehe has super coliru powers
similar to super cow powers... but with more coliru
 
9:25 AM
> gimme gimme gimme
in Discussion between sehe and DevSolar, 38 mins ago, by DevSolar
@sehe: [This here](http://coliru.stacked-crooked.com/a/9f2c9e613b838a52) accurately solved my problem. If you'd swap the code in your answer for the linked code, that would be a checkmark.

Thank you very much!
IDGI. He's 42k rep. He should know how the site works, right
 
9:38 AM
user image
2
 
hehe
same with WinZip
 
well, WinZip has been integrated into Windows for a good old time now
 
Ah.
Haven't really used Windows since XP.
 
I think even then it was integrated
 
10:17 AM
@thecoshman no it hasn't
Part of its functionality has been duplicated inside Explorer
 
nwp
@Trey See HYPERTHREADING.
 
10:47 AM
A lava lamp (or Astro lamp) is a decorative novelty item, invented in 1963 by British accountant Edward Craven Walker, the founder of the British lighting company Mathmos. The lamp consists of a bolus of a special coloured wax mixture inside a glass vessel the remainder of which contains clear or translucent liquid; the vessel is then placed on a box containing an incandescent light bulb whose heat causes temporary reductions in the density and viscosity of the wax. The warmed wax rises through the surrounding liquid, cools, loses its buoyancy, and falls back to the bottom of the vessel in a cycle...
Lava lamps are not that innocent.
 
Neither are kitchen stoves.
 
nwp
@sehe What did you do with your lamp o.O
 
nwp
11:12 AM
> Can I state 1+1 is 2, or does that show my obvious mathematical bias?
 
@sehe More like some people do not read or listen to instructions. :)
 
@wilx when there is no proper explanation given curiosity can outhweigh
 
@sehe I thought MS brought it and merged it into Explorer...
 
11:32 AM
hi
 
hi
 
lol I made the password change page backend crash by using a #
so what's up?
 
nwp
That's why you use a standard Pasw0rd! on every site. Ideal length, capital letter, number, special character that is not too special. Works every time.
 
11:57 AM
yay, I managed to fuse panchromatic and multispectral bands /o/
now opening an image is slow af
 
@Morwenn What does that even mean!?
 
@wilx satellite imaging stuff :p
you've often got RGB bands with a given resolution, and a single higher-resolution band known as the panchromatic band
to obtain a higher resolution while keeping colours, you can fuse the panchromatic band with the RGB bands
 
I see.
Well, I don't. But you know what I mean.
 
:D
 
12:14 PM
anyone ever got their hands on a c++ rest framework that doesn't suck?
 
maybe it's the REST part that suck in general
 
12:31 PM
any rpc suggesion?
 
@slaphappy Sun RPC? Corba? DCOM?
What about Microsoft/cpprestsdk for the REST?
 
after hearing amazon coming to australia for 5 years, still not sight of it
was patiently waiting for some specials ... yet nothing
other than books ... which it was selling on australia site for ages ...
like crying wolf for the 101th time
like forever saying 'ready' without that 'go'
like having rambling in the tummy for the whole afternoon, yet go to toilet ... nothing comes out
disappointment ...
 
1:12 PM
no amazon australia before?
 
they only sell books
not general retailing
 
nwp
@slaphappy That's a bit like asking for a programming language suggestion. You should specify your use case.
I made an RPC thing that works great for 2 way communication using C headers to define the interface that works across anything that can send bytes reliably (TCP, comport, ...). It includes somewhat sophisticated locking logic to make the RPC calls behave like regular function calls, has little overhead and only rudimentary versioning support.
Other RPC libraries usually hardcode TCP and have sophisticated versioning support. It depends on what you are looking for.
 
1:32 PM
So, I was just being the opinionated bastard refusing to complicate code for no reason. If you are sure your concerns are valid, just code it up! coliru.stacked-crooked.com/a/de2f41f5c3c521c4sehe 42 secs ago
C++ people do love to complicate code.
user image
5
Uhoh. The end is near. I was just followed by... wat now?
 
It's C! It's C++! It's Unity! It's Xamarin! It's casting the result of malloc! No, it's a Markov chain turned into a Twitter user!
 
@nwp only in the context of "rest sucks" so something with similar use cases
which i'm pretty sure doesn't exist so
@wilx did you use it?
 
> ":)"
Somehow it troubles me when people respond like this. I mean, even if it were stupid, it's still tragic.
And this is certainly not in the "put-your-cat-in-the-microwave" category. I can see myself doing that (unless it's really very hot, obviously, but if the oven gets so hot on the top surface, I'd never use the oven for the same kind of practical caution)
@milleniumbug It's the casting of malloc that removes all credibility for me. They selected that background picture. GUILTY.
 
1:47 PM
@slaphappy Of course not. :)
 
Because I know it exists, and when choosing a c++ library my order of preference is boost, then MS, then something else that doesn't use camel case
But I had a quick glance at the project page and it looks huge, with a complicated build system, so I wondered if anyone here had feedback about working with it (or any other good rest library, really)
I've been googling around but most posts seem to be by noobs who don't understand much about rest or apis or c++ much less able to pertinently critique the quality of a library.
 
Do you really need a rest framework? It should be simple to craft your own REST on top of an a HTTP library (beast).
 
I wonder if I wouldn't be faster just whipping out something dumb out of a json lib and the boost.asio http bits
Yes, that's part of the question too
 
@StackedCrooked Ironically, Beast does implement websockets right, and HTTP only partially
 
This seems to be what I need yes
is it slated for 1.66?
 
1:55 PM
@nwp Do you have it shared? I'd love to see it. Does it have request/response multiplexing or is everything sequential within a connection?
@slaphappy It was in review, and some condition applied IIRC
However, it's quite usable in its current form, I suppose.
(More so than e.g. Boost Process which is "in" for a few versions already, IMO)
 
yeah I had to apply at least two patches to get simple programs working with process
 
@wilx I think it should be a good option these days. Back in 2013 I skipped on it but only because linux/mobile support wasn't there yet. That appears to have been fixed.
@slaphappy Wow. That's worse than I know of. My gripe is with missing key functionality (safely inheriting fds, fork notification)
 
I think the windows backend is unstable and hasn't been much tested
 
nwp
@sehe It's here. The readme is basically the only documentation besides the code.
 
I literally rewrote our products process runner interface to boost and reverted that (the code is still in, but config switches back to old, crufty, implementation)
@slaphappy Oh, my experience solely on POSIX
@nwp Cheers
 
nwp
1:59 PM
You can send messages and wait for receiving them and the internal mutex logic will make sure the right thread gets it.
 
"I will call back in 5 minutes" doesn't call back
 
@slaphappy what
Oh, somebody in real life?
 
yeah, just a random rant sorry
 
That was random indeed :)
 
I will try beast
 
2:03 PM
Quick check, are you wearing your scarf?
 
no we have heating in there :)
 
Never skip skarf
@slaphappy cpprestsdk doesn't suck, especially not when underpinning the azure c++ sdk
 
nwp
@sehe I made some neat pictures in an attempt to document the mutex trickiness, but since I mostly forgot what all that stuff means I guess I failed.
 
boostdoesnothaveanxmllibrary.com I'm buying the domain today. I'm getting rich off the clicks — sehe 6 mins ago
 
nwp
There is also a test framework app, even less documented, that uses the RPC generator and runs lua scripts to test devices. It's pretty neat if you ignore all the hackery.
 
2:15 PM
@nwp man, goggle warnings!
 
someone should just take pugixml and make it a boost lib
4
 
The graphs are probably neat, but the colors are indefensible
 
or whatever
 
@slaphappy I'm all for it (add namespace support)
 
there's no way we're the first to think of this
 
nwp
2:18 PM
The colors correspond to which mutex is locked at the time.
@sehe What exactly do you mean?
 
2 mins ago, by sehe
The graphs are probably neat, but the colors are indefensible
 
nwp
Right, google and goggle is not the same thing.
 
Nodes with gradients are illegible to me. And they remove sense of visual understanding for me.
It's subjective.
 
giggle is yet another thing
 
gagging, too
 
2:19 PM
no need for giggle warnings though
 
well...
 
@sehe I agree that the purple or other dark backgrounds are hard to read.
 
nwp
This answer is so good, I thought I'd written it — Valorum 4 hours ago
2
 
@nwp I tried to make sense of the second diagram now. To be perfectly frank, I'd skip on a library based on the diagram (way overcomplicated). But I'm a lot better grokking code, so I'll have a look at that later.
(It doesn't help that "unpause caller" and "pause self" have same color, there's no explanation for "sudden highway arrows" etc.)
I suppose visualizing all control flow paths in any RPC framework would be unwieldy. Which, to me, means: do not bother :)
@nwp awesome
 
nwp
The complexity is intrinsic to the problem and you get to skip implementing it.
One way of simplifying the logic is allowing for one thread to lock a mutex and another to unlock it. Sometimes that is allowed, sometimes it isn't.
 
2:31 PM
it is possible to implement something like that yourself using a mutex+condition variable
though if not careful deadlocks abound
 
ft. Igorrr
 
@nwp Or to use the scheduler to remove need for locks
@nwp Are you using a mutex per call/request?
When in doubt, don't share.
 
nwp
Well, there is the caller thread that just does int answer; Result r = get_answer(&answer, args); and the parser thread that handles incoming data which may or may not be the answer. I don't see how to pass the data from parser to caller without multiple locks.
 
that's a producer/consumer problem
 
nwp
Also due to it being an embedded device there is no preemptive multithreading or a real scheduler. The user must provide 4 mutexes as well as functions that lock and unlock them and a function that sends bytes to the other side and one that receives bytes from the other side. The library handles the rest.
I think timeouts are optional, but that means you better not lose any bytes.
 
 
2 hours later…
5:47 PM
@StackedCrooked can we haz pugixml? apt-get install libpugixml-dev is all there is to it
@nwp message passing, indeed (consumer/producer)
@nwp interesting. Though it would also be fair to say cooperative multitasking could vastly reduce the need for locking, not increase
@nwp In any network setting, I'd never consider timeouts optional. Unless stability is not a concern
 
6:48 PM
@nwp sigh. Sign of the times. :(
 
@sehe "Unless stability is not a concern", for me this is usually a concern for the next version.
 
 
3 hours later…
9:50 PM
@wilx man don't you notice your own bias feeding? The post was (when I looked at it ~5hrs ago) quite balanced and especially being treated that way.
 
@sehe The mere fact that somebody has to ask about this BS is the sign of the times, bear.
@sehe Yes, I have my own biases as anyone does.
 
And? Many people ask things. It's how we answer it.
Oh. It wasn't about having biases.
 
@sehe And nothing.
 
Cherry picking is an easy game. I can go the newspaper each day and make any point that way. It's how Breitbart and things like NowThis. And zillions of troll accounts, and a good part of politicians: cherry-picking everything that fits in their shop.
 
@sehe Dude. Calm down or you are going to burst a vein.
 
9:55 PM
Projection.
 
@sehe Let's back up. What is your problem with "Sign of times." again?
 
Simply put: it's a sign of stupid to even respond to a question like that. It doesn't mean a thing. It would, if the consensus had been "ooo no, can't do that! It's not PC"
 
@sehe Is this what you think or what you think that I think?
 
It's a sign of the time that people like yourself go all "sigh" at the first hint that people ask a question that might get tendentious response. Irony: that's being tendentious
@wilx I say what I say.
(That tendentious behavior is otherwise known as "being triggered". Yup. Not a thing you'd usually apply to yourself, but there you have it.)
 
@sehe I agree. It is a sign of times.
 
10:03 PM
So maybe don't do that :)
 
@sehe Fuck you. No.
 
Suit yourself.
 
@sehe I always do.
 
Since you're always shoving it in my face - it's an open chat - I might as well respond once a year, or so :)
I consider it a courtesy to actually connect to people I know. I'd feel hypocritical if you didn't know that about me.
 
@sehe Dude, nobody shoves anything into your face any more than to anyone else in here. You are not that important.
 
10:09 PM
Another fine case of projection there.
Oh and by the way, I don't mind. Things are also interesting, because you frequently make me think again, and recheck.
 
@sehe Sure. :)
 

« first day (2595 days earlier)      last day (2355 days later) »