« first day (787 days earlier)      last day (4154 days later) » 

9:00 AM
I think decay_reference could make for a more evocative name instead of unwrap_reference. To link to std::decay (there are so many features that 'decay' things that take care of reference wrappers that it's to the point that I'm not sure why std::decay doesn't do that out of the box).
So you'd have decay_reference: std::decay<T> plus the other specialization.
@R.MartinhoFernandes I think it's nice that this post is somewhat easy to understand (modulo that not-quite-std::get snafu), it's neat seeing all the pieces coming together.
 
@LucDanton That won't do: what about things like reference_wrapper<T>&?
 
As compared to the previous one in the series.
@R.MartinhoFernandes Unfortunater and unfortunater.
I really am not looking forward to describing <type_traits> to people.
 
I am a bit worried the next one will not be as good. tuple_cat was messy enough to implement. Explaining it properly will take some effort, starting with me reading the code again and making sense of it.
 
I think it's smart that you leave assignment to construction + special op.
It's just not the interesting part of the series.
I'm switching HTTP libraries, thought the interfaces were sufficiently similar. First error is that one uses simpleHTTP, and the other simpleHttp.
 
9:09 AM
Also I suspect Aeson of surreptitiously using both 'JSON' and 'Json' in its names.
I'm changing libraries because I'm done playing with Either Blah style error-handling for IO. Trying out IO exceptions for now.
 
Argh, do you know the option to make vim not put double spaces after periods when you Join lines?
 
Wow, I've never noticed that before I think.
So uh no, can't help.
 
Requires arcane magic level 20.
 
@LucDanton Never really used exceptions. I think that for every program I wrote always built a monad stack with Either-based error handling in it.
Though I often used custom error types.
 
@R.MartinhoFernandes Remember those pages? IO (Either Foo (Either Blah (Pages p (moarPages :: IO (Either Foo (Either Blah (Pages a)))))) was not so fun to handle.
 
9:15 AM
Gawd, why all those Eithers?
> If the 'joinspaces' option is on, these commands insert two spaces after a '.', '!' or '?' (but if 'cpoptions' includes the 'j' flag, they insert two spaces only after a '.').
Damn rules be complicated.
 
I wanted to see what happens when you preserve all the errors. And well, that happened.
Plus everything I'm doing relies on querying that web API. If the network fails, might as well pass that up and retry/fail there.
 
user142019
Cool Node.js has a new web design.
 
Haha, motherfucker goes right into my .vimrc: set nojoinspaces " who the fuck though this was a good idea
 
lol
 
9:18 AM
When I trained my touch typing I used gtypist. It uses those typewriter-era rules about double-spacing. Those things tripped my fingers so many times.
 
It's pretty much irrelevant, since either the Markdown parser or the HTML rendered in the browser will eat up the extra spaces, but boy does it look ugly in the source.
 
I think import Control.Applicative ((<$>), (<*>)) is my favourite thing to put on top of my modules.
 
@LucDanton Have you tried Control.Applicative.Infix?
 
Let :m + that up.
 
You probably need to cabal install it.
 
9:19 AM
Yup
 
The <^, ^> thingies are awesome.
 
Not sure if srs
 
<^(+)^> <- lifted addition (they look like wings, right?).
 
src/Control/Applicative/Infix.hs:1:1:
    Ambiguous module name `Prelude':
      it was found in multiple packages: base haskell98-2.0.0.1
That the one?
Um, looking at the docs I'd say no.
 
@LucDanton Yes, that one.
 
9:23 AM
Oh, alternative explanation is that it is, but the docs are broken as well.
 
@LucDanton Last time I used it it worked fine :/
@LucDanton Docs look fine here.
You may be missing a font, or something.
 
morning :)
 
Do you see your lifted addition? What happens if you follow the link?
 
Oh, wait.
Yeah, that's borked.
:/
 
2
Q: Can't build cabal package due to ambiguous Prelude

keiterI've been trying to install BNF converter from cabal, however there is a problem building it. Apparently, this package uses a mix of modules from haskell98 and version 4.* of base. This presents a problem in that if you compile with haskell98 hidden then some modules are not found. However, if yo...

 
9:25 AM
(<^) = flip (<$>)
(^>) = (<*>)
 
is it ok to chat about Qt related issues in this room too at some point?
since it's C++
 
Anyway, that's the whole module (well, that and the versions using weird characters)
 
Ah I see.
 
Robot, I looked at some of your dynamic array code this morning, and I came up with this question: "What did you do to acquire this amazing programming skill?" Magic?
 
@NathanDaly We are talking Haskell, so I can't really deny that.
 
user142019
9:26 AM
@NathanDaly only Haskell here. :P
 
haha
fairy muff
 
<↿`upUpAndAway`↾>
 
user142019
Hmm, I wonder if uv_close is asynchronous since it takes a callback. If it is, I’m invoking UB. :<
 
I think I prefer <^ ^> as well.
 
user142019
> Request handle to be closed. close_cb will be called asynchronously after this call. This MUST be called on each handle before memory is released.
 
user142019
9:28 AM
I’m fucked.
 
@TonyTheLion What dynamic array?
 
Could not deduce (a ~ Either String b0)
wut
 
@TonyTheLion Also, I have been programming for over 13 years now.
 
anyway, praise allah! and odin! and god!
the doctor's office were going to order me a taxi, but they FORGOT. so i have to use up the time. i have already made myself a cup of coffee
 
@R.MartinhoFernandes It's a vi compatibility thing. See
> NOTE: This option is set when 'compatible' is set.
 
9:34 AM
@R.MartinhoFernandes ah, that explains a lot. I was missing that datum.
 
@sehe That's irrelevant: boolean (default on)
 
@R.MartinhoFernandes The one you linked to, the 2D runtime array, whatever the fuck it's called
 
OpenCV Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)(size.p[0]*size.p[1]) && elemSize() == (((((DataType<_Tp>::type) & ((5
12 - 1) << 3)) >> 3) + 1) << ((((sizeof(size_t)/4+1)*16384|0x3a50) >> ((DataType<_Tp>::type) & ((1 << 3) - 1))*2) & 3))) in unknown function, file d
:\opencv242\build\include\opencv2\core\mat.hpp, line 569
Press any key to continue .
^ Someone else's informative C++ eror mesage.
 
9:35 AM
No one in his right mind with set compatible anyway.
 
eror error ftfy
 
Even set nocompatible is redundant as fuck, but we do it anyway, just to be sure.
@Cheersandhth.-Alf That is one heck of an assertion.
 
It's the only way to be sure.
 
@LucDanton Do you know that just by having a user .vimrc sets nocompatible automatically?
 
I'm not sure? I wanted to echo the sentiment. You know, nukes, orbits.
 
9:38 AM
@R.MartinhoFernandes Well, it doesn't benefit you by default. Of course it's relevant. I imagine the feature may not have existed otherwise. But, yeah, the default is odd
 
I find myself doing (a -> m b) -> n a -> m b way too often, converting Either String to or from Either Blarg to or from Maybe and the like. Isn't there something to ease that pain? What with everyone having their own error reporting strategy.
 
In std::set is it possible to count number of elements in some range?
 
lower_bound and upper_bound, then distance
 
distance - by difference?
 
Ah, should have thought of maybe (Left "wut") Right I guess.
 
9:43 AM
@VinayakGarg Isn't std::distance a thing?
Pretty sure you can't subtract set iterators.
 
@FredOverflow Didn't knew about it.
 
TYL std::distance
 
yup
I have lot to learn in C++
 
And either (const Nothing) Just as well.
 
lol const Nothing :)
That just a function f _ = Nothing, right?
 
9:47 AM
Ya
Either Foo a to Maybe a is lossy.
 
Woah, wait.
Dammit.
 
"posted on December 16"?
 
ow, it's 16 December already
 
Yeah :/
I forgot to set the "published" flag to false.
 
damn time-travellers
 
9:55 AM
Nothing to see here.
 
Where?
 
11
Q: What are the advantages of using nullptr?

Mark GarciaThis piece of code conceptually does the same thing for the three pointers (safe pointer initialization): int* p1 = nullptr; int* p2 = NULL; int* p3 = 0; And so, what are the advantages of assigning pointers nullptr over assigning them the values NULL or 0?

 
Are all questions posted here by Feeds?
 
Only when tagged .
 
I see.
 
10:02 AM
Why is everything down this week?
 
> We just added another game to the Humble THQ Bundle!
 
@R.MartinhoFernandes End of the world approaching.
 
@CatPlusPlus Another? Or is it just you noticing Dawn of War late?
 
Yes
I got email at 6:23 today, it's not late :v
 
Did I mention I have a Steam key for Dawn of War that I won't be using and am willing to donate?
Now why the fuck is this thing telling me this font has no name.
 
10:29 AM
What do you see ?
 
user142019
A rotten apple.
 
A square
 
user142019
I see .
 
lol
That character has implementation-defined behaviour.
 
user142019
Apparently I missed a meeting today at 10:50.
 
user142019
10:32 AM
Ah well, it would have been more of a waste of time than sleeping.
 
Maybe you missed the love of your life.
 
user142019
Not really. There are only guys there.
 
user142019
And for as far as I know, I’m heterosexual.
 
That's gay.
 
user142019
10:34 AM
At least I’m not robosexual.
 
@Zoidberg'-- Anyway, can I see it?
 
user142019
 
I see F8FF in a square. On Linux right now.
 
> To make Chrome even faster, we've automatically disabled some extensions that may have been added without your knowledge. You can enable or disable any extension below.
Thanks for disabling ABP assholes
 
user142019
10:36 AM
They make money of ads, of course they disable ABP.
 
ABP assholes? Which extension is that?
Is it porn?
 
user142019
AdBlock + Assholes
 
@CatPlusPlus Hahaha, I wonder why.
 
user142019
It’s like AdBlock, but with butts.
 
The sled sled down! Did you see the logout animation?
 
user142019
10:37 AM
Yes.
 
@StackedCrooked Yeah, me too. It's a character with meaning depending on vendor. Apple fonts often assign the Apple logo to it. Some MS fonts assign the Windows logo to it.
@StackedCrooked It's been that way for a few days now.
 
I noticed it first
And robot didn't believe me
 
user142019
@R.MartinhoFernandes I think it’s in every day in December.
 
user142019
Because Christmas.
 
Yesterday I saw a site that did JavaScript snow
It's like fucking 1999 again
 
user142019
10:40 AM
Today I’ll be writing Java! Hurray!
 
user142019
Writing the first of four games we need to write for school.
 
@CatPlusPlus Maybe I should add a flash animation intro movie.
Something really long.
 
@CatPlusPlus In all respects, since the world was about to end in 1999 as well.
 
10:58 AM
ok, which brain-impaired moron is flagging things now?
 
nice to wake up and have four recruiters leave me messages asking for my attention
 
Not sure if sarcasm.
 
not
 
Does the “strict weak ordering” requirement still exist in C++ for algorithms such as equal_range?
cppreference.com doesn’t document that
Damn, yes, it does
grr, the documentation on cppreference.com should include that, it just led me on a merry goose chase :/
 
> For all algorithms that take Compare, there is a version that uses operator< instead. That is, comp(*i, *j) != false defaults to *i < *j != false. For algorithms other than those described in 25.4.3 to work correctly, comp has to induce a strict weak ordering on the values.
25.4.3 is where equal_range lives.
 
11:11 AM
@KonradRudolph Fix it
 
@KonradRudolph No, it does not.
 
@R.MartinhoFernandes Huh?
 
@KonradRudolph See §25.4 paragraph 3 (quoted above).
 
@KonradRudolph Documentation is like sex. When it's good, it's really good, but if it's bad, at least it's better than nothing
 
@R.MartinhoFernandes I see that and I read it as mandating strict weak ordering. Where do you see it imply the opposite?
 
11:13 AM
How do IDEs get line endings wrong
 
@KonradRudolph Don't you read the part where algorithms described in 25.4.3 are an exception?
 
Why is this so hard
 
other than those
 
@CatPlusPlus By being "better than all others", i.e., Visual Studio?
 
11:14 AM
Both VS and MonoDevelop seem to insert line ending different than what's in the file on Enter
And then complain on save that line endings are wrong
Go fuck yourself aargh
 
Okay, now it gets interesting, @R.MartinhoFernandes: does that imply that I can call equal_range with a comparator that overloads operator()() twice, and search for an incompatible object?
 
Terrible editors all around
 
(case in point, I want to search a point inside a list of ranges, and return all overlapping ranges)
 
@KonradRudolph Overloads operator()() twice? What?
 
@Neil Aphorisms are like sex. When they apply they are really good but when they don’t apply they’re just fucking confusing.
 
11:15 AM
@KonradRudolph Use TreeSet. Oh no sorry, that's java
 
@Neil Wouldn’t help here
 
All you need to guarantee is that the range is properly partitioned.
 
@R.MartinhoFernandes Well, once for (range, point) and once for (point, range)
 
@KonradRudolph If you could translate a point into an inclusive range from itself to itself
Then it would
 
@Neil what does offer TreeSet offer then that’s not offered by C++ algorithms?
 
11:17 AM
@KonradRudolph That's fine.
 
@KonradRudolph Aren't you the one asking how to accomplish this using C++ algorithms?
 
@Neil no, I didn’t, I just asked whether my way of doing it was valid – still, TreeSet doesn’t have anything to do with that
 
lol, good luck finding equal_range in Java.
 
std::set is a tree
:v
 
hm, that didn’t work …
what was that ideone alternative again?
 
The range is not properly partitioned?
 
@R.MartinhoFernandes how so?
 
cmp(4, v[i]) gives false, true, true, true.
> A sequence [start,finish) is partitioned with respect to an expression f(e) if there exists an integer n such that for all 0 <= i < distance(start, finish), f(*(start + i)) is true if and only if i < n.
There is no such n.
Oh, wait.
Should be !cmp(4, v[i]).
Then that's fine, n==1.
cmp(v[i], 4) gives true, true, false, false. That's n == 2. I am not sure if the wording is supposed to imply the ns must be the same for both expressions.
> Also, for all elements e of [first, last), [...] comp(e, value) shall imply !comp(value, e).
@KonradRudolph There you go.
 
enum quantum_bool { true, false, both };
 
11:39 AM
both lol
 
That's wrong.
 
you know
 
enum quantum_bool { true, false, file_not_found, all_of_the_above };
 
it suddenly occurs to me that "both" feels like a really strange word and I'm totally unsure if I've heard it before or just made it up
 
oh you've got to that stage...
if you keep going you'll end up in the Sahara eating sand :P
 
11:41 AM
@R.MartinhoFernandes you forgot not_sure
 
dafuq is quantum bool anyways?
 
@R.MartinhoFernandes Ah, damn. So strict ordering after all.
 
@KonradRudolph No, only antisymmetry.
 
has anyone every created VS project templates?
oh, I just noticed we have some mods lurking in here
 
You mean Marc?
 
11:43 AM
yes and balpha
 
@R.MartinhoFernandes > a strict (or irreflexive) partial order "<" is a binary relation that is irreflexive and transitive, and therefore asymmetric. (Wikipedia)
 
Probably came here to fix my earlier message that is on the starboard.
@KonradRudolph That is not what I said
 
what I wanted to say is that, as far as I know, strict ordering == antisymmetric ordering
 
A relation can be both symmetric and antisymmetric.
@KonradRudolph No.
Asymmetry != antisymmetry.
 
ah :)
true
 
11:49 AM
Plus, even if the the quote you used uses asymmetric to mean antisymmetric (some weirdos do), it states the implication irreflexive and transitive => asymmetric, which does not imply asymmetric => irreflexive and transitive.
Furthermore, a strict weak ordering has additional constraints over a strict partial order.
 
Anyway, the upshot seems to be that I have to implement my own binary search. What a bother.
 
It requires transitivity of incomparability.
@KonradRudolph The moral of story is: you need to learn set theory to do C++ :P
 
the moral of the story is: back to the drawing board and dust up those algorithms
 
Why don't you just combine upper_bound and lower_bound by hand?
 
does that actually help?
don’t they suffer from the same problem rather?
anyway, lunch …
 
12:02 PM
@KonradRudolph No. Each one of them requires only partitioning according to one of the relevant expressions.
Seems to be fine for your use case.
 
no, core dumps for my use case
 
I guess equal_range has stricter requirements to allow some optimization (single-pass, maybe)
 
okay, I’m afk … see ya :)
 
Seems they give you the ends reversed.
Also, yeah, lunch too.
 
I want lambda-case :(
 
12:10 PM
lambda case?
 
More concise syntax for anonymous functions that start with a pattern match.
 
eww pattern matching
 
fucking vs sucks dick
why can't it just do what I want it to do
or even make sense
 
@R.MartinhoFernandes Hohum. I should collect royalties. /cc @StackedCrooked where's the content license?
@DeadMG you made it up. again
@TonyTheLion New lounge theme: run through the desert on a font a with no name...
Oh haha. We have gravatars falling off in santa sleigh style
@TonyTheLion Is this where we can register our preference?
 
@sehe lol
 
12:23 PM
@LucDanton Op -- / Op - / Op- / Op- / Oppa lambda-style!
 
@sehe oh gawd, that statement had an unintentional meaning :/
 
There is no such thing (vis. Freud)
 
I don't care about Freud
vis.???
 
Who was high
 
oh that was thingymagig
Zoidberg I think
 
12:34 PM
can anyone teach me number patterns
 
what kind of number patterns?
 
What's number patterns?
 
also this is not math.se
 
output
3
32
321
using for loop
i've been at it for some time
 
dude, for (int x = 3; x != 0; --x) { std::cout << x << std::endl; }
have you read a book on programming basics?
cause if you had, you'd be able to figure that out fairly easily
 
12:37 PM
@TonyTheLion Ell
 
oh yea
 
@TonyTheLion That will only print the last line.
 
@KexyKathe There: all the series you'll ever need: oeis.org/A001969
 
@TonyTheLion that wasnt it
@sehe thanks
 
then ask questions clearly
ffs
 
12:41 PM
@KexyKathe Wut?
 
I misunderstood his question.
 
@FredOverflow I like mine better
 
I like std::cout << "3\n32\n321\n"; best;
 
meh. old
 
12:44 PM
@sehe WTF is going on with you, man?
 
@sehe thanks once again
@FredOverflow thank you!
sorry im fairly new to programming
 
@KexyKathe Here. This should make your prof happy amused cry wonder:
   std::ostringstream oss;
   boost::for_each(irange(3, 0, -1), [&] (int i) { oss << i; std::cout << oss.str() << '\n'; return i; } );
 
@FredOverflow Short, concise and to the point :)
 

« first day (787 days earlier)      last day (4154 days later) »