« first day (691 days earlier)      last day (4240 days later) » 

@MooingDuck I... somewhat understand that.
 
I was going to post that in the Haskell room, but:
 
@Drise wait, that's all wrong
 
What is the purpose of freezing a room with inactivity, btw?
 
There's got to be a way to find the first int.
 
6:01 PM
@FredOverflow Flag for mod.
 
std::find_if(mymap.begin(), mymap.end(),
    [](const std::pair<const int, int>& node)->bool{return node.second==32;}
    );`
 
They'll unfreeze it.
 
@Drise There is- re-implement boost::bimap.
 
@MooingDuck lol
 
the boost stuff isn't magic, you can roll it yourself if you're not allowed to just use it directly
 
6:02 PM
@MooingDuck Wait.
 
@DeadMG ...but since it's static after being filled, you're better off with sorted vectors instead of trees.
 
@Drise en.cppreference.com/w/cpp/algorithm/find std::find_if, and UnaryPredicate is bool (*function)(const std::pair<const int, int>& node)
 
@Drise Telling whether you've found what you're looking for.
 
@JerryCoffin Wasn't paying attention to that part.
 
@DeadMG Not surprising -- kind of got lost in the shuffle.
 
6:04 PM
@MooingDuck No Standard algorithm would be so stupid as to take a function pointer.
 
Ha, thanks to my 8 GB of RAM, I can run 2 instances of VS2010 and 3 instances of VS2008 at the same time!
 
@FredOverflow It emulates natural freezing.
 
@Drise find_if finds the first key/value pair (of a map) that matches a condition, in this case, we want the one who's value is equal to 32.
 
@MooingDuck Where 32 is the value I'm looking for, correct? (It's not a static number)
 
@Drise yes. (You used 32 as an example, I sorta stuck with 32 to keep it clear what all the variables/values were)
 
6:05 PM
@Drise Right.
 
@EtiennedeMartel Are you sure you're awake?
 
@EtiennedeMartel And the purpose being...?
 
@MooingDuck K
 
@EtiennedeMartel oh. my. god.
 
@Drise good morning
 
6:07 PM
@MooingDuck Is this at least optimized for map's BST?
@Chimera Whatup
 
@R.MartinhoFernandes Life is hard.
@FredOverflow I neck deep in legacy stuff right now, and I need to cross check a bunch of things.
 
@Drise Same old same old. You?
 
@Drise No.
the whole point of your problem is that map's BST is only optimized for the key.
 
@Chimera Much the same. Minus my laptop craping out after 2 years.
 
it holds no useful properties for finding the value.
 
6:09 PM
@DeadMG Oh... right.
 
there is no faster way to find the value in a map than to walk the whole BST looking for it.
of course, you can cache and memoize that lookup in all sorts of interesting ways
 
@DeadMG So. Does that find_if return me an iterator...?
 
@Drise I see you are gaining rep! Congrats.
 
@Drise I dunno. You can look up the docs as much as me.
 
@Chimera Holy bajesus. I broke 1.5
 
6:11 PM
@Drise awesome!
 
@Chimera Lawl. I am ahead of you by 1 point :P
 
hey, it's e-penis waving in here
2
 
@Drise HEH!
 
@DeadMG Iterator to the first element satisfying the condition or last if no such element is found.
Just thought you may want to know
 
@Drise I still have votes left today. Who pays more? //cc @Chimera
 
6:12 PM
@Drise yeah, find returns an iterator
 
@R.MartinhoFernandes LOL!
 
@R.MartinhoFernandes I pay 3 votes myself.
 
@Drise Same here
 
But only for worthy q/a.. might be hard for you.... :-)
 
6:14 PM
@MooingDuck So I can just say find_if....->first?
 
auto it = find_if(blah blah);
if (it = container.end()) throw exception;
else
    int key = it->first;
 
@DeadMG pretty amazing tech
 
I still prefer RC cockroaches.
 
error: 'nodeID' is not captured
 
@Drise I hope that's not to me because it doesn't make sense.
 
6:18 PM
@MooingDuck That's what the compiler says
In lambda function:
error: 'nodeID' is not captured
warning: control reaches end of non-void function
 
The lambda needs to capture nodeID?
 
[](const std::pair<const int, int>& node)->bool{return node.second==nodeID;}
 
Also, weren't you supposed to not use C++11 or am I misremembering?
 
@R.MartinhoFernandes Yes and no. For this I try to use it as little as possible, but I have gotten away with it for a while now without complaint.
 
6:19 PM
Try: [=](const std::pair<const int, int>& node)->bool{return node.second==nodeID;} and see if it works better.
 
You will be given a Billion US dollars, if you did one thing, what thing could someone NOT get you to do for that sum of money?
 
@TonyTheLion long list
 
@TonyTheLion Commit suicide.
 
@JerryCoffin got it
 
@JerryCoffin good answer, because the Billion is useless then :)
 
6:20 PM
@TonyTheLion any bodily mutilation, blindness, break back, paralysis etc
 
@TonyTheLion not if you have descendants. Or at least someone who inherits.
 
@TonyTheLion Yeah, I figured it was one nobody could argue with very much.
 
@MooingDuck Talk about self sacrifice
 
@MooingDuck oh yea
 
6:21 PM
@TonyTheLion Return the money if I refuse to do the thing.
 
@MooingDuck I love my children, but I think raising them well is worth quite a bit...
 
@Drise didn't say I'd do it, merely that it wasn't entirely useless.
 
I must say we have some sensible people around.
 
Hello
 
@R.MartinhoFernandes you only get it AFTER doing the thing.
 
6:22 PM
@MooingDuck Btw, I found 32, and it gave me 19547. Thanks as always you compulsive helper you.
 
@TonyTheLion Sensible -- or at least we all agree on the same stupid ideas.
 
@JerryCoffin or that :P
 
@ManofOneWay Hello.
 
Have you tried taking a small water gun into the bathroom and shooting the person's feet next you?
2
 
6:23 PM
@Mysticial That sounds... arousing. (jk)
 
I live alone, it's hard to do that
 
@JerryCoffin How are you Jerry?
 
@Mysticial No, but for a billion dollars I would.
@ManofOneWay Not bad -- just ate a little lunch. Compile finished, so I probably need to get back to doing something useful soon...
 
@Mysticial But seriously, instead of hitting the feet directly, hit the tiles just near the feet as to create the imitation of the spray of it hitting near the feet.
 
@JerryCoffin Sounds nice :)
 
6:25 PM
Oh hey, its the hippie dude looking at the same flowers again
 
TIL Eclipse doesn't let me delete layout files that don't compile.
 
@Drise You also have to wave it around a bit to simulate that it's out of countrol.
 
Anyone know of a way to get, at compile time, how many digits are there in a litteral integer constant?
 
With UDLs?
 
@EtiennedeMartel I made a struct that does that for unsigned only, though handling signed is only trivially harder.
 
6:26 PM
@R.MartinhoFernandes C++03, unfortunately.
 
Or you mean compile-time log10?
 
@EtiennedeMartel is log10 constexpr in C++11?
 
@MooingDuck Fine by me. Said litteral is used as an array size.
 
@EtiennedeMartel Do a simple modulo
 
@DeadMG Oh, right. Didn't think of that.
 
6:27 PM
@TonyTheLion That's sad.
@Mysticial No.
 
@R.MartinhoFernandes :(
 
@DeadMG You mean, a bunch of them.
 
@EtiennedeMartel ideone.com/KcHYC
 
@R.MartinhoFernandes I actually meant division.
 
If you can do UDLs, use template <char... C> constexpr int operator""_number_of_digits() { return sizeof...(C); }.
 
6:30 PM
you're basically talking about int count = 1; int i = ...; while(i /= 10 != 0) count++;
 
@DeadMG see my code?
 
why does my IDE say "duplicate data type in declaration" on the lambda?
 
@Drise how should I know? ^^
 
hmm, java.exe does a lot of null pointer reads/writes.
 
@MooingDuck Thanks.
 
6:33 PM
I mean, it compiles, cool. But I hate red squigglies.
 
@Drise you could replace it with a functor if you want. Equally effective, just a few more lines of code.
 
yesterday, by Drise
You know, I think it has something to do with your avalue and dvalue. Might want to check those pesky tvalues too.
You're starting to get into that confusing word category again
 
You replace it with a thingy.
 
Shit
That was yesterday?
 
That thingy is equivalent to the other thingy.
So you can use one thingy in the place of another thingy.
 
6:36 PM
Surely I wasn't on SO yesterday
 
@Drise It's yesterday UTC.
 
@R.MartinhoFernandes Oh, so like yesterday at midnightish UTC
Er, 12:48
I posted it 7:48 pm my time
 
@Drise sec, code incoming
 
Xeo
6:40 PM
Woah, why suddenly 4 votes on my Rule of Five question (which I myself don't even find that good anymore) ?
 
@MooingDuck I uh... uhh... craps pants ... I think I'll uh.. stay with the red squiggles.
Looks like a bunch of blah blah blah blah to me
Bob Loblaw
 
@Drise the find_value function should look just like what you already have, except where you have a lambda, I have "finder<key, value>(value_to_find)". And main is obviously just a demo
 
 
@Drise I love Bob Loblaw's law blog!
 
@Drise ...congratulations, you've just figured out why they invented lambdas!
 
6:42 PM
@Xeo Hehe. Someone linked to it on a new question.
 
@JerryCoffin implemented FTFY
 
@Drise really, all of it should make sense to you except for passing an object as the third param of find_if, and maybe the finder::operator() function.
 
Xeo
@R.MartinhoFernandes guessed as much
 
@MooingDuck Templates frighten me.
 
@Drise ooooh
 
6:43 PM
@Xeo Why do you think it's not that good?
 
@MooingDuck But yes, after putting my brain on temporary fear hold, I think I got it.
 
@Drise ideone.com/DOQXN template-less version
 
@Xeo Poor thing.
 
@MooingDuck What is the difference between typename and typedef?
 
Xeo
@R.MartinhoFernandes Dunno, in hindsight, it's kinda dumb to assume every class needs a (user-defined) move ctor or any user-defined special member (I'm very much in favor of the Rule of Zero and always promote to use building blocks and let the compiler generate stuff).
 
6:45 PM
@Drise it's like the difference between a car and a carpet
 
@MooingDuck Oh ok.
 
Xeo
@MooingDuck Shhh, copy right infringement! :P
 
 
Xeo
@R.MartinhoFernandes Well, atleast it caused me to pass the 200 mark and gives me the upvotes I want in :)
 
> 7,741 people recommend this. Be the first of your
 
6:46 PM
@Drise One is like class, the other is like using :P sows confusion
 
Be the first of my WHAT?! I must know!!!
 
Xeo
friends
 
@Xeo I know. You had to be lame though, didn't you.
 
Xeo
But you don't have any, so it stopped before it gets embarassing.
:3
 
@Xeo You are almost quite entirely correct. I have 30.
 
6:47 PM
@Drise I think "invented" was just fine. While they didn't invent the concept of lambdas, they did invent something new and definite somewhat different from what Alonzo Church invented that happens to share the same name.
 
@Drise template is the keyword you put before a function to mark the function as a template. typename is a word you put before a type to tell the compiler that a thing is a type and not a variable, for the cases where it gets confused.
 
@MooingDuck That explains it so
better.
 
Xeo
@MooingDuck It was about typedef vs typename, not template vs typename :P
 
@Drise If I write mystruct<int>::apple then the compiler doesn't know if apple is a value or a type. So it assumes apple is a value, unless you put typename in front.
@Xeo oops
@Xeo well those are even more different.
 
Xeo
anyways, dinner!
 
6:49 PM
@MooingDuck ok. And that's different from typedef how?
 
@Drise typedef makes an alias for a type. typename doesn't make an alias
 
ok
My suit is grey not.
 
@Drise Typedef simply creates an alias for a type, so something like typedef int8_t char means I can use int8_t to mean the same thing as char.
 
typedef mystruct<template_param>::apple thing ; //thing is the apple class
typename mystruct<template_param>::apple thing; //thing is an instance of the apple class.
 
@MooingDuck Erm, what? You are not thinking straight.
 
6:51 PM
My suit is NOT grey.
@MooingDuck You're just really losing me. Also, class.
 
@R.MartinhoFernandes I made a boo-boo?
 
The first one will need a typename just as much as the second one.
Yes, it sucks that much.
 
@JerryCoffin does the char go on the left or right? I always get confused.
@R.MartinhoFernandes ah, right
 
@Drise There's a class following along, and you're making comments on their behalf? That would explain a lot.
 
@JerryCoffin You got it wrong too!
 
6:53 PM
@MooingDuck Syntactically, typedef is a storage class, so the rest of it just just like defining a variable.
@R.MartinhoFernandes Hm...so I did.
static char x; -> x is variable with static storage class. typedef char x; -> x is "variable" with "typedef" storage class.
 
@JerryCoffin Um that "variable" is going to need a lot more qualification than just a quote.
 
@CaptainGiraffe Perhaps "symbol" would be a better choice.
 
@JerryCoffin I'll just post a that's_the_joke.jpg.
 
@R.MartinhoFernandes Works for me =)
 
6:59 PM
Just heard a friend say, "If they SOLD a version of this program that works like my pirated cracked version, I would buy it!"
 
@FredOverflow OMG, Erik Meijer has left the world of pure FP and is advocating side effects now! I just can't believe it.
 
@R.MartinhoFernandes Well, well.
 
@R.MartinhoFernandes First thing I do when buying a DVD is normally to rip a copy with the previews, FBI warning, etc., removed.
 
@R.MartinhoFernandes That very sentiment is why Dad (@73) is using ubuntu.
@JerryCoffin Odd thing is; this started in the eighties, ought to have been killed and dead in the mid nineties. How it has progressed into the BluRay era baffels me.
 
Oh God. I’m away for a day and the memes are all over the place.
Also hi.
 
7:09 PM
@CaptainGiraffe Not really baffling -- a simple case of vendors seeing customers largely as the enemy, and serving what they see as their own interests instead of the customers'. In fairness, the movie people seem to at least be working at little at trying to find meaningful solutions. The music people are simply trying to force the world to live in 1982 (1984?) forever.
 
@JerryCoffin Dammit, I was about to ask if you meant 1984.
 
@JerryCoffin Really, I thought it was the other way round.
the music people at least do iTunes and stuff
it's the film industry that do jack shit to improve customer experience
 
@Fred:
in Haskell, 16 secs ago, by R. Martinho Fernandes
Yay! Live again.
 
@DeadMG No, they don't -- Apple does iTunes, and has managed to get the music people to go along, to a very limited degree. Left to their own devices, the music people just want you to buy a CD. They've done some web-based stuff of their own, but burdened it with so much paranoia that it was unusable. While movie people aren't doing well, at least (for one example) most new BD come with digital download capabilities (from the vendor, not Apple or other 3rd parties).
 
right, but at least the music is vaguely concurrent with the CD
film you have to wait a long time to see any kind of non-cinema release
 
7:17 PM
@DeadMG The closest analog music has to a cinema release is concerts -- and music is often performed live long before it's released on CD (e.g., I first heard "Closing Time" when Semisonic was still an opening act, years before they released a CD at all).
 
@JerryCoffin Concerts -> Theater.
@JerryCoffin If you want a few songs promoted to release at one date with a million of promotional nippets distributed worldwide; fine then Cinema Release -> Concert.. (Wait Gaga?)
 
@CaptainGiraffe I think you lost me there. I thought we were talking about music, but they you brought up Gaga -- clearly no relationship to music at all... :-)
 
So, can I read the ebooks I bought through Barnes & Noble on the new Kindles? No? We're done here.
 
@JerryCoffin =) My favorite is Valentina Lisitsa (sp.) She does a lot of her stuff in HD on youtube. I'd throw a lot of money on her if I ever got the chance.
 
@CaptainGiraffe I'll leave that to others -- piano is all right for live performances, but I've yet to hear a recording that was worth listening to at all.
 
7:30 PM
Dog ears?
I was gifted with crappy hearing, so I can enjoy music in most circumstances.
 
@R.MartinhoFernandes Not any more, but when I was young, yes, I could hear dog whistles.
 
@JerryCoffin I heard this was good.
 
@EtiennedeMartel For your enjoyment, this is what the concert should have sounded like. youtube.com/watch?v=1Qdr3Uvs09o
 
@R.MartinhoFernandes woof
 
@EtiennedeMartel I'll take your word for it -- I've never been much of a jazz fan either.
 
7:39 PM
Poll time: I love music: 5 ... Don't care for it: 1, (3 I like pop and rock/ I like country and western) explanations are optional.
 
Hello.
 
@JerryCoffin You seem to take my word a lot. Why do you want my word that much, eh?
 
He's writing a book.
 
@R.MartinhoFernandes Not an IP lawyer?
 
@EtiennedeMartel You seem to give them out pretty freely, so why not...
 
7:46 PM
@JerryCoffin I like the sound of my own voice.
 
Im doing a program that has the feature, "Input ? at any time to exit". To do that i have to repeat this

`if(str=="?"){
return 0;}`

To do that i have to repeat this after each input operation, Is there a better way to do this?
 
@EtiennedeMartel I prefer typing to express myself, at least as a rule.
 
@CaptainGiraffe 4 - pop/rock/rap
 
@MohamedAhmedNabil Put the input stuff in a function, and call it.
 
@MohamedAhmedNabil not really
 
7:47 PM
Use a monad!
Oh wait, C++.
 
@MohamedAhmedNabil functions are good
 
@EtiennedeMartel But I can only exit the function itself not the int main();
 
EWWWWWWWWWWWWWW.
 
took me a second to realize what I said, sorry
@MohamedAhmedNabil there's not really a better way
 
@MooingDuck :)
 
7:50 PM
@MohamedAhmedNabil What.
Oh, right, right.
 
@EtiennedeMartel if i use a function. and do return it will exit the function not the main() function
@MooingDuck Ok, and btw Remember when you told me about strings. What was the other thing?
 
@CaptainGiraffe I'm far too picky for to give a short answer (e.g., classical: um...well, quite a few violin concertos and Haydn's trumpet concerto -> 5. Most piano sonatas -> ~2.)
 
@MohamedAhmedNabil correct. That means you're better off not using a function
@MohamedAhmedNabil capacity.
@MohamedAhmedNabil strings hold a "current size", a "maximum size before it has to move the cstring", and a "pointer to a cstring".
 
@MooingDuck Anything before the 60's ?
 
@CaptainGiraffe very little before the 80s
 
7:53 PM
@MooingDuck I'll jot you down as a 3.3.
 
When do you think that C++11 will be fully implemented in an IDE's compiler
 
an IDE isn't a compiler.
 
@MohamedAhmedNabil The IDE's will follow the compilers.
 
@Rapptz So? IDEs still need to implement its stuff for their smarts.
 
@CaptainGiraffe I might not understand your scale then.
 
7:55 PM
An IDE without smarts is nothing but a glorified text editor. (And a crappy one at that)
 
When do you think that C++11 will be fully implemented in a compiler? ^.^ my bad, just a bit sleepy
 
@R.MartinhoFernandes Several IDEs I've used don't provide the compiler or debugger, just the IDE itself.
 
@MohamedAhmedNabil probably never? No compiler ever got C++03 all the way.
 
@MooingDuck It's like the Knuth scale N.m
 
@MohamedAhmedNabil though clang is almost 99%
 
7:55 PM
@Rapptz Erm, without a compiler, it's hard to classify something as an Integrated Development Environment.
 
@MooingDuck Why do they keep making new C++ versions
 
@MooingDuck Woah, woah, calm down.
 
@MohamedAhmedNabil people keep coming up with new ideas. When people stop having ideas we'll consider C++ "done"
 
@MohamedAhmedNabil C++03 had one feature (export) that was too complex to implement. It was removed in C++11.
 
@MohamedAhmedNabil Primarily to address areas of development that weren't previously of as great a concern.
 
7:56 PM
@MohamedAhmedNabil C++11 added rvalues which makes programs much faster and less bug prone.
 
So idea's are basically left, unused and discarded till the become old.
 
@JerryCoffin A very good point.
 
@Rapptz For example, if it has syntax highlighting (and this applies to any text editors, not only to those in IDEs), it needs to implement C++11 support.
 
@MohamedAhmedNabil I'm not sure what you are saying, but it seems to be the opposite of what I said.
 
@MohamedAhmedNabil That would be bad ideas.
 
7:57 PM
Same goes for any IntelliSenses and refactorings, and whatevers.
 
@MooingDuck People come up with new ideas, thoose ideas arent implemented.
 
@MohamedAhmedNabil the best ones are
 
@R.MartinhoFernandes That still doesn't mean that an IDE is a compiler.
 
@MooingDuck rvalue references. rvalues were there all along.
 
7:59 PM
@Rapptz But that makes "An IDE is not a compiler" an irrelevant reply to "When will IDEs implement C++11?".
 
Did anyone see this before XD?
 
@MohamedAhmedNabil yep
 
@MohamedAhmedNabil Repeatedly.
 
@R.MartinhoFernandes Text editors could be edited very easily. You can put custom keywords if you'd like.
 
No I must have missed that xkcd. I probably had one to many to drink
 
7:59 PM
@MohamedAhmedNabil yes, I have seen every xkcd comic, and wouldn't be surprised if that was common in this room
 

« first day (691 days earlier)      last day (4240 days later) »