« first day (1560 days earlier)      last day (3387 days later) » 

8:00 AM
@Rapptz Erm. This is the kind of code I'm expecting to avoid by using a parser generator:
  {
     if ( in.size() > t.size() ) {
        t += in.peek_char( t.size() );
        const auto i = b.ops().lower_bound( t );
        if ( i != b.ops().end() ) {
           if ( match( in, b, s, t ) ) {
              return true;
           }
           else if ( i->first == t ) {
              s.push( i->second );
              in.bump( t.size() );
              return true;
           }
        }
     }
     return false;
I don't get that. This is from the very very first calculator sample. And it's (by far) not the only messy code block (though admittedly they push the envelope for "beginner sample" a bit)
 
user1804599
8:19 AM
HI sweeties.
 
user1804599
@Jefffrey No.
 
user1804599
They're checked at call-time, at return-time and at mutation-time.
 
user1804599
HoloLens looks cool.
 
morning sweet breads
@Columbo no, you're spot on
 
user1804599
@thecoshman morning moldy bread
 
8:26 AM
@рытфолд sweet breads are not bread :P
 
user1804599
 
meh, Rust or broke :P
Big crowd whilst he gives them his D
 
@sehe Yeah that does seem a bit odd. I found the post on /r/cpp while looking at older posts.
 
user1804599
@sehe regex
 
@рытфолд I don't think so. At firsrt glance I'd say it's machinery to push operands in a stack of stacks (to represent an expression tree). To me that's not very good interface then. Spirit helps a lot more in the area of ast manipulation/generation
TBH it's a turn off when the sample runs on with non-descript code like this (push this, pop that, if a little, for a little, add salt to taste, pronto! magic)
 
user1804599
8:33 AM
In Perl 6 you can manipulate stacks from within regular expressions!
 
I know.
 
user1804599
@FredOverflow which prize?
 
@рытфолд is Perl 6 'finished'?
 
Perl6 would be worth learning had I not been traumatized by Perl5 had a need
@рытфолд the Dahl-Nygaard Prize
:)
 
user1804599
@thecoshman no but Larry told me he expected the first stable release to be in 2015.
 
user1804599
8:35 AM
So aim for 2035.
 
@рытфолд in C you can manipulate memory blocks with code!
 
@рытфолд yeah, it'll never happen :P
 
user1804599
@BartekBanachewicz Of course you can. C wouldn't be very useful if you couldn't.
 
@thecoshman thank god
 
user1804599
@BartekBanachewicz Reminder: you know zero about Perl 6.
 
8:36 AM
I swear if I this build won't work today I'll rewrite the whole shit to something sensible
 
Perl 6 is a complete rewrite of the language, you really can't compare it with 5 AFAIK
@BartekBanachewicz may as well start now :P
 
@thecoshman oh, interesting.
 
@BartekBanachewicz congratulations on your use of sarcasm :)
 
 .-._          _,.---._    ,--.--------.
/==/ \  .-._ ,-.' , -  `. /==/,  -   , -\
|==|, \/ /, /==/_,  ,  - \\==\.-.  - ,-./
|==|-  \|  |==|   .=.     |`--`\==\- \
|==| ,  | -|==|_ : ;=:  - |     \==\_ \
|==| -   _ |==| , '='     |     |==|- |
|==|  /\ , |\==\ -    ,_ /      |==|, |
/==/, | |- | '.='. -   .'       /==/ -/
`--`./  `--`   `--`--''         `--`--`
 
called it
 
8:40 AM
@EtiennedeMartel I don't see much (if anything) US specific in there?
 
> Growing up really poor means realizing in your twenties that Mommy was lying when she said she already ate,
weighty words
 
user1804599
> Giving birth when you can't take care of your children.
 
@рытфолд if only abortion / child welfare was considered a priority in the US rather than a sin...
 
not being able to afford an abortion
 
user1804599
ctrl+Z
 
8:45 AM
that's not abort. ctrl-C is closer
 
@рытфолд Looks like she can take care of the child just fine if she's feeding them.
 
user1804599
It undoes the pregnancy.
 
user1804599
@Rapptz Point is she can't.
 
Says who?
 
user1804599
thecoshman
 
sbi
8:46 AM
Hi folks.
 
¬_¬ lets not go into the whole "abstinence is free"
 
The theoretical child is already 20.
 
user1804599
> was lying
 
sbi
Is there something wrong with this question?
 
user1804599
You can be 20 and skin and bones.
 
8:47 AM
@Rapptz does that change the fact it happened?
 
@thecoshman ..?
@sbi Probably "What have you tried?"
 
sbi
@Rapptz This isn't homework!
 
@sbi it's using the latest everything, which offends most people. It's also looks like you just want opinions, again, offensive to many. IMO a fine question, but how I understand what others like, terrible
 
@sbi It doesn't really have to be. If you're asking "How do you do X?" people typically expect an attempt from the question author.
 
Regarding abortion, don't forget as well that sometimes, the woman can be put to wait for some time aaaaaand... It's now illegal for her to abort
 
8:50 AM
@sbi that's what they all say :P
 
sbi
@thecoshman The latest?? With an OS version from 1996?? And GCC4.1?
 
@sbi I understand you have constraints, I'm just pointing out that many refuse to accept they can exist.
 
sbi
Also, I don't want opinions, I want a good implementation! :)
 
And SO is not for that...
 
sbi
@thecoshman Ah, so when you wrote "it's using the latest everything", you actually meant the opposite?
 
8:51 AM
@sbi again, you want some one to do it for you. IOW move on
@sbi :S yes
 
sbi
@thecoshman But I don't want code, I want a good description of how to implement something like this. How is that not something you ask on SO??
 
Sounds off-topic to me tbh.
 
@sbi because they have farted out all sorts of other bollocks little sites, this is programming theory, or code review or some other crap like that.
 
Or maybe too broad. Not sure.
I don't think it's off-topic yet to ask "how do I implement X"
 
@рытфолд I couldn't stand the unbalanced audio :S
 
sbi
8:55 AM
You guys are shitting me. A question about creating a specific kind of lock in C++ off topic? What have did you drink this early in the morning??
 
@thecoshman The proper term is "mono".
I didn't downvote it (and I don't plan to) but at the same time I'm not really surprised it is.
 
@Rapptz not really. Mono is just single channel, you can still play mono through multiple speakers. This was just panned very heavily to the one side.
 
It only plays on one of the cans in my headphones.
 
sbi
Oh yeah, and asking the question here got me another downvote. You guys are really helpful. (As if I'd care about 107k-2. It's just that I need this answered.)
 
This is definitely mono.
@sbi People on SO don't really appreciate "How do I implement X?" questions because without effort from the author it seems like "Can you please code this for me?" which is looked down upon.
That's the only thing I've really noticed immediately from this question.
@sbi Not me.
 
8:58 AM
@sbi oh now really, don't get stropy, there are plenty of other people who can downvote
 
sbi
@Rapptz I didn't say so.
 
@Rapptz mono != only uses one speaker.
 
Some might sat that 'a reader needs to lock and release three mutexes in order to access the data, then that is unreasonable design'. I couldn't possibly comment:)
 
@thecoshman What the hell is your definition of "mono"?
 
sbi
@thecoshman This got a downvote a couple of days after I posted it, and then, two weeks later, another one a couple of seconds after I linked to it here. Accident my ass.
 
9:00 AM
> Monaural or monophonic sound reproduction (often shortened to mono) is single-channel. Typically there is only one microphone, one loudspeaker, or (in the case of headphones and multiple loudspeakers) channels are fed from a common signal path. In the case of multiple microphones the paths are mixed into a single signal path at some stage.
 
sbi
Oh well. I'm gonna put a bounty on it. That will show you how the very same folks who downvoted this question suddenly consider it appropriate...
 
yes, it's recorded in mono, but it is played back with a Stereo panned almost exclusively to the one side.
 
sbi
I am not aware of any body that approves a way to write C++. — thecoshman 3 mins ago
Are you drunk, @thecoshman?
 
Either way, there's no excuse for it!
 
@sbi To be fair, your question looks just fine to me. You can improve it by showing a bit of your thoughts on the matter.
 
9:02 AM
@sbi no. I responded to the question you asked. But I don't know for sure that there are none.
 
sbi
@Rerito Thanks, that's the first helpful hint I got. I'll think about how to do this before I put a bounty on it.
 
@sbi don't give us that crap
 
@sbi I think if you showed what you tried (e.g. "I tried a mutex but it didn't meet my requirements because ...") before you bounty it, it'll be better received.
 
You also should clarify what your requirements are. You seem to know a way of doing it, but don't like that solution.
 
sbi
@thecoshman I don't even know if your comment follows English grammar rules, let alone that it has any meaning one could derive from it. I certainly can't.
 
9:04 AM
> What is an approved way to build a multiple-read/single-write lock out of simpler synchronization primitives?
Who would 'approve' it? A standards body?
 
@thecoshman Don't be so nitpicky...
 
sbi
@Rapptz I can certainly say that we're using plain mutexes but that this seriously hinders the performance of readers. Maybe that will be helpful. Thanks a lot!
 
@thecoshman 'Here is an algorithm to build an X out of Y and Z' is the kind of stuff that would fit the bill.
 
sbi
@thecoshman And what's that to do with "approving a way to write C++"?
 
@sbi approving how to write C++
 
sbi
9:06 AM
@thecoshman I wasn't asking "how to write C++", I was asking how to build a single-writer-multiple-reader lock.
 
@sbi The close vote is me. It's too broad. I don't really get what you expect to happen. Do you expect someone to up-and-write it for you on the spot? Do you expect someone to lift it from their proprietary code base (I wouldn't trust that) or do you expect people to go google and find the library that you can copy it from? (That's not a good question)
The only thing that remains is that you expect an expert (say, Anthony Williams) to step up and provide the authoritative, canonical exposition on design trade offs when implementing reader-writer locks. I'd say that would be awesome but (a) SO isn't really for that (b) it's very unlikely that people will notice & find the time (c) this information is usually found on blogs/in their books. So, as LRIO would say: time to go to the company library :(
 
@sbi build, write, a library that does exactly what I want, what's the difference?
@sehe what do you mean by 'the company library'?
 
sbi
@sehe I expect someone to say "You will need two counters, one for readers, one for writers, either atomic or mutex-locked, plus another mutex for the data. This is how you put them together. <pseudo code> I am sure you can fill in the blanks on your own."
 
That looks like a Wikipedia job. It's at the very least language agnostic
Maybe CS.SE?
@sbi When/if you do the bounty, that'd make an excellent reason message
 
sbi
@sehe A single-writer-multiple-reader lock is something common enough to come pre-packaged on a lot of platforms, yet complicated enough to get right and performant for some platforms to have got it wrong in their first try. (ISTR .NET initially having a very slow implementation.)
 
9:10 AM
That's exactly it! Why would you expect to get the correct stuff on SO?
 
sbi
@sehe TBH, I only added the tag after the question didn't draw any attention for a while. Mostly writing in , I wasn't used to a question not getting an answer for longer than 10mins.
@sehe Because this is what the site was made for: getting good answers to standard questions?
 
Gah. Already removed. Interestingly that oneboxes the question.
 
@sbi It depends too much on the details of the platform and requires too much specific expertise. You can't just fill in the blanks because those blanks involve race conditions, re-ordering, and stuff like that. An actual good answer that would enable you to create this thing that works well would basically entail writing it for you.
 
Anyhoops, that could be a little bit clearer. You don't say -which- parts are missing :/
 
fill-in-the-blanks-from-pseudocode only works when it's reasonably feasible for the questioner to actually get it right.
 
sbi
9:14 AM
@Puppy That's bullshit. Synchronization primitives do not depend on the platform.
 
@Puppy And in that case, I would rate the trust worthiness very very low, unless someone with a heap of authority can show when and how it was tested
@sbi The implementation thereof, though. There are too many damn subtleties (especially regarding e.g. the prevention of specific starvation modes)
 
@sbi "was made for" that's a gay old thought
 
sbi
@sehe Yes. But a mutex' behavior is well-defined. Who cares about the implementation?
 
@sbi They do if you want them to be efficient or have certain specific properties. The hardware operations available directly impact how they can be efficiently written.
 
@sbi Then use it?
 
sbi
9:17 AM
@sehe Right. And my question was: How do I put these Lego bricks together to build a car that flies? People only oughta explain the concept, I can stack bricks just well.
 
especially in a compiler which is pre C++11 memory model.
and even they couldn't define a memory model that includes all the functionality of each platform.
 
sbi
@Puppy Hell, getting any implementation would be fine. I am sure that there's people on SO who are way better at this shit then I am.
 
@sbi Then just use a normal mutex.
or implement it yourself.
 
> I'm a semi-technical startup in C
 
sbi
@Puppy We're doing this. It's seriously hindering read performance.
 
9:19 AM
then "any" implementation will not, in fact, suffice.
 
sbi
...of a single-reader-multiple-writer lock. Which I then can measure.
 
you can but the answerer can't so he can't know whether or not it's good enough.
 
I have created something in C++11 that actually compiles on visual studio 2013.
 
@sbi I'm sure that you'll have the patience to wait until they come along then
 
@sbi It wasn't me!
 
9:20 AM
there's no way for anybody to provide a workable answer without doing basically all of the legwork.
 
@thecoshman Gee. Doesn't happen often that I get to use this one:
 
@sbi that's not explained in the question very well. You are looking for a better solution, but it looks like you just want a solution.
 
Compilation successful!
Total compilation time: 859ms
Total execution time: 890ms
 
@sehe :O
 
@Puppy Or, talking out of his/her ass
 
9:21 AM
Is it me, or is there a huge flood of gunge pouring into the C++ tag this morning?
 
sbi
16 mins ago, by sbi
@Rapptz I can certainly say that we're using plain mutexes but that this seriously hinders the performance of readers. Maybe that will be helpful. Thanks a lot!
 
@Puppy Spot on. POSIX mutex is a valid implementation of rw lock (it's just very suboptimal in some cases)
 
sbi
@MartinJames Ah, now you have unveiled yourself!
 
All these bogus warnings :(
 
@sbi vOv what more is there to say then?
 
9:23 AM
So does std::snprintf exist in VS?
 
@sehe Is it now?
 
sbi
@thecoshman Nothing you said in the last 15mins, that's for sure.
 
@LucDanton I'm having a hard time thinking of a scenario where substing a mutex for a shared mutex would necessarily cause more damage then just (obviously) more lock contention.
 
@sbi does this help anyhow?
 
@sbi oh, is this even something to worry too much about? Will you still be working there much longer?
 
9:24 AM
@sehe That’s a different claim than 'is a valid implementation'.
 
it seems to be giving the kind of general directions you are after
 
I would have thought a shared mutex is all about concurrent readers. Ye olde mutex doesn’t do that. What is going on?
 
@LucDanton I guess so.
 
sbi
@AndyProwl Wow, great find! Thanks! I hadn't seen that when I was searching the site.
 
no prob
 
user1804599
9:26 AM
I just noticed.
 
user1804599
My HTML template contains not a single HTML tag.
 
user1804599
Yet it creates a nice HTML table with text, lists and images.
 
@LucDanton I'd say synchronization primitives are about protecting the shared state from racing access. mutex does this (albeit suboptimally for some loads)
 
I’m told that some problems can be solved with a shared mutex, but not a regular kind, too. So it is a matter of correctness, too.
 
user1804599
Functions are good.
 
9:27 AM
@LucDanton Ok. Not very solid, but enough to refute my own broad claim :)
 
huh... so... erm... Java... do-while loops; kinda annoying that the do has a tighter scope than the while check.
 
@LucDanton They're probably just not solvable efficiently with a regular one.
 
@sehe So that is the other way around: a shared mutex is an implementation of a mutex… And you were the one to suggest CS.SE!
 
@Puppy I think I can construct examples that would deadlock on another resource, but this implies other locks. (Then we're in fact talking about a system of locks, which no longer is the same thing. It's a composite synchronization mechanism then)
@LucDanton :)
 
user1804599
@thecoshman use streams instead of explicit loops!
 
9:33 AM
@рытфолд nah, need to raw power :P
plus I'm looping with a counter, so there's that
and I need the counter
 
> When you ask someone to take a picture of you, technically, they are the photographer, and they own the copyright of your picture. in defense of selfie-sticks
o.O
 
user1804599
Oh that moron died. Nice.
 
> Now your exchange goes from "Can you take a picture of us?" to "Can you take a picture of us, making sure that the church is on the top right corner, and also, I am going to need you to sign this paper".
@рытфолд mmm
 
user1804599
NOOO I wrote an HTML tag. :(
 
I’m going on a limb here but I doubt the legal system works on gotchas. Also, verbal contracts.
 
9:35 AM
8
Q: In Python, why is 'r+' but not 'rw' used to mean "read & write"?

robIn Python, when opening a file, we use 'r' to indicate read-only and 'w' write-only. Then we use 'r+' to mean "read and write". Why not use 'rw'? Doesn't 'rw' looks more natural than 'r+'?

I found this on the hot question list.
 
user1804599
Python is terrible at I/O.
 
@рытфолд ..and processing data. The rest is fine.
 
user1804599
open is an absolute abomination in many ways.
 
I/O is terrible
it's the primary cause of all performance problems
 
rightfold is terrible at everything
 
9:40 AM
@LucDanton Yup
 
Xeo
mornin
 
user1804599
The problems are easy to solve:
1) Separate reading/writing from decoding/encoding.
2) Separate reading and writing.
3) Don't choose encoding based on a fucking environment variable.
 
@Xeo 3mil o_0
 
Xeo
hai
 
@thecoshman but luckily, there's the Viagra Monad (which is really nothing but a Cialis in the category of erectile dysfunctors)
@рытфолд 3) say what (do you mean the system locale?)
 
user1804599
@sehe LC_CTYPE or whatever it's called?
 
That's the authoritative source for system locale, AFAIK
 
@Xeo ?
 
user1804599
Instead of picking one default and sticking with it, like UTF-8, or not picking a default at all (what I prefer).
 
huh... so when you look at a spam message in gmail, it warns you that this this might not be safe... by putting a header at the top of the email... or is that the email itself?
 
Xeo
9:43 AM
@Rapptz Not respecting order
 
> a mystery user with no key
 
@Xeo yeah, meh. It becomes slightly more funky when combined with variadic functors (or multiply inherited lambdas for pattern matching!)
 
@Xeo Won't work if f returns non-POD, as passing those to a variadic function is UB.
 
@Xeo well, who said that for_each_argument should specify execution order :)
 
@Puppy You get a 0.
 
9:45 AM
oh yeah.
 
user1804599
Even Node.js does it correctly. :v
 
I saw the comma and the 0 but neglected to actually determine their meaning.
 
user1804599
> fs.readFileSync('/home/rightfold/foo.txt');
<Buffer 68 65 6c 6c 6f 0a>
> fs.readFileSync('/home/rightfold/foo.txt', 'utf8');
'hello\n'
 
BTW @sehe when was the last time I've sent any music to you?
spotify:track:2KdNymqcDKBWViy0jDMnIS
 
which is why you got a 0.
 
sbi
9:47 AM
Will anyone of you be going to ACCU 2015? Disregarding my current career-ending activism, my boss just told me to book the conference. :)
 
I may do, considering that I live literally ten minutes from the venue.
in fact I offered Tony to stay at my place if he wanted to attend.
 
Xeo
@sbi I'd like to, but sooo expensive
 
it's not spacious (or necessarily clean) but it is somewhat private and it would be free.
 
sbi
@Puppy Ah. Previous experience taught me to not to put too much expectations into such a statement from you. :-/
@Xeo Not for your company. Don't they have a conference budget?
 
@sbi Seriously, I don't know what you're talking about. We never agreed any particular time and date because when we discussed it, the timings did not work out.
you were only available during the evening and I was only available during the day.
 
9:49 AM
@sbi I'm tempted, but yeah, expensive. And Unconference being in London complicates things
 
Xeo
@sbi I guess I should ask
 
sbi
@AndyProwl No offense to you guys, but if I have to chose between the two, I know which one I'd rather go to.
@Xeo That's the spirit! :)
 
@sbi that's good news then :)
 
sbi
@thecoshman How so? (My boss in on our side in this.)
 
Hanging out with friends > Hanging out with strangers.
 
Xeo
9:51 AM
@sbi You suck!
 
sbi
@Rapptz But what strangers! (To just drop a few names: James Coplien, Kevlin Henney, Michael Feathers, Phil Nash, Anthony Williams, Kate Gregory, John Lakos, Alisdair Meredith, Francis Glassborrow, Dan Saks...)
 
Not friends with any of them :v
 
sbi
@Xeo I gotta make choices.
 
@sbi Pros and cons, I guess. Professionally, ACCU is certainly going to give me more (but only because Xeo, Robot, and Puppy won't be giving talks at the Unconference). On the other hand, Unconference is fun with people I know.
 
Indeed.
 
9:53 AM
@sbi oh, it's the bosses bosses that are the yanks?
 
dunno I'm looking at the schedule and there's nothing that I'm feeling compelled to attend
 
Xeo
Android 5.0.2 is kinda... meh
 
user1804599
 
Xeo
interface-wise
 
sbi
@Rapptz I am somewhat friend with Kate. I have played pool with John Lakos. I had beers with Alisdair.
 
9:54 AM
I quite like the schedule
 
> If you use integers as arguments where position objects are expected, it will be assumed that you mean the units of the current lexically scoped Unicode abstraction level. (Which defaults to graphemes.)
wat.
 
Ah sure, I'll ask my manager, see what he says :P
 
sbi
@AndyProwl I can understand that sentiment. OTOH, I hang out with folks I like plenty here in Berlin. (Just for starters, there's the pub night of the people wit me in the tenant's fight every Monday evening.)
 
Elo
 
sbi
@Puppy I'd have been surprised.
 
9:56 AM
@AndyProwl I'll have plenty to say, but not much to listen to :P
 
sbi
@thecoshman Ha! :)
 
@sbi inb4 "no..."
@sbi hey... why do you laugh?
 
@sbi putting it on the to-ponder list (would need to self fund)
 
sbi
@thecoshman Why would he deny it? I thought you work for an international company? They certainly would have a conference budget, no?
 
@thecoshman I'll attend your talk on how to properly blend kahlua, baileys, and all the rest!
 
sbi
9:58 AM
@thecoshman Because I am a friendly grumpy old man.
 
Nice exchange about feedback on coding style guides here:
So what would be good reasons for not using the same coding standard all over an organisation?
 
@sbi like I said, I have your "speak up when shit stinks attitude" just not the credibility and respect to get away with it.
 
@sbi Sounds good :) I'll check my finances anyway and let you know if I'll join
 
oh man, you have to choose which talks to go to?
I don't think I can handle that sort of shit :P
 
sbi
@sehe Ouch. That is an expensive one to pay on your own. Are you planning to come to MeetingC++ in December? IIRC, that is cheaper.
 

« first day (1560 days earlier)      last day (3387 days later) »