« first day (922 days earlier)      last day (4027 days later) » 

6:00 AM
@LucDanton Really? o.0
 
I copied and pasted it and saved it to a text file.
:D
 
Lol
When Rapptz is old
"Why... ... why, what's this..."
Dusts off a DVD ROM. "Oh.... oh my, yes. My old programs... Let's take these babies for a spin."
 
> I'm not sure this is a bug. I am requesting clarification on the behaviour.
 
"O... oooh, I remember this bad boy! It was in the... the early 2000s! Why, I remember seeing the errors stretch so far... Chuckle. Ah... I was so surprised then... how young, how naive I was to save this."
 
hehe it compiles now.
 
6:04 AM
That sure seems appropriate to ask on a buglist :(
 
24661 errors to zero.
Today is a good day
@Luc By the way, why would you use source/ instead of src/?
 
I don't like overly terse names that strp away vwls. What does that save anyone from?
 
Well, at least it isn't anything ridiculous. hdr => header
So you managed to repro my weird hg mv thing?
 
Dunno. hg mv source target means 'source renamed to target', while hg mv source target/ probably is the same as hg mv source target/source
OTOH I recall meticulously using your exact commands, so that would mean you complained about hg mv source target when you were really writing hg mv source target/.
I don't know how hg and the shell interact here anyway.
 
I did uh hg mv source/ source/subdir
so that might have been it
 
6:11 AM
Oh yeah. Slightly different spin though, perhaps hg mv source source/subdir would have worked.
 
I ended up ovecomplicating it to doing something similar to what you showed me.
something akin to hg mv source/ source/subdir && mkdir source/subdir
with another thing I forget lol :(
I just ended up saying "ugh all this to move to a subdirectory"
 
Lol
I'd just rename the directory manually and do a full-fledged add/remove
 
I wasn't sure what would happen to the history
Which btw I'm still not sure worked
 
=l
Lol
Why does the history matter?
"Removed a bunch of shit"
"Added a bunch of shit"
Pull the latest, it's all good.
 
I just checked
it wipes the history anyway :( lol
 
6:23 AM
o.0
Wow.
 
git filter-branch
 
mercurial
:|
12
A: Why 'hg mv' (mercurial) doesn't move a file's history by default?

xanatosYou can can change the default behaviour of log: in your ~/.hgrc (or somewhere/Mercurial.ini), add [defaults] log = -f I've read the appearance of the log is for speed reason. Move isn't truly a "first level" operation in Mercurial. It's a copy + delete (this compared to Bazaar where the mo...

Well I found this
In hindsight I should have searched
 
Are.. ...
are mutexes supposed to "die" after you std::lock_guard them?
... Okay.
What the shit.
 
Oh, I didn't even understand your issue.
 
@LucDanton I don't either.
That's how batshit crazy it is.
Also, std::ref seems to be a giant liar. =[
 
6:30 AM
I didn't know about --follow although I did know to look up deleted stuff in the history.
 
room topic changed to Lounge<C++>: We're laundering... [c++] [c++11] [coliru] [no-helpdesk]
 
Laundering?
 
0
Q: Unhandled exception error due to LNK error

user1583647I am trying to use C++ shared library generated using deploytool in MATLAB in Visual C++. I was getting error: Error 1 error LNK2005: "void __cdecl shoes(class mwArray const &)" (?shoes@@YAXAEBVmwArray@@@Z) already defined in try2.obj Error 2 error LNK1169: one or more multip...

 
D-D-D-D-Driiiiive-by!
 
@user1583647 You've put too much code for a linking error question.
 
6:37 AM
@ThePhD Make it sound a little bit more interesting. I don't want the PHP room to think we're doing chores all week
 
Sorry I am not quiet sure if the error is due to the LNK error or otherwise
 
Is the typical string_ref/string_view convertible from std::vector<char>?
 
@sehe Just make sure customs doesn't see that.
 
:) that was the pun
@LucDanton hmmm? You mean, can it refer to sequence backed in a vector?
 
That too.
Although I would think it'd be subpar if sink(v) wouldn't work and you'd need to do sink({ v.data(), v.size() }) or some such.
 
6:44 AM
@ThePhD I looked up what std:lock-guard is. Sodding RAII - get rid of it, instanciate one mutex. Leave it alone.
 
@MartinJames Are you from 1998?
 
@LucDanton Yes. Also, the multithreaded code I wrote in 1998 still works.
 
'works'
 
@LucDanton 'Does not crash or make mistakes'.
 
Xeo
So currently, nopes.
And mornin'
 
6:48 AM
morning
@MartinJames mmm. what does lock_guard even have to do with instantiation of the mutex?
 
@sehe You can question this next.
 
@sehe It does not, AFAIK. It takes ownership of it and releases the mutex when control leaves the block.
 
It doesn't take ownership (that doesn't mean what you think it means in C++, especially with a RAII container). It acquires it.
However, the reason I asked is because I can't make heads or tails of your disgruntled claim here:
10 mins ago, by Martin James
@ThePhD I looked up what std:lock-guard is. Sodding RAII - get rid of it, instanciate one mutex. Leave it alone.
(apart from lazy spelling)
 
@sehe In that case, maybe that is not ThePhD problem. I read maybe bad documentation.
 
... sure
 
6:56 AM
@sehe Oops, cannot spell 'instannshiate'.
 
Well, if the address value is anything like ti says it is,
it's saying there's an access reading violation at a really low level in the mutex code
The problem is, the mutex itself is pointing to a valid object
same with the other variables
 
Or std::lock_guard. It's lazy spelling alright: stackoverflow.com/posts/6215084/revisions
 
A little debugging, however, shows that the scope of the queue that's being pulled from... changes?
Somehow.
 
@ThePhD The scope can't change. Scope is a static property of an object. Do you mean bounds?
 
@sehe Oh soddit.. cannot speel owt todday.
 
6:59 AM
When itemsignal.Set() (Semaphore) is called on one BlockingQueue, the blocking Pop function starts as expected, but...
 
Yeah, vectors do reallocate
 
... the address of the this pointer... changes.
 
@ThePhD (a) corruption or (b) different stack frame (think: thread)
 
That is, apaprently it's signaling another BlockingQueue
... But there's only one.
@sehe Oh, right...
 
Have you run valgrind/helgrind?
 
7:01 AM
@sehe No such tool for MSVC, so the only valgrind I get is my own two eyeballs.
 
Just port the code :) It's standard c++ for a reason
 
Is there a std::semaphore or analogous type? :O
If so, I can change my Semaphore to that and drop the platform specific stuff to test elsewhere.
... Hey...
I have a question.
threadwork.emplace_back( ); <--- an emplace_back in a std::vector
Should this vector default-construct the T of the vector and then std::move it into place?
Or should it just default-construct the item in place?
 
1 message moved to bin
 
@ThePhD mmm I would be surprised if you couln't get somewhere with an atomic<size_t> and a condition variable
 
@sehe Ah, okay. I'll try that then.
 
7:07 AM
@ThePhD the latter
 
@ThePhD The less number of ops, the better.
 
Well, MSVC is default-constructing the item, and then a std::move happens.
I recorded the address of the newly-moved BlockingQueue and the old BlockingQueue
It's... apparently changed
 
Debug moar. This sounds... twisted
 
@ThePhD You sure you've constructed it at the exact memory location it's meant to be placed?
 
@MarkGarcia I'm not the one doing the constructing. I'm just calling emplace_back with no parameters.
 
7:10 AM
10 mins ago, by sehe
Yeah, vectors do reallocate
 
Arrgh, shit
You're right
It's reallocating.
Titties. =/
 
vector.reserve()
 
Is that allowed with move-only types?
 
Of course! If it's not allowed, use std::array<>
 
@ThePhD Oh. You're using std::vector?
I thought you're making a custom one. Hehe.
 
7:11 AM
@MarkGarcia Yeah, with indices into the vector.
 
7 mins ago, by ThePhD
threadwork.emplace_back( ); <--- an emplace_back in a std::vector
 
@ThePhD It's true what sehe has quoted. Moves on movable types, copy (not movable) on copyable types.
 
Okay
 
In fact, because vectors must be allowed to do memory reallocations, element types are required to be movable (used to be "copyable")
 
After using Reserve, the this pointer doesn't change anymore.
That's still odd, though.
 
7:13 AM
@MarkGarcia TBF I think it does moves on no-throw movable elements only
 
if I'm indexing into the original vector to get the item, why would i-
...
 
@ThePhD How?
 
@sehe If the type is move-only it goes ahead anyway.
 
@ThePhD because it grew?
@LucDanton TIL. Great room this
 
Xeo
@LucDanton It fails miserably, you mean, unless the move ctor is noexcept.
 
7:14 AM
@Xeo Nah. C++, once again, assumes you know what you're doing :)
 
@sehe Well, think about it. I'm doing threadwork[ index ] to get the BlockingQueue for the thread associated to index. Even if the vector reallocates, why is it hanging on to an old BlockingQueue at that index?
 
@sehe That somehow gave me a thought to ponder on.
 
Xeo
@sehe Huh? Standard specifies that vector for reallocation only std::moves its stuff if its move ctor is noexcept, otherwise it copies.
 
@ThePhD You know, stale reference?
 
@Xeo Get your morning coffee in you.
 
7:15 AM
lol
 
Xeo
:|
 
Hm.
I think it might have to do with my lambda.
I'm going to take away the reserve, because reserve or not, this should work.
 
Short version: elements are moved as if via std::move_if_noexcept.
Long version: go read about std::move_if_noexcept.
template <class T> typename conditional<
!is_nothrow_move_constructible<T>::value && is_copy_constructible<T>::value,
const T&, T&&>::type move_if_noexcept(T& x) noexcept;
Returns: std::move(x)
 
Xeo
Are we arguing std::move vs move-construction again?
 
No.
 
7:18 AM
@sehe See, take a look at this. It shouldn't fail as long as pool doesn't change (it doesn't), right? coliru.stacked-crooked.com/…
 
Xeo
Then I don't see what you're on about. A move only happens if the type has a noexcept move ctor.
 
2 mins ago, by Luc Danton
Short version: elements are moved as if via std::move_if_noexcept.
 
E.g. the thing from pool.threadwork shouldn't reference a dead variable because I'm re-accessing the vector everytime I need to get it.
 
(This means you're wrong.)
Final important detail to keep in mind: "If an exception is thrown by the move constructor of a non-CopyInsertable T, the effects are unspecified."
Just like sehe said:
5 mins ago, by sehe
@Xeo Nah. C++, once again, assumes you know what you're doing :)
 
... OH WAIT
SHIT
DAMN
I KNOW WHY IT FAILS
 
Xeo
7:22 AM
Hm. I'll go wash my face...
 
You're lucky I couldn't find a non-exotic throwing move-only type that you'd want to put into an std::vector. OTOH that those are hard to come by is a pretty good sign that the rules are sane in that respect.
 
Yeah, that was my thinking too. C++ just doesn't want to sell you "no" if you happen to have move-only type with noexcept(false) move construction
 
Apr 19 at 13:25, by kbok
Welcome to your new favourite place! Please read the newbie hints so that you can feel at home.
 
Dammit, beat me to it
 
He keeps trying that (@Mysticial me too :))
 
7:25 AM
@sehe So, let's assume the threadwork vector has a capacity of 2, right? All of these things are being spawned together, rather than separately. So the thread will begin executation and will lock in Pop of the BlockingQueue that comes from the original threadwork. While the thread is riveted in place by the semaphore's lock, the vector then reallocates. While the indexing will get the new, correct BlockingQueue, the old one will stay dead.
 
I downvoted your shitty question for linking it twice.
 
But the old one is what the thread is already locked into!
So it wills tay there until it gets signaled erroneously, and then everything breaks because the mutex associated with it is already dead (std::move'd out).
 
@Rapptz Thrice
 
Yeah even worse :|
 
Yaay, I managed to figure out one of my own complicated bugs. <3
The problem is, it's a bit disburing.
 
7:26 AM
11 mins ago, by sehe
@ThePhD You know, stale reference?
I haven't looked at your code too much (my head hurts as it is)
 
@sehe You don't have to. Right now you're my rubber duck polar bear <3
 
'Tis relevant indeed.
Also, uh.
Oh wait nevermind answered my own question in my head DERP.
 
@sehe boost spirit?
 
What is the maximum number of threads you guys could imagine utilizing at any single given point in time?
 
7:29 AM
std::is_integral<const int>() reported as true with libstdc++. Spec is "T is an integral type (3.9.1)." Opinions?
 
@LucDanton ... That's right? I mean, what does const have to do with is_integral ?
 
@ThePhD e
 
@ThePhD std::thread::hardware_concurrency * {1|2}
 
I hit this because I have a <T, Invoke<std::is_integral<T>>> specialization that's now ambiguous with the one that catches const T.
 
@MarkGarcia That was my first guess, but @melak47 pointed out sometimes you want more threads than is available than the hardware (imagine an image downloader or something for the web. It has more backgrounds jobs than just the number of processors reported by the hardware many times)
The reason I'm asking is because with how everything is set up, I cannot afford to let my vectors resize.
 
Xeo
7:32 AM
@LucDanton 20.9.4.1/2: "2 For any given type T, the result of applying one of these templates to T and to cv-qualified T shall yield the same result."
 
So I have to give a really generous up-front estimate of everything before-hand.
 
@ThePhD You can have hundreds of them if they are idle most of the time.
 
Thanks for reminding me.
 
@ThePhD My system currently runs 976 threads.
 
@StackedCrooked that was the context, yes
 
7:33 AM
@MarkGarcia 2048 it is then. :D
 
o_O
 
IIRC that's come in handy in the past, so there's probably no way to win here.
 
Though, you know.
 
@ThePhD For an app, I'd go a safe(r) 16.
 
@ThePhD take copies of work, or move the items out of the queue (make the thread own it)
 
7:34 AM
To also solve my problem, I could use a std::unique_ptr<>
 
Xeo
Time for a Bool<std::is_integral<T>::value && !std::is_const<T>::value>?
 
That way no matterhow many time it's moved, the BlockingQueue will always be valid (the pointer itself never dies).
@sehe The problem isn't that: it's the issue of Blocking.
 
I thought I had is_unqualified.
 
@sehe Sometimes it works if you retry a few times to "warm up" the caches etc. But I guess you tried that already.
 
When the thread blocks, waiting for work, the vector containing all the BlockingQueue's for the thread can resize. When it happens, stale reference.
 
7:36 AM
Damn it. My SQL question's getting nowhere. I'm considering adding a javascript or jquery tag to it.
 
Eh, maybe I just thought of adding it when I noticed it in Martinho's code.
 
static_assert(!std::is_unqualified(typeid(std::this_developer::credentials()), "stay clear");
@StackedCrooked too many times
 
Blame boost :P
I've thought about a system where expiration allows a retry with longer timeout.
 
@ThePhD Hmm.. really don't understand your architecture, there. You have one queue per thread, but the queue and thread are not all one class?
Maybe I just need more coffee..
 
lol, is_unqualified only appears deep inside taussig. Can't find it in either wheels or ogonek. It's a bit telling on how useful it is I think.
 
7:41 AM
@MartinJames Yeah, that's how it's set up at the moment.
Perhaps that's a very bad flaw in the design?
 
@sehe are you still running your own coliru?
 
My own coliru just stopped working that day. Still borked.
 
@MartinJames Still, even then, that doesn't change the fact that if the Queue and the Thread are in the same class, that doesn't stop a std::move from invalidating an reference that's still being used for blocking.
 
I might need to investigate ordering of partial spec one day. Will gladly use the workaround though.
 
The same problem will persist indefinitely so long as the std::move happens on any part of the resources (because that resource effectively gets completely locked down for the time that it spends blocking (infinity))
 
7:43 AM
Hey folks
 
<bracing/>
good morning
 
@sehe If it stops working it's often due to a permissions error somewhere.
 
@StackedCrooked except, it doesn't appear to be
 
=\
std::forward keeps trying to make a copy of my reference.
 
sbi
> NASA has discovered 2 "Earth-like" planets that could have liquid water, but neither have wi-fi so what's the point. — @BettyFckinWhite
7
 
7:45 AM
LOL
 
sbi
Good morning, folks.
 
morning
 
@sbi that is so getting starred
 
sbi
I am still trying to become sober again.
 
@sbi Good morning.
 
Xeo
7:46 AM
@LucDanton Partial ordering <3
Hi ape. And off to work
 
@sbi did you celebrate something yesterday?
 
sbi
@StackedCrooked I gave that speech yesterday, before the parliament of my community. (Allegedly, this part of Berlin is, when counting inhabitants, the 3rd-biggest community in Germany.) I got lots of applause, and only the fucking Christian Democrats didn't vote yay for us. But even they didn't dare to oppose, they only abstained. So we all went for a beer afterwards.
 
Quick question. I read a blogpost a while back on the following topic. I hope that someone remembers the link to that blog post (or a similar one)
 
ssssst
 
Uh.
How do I "capture" a variable in a lambda, again? >_>
Does it go in the [] part of the lambda?
 
7:47 AM
@ThePhD [in here]
 
The topic was: "How to calculate the Y scale for a bar graph, where there are no values on the Y axis"
 
@sehe Can I capture this ?
Like, uh
[ *this ] ?
Will it capture it by reference?
or by value?
 
@ThePhD [this]
 
@ThePhD That would copy this.
 
7:48 AM
@MarkGarcia .. Woopsie~
 
@Rapptz triggering my OCD, are you
2
 
@ThePhD You could do [&*this].
 
@MarkGarcia No.
 
@sehe When I modify a person's code I don't mess with their bracing style.
 
@LucDanton Why's that?
 
7:49 AM
@sbi Good news. About the fucking CDs beer!
 
Elements of the capture-list must be =, &, a local identifier (optionally prefixed by &) or this. No arbitrary expression.
 
@Rapptz Oh well. You're doing it wrong :) (astyle is right :))
 
sbi
@sehe Yes. It becomes even better, though.
 
Do tell (everyone, shut up)
3 mins ago, by sehe
ssssst
 
@LucDanton Oh.
 
7:51 AM
@LucDanton When you capture this, do you just use this like it's natural? o.0
 
@LucDanton Though that will change with C++14, it appears
 
I suppose [r { &*this }] would apply.
 
... o.0
 
In C++14, I hopes :)
 
C++ syntax crosses my eyes.
 
7:52 AM
Can't think of a benefit over [this] though.
Oh wait
My bad.
 
const-volatile subtleties?
 
Just realised we want 'capture-by-ref-addressof', not 'expression-addressof'.
 
Can I rename variables I capture?
 
inb4 the ape posting a sequence of messages all at once
 
I don't know if [&self { *this }] will be allowed. Note that you'd need to use self.foo, too.
 
@LucDanton Couldn't be, right, self would become a field inside the lambda. Mmm. Why not, in fact :)
 
How is the new lambda syntax?
 
sbi
@sehe I have a very hard time to express these local political terms in English. Bear with me, though, I am trying hard...
 
I just saw that you can have auto now
 
sbi
The company that owns the houses where the renters are protesting (we're more than a dozen houses now, from 9 different streets) starts to bend at their knees. Some representatives leaked us the company's proposal for a voluntary contract, governing the rent rises they will put on their customers when re-doing their houses. This proposal is still limited to the three originally protesting houses, so that will have to be amended.
But it's along the lines of the contract a sibling of that company already has. We still have to have a close look at the differences, or rather: let some lawyers look at them. But so far, they have bent one knee already.
 
7:55 AM
@sbi Just throw it out in German and crowdsource your translation :)
 
@Rapptz Generic lambdas? ("Template lambas")?
 
sbi
@sehe I am not sure the crowd here has a chance with terms like "Bezirksverordnetenversammlung". (Which is the term for a parliament for the communities that make up Berlin.)
 
:) What a beauty, that word
Assembly of district delegates?
 
IT WORKS!
FINALLY. <333
 
sbi
@sehe Yeah, something like it. But see how long it took you to come up with this one term. And I have to do such translations five times for each sentence.
 
7:57 AM
s/WORKS/APPEARS TO WORK/
s/FINALLY/FOR NOW/
 
Fuck. A complete PDO tutorial: stackoverflow.com/tags/pdo/info
 
@sehe =[ y u dampen the party?
 
For your own good :)
 
sbi
@ThePhD One of the many possible outcomes of UB is that it might appear to work.
 
@Rapptz Can someone close that too please? :( Feels weird being the only vtc.
 
7:59 AM
@sbi Yeah, I know. Whenever conversation wanders off technical topics I often get choke myself :|
 

« first day (922 days earlier)      last day (4027 days later) »