« first day (1604 days earlier)      last day (3345 days later) » 

5:00 PM
I placed a bet on a CS GO match and I won
cool
 
real money bet?
 
normally it's cs:go items
my friend's in debt
 
lame
 
@Borgleader cheers Locke
 
they're worth $$, though
 
5:01 PM
@Borgleader somewhat
CS GO skins
you can sell them for real money but you get them in game
 
is anyone going to tell me what Robot wrote or not
 
if I have map<T,V> and I want to for_each it... is my lambda taking const std::pair<const T, V>& or const std::pair< const T&, V>&?
 
if you bet 3 x $1 skins that's like betting $3
 
... except you're getting them for free, no?
 
@LightnessRacesinOrbit told you already, kindof
 
5:03 PM
@thecoshman if you wait enough yes
 
i dont wanna get banned meself, so i didnt repeat it exactly
 
@Borgleader say then immediately delete
 
WTH?
 
@thecoshman auto or map<T, V>::value_type
 
@milleniumbug huh? std::for_ecah will pass a const std::pair& to whatever callable you offer... not sure where what you say fits into anything
 
5:08 PM
why does it feel like certain code isn't fucking getting executed?
 
@thecoshman You asked which type your lambda should accept. And I answered.
 
@milleniumbug but if my map is <T,V> you are saying the lambda would take a V... no?
 
@thecoshman T is key_type, V is mapped_type and std::pair<const T, V> is value_type
 
fucking hell it's time to set clock one hour ahead
 
one shall not feel anything when writing code, if you are overly excited and/or depressed about what you are writing.. you are doing it wrong
 
5:13 PM
lost a fucking hour
 
That's slightly confusing
 
this DST shit should just die
 
@Borgleader it's nice when i get an extra hour once a year
but then i lose it when i need it most
 
@Blob what part of the world changes DST.. today?
 
@FilipRoséen-refp i noticed today
 
5:15 PM
@Blob when was the "real" date, and whereabout are you?
 
@FilipRoséen-refp new york. it probably "changed" yesterday night
 
@milleniumbug oh I see...
 
but i noticed my watch didn't match my computer's time
i was robbed
i need to do productive stuff, see you guys
 
@Blob ah, alright. In Sweden we changed it (-1) at the 27th of Oct, and gonna "reset" it the 29th of March
I never learn which is which...
 
it was at 2AM this morning
 
5:18 PM
@milleniumbug if you were stating that both would work, auto fails to compile
 
@thecoshman It would work in C++14
 
@milleniumbug <shame face>
another thing, perhaps I am doing it 'badly'. I have a collection of cubes, and I want to find the largest, so I use a for_each to calculate the size of each, and if it is large than what I have stored as the largest, I update what the largest is. Is there a way I can get the iterator pointing to that largest thing? writing it out now, I think doing my own for loops would work better... as that way I actually have the iterator...
 
@thecoshman first std::transform and then I think it's called std::max_element
transform will map them to sizes, then you can find the largest one
 
oh
and std::max_element returns the actual itterator?
 
5:28 PM
@thecoshman I'm pretty sure it does; feel free to cppreference.com-it :)
 
@ScarletAmaranth on there plenty these days :P
 
@thecoshman it's my homepage
 
What do you guys think about me writing style?
 
@Cinch std::endl, yeah right
do not write C++ tutorials if you can't write C++ :-\
 
@ScarletAmaranth ???
why is std::endl; bad?
 
5:37 PM
@Cinch because it flushes the stream for no reason
 
@ScarletAmaranth Is that necessarily a bad thing?
It may be slower, but for educational purposes
It leaves a loose end on which I can pick up the thread that leads to explaining how streams work and why flushing is
 
we really don't need more horrid C++ tutorials :-\
 
@ScarletAmaranth Are you kidding me I am creating the best jam-packed Hello World tutorial there is
 
well, you're free to do whatever you want :)
 
@ScarletAmaranth that's only bad if you don't need it flushed vOv
and it seems std::transform transforms in place...
 
5:42 PM
@thecoshman hell no - you can pass in an output iterator to a new range
 
@ScarletAmaranth oh... that sounds 'costly'
 
@ScarletAmaranth So he's been told (repeatedly)
 
@thecoshman how is it costly? std::vector<cube> sizes(myCubes.size()); and then std::transform(std::begin(myCubes), stD::end(myCubes), std::begin(sizes), [](auto const& cube) { return cube.volume(); });
 
@ScarletAmaranth perhaps I misunderstood... would it not copy a collection to a new one?
 
user1804599
> “The Burger King customers looked so good on TV, but when I got here they turned out to be kind of gross,” said Strauss
 
user1804599
5:45 PM
lol
 
@thecoshman nope, it simply constructs the sizes in the new range
 
@ScarletAmaranth 100% superfluous use of transform over range-for
 
you did give the vector the wrong type.
 
@Puppy I did - it was of course meant to be whatever he is using for volume / size / whatnot :P
 
@Cinch "Hello World exposed" sounds like a dirty programming tabloid
2
 
5:47 PM
@Pris This guy gets it
 
@Mr.kbok 100% imperative thinking of yours :P
 
I wish you could save tabs on Firefox
 
@Pris Open an issue in their bug tracker
 
History > Restore Previous Session
neato
 
derp, just do std::max_element and provide it a custom compare function vOv no?
 
5:50 PM
@thecoshman sounds like a HACK to me! (and not sure if max_element can eat a custom comaprator)
 
hmm... that also means I could end up calculating shit a lot more :\
 
how come?
 
> I will teach from the bottom-up
closed the tab
 
you need the size of EVERY single cube to find the highest one
and std::transform will do this part for you
and then you need the "biggest" of them all, which is what std::max_element is for
am I missing something?
 
@ScarletAmaranth It is, but that's what iterators are.
 
5:51 PM
@ScarletAmaranth lol, agreed. Still.
 
@ScarletAmaranth I meant if I just used max_element
 
thecosh's way is better, if max_element can indeed take a custom comparator which I imagine it can.
 
@BartekBanachewicz Forgot to update my git tree before looking for mousey things.
 
user1804599
@ScarletAmaranth Use Grover's algorithm.
 
I'm just thinking whateverHeNeeds = find greatest . map volume kind of thing vOv
@райтфолд lol; I had too look that up xD
 
5:53 PM
@Puppy except I have to compute that data for comparing them more times... rather than just get the size for each once, then compare those as more or less 'float float'
 
user1804599
Use std::sort(xs.begin(), xs.end()); then *(xs.end() - 1).
 
user1804599
It will give you the largest one!
 
@thecoshman then do what I said :P
 
@thecoshman Let the optimizer give a shit about that.
 
user1804599
I wish I were a crack addict.
 
5:54 PM
unless you already find that repeating three multiplications (!) is gonna be a serious problem for you.
 
@Puppy true...
@Puppy but as a principle... say if it's costly to work out the value that you want to compare...
 
as a principle
fuck doing work yourself, make the optimizer do it.
only do it if you have to.
 
@thecoshman as a principle, do the "right thing" to transform and max_element; then benchmark to see if you give a crap about efficiency
 
@thecoshman std::priority_queue?
 
@ScarletAmaranth Don't even bother benchmarking at this juncture.
 
5:57 PM
Y U NO ALGORITHM... :-\
 
user1804599
@milleniumbug std::multiset!
 
@райтфолд I saw that
 
user1804599
std::set should work if all the highest elements are the same.
 
The Puppy Principle? That should be a thing.
 
yes it totally should be a thing.
according to the Puppy Principle, you're a moron.
 
user1804599
5:59 PM
Use the rightfold principle: performance doesn't matter as long as it's performant enough.
 
lol, this afternoon, for sure:)
 
4 mins ago, by Puppy
fuck doing work yourself, make the optimizer do it.
 
user1804599
What if you are the optimiser?
 
then you've been made to do it I guess
 
user1804599
fucking PHP
 
user1804599
6:07 PM
array_map($f, $xs) and array_filter($xs, $f).
 
php is low hanging fruit
 
user1804599
yummy, fruit (except tomato)
 
user784668
PHP allows WORD JOINER as the sole character in an identifier.
 
user1804599
I wonder if PHP considers ß and SS the same in a class name. Class names are case-insensitive.
 
user1804599
Case-insensitivity is bad in general, although it's very nice if idiots name their thing Json… or Http… instead of JSON… and HTTP….
 
6:12 PM
@райтфолд So it's a fruit...
 
> I am not endorsing Microsoft Visual Studio even though it is considered the best IDE to program C++ in.
um#
I am not endorsing VS even though I am endorsing VS
also "it is considered [by whom?]"
 
user784668
@LightnessRacesinOrbit Um#? Some new Microsoft language?
 
@LightnessRacesinOrbit double speak
 
@Fanael lol Um#
 
user1804599
6:14 PM
Umbrella.
 
user1804599
"Paraplu" ftw.
 
Lounge<Um#>
 
user1804599
kbok
 
user1804599
yummy kebab
 
user1804599
6:15 PM
I wonder what the world would've been like if kbok didn't exist.
 
user1804599
Would it be better? Would it be worse? Would it be similar?
 
@LightnessRacesinOrbit I pray you never have children who depend upon you for the things they don't yet know how to ask for. Which is actually how everyone arrives wherever they are. Still, I don't think we need worry about that... as it would involve something more than spending all night on C++ chat rooms asking if girls are hot or not. Your reproducing likelihood is darn near zero. So we have no problem. — HostileFork 35 mins ago
this guy actually went back through the Lounge transcript to find something to try to embarrass me with
lol
and still failed
 
@LightnessRacesinOrbit Damn that's icy hot burn right there
 
user784668
@LightnessRacesinOrbit Why would he do that? You're embarrassing yourself well enough already.
 
user1804599
@LightnessRacesinOrbit nice.
 
6:17 PM
@райтфолд is that for real?
 
@Fanael Fuck you
 
struct {constexpr operator int(){return 0;} constexpr int operator++(int){return 1;}} C; template<int> struct Haskell {};

int main () {
  Haskell<C/C++> {};
}
 
user784668
@LightnessRacesinOrbit Thanks for the offer, but I'm afraid I have to refuse.
 
user1804599
@ScarletAmaranth yes.
 
6:18 PM
that should be the title
wicked.
 
Morons like you who upvote idiotic comments like that encourage more such comments
It boggles the mind
 
user1804599
bogey
 
user1804599
buoy
 
user1804599
"Buoy" is a terrible word.
 
user1804599
Buoyage has many consecutive vowels.
 
user1804599
6:21 PM
Buoy queueing.
 
Here's the second part of my naughty, naughty, Hello World: compactcpp.wordpress.com/2015/03/08/…
 
user1804599
@Cinch Integers can be neither negative nor positive.
 
emphasize that main must return an int
 
user1804599
And functions are not replaced by their return values.
 
user1804599
6:23 PM
That makes no sense.
 
Steam is broken!
 
some nice games on sale though
 
@райтфолд functions are evaluated to their return values, effectively, at runtime
 
user1804599
Function calls can be if they are referentially transparent, but a pure main function would almost always be silly.
 
this isn't a functional language; functions don't need to return anything, which shatters the idea.
 
6:25 PM
@Blob uh... main does.
 
@Cinch functions in general.
 
user1804599
> Because all C++ code is grouped by curly braces.
 
why do you even click that link?
 
user1804599
My includes and namespaces are typically outside of curly braces.
 
@райтфолд ???
 
6:26 PM
@Cinch Well, the user does not actually need to return anything from main.
 
namespaces are defined with curly braces
 
@райтфолд Also any macros you may need.
 
user1804599
namespace x { } // this code is not inside curly braces
 
also there's quite a bit with templates and such that you don't define inside curly braces.
 
@Puppy that's not the point; his thingy said functions are replaced by their return values
 
6:27 PM
which is clearly bullshit.
 
@Puppy Yes...
 
which was my argument
 
There's a reason I post stuff hera, ya know
 
only function calls are replaced by their return values, and even then, that's only true in most cases.
 
@Cinch Nice.
 
6:27 PM
there's always void functions, exceptions, setjmp/longjmp, std::terminate, etc.
 
user1804599
Infinite loops. :p
 
user1804599
exec is most interesting.
 
also infinite loops.
 
user1804599
setjmp even returns twice!
 
it does?
 
user1804599
6:29 PM
It returns when you set the jump point, and it returns when you call longjmp.
 
I wish void wasn't there... returning unit would almost always just make so much more sense
 
ah true.
 
user1804599
longjmp makes setjmp return.
 
but couldn't you call longjmp more than once?
 
user1804599
fork and clone also return twice. :P
 
user1804599
6:29 PM
@Puppy No idea. I never use this crap.
 
Well, continuing on...
Any other objections?
I think I'll release this to Reddit
 
good job
 
yes; stop writing
 
-1
Q: Decrypt the string of 0 and 1 if possible

shaunGiven an generator of 0 and 1 as below : void encryptor(int N,unsigned S){ for(int i=1;i<=N;i++){ S=S*1103515245 + 12345; int x=(S/65536)%32768; x%=2; cout<<x<<" "; } } As we can see it will produce a string of 0 and 1. Now if we are given a string of 0 and 1 can we predic...

am I just being thick or is this largely nonsensical?
 
then you can infect more people with terrible tutorials so that they, too, can suffer from completely incorrect information.
 
6:30 PM
@LightnessRacesinOrbit Yes
 
@CatPlusPlus Look if you have nothing useful to say just don't say anything okay
 
That's about the context of setjmp
Not setjmp itself
 
@LightnessRacesinOrbit uh no
he just didn't put a ?
 
std::jump_buf buf; setjmp(buf); while(true) longjmp(buf);
just for basic imagination.
 
user1804599
while (true) isn't needed.
 
6:32 PM
@Puppy What precisely is "incorrect" or "terrible" about the tutorial? Or is this just your daily "pretend I'm so much better than everybody else to make it easier to wank in the mirror tonight" routine?
 
true.
but you get the point that here setjmp could return more than twice.
 
@LightnessRacesinOrbit I tried to read it; it's both horrible and incorrect :-\
 
user1804599
If that's not UB, then sure.
 
@ScarletAmaranth It is?
 
So it's a C++ tutorial?
 
6:32 PM
@CatPlusPlus :P
 
@Puppy holy shit setjmp is a C function.
 
@CatPlusPlus Just as bad as all the rest.
 
there is no reason I should be teaching C in a C++ tutorial
 
I'm glad that you finally figured that out.
 
user1804599
You shouldn't teach setjmp and longjmp if it is a C++ feature.
 
6:33 PM
so you could in addition cut all the HTML, JS and whatever crap that you added in.
 
user1804599
In fact, you shouldn't teach anything C++-related.
 
which are just as relevant as setjmp.
 
@CatPlusPlus uh yes
 
less, so in fact
 
@CatPlusPlus btw your UN name me giggle just now heh heh
 
6:34 PM
Not many people should be teaching C++, that part is correct
 
user784668
Nobody should be teaching C++
 
lol targetting people who have no idea about programming with a C++ tutorial
 
@CatPlusPlus uh 1.x isn't for people who know nothing
0.x is
 
6:36 PM
> You must always provide a matching } for every { you create.
Really
 
well that's clearly not true.
 
user1804599
Not in character literals, string literals, comments and preprocessor directives!
 
I was also imagining leaving your header file without a } and making everybody who includes it (which may not be you) provide a closing }.
 
> And then, regex statements (which aren’t programming but formatting) look like this (for email, by the way):
lol
 
regex statements?
oh dear.
 
6:37 PM
This doesn't even come close to being a correct regex for emails
 
user1804599
Matching an email with a regex is quite easy. An email address OTOH is more difficult.
 
Also formatting yeah
 
ISTR that matching an email address with a regex is impossible.
 
@ScarletAmaranth I read it, and it's fine.
 
6:38 PM
or at least 800 lines long or something.
 
user784668
{%>
 
trigram?
 
user1804599
@Puppy the answer is Perl! stackoverflow.com/a/1917982/1804599
 
user784668
@Puppy Digraph. Trigraphs are deprecated and going away in C++17 IIRC.
 
Well, "regex", PCRE can come close
 
6:39 PM
@райтфолд Perl is like Lupus, it's never the answer.
 
If you ever use that fucking regex then I'm going to annihilate your code
 
@Borgleader "What disease does Rightfold have?"
 
@LightnessRacesinOrbit you must have skimmed really fast then; he states quite a few things that are simply untrue; every function is replaced with its return value...
 
user1804599
You can also do it in Perl by calling a Perl email address validation library from your regex, since you can execute arbitrary Perl code from a regex.
 
user1804599
At least in Perl 6. Not sure about Perl 5.
 
6:40 PM
@ScarletAmaranth At a beginner level that's absolutely fine. What is your problem with it?
 
@LightnessRacesinOrbit pantoonism
 
user784668
@райтфолд Perl 6 is not what most people mean by Perl.
 
@LightnessRacesinOrbit it is a false statement
 
@ScarletAmaranth How so?
 
user1804599
6:40 PM
Here's how I validate an email address: const True.
 
Lying to children
But seriously don't write C++ tutorials
 
@LightnessRacesinOrbit because there are void functions for instance, and there are also functions, that, after called, do not terminate "properly"
 
Cue false dichotomy.
 
user1804599
What is a dichotomy?
 
Kind of a crocodile
 
6:42 PM
@ScarletAmaranth At this level of abstraction, it is perfectly reasonable to say that a call to a void function is "replaced by its return value` (which is void()). And functions that never terminate are largely irrelevant here.
You're the one who's wrong
 
user784668
@райтфолд You're either intelligent or райтфолд.
 
user1804599
I wish I were dumb. I'd have a life without worries.
 
@райтфолд Therefore you must consider yourself smart
 
@LightnessRacesinOrbit void()? void cannot be constructed
 
6:43 PM
You would be too dumb to bot have worries.
 
user784668
@ScarletAmaranth void() is legal C++
 
@ScarletAmaranth You should check your facts before you go accusing people of abject incorrectness.
 
@ScarletAmaranth a, void(), b
 
That's what you get by being irresponsibly pedantic.
 
user1804599
6:44 PM
If functions were replaced by their return values then void f() { return 1; } were replaced by one which is obviously impossible.
 
alright, my bad, I stand corrected
 
function calls
 
@райтфолд Wouldn't a compiler be able to optimize it that way anyways?
 
user1804599
No.
 
user1804599
> impossible
 
6:44 PM
you're an idiot
 
@райтфолд is that a C++ function?
 
well the compiler would obviously reject that code.
 
Don't listen to pantoona
 
Oh i forgot that it was returning void
Regardless what do you guys think about part 2?
 
user1804599
You can replace calls to functions by the return values.
 
6:45 PM
why the fuck does C++ allow construction of an incomplete type that should technically have no values inhabiting it
 
because of the use case I literally just showed you?
 
me confused
 
It's not construction.
 
It's not an incomplete type
 
user1804599
6:46 PM
void is incomplete.
 
user784668
voi
 
I just posted that.
 
idk why they're freaking out then.
all functions are evaluated to their final return value in practice
 
user784668
WTF is SourceLocation in Clang sources
 
user1804599
6:48 PM
It's a location in the input.
 
what they do while doesn't matter so much to anything outside unless it's affected
 
@Cinch because they're idiots
@Cinch I already told you several hours ago to simply ignore them
I made you a GIF and everything
 
user1804599
It could be represented as a (filename, column, line) triple.
 
user1804599
It may be more complicated because of macros. I don't know.
 
user784668
@райтфолд Except it's represented as unsigned
 
6:49 PM
Alrighty then, I'm moving the party to Reddit
 
user1804599
@Fanael Then it's probably just the index.
 
user1804599
The column and line can be calculated from it given the source code.
 
> Encodes a location in the source. The SourceManager can decode this to get at the full include stack, line and column information
 
@Fanael It's a location in the source, obviously.
 
user1804599
6:52 PM
@Cinch Downvoted.
 
@райтфолд At least comment, c'mon!
 
user784668
Ahahahahaha
 
user1804599
I already did that all the time in here.
 
Anybody Russian here?
 
6:54 PM
no.
 
user1804599
no.
 
райтфолд? | :D
 
Vlad is
 
we did have some Russian regulars but they went off to war in Ukraine.
 
user784668
We have people from Nottingham, which is almost the same
 
user1804599
6:55 PM
Abyx left? I plonked him long ago.
2
 
he was killed by a mortar shell in Donetsk
 
user1804599
> last message: 3d ago
last seen: 35s ago
 
user1804599
Abyxmal chat activity.
 
||| I wonder whether Russians, in written text, sometimes open with «
without closing with »
 
he's pretty spry, for a dead guy
 
user1804599
6:57 PM
Palovana is a beautiful song.
 
COME ON TARS
 

« first day (1604 days earlier)      last day (3345 days later) »