« first day (3337 days earlier)      last day (1594 days later) » 

1:26 AM
Social media is such a double edged sword, any calculating pervert can go on reading stackexchange employees twitter and analyse who think themselves are about to get retrenched next year.
I know someone who have developed such a tool. I myself is not as pervert, I love more about nature and physics and less about people, so my innovations are more about nature and physics and less about analysing people.
With all the money in the world, you can't buy things that does not already exist in human society. No matter how united and vast large in numbers, an ant colony can still be annihilated by a relative small external force.
Ants would not have realised that, would they?
 
2:34 AM
Can anyone please tell how to get size of std::vector<int> as I have tried almost every method that I have read of, like auto size = args.size(), int size = static_cast <int> (args.size()).
    range.cpp: In function ‘std::__cxx11::string range_extraction()’:
   range.cpp:8:12: error: could not convert ‘size’ from ‘int’ to ‘std::__cxx11::string {aka                                                                               std ::__cxx11::basic_string<char>}’
   return size;
            ^~~~
I read this post too, and applied the methods.
 
 
6 hours later…
8:10 AM
 
 
2 hours later…
9:56 AM
Hah. Awesome. You might want to check your arithmetics. I thinks that's 2019-12-05 07:57:17Z - 2008-10-02 03:18:53Z so 4081 days or "exactly" 11.173698 years — sehe 18 secs ago
 
 
1 hour later…
11:15 AM
My program has a lot of divisions and multiplications by 2. Does anyone know for an optimzier would likely change these to bit shifts or would a speed increase happen if I were to replace the code with << and >> ? I'm using g++
 
@northerner if it's literally "2" in there then the compiler will optimize it 100%
 
11:40 AM
Precisely
 
nwp
@JerryCoffin Yes
Sehe exists!
@AjayMishra Wrong room, go here.
 
user7659542
12:03 PM
What are the advantages of having a stateful library?
 
user7659542
IMO context passing pattern is the way to go
 
user7659542
I don t see any downsides
 
user7659542
or advantages of having a stateful lib/framework
 
12:36 PM
@northerner For the multiplication, the optimizer will probably use x+x and not x << 1. For division, the situation is more complex as it has to do the right thing for x < 0 if x is signed (if x is unsigned, a shift will be used by any optimizer worth its name). It will be optimized but not to the same code as x>>1 and thus you may very well see a speed increase in some benchmarks. As always using modern machines, measure in context because context is important.
 
@traducerad in theory: lower call over head particularly if the state has to exist anyway to use the underlying functionality
 
12:52 PM
@traducerad If you have objects persisting from one call to the other, are those objects able to get back to the relevant context? If yes, that may increase memory usage for in practice storing a lot of pointers to the same context, and no good behavior if they happen not to be the same.
If no, you have to pass the context in a lot of places, leading to a non-natural API. That does not mean the problem is always unsolvable -- I agree there must be lot of places where state is used unnecessarily, but there are reasons to use a statefull lib/framework.
 
user7659542
@Mgetz you mean the overhead is lower because you somehow have to get the state and copy it in the lib to be able to use it?
 
@traducerad no literally in register spill/restore etc
 
user7659542
So, you are saying libs should be stateful and that is the way to go?
 
that my not seem critical but can be in mobile and embedded
 
user7659542
rather than passing ctxts everywhere
 
1:01 PM
@traducerad lol no, depends on a lot of how it's going to be used. For example stateful is a horrible choice when you're dealing with multiple instances of hardware for example.
 
user7659542
@Mgetz Absolutely! That is my vieuwpoint as well
 
user7659542
you are much more flexible in that regard
 
user7659542
+ testing is easier
 
user7659542
you can manually constitute a state in your handle
 
user7659542
and pass it to the function under test
 
user7659542
1:02 PM
rather than having a hidden state in the lib
 
user7659542
also you have a better reentrancy
 
user7659542
IMO stateful libs are a bad approach. I have never been in a situation where this was absolutely necessary
 
@traducerad hence the "it depends". OpenGL vs Vulkan/DX12 is a good study. OpenGl was originally written for machines that would have one GPU (or GPU like device) so there was only ever one state. However that also means that it is inherently not thread safe. Whereas Vulkan/DX12 were written from the exact opposite perspective. Multi-GPU, multi-thread.
but there is an overhead associated with that
 
user7659542
@Mgetz I believe this is merely a matter of time. Embedded devices with more memory and improved hardware will keep coming. The time where you absolutely had to store your variale in an uint8_t rather than an uint32_t beliongs to the past
 
@traducerad definitely getting cheaper... but 8/16/32 bit micro-controllers and their like are still absurdly common
 
user7659542
1:07 PM
@Mgetz I presume people still using 8 bit mcus for instance are using them for historical reasons. New developments nowadays will probably not use an 8 bit mcu
 
user7659542
why the heck would they...
 
user7659542
just for saving a couple of pennies?
 
user7659542
you ll be limitting yourself on a software perspective
 
@traducerad cost, most 8bit units are literally pennies whereas 16 bit ones are in the dime range, 32 bit cost a dollar or so
@traducerad yes but if the application doesn't need something expensive and is simple 8bit can work just fine and safe millions in a large run
that said for most of the applications running anything like graphics.. yes they'd use 32bit controllers, but memory may still be very limited
 
user7659542
Ok so... The only downside of having a context based pattern is overhead
 
user7659542
1:10 PM
which I believe in many cases is not such a big deal
 
user7659542
unless working on 8 bit mcus or the like as you said
 
@traducerad and API mis-use... which can be significant, but that's an issue anywhere. Insofar as you're reasonably careful with precondition checking while in dev it works
 
user7659542
@Mgetz API misuse, then use an opaque context
 
user7659542
But then you make my point about testing invalid to some extent
 
@traducerad yes, in which case your API should fail hard and fast if it thinks it's incorrect
@traducerad fuzz... ALL THE THINGS
 
user7659542
1:13 PM
@Mgetz why do you believe having a single state is not thread safe? Just use mutexes and so on if you have to share data/states I d say?
 
@traducerad you can but most APIs won't add that overhead when the caller may not need it
 
user7659542
@Mgetz what type of product/sw may be so performance oriented that they believe using a mutex is too much overhead?
 
@traducerad embedded or APIs that are intended for low perf machines... e.g. where stateful makes sense
or for that matter on stateless functions intended to only operate on one context
generally stateless APIs are only thread safe from the perspective of creating and destroying contexts. The contexts themselves are not thread safe
DirectX 12 is a good example of this: even though it uses COM style APIs they aren't actually COM. COM requires thread safety, either by declaring a single threaded apartment or by using mutexes and synchronization
 
user7659542
1:28 PM
@AProgrammer No not necessarily, because you have a context for every subsystem and a single context containing the subsistems ctxt.
 
user7659542
So I don t see why you d have many pointers pointing to the same thing
 
user7659542
@AProgrammer yes everywhere you pass the piece of context which is necessary. Just the same way as in cpp you always have access to the class to which you belong. So IMO it is not unnatural, quite the contrary
 
1:54 PM
@traducerad From your context, you get an object. Are you able to get back the context from the object? If yes, that back pointer is stored somewhere, and you can get many of these back pointers which have all the same value if the system is naturally mono-context. If no, you'll need to pass the context along the object. In your code using the library as well as in the library API.
 
user7659542
@AProgrammer What is an example of a naturally mono-context app/product for you?
 
@traducerad You replace a obj->fn(params...) by either obj->fn(ctx, params...) or ctx->fn(obj, params...) and that may leads to usability issues.
 
@AProgrammer well in most cases it's a procedural API
so fn(cntx, params...)
 
@traducerad The library handling licenses is an example. It has state and I've never seen a case where that state is not unique for a process.
 
 
5 hours later…
@Mysticial Nothing to laugh about here. If the graphics on the card are cool enough, it's a great graphics card, regardless of how much it may suck at actually drawing any graphics.
 
@JerryCoffin Listen to the video if you haven't already.
 
@Mysticial Maybe tonight--I'm at work and didn't bring in headphones today.
 
7:07 PM
@Mysticial was literally just about to link that to you
> Our goal today is to see if the Waifu is hot
XD
 
@Mgetz The best part is how he can say all of that with a straight face.
 
@Mysticial oh god I'm cracking up so much right now
 
@Mgetz And even without sound, I can glance at the graphs and see that yes, the waifu is hot. Way too damned hot.
 
@JerryCoffin it's pretty cheap cooling but still better than the THICC
also apparently the Waifu whines a lot when not under load
 
@Mgetz A whining Waifu. Couldn't be.
 
7:18 PM
@JerryCoffin The purpose of the video was to check if the Waifu ends up on top.
 
@JerryCoffin yes but apparently the waifu's fans eventually drown it out under load
 
Then to open it up for inspection.
I'm amazed he can cram so many puns into the video with a straight face. I really wonder how many retakes it took.
 
I may have to close this tab before I get cited for sexually harassing my coworkers just by having it open.
@Mysticial I think this one may have taken more.
 
@Mysticial double entendres not puns
 
@Mgetz and innuendos
 
 
4 hours later…
11:47 PM
@Mysticial I want to get Samatha Fox on my next GPU!
Her music videos was very uplifting for teenage me.
 

« first day (3337 days earlier)      last day (1594 days later) »