« first day (2686 days earlier)      last day (2264 days later) » 

12:00 AM
then readers don't have to block on mutation as well
 
@Puppy That is the solution that I'm proposing. But we're also very careful with introducing lockless programming to people who aren't low-level programmers since the probability of someone messing up and blowing up in a bad way is non-zero.
 
it's a lot cheaper and allows free concurrent writes whilst people are requesting the getter
 
So if it's not performance critical, we recommend just locking entire functions to be done with it.
 
hmm
I'm not a fan of this approach since, well, nobody ever made horrible mistakes by just trying to lock entire functions or classes... ;p
 
@Mysticial Must resist urge to troll meta. "Does SO need a move to Quora option?". Search the number of times Qoura is mentioned in, comments, and how many times those references occur in closed questions. Obviously, users are crying out for the feature!
 
12:03 AM
but I'd have to go with just make the mutex mutable
 
@Puppy I would argue that the consequences of messing that up (a deadlock) is probably better than silent data-corruption because somebody missed a store-release or something.
 
well in this case, I'm pretty sure that std::atomic can take care of everything easily with no trouble
I mean, it's not a lockless algorithm, it's just one flag
 
There is also a reasonable chance that if the flag is simple enough you can just volatile it
 
no
don't ever volatile for threading....
 
lockless yo
 
12:05 AM
that's not lockless, that's senseless
 
but also lockless?
 
it's lockless, it's just totally broken as well
 
@Mysticial you could wrap it in a init_once class
 
lockless is usually referred to algorithms that are both lockless and also actually correct
 
starts out in invalid state and upon a init(T&& t) will set the flag to true if not already set otherwise nop
 
12:07 AM
 
@Mysticial I don't like mutable because it obscures that, actually, some mutation is happening. Can you just remove the const? Or alternatively have two functions one that is getMember() and another one called getMember_TS() or getMember_unsafe() ? This was the approach of a recent commercial code base I integrated into. Seemed to work pretty well.
 
@Mikhail Logically, no mutation is happening. In fact, the mutex lock pretty much exists to enforce just this.
mutable was basically invented for just this purpose.
 
@Mikhail Not in this case. They found a race-condition in some core library which has had the const-getter for years. And because of the dependencies on it, they can't propagate it up. And this somehow got escalated up and down the management chain where it ended up with me since somehow I became the go-to person for this sort of stuff.
 
@Mysticial I let my classes implement the BasicLockable concept. Then I change the signature of the getter to Stuff getStuff(std::unique_lock<MyClass>&);. User needs to create the lock first before the method can be called.
There's also things like Folly's Synchronized<T>.
In any case I don't really like internal locking.
 
@Puppy I agree completely that what you mention is the paradamatic use of mutable. Its actually one of the interview questions I ask candidates. BUT I've had so many bugs related to mutexes that I think all code taking them should be marked with a compile time DANGEROUS flag. That's why I like that at least its not const.
 
12:14 AM
mutable implies that it will be used in dangerous situations
 
Its hard to see by looking at the interface
 
@Mikhail In my own code at home, I get rid of the const. I have some classes which represent a thread-safe read-only interface to some file. But because they're implemented with handles with file pointers that change, I can't make anything const since everything needs to acquire a mutex.
 
Well, handles shouldn't change except during assignment? Aka, ReadFileEx doesn't change the handle.
 
they get used non-const in the native C apis though
 
if you wrap all the exposed bits in C++ and make it less dangerous, it would look like java or c#
it's a speed/danger trade off
 
12:17 AM
@Mikhail That's... not really going to help. For a start, you're misusing const to mean something completely different to what it actually means/is used for. For a second, atomics, tasks and other such things are just as dangerous.
 
@Mysticial You could with pImpl.
 
@Mikhail But they're not thread-safe. Because if one thread tried to access offset X and another thread needs to access Y, they need to be sequentialized since they hit the same handle with the same file-pointer. So they're mutexed.
 
@Puppy I guess the only way to write dead lock free code is to use std::timed_mutex :-)
@Mysticial Oh I see what you mean, although I believe the actual API functions are thread safe but you might get jumbled data/text...
 
@wilx I generally don't like the idea of hiding non-constness behind a pointer. Since in most cases, I prefer "deep" const even though the language only specifies "shallow" const.
@Mikhail In my own code, I also do telemetry on disk access. So that by itself eliminates the possibility of const-ness if I stick with the "deep-const" concept.
 
@Mysticial Yeah, so it looks like at least 2 of us, don't like mutable...
 
 
5 hours later…
 
1 hour later…
6:17 AM
best, part is he didn't mention people actually for this
actually pay for this
 
6:31 AM
@Mysticial const_cast is begging for a subtle bug down the road
 
 
2 hours later…
Ven
9:00 AM
Hellounge
 
Hiounge
 
anyone has some experience configuring wpa_supplicant.conf?
 
@wilx o_0 I need to get my lazy ass sorted into taking those nominations and setting up the actual vote
 
@thecoshman You do!
 
9:31 AM
What if I spend a month touring the USA eating endlessly at the myriad of buffets on offer. It might just change my appearance dramatically.
Or if they spend the flight sleeping on one side of their face....
 
nwp
> Never have passports been uglier.
 
not sure troll or actually thoughtful crowd ... :p
 
 
3 hours later…
12:34 PM
@Ven Heil Lounge
 
12:47 PM
@Mysticial No it doesn't.
assuming that I understand what you mean by telemetry, i.e. measuring access times and such performance metrics
whether const is logical or bitwise (should be logical), and whether it is deep or shallow, are two completely independent properties.
logical const completely allows the const accumulation of such metrics, shallow or otherwise.
 
Ell
Hi folks
 
Ven
\o
 
1:46 PM
The hubris of some people stackoverflow.com/q/48915888/332733
 
@Mikhail this is the pinnacle of the "convince managers with some pretty pictures, force programmers to deal with this, and force them to pay millions for technical support because at this point they're so deep it will cost them less than rewriting everything" strategy
 
2:05 PM
@Mgetz which people
 
@BartekBanachewicz The OP assuming that he can use standard functionality with a custom allocator and that will automagically replace all new and delete
 
downvote and move on vOv
 
Ven
@BartekBanachewicz BUT PEOPLE ON THE INTERNET ARE WRONG
 
how bad is Angular?
 
Ven
@BartekBanachewicz very bad
 
2:11 PM
@Ven dang it
 
2:31 PM
Hi friends
 
@BartekBanachewicz Try Angular 3
 
2:47 PM
@LoïcFaure-Lacroix why would I do that
 
Ven
self-hatred
 
"With your spirit calm, attack with a feeling of constantly crushing the enemy from first to last."
 
@BartekBanachewicz They forgot to develop angular 3 and moved to angular 4 directly
 
Yeah just like Windows9
 
2:50 PM
I don't see a problem in skipping vesion numbers
 
But they went from XBox360 to Xbox 1
Version number shouldn't be that confusing
 
there was a good reason for Windows9 though
 
turns out a shitload of applications assumed that if the version number started with 9, that meant 95/98.
 
Ven
>implying they couldn't just use Win10 or Win8.9 internally
 
2:54 PM
that would have just made life even more confusing
 
^
different internal/external versions is just asking for trouble
 
@Puppy Ah right forgot about that. Make sense...
I believe there are drivers also that used to rely on that... It's even worse when they base some values expecting the path to be in english
 
3:12 PM
version numbers don't really matter, and what ever you do, people will still be stupid
 
3:35 PM
@BartekBanachewicz this has always been the case? windows 7 was actually NT6.1
they didn't start matching the version number with the external version until windows 10
 
actually for Windows 7 they did that for very similar reasons
there was a bunch of software which assumes that if your NT version was not 6, you were on XP or earlier, or some dumb shit like that
 
@Puppy now they just lie to you
unless you say you're windows 10 compatible in the manifest they go with the highest supported version IN your manifest (usually 7)
 
makes sense to me
 
unfortunately it does to me as well
 
Ah, the tangled webs we weave when first we practice to deceive compensate for moronic application developers!
 
3:49 PM
@JerryCoffin there are three types of windows developers: The clueless, the bored, and the overclever
 
@Puppy So how do I do telemetry with a deep const?
 
use mutable (logical const)
 
ewww
 
logical const is fine.
 
@Mgetz I would've said most fall into one category: short sighted. Expending the minimum effort necessary to get the job done at the moment, with little (or no) care for the fact that this can end up being used for a couple of decades (or more). That included me for quite a while.
 
3:55 PM
@JerryCoffin that was assumed. Most windows devs that aren't that short sighted work for MS
 
@Mgetz MS may employ some who aren't short-sighted--but they definitely employ (or at least a times have employed) a fair number who were. Quite a few hoops they jump through are to preserve compatibility for their own apps.
 
@JerryCoffin true, but most of their newer code doesn't use any of that garbage
 
doiu3bv2f9vb31294bnfg
 
@SombreroChicken Time to change the password for wherever you intended that to go, I'd guess...
 
@JerryCoffin I wish I was disciplined enough to actually use good passwords like that.
 
4:00 PM
@Mgetz Their new code doesn't require hacks yet. But essentially nothing does when it's still new.
@SombreroChicken That's not a matter of discipline. It's a matter of using a decent password manager.
 
I usually just use Jake123
Jake being my pet's name, of course.
 
@JerryCoffin I would say it requires predictable non-package specific hacks even then. Unlike the famous SimCity2000 hack in XP
 
I think TOTP should be the new standard anyway
 
top of the pops?
 
4:33 PM
@SombreroChicken "This text encrypted with double-ROT13 for extra security."
 
 
3 hours later…
7:33 PM
nice, it's easier to make a sine wave using PWM than I thought
having an oscilloscope is quite handy to see what you're doing thought
 
a well picked lowpass filter does wonders
 
no idea. I just have a random cap that filter out most of the square wave pulses.
every time my timer ends I change the pulse width. But I'd get better results if I was actually computing the pulse width to make a sinewave
anyway I'm pretty happy it works.
Next step is to connect the 30khz waveform to a speaker to keep the dogs quiet
next step is to make a device to detect sound. To check actually what is the maximum frequency my speaker can output
 
8:18 PM
@Borgleader I'm not sure what to say of this:
72
Q: How do you write a Stack Exchange answer?

Chris SunamiOver my years on StackExchange I've come to view answering SE questions as its own, highly specialized writing subgenre, with its own demands, and its own ideal format. By trial and error, and observation of highly upvoted answers, and of answers that I personally find useful, I've created my ow...

I don't even...
 
@LoïcFaure-Lacroix the cap is a low pass filter
@Mysticial rep whoring IMO,
 
 
1 hour later…
9:31 PM
@milleniumbug There was this amusing piece of software called "IBM Rational DOORS" which was a glorified excel spread sheet that help upper management at large companies estimate the relative cost effectiveness of product strategies and features. A few places I worked at actually never tried to figure out how much features were costing them. This piece of software, if anybody gave a fuck, and had a time machine, would have saved them hundreds of thousands of dollars.
 
@Mikhail this seems to be a general paradox of the "budget management" thingies - you have to spend money in order to save money :D
and if you don't even use it, you're literally wasting money
 
9:48 PM
@Mikhail like most things, sometimes you have to slow down (and plan) to speed up
 
10:01 PM
We'd always joke that Rational DOORS could, in theory, determine that it was a waste of money
 

« first day (2686 days earlier)      last day (2264 days later) »