« first day (687 days earlier)      last day (4262 days later) » 

12:00 AM
@sehe I don't recall where that alias = T thing comes from. Perhaps it started in one of the C++ lists. The name isn't much of a stretch when it comes to demonstrating alias templates :)
 
@LucDanton I first saw the name from something Johannes posted here.
 
@R.MartinhoFernandes Keeping in mind that a 'better' result_of/is_callable is arguably one that ignores that whole pointer to member mess and puts the burden of calling std::mem_fn on the caller. You can stretch it to a two-parter where you introduce invoke as the more elaborated solution!
 
Xeo
Oooh, I have more videos to watch. Just found out there are recorded talks from C++Now '12 on Youtube :)
 
I wish I could watch YT now
 
Not sleepy yet?
 
12:03 AM
getting there slowly
 
@LucDanton Hmm, yeah, that mess does not really help make an interesting article.
 
Xeo
Talk about how you'd like the Asio API to be :P
 
@Xeo But if I take the time to thinking it out to writeable form I'll feel enticed to do it! I want to stay committed to ogonek. I won't betray her!
 
Xeo
Pff, aren't you commiting to that rtl thing too?
 
Nah, that was an experiment to see if it would help write ranges.
 
Xeo
12:08 AM
C'mon, you need a break from that Unicode madness!
I'm really interested in what you don't like with the existing API
 
let him do the Unicode madness
maybe there'll be a decent Unicode lib one day
 
@Xeo Which API? Asio?
 
Xeo
Aye
 
Well, one thing I don't like is that it kind of pushes your code towards CPS.
And CPS is really fugly.
 
@R.MartinhoFernandes +1
 
Xeo
12:10 AM
Isn't that what the proactor pattern is kinda all about?
 
Dunno, never heard of that proactor thingy :S
 
@Xeo If it has a name, it isn't less annoying
 
Xeo
You define upfront what happens when an async operation is finished
 
Let's say I have this sync code: int x = read_an_int_from_the_network_blocking(); std::cout << x;.
With Asio you truly make a continuation and give it to the io_service.
 
Xeo
std::async(foo).then(bar) would fall in the same direction
 
12:13 AM
I have found Asio to be confusing
 
@Xeo Not really.
That doesn't turn your code inside-out.
It only requires some glue instead of semicolons (which is why the continuation monad in Haskell is actually usable: do-notation does the semicolon parts).
 
Xeo
ah, true, you have to define the chain at the async call point
So basically you want Asio's API to use futures with .then?
Or something in that direction?
 
Yes, something along those lines.
 
Xeo
Well, you can always use #include <yield.h> :>
and have it completely imperative looking
 
Xeo
12:16 AM
?
 
Well, what's <yield.h>, and what would the code look like?
 
Xeo
Ah, it's the coroutines thing from the Asio author
 
Ah, that. Does that support the entire language?
 
Xeo
Well, it supports everything that is allowed after an else, since that's what it expands to. Or what do you mean?
 
e.g., can I yield in a catch?
 
Xeo
12:20 AM
It switch-jumps to the yield point
 
Can I throw from a function with yields in it?
 
Xeo
I.. think so?
Since the coroutines are stackless, there's atleast no cleanup problem
 
@Xeo Would that work in a catch block?
 
Xeo
Hm, good question if you can interleave that like with loops
Note, I didn't use it yet
I just read up on it earlier and recently from his videos
 
That's exactly what I'm concerned about. I want it to work without me having to think about corner cases if I am using language constructs in non-trivial ways.
Or at least get a compiler error.
 
Xeo
12:24 AM
Well, you're basically operating inside a switch, so you can do anything that's allowed there
 
Xeo
Only problem would be local variables whose initialization might get skipped when jumping, I think
 
Also, I'm not sure yield can easily replace async/await.
 
@R.MartinhoFernandes from what I remember: yes, I think I've seen him use that in a demo. But, again, it is stackless.
 
Xeo
It works well atleast for Asio and the async operations
 
12:25 AM
Is the C++ standarad available forsale as a hard copy
 
(I know it does some in some scenarios, because I've hacked it to do that before, but in general it can become a mess again)
 
#include <iostream> using namespace std; #define pi 3.1415926535897932384626433832795 int main() { // Create three float variable values: r, pi, area float r, pi, area; cout << "This program computes the area of a circle." << endl; // Prompt user to enter the radius of the circle, read input value into variable r cout << "Enter the radius of the circle " << endl; cin >> r; // Square r and then multiply by pi area = r * r * pi; cout << "The area is " << area << "." << endl; } — user1641173 52 secs ago
 
@MohamedAhmedNabil Likely. But get it from the robot's profile: stackoverflow.com/users/46642/r-martinho-fernandes
 
I'm trying to overload operands on a private struct in order to nicely have the effect of moving an object in space easily, i.e. object.tx += 0.5f and rotating it with object.rx = 90.0f. But since tx, ty, etc. are structs, there is no nice way of retrieving the rx value for example. Or is it ?
 
heh
 
12:27 AM
@sehe Is that considered pirating ?
 
@ManofOneWay Conversion operator? (But implicit conversions are evil, etc)
@MohamedAhmedNabil It's built from a publicly available source.
It's not the exact official text, though, since it has a few typos and stuff corrected.
 
@R.MartinhoFernandes Then why is it sold here iso.org/iso/catalogue_detail?csnumber=50372
 
Because that's the official text.
All the drafts are publicly available.
 
@MohamedAhmedNabil Nope
 
Only the final version isn't.
This repo is maintained by the standard committee's editor github.com/cplusplus/draft and that's where I build from.
 
12:29 AM
@Rapptz that was pretty bad...
 
@R.MartinhoFernandes How does it work? Am I able to say that object.rx will always return the actual floating value of x?
 
I was talking about a hard copy, A real book not pdf.
 
I don't think there's one.
 
@R.MartinhoFernandes Because that's the only thing I want it to return, if I just type object.rx and not the actual struct
 
@sehe His post updated. Area doesn't actually do anything.
 
12:30 AM
@ManofOneWay You can have it return the struct but the struct has a operator float() const { blah blah } or something.
It works fine in most situations.
 
@Rapptz Duh. Look at the editor. I updated it :)
 
Oh, it says veer on my screen.
 
float r = object.rx; works, for example. You can also pass it ok to functions expecting a float. But it may mess up when overloads or templates are involved.
 
@Rapptz See link
 
Xeo
 
12:32 AM
@sehe Yeah I see it now.
 
Xeo
Damn, with all the talk vids, I'm so gonna have a sleepless night...
 
@Xeo They'll be there tomorrow... (They've been there for months!)
 
@Rapptz Am i lucky or what XD I was spending the last half hour searching for something like this XD
 
Xeo
Yeah, but I'm the type of person who almost can't wait when he got an interesting video
 
@MohamedAhmedNabil searching for what?
 
12:33 AM
Things.
 
@Rapptz a good presintation explaining modules
 
Modules don't exist yet.
That's probably why there's no good presentation about them.
 
Xeo
Gah, if only the audio quality was better..
 
@StackedCrooked That's the top secret project Jeff said he was working on?
 
@R.MartinhoFernandes Oh cool. But what should the operator do? Return the float value? It cannot have a return type though
 
12:40 AM
Ah no, it's just a blog compilation.
@ManofOneWay ? The return type is the type it converts to.
 
        inline operator float() const {
            return _position;
        }
does this work you mean?
 
Yes (assuming _position is a float).
 
Great, it works =) thanks
I may be a bit dangerous though
But I like how an object can be moved around with the matrix operations abstracted
What do you think?
 
1:24 AM
@KonradRudolph a bit of range love: gist.github.com/3591664
    std::size_t header_width = use_header
        ? 1 + *boost::max_element(header | transformed(length))
        : 0;
 
Xeo
1:43 AM
// We cannot use a `stringstream` with `getline` in the following since that
// would skip over multiple occurrences of the delimiter when columns are
// empty; we want to preserve those empty columns.
erm, how does getline skip empty columns?
Say std::stringstream s("o::o:o:o:::o"); should give 8 iterations (assuming I didn't miscount) for getline(s, some_string, ":")
@sehe ping, since you're not here anymore. See above.
I'd also do po::bool_switch(&not_use_header) for the "no-header" flag, but that's just me
 
 
3 hours later…
4:38 AM
scrubs
 
scrubs?
 
5:09 AM
Hello all :)
 
Hello
 
If I use cin>>(int variable) and give a character as the input , there is a massive buffer overflow and the program just goes insane, does anyone know if there is a graceful way out of this situation ?
 
there's nothing wrong with int i; cin >> i; for any input entered.
the only reason why this would cause you a program is because some other aspect of your program is the fail
 
there seem to be a lot of pages that disagree
 
appeal to authority fallacy, where authority is "a lot of pages".
 
5:12 AM
lemme clarify , i am giving a character as the input
 
ultimately, there's no way I can have a single fucking clue what's wrong with your program
you've given me the tiniest most worthless tidbit and asked me to psychically divine your problem
 
Hehehe , it seems I shall have to deal with the noob treatment again
All the info about the query is in the query
really , it is , just try it
 
then you have an unanswerable query
good luck, have fun.
 
I remember you being a lot friendlier a few months ago :P
 
that usually depends on if you're wasting my time with questions that don't have answers
 
5:14 AM
no biggie , I'll try to deal with it, still I suggest that you try what I have suggested
you are dismissing the query without trying it out
try it , then I shall accept your dismissal
 
trying what out?
you haven't given anywhere near enough anything to try it out
that bein the whole reason I'm dismissin it
 
Okay, so, The Expendables 2 was quite enjoyable.
 
I heard that both it and it's predecessor were terrible
 
Well, you obviously don't check Rotten Tomatoes very often.
Anyway, I'd categorize that movie as a comedy disguised as a macho action flick.
It's over-the-top, cheesy, ridiculous, and most importantly, it does not take itself seriously, which is the only way to make such a movie bearable.
 
5:30 AM
The Bourne Legacy wasn't great, saw it tonight.
 
Yeah, I heard it sucks.
 
It was just so slow....
 
@Chimera Hey, it has 55% on the Tomatometer!
 
@EtiennedeMartel amazing.
You ever find a ton of unlabeled DVD's and start popping them in to see what's on them?
 
I don't have unlabeled DVDs.
 
5:33 AM
I don't have a DVD drive
those things are so 1990
 
Actually, I don't use DVDs as a storage medium.
 
@DeadMG What do you use?
 
@Chimera A hard drive.
and an Interwebs connection
 
Yeah, TBs are cheap these days.
 
DVD's and CD's still have uses though.
 
5:34 AM
why lug around DVDs which are easy to misplace or damage
when I could simply download whatever I want, whenever I want it?
 
user406009
@angryInsomniac Guess you are facing an issue with the variable being left initialized because it cannot read in a valid integer. One option is to just read in strings and parse yourself. Another option is to check cin.fail() and then mess around with resetting cin.
 
@EthanSteinberg ideone.com/mHwWi speaks for itself
 
@DeadMG Except when your Internet connection drops.
 
@EtiennedeMartel Then I'm fucked. So what's new?
if that happens often I'll just keep what I download on my HDD
and I'll have a way bigger collection than crappy DVDs
 
user406009
I am guessing he is using that input number as an offset into an array.
 
5:37 AM
@DeadMG Indeed.
 
@EthanSteinberg Hence why I said that I would have to psychically divine his program to see his problem.
even iostreams aren't so badly designed as to be an input library that generates buffer overflows on bad input.
 
@DeadMG so does this ideone.com/hEmhL
 
"Don't see no buffer overflow error". Double negative. :-)
 
The craposaurus.
 
@angryInsomniac What does it say? Cause I'm not really seeing it.
 
5:40 AM
I have this program that doesn't work. It's below. What's wrong?

return;
 
@Chimera What's it's expected behavior? If it's "do nothing", then it is working.
 
@EtiennedeMartel Nah, just a bad attempt and poking fun at the other question.
 
It was so bad, my lower jaw got out my ass.
 
lmao
 
I thought that was expected behaviour for you
 
5:43 AM
@DeadMG ideone.com/7oAbW check this , I just gave the 1 input , where did the other cin get filled from ?
 
@angryInsomniac Who gives a shit? You tried to read from a failed stream. That's your problem.
 
Wait, is this guy trying to avoid writing safe input stuff?
 
in fact, if I recall, it doesn't read anything in that circumstance
 
Ya. No blocking.
 
@DeadMG if you run it in visual studio or something , just give one char and it fills everything successively
 
5:45 AM
it doesn't matter what it does
you read from a failed stream
that's your problem
 
What is going on here?
 
user406009
@angryInsomniac std::cin notices the end of file and stops reading in things(sets fail bit etc). I forget whether the last char is EOF or nothing.
 
@EtiennedeMartel I don't know.
 
EOF is not a character.
 
EOF is people!
 
5:47 AM
Why would you even use std::cin? Doesn't that make it hard to validate the data? Remember, I really don't use C++.
 
Unidentified File Operation
 
@Chimera Yes.
 
@EthanSteinberg it does set a fail bit , but all the cin's just get filled by themselves
 
it's not very sane to do I/O like that
 
@Chimera because ... it is a stupid assignment with restrictions
 
5:48 AM
@angryInsomniac What the fuck is "fill"? That term doesn't belong anywhere near I/O.
 
@angryInsomniac ah
 
Fill ALL the cins!
 
For what it's worth, it's not just C++ iostream that have that silly behavior where they produce garbage; also some low-level i/o circuits do that. And, currently the built-in keyboard of my soon-to-be-shot laptop. Beware the garbage.
 
@EtiennedeMartel lolz
 
Anyway no one is going to recommend you with a solution because it's not obvious what you're having a problem with.
 
5:49 AM
@LucDanton Which was exactly my original response.
 
@DeadMG ikr
 
it was far too unclear what his problem or code was
ikr? that one's new to me
 
I know right?
 
@DeadMG Yeah, if only there was a website where people can ask programming-related questions and get answers...
2
But I'm afraid that only exists in my imagination.
 
Well, more like 'inorite?'
 
5:51 AM
@angryInsomniac as the puppy explained sloowly and cleaarly, you're reading from a failed stream. don't do that.
 
getting tired. almost 11pm here.
 
@Cheersandhth.-Alf I am looking into clearing the stream after its fudged
 
Just to make it clear though, those reads don't cause UB. Use of uninitialized variables will. (Which has also been already pointed out, but apparently everything bears repeating.)
@angryInsomniac std::cin.clear();
Well, that's a very strict meaning of 'clearing'. It means 'clear the error state'.
 
And then empty the buffer with std::cin.ignore(std::numeric_limits<std::streamsize>::max());.
 
@angryInsomniac don't do that either. read whole lines or blocks of text. convert elsewhere
 
5:53 AM
If you mean 'clear the ill-formed input' there's more to it.
 
user406009
Wait, what is the difference between char c; std::cin>>c; and char c; std::cin.get(c)?
 
@Cheersandhth.-Alf as i said , i cant , its a stupid fucking assignment
 
@EthanSteinberg One is formatted (skips whitespace), the other isn't (it simply gets the next byte).
 
I would read a string and then change it to int
but I cant
 
@angryInsomniac you're caught in a web of bad ideas
 
5:54 AM
@angryInsomniac Why?
 
wait
 
@Cheersandhth.-Alf possible
 
there are assignments that aren't fucking stupid?
 
What does your assignment explicitly say?
I'm genuinely curious
 
@DeadMG Yes. They're rare though.
 
5:55 AM
@DeadMG there is a point after which your attitude becomes old, you crossed that about 10 messages ago
@EtiennedeMartel cannot use any string related stuff
 
@angryInsomniac Hey, he might be an obnoxious bitch, but he's our obnoxious bitch, so cut him some slack.
 
@angryInsomniac Thanks for the ad hominem, but it doesn't bother me.
simple fact is, you've shown no useful code whatsoever, and very little description of your program, so we can't help you.
 
@angryInsomniac Alright, your teacher sucks.
 
@DeadMG nope,you have decided on your own that i have , by this point i believe that everyone understands the problem
 
user406009
Don't these types of assignments usually come with guarantees such as "assume all input data is valid"?
 
5:57 AM
Is this one of those classes that leaves std::string to the very end
 
@EtiennedeMartel "bitch", he he
 
@angryInsomniac Understanding the problem and being able to help you are two different things.
 
@angryInsomniac I have no idea what you are doing, and what your problem is. Because you have explained nothing.
 
@EtiennedeMartel hehehe, might be , anyway, I'll look into other ways of doing this
 
the problem was obvious from the beginning: your code has nothing like appropriate invalid input handling
 
5:57 AM
@angryInsomniac You haven't even explained the problem.
 
oh the flames
 
No one is flaming you.
 
why don't you post your assignment
 
No, the flames are when people call you names.
 
@LucDanton fucker
 
5:58 AM
i think maybe he is a little trolling just 4 fun
anyway
 
I am an exemplary flamer
 
@Cheersandhth.-Alf nevermind , my problem I'll look for a solution :P
 
this public service example of flaming provided by DeadMG™, don't forget to leave a tip
 
5:59 AM
I don't get why you won't post the assignment.
 
@DeadMG Nah, I like it when you're poor.
 
aww
but I flame good! :(
 
@DeadMG "flamer" has a number of meanings. :-)
 
@DeadMG I flame well. People do good, you do well. :P
 
Shhh... he just got here.
 
6:00 AM
@Rapptz Shut up. It's said how I say it's said.
 
oh, the air force had an air show over oslo yesterday. nrk reports that thousands saw it
 
@Cheersandhth.-Alf So thousands managed to observe a giant waste of public money?
 
@DeadMG You are weak.
 
I loves me a good air show.
 
sounds effective
 
6:02 AM
Are you Amish @DeadMG? Because you sure don't like to have fun.
 
@DeadMG the party pooper.
 
no
I simply have my own definition of fun and object when my money is forcibly taxed from me so that other people can waste it in ways they find fun
public money should be spent exclusively on things that are unambiguously useful for everybody.
 
@DeadMG Military air shows aren't really a waste. It's also good practice for the pilots and the crews that ready the aircraft for flight.
 
@DeadMG considering that oslo is a small city it may not sound unreasonable to talk about thosands, but there are I don't know 800 000? or so people living there
 
@Cheersandhth.-Alf And I'm sure that only the people from Oslo paid for the show, right? And every single one of them thought it was a useful expenditure of their money?
 
6:05 AM
@Chimera You do know that @DeadMG sees any form of military as a giant waste of money, right?
 
He'd love Japan then.
 
@EtiennedeMartel I didn't, but it doesn't surprise me.
 
@DeadMG you don't have to pay to seem them planes in the sky right above you
 
@Chimera I actually, I think the same. Ha.
 
well it's about 600 000 people
 
6:06 AM
@Cheersandhth.-Alf No, but your taxes did pay for the planes, the pilots, the fuel, and such
 
@EtiennedeMartel That's fine. We are all entitled to our opinions.
 
this is nice news:
"Pakistani police have arrested an imam accused of planting burnt pages of the Koran in the bag of a Christian girl accused of blasphemy, officials say."
she's like 11 or 14, with Downs, and they planned on executing her for carrying those pages
it scares me that that country has atomic weapons
 
the religion of peace. ha
I wish no countries had atomic weapons.
 
The US makes up 41% of worldwide military expenditure.
Which, imo, is way too high.
 
6:08 AM
I think that conventiopnal weapons are worse than atomic
 
@Rapptz Do you think the world would be more stable if the U.S. pulled all of its troops from foreign countries? Honest question, I don't know what would happen.
 
@Rapptz Yeah. Probably because AK-like weapons are so cheap.
 
I don't think military spending is really "a waste", I just think it needs to be cut down.
$711 billion for 2011 is way too high.
 
I agree, but the U.S. government wastes money in every god damned department. Cutting the defense budget is a good start, but it won't fix all the problems.
 
The Evil Government™.
 
6:13 AM
@Chimera A lot of departments don't get a lot of money from the government.
 
i think, the main problem is that technology evolves faster than society. that's main problem with government, with war, with adverts, ...
 
Not evil, just wasteful.
 
basically it's just that people don't have the instincts or learned behaviors to Do The Right Thing and not, e.g., shoot around themselves at a university
 
@Chimera By the way, do you watch Fox News often?
 
but in larger view may even explain fermi's paradox
 
6:15 AM
@EtiennedeMartel Why do you ask?
 
@Chimera Fox News tends to be very "conservative". I use the term loosely.
 
@Rapptz Yeah, to the point they're almost a parody of themselves.
 
Indeed.
 
Why do you ask?
 
Curiosity, I assume. You don't sound like someone who watches Fox News to me.
 
6:17 AM
@Rapptz Yeah, way too moderate. I means, there's the standard "the government is too big", but aside from that...
 
Oh I see, so now you want to insult me?
 
@Chimera If you take it as an insult, I apologize, that was not my intention.
 
What was your intention?
 
I didn't mean to insult.
It really sounded like a question from curiosity to me, with no ill intention.
 
@Chimera Wondering if you think that way because Fox News says so.
 
6:20 AM
Bullshit, you don't ask someone "hey do you watch a lot of Fox News" without having already passed judgement on somebody.
 
What.
And how would I judge you?
 
@EtiennedeMartel I get my news from many sources and don't come to my beliefs based on one source.
 
See? That was a decent answer.
 
If you watched Fox News I wouldn't judge you.
 
No need to take it personal. Damn.
 
6:22 AM
Main reason being because Fox is a local channel in cable that has different political views from the company.
 
@Rapptz Yeah, it's uncanny.
 
@Chimera Fox News isn't an actual source.
 
I don't watch TV though. I just read stuff online.
 
i think it all depends on whether the person watches fox news for laughs, and more generally the reason for watching that channel. me (and e.g. sbi) simply does not watch television, as a rule. best to not have that idiot-box
 
But see, just asking "do you believe it because Fox says so" is a bit insulting. And I fully know where you meant to go with it.
 
6:24 AM
i forgot coffee :-( now!
 
@DeadMG What do you consider to be good sources of news?
 
@Chimera (If he doesn't answer "The BBC", then he's officially a hater)
 
BBC
 
I'd say the NY Times as well.
 
@EtiennedeMartel Actually, I do usually use the Beeb as a news source.
 
6:25 AM
Huffington Post is okay too.
 
the other news outlets in the UK are very huffed
because the Beeb is taxpayer funded
so the instant the Beeb dos anything even slightly wrong, they get jumped on
 
@Rapptz Ha, those guys are "liberals" (that means right-wing-but-not-as-much-as-the-conservatives).
 
Yeah, I say I'm an independent but I tend to vote Democrat.
 
Every time I hear people telling me that Obama is a "socialist", I have to resist the urge to punch them in the throat.
@DeadMG Yeah, the best news outlet in Canada is the CBC. I'm starting to see a pattern here...
 
well
generally speaking, taxpayer media outlets compete with non-taxpayer media outlets
this gives the non-taxpayer media outlets a huge incentive to cry foul at the earliest opportunity
so generally, they have to be quite On The Level to survive
 
6:32 AM
@EtiennedeMartel NBC is pretty bad here..
 
@Rapptz Probably because it lacks funding.
 
@Rapptz Isn't PBS the US state-run media outlet/
 
Oh, wait, yeah.
NBC isn't government funded, IIRC.
 
PBS isn't funded very well I think.
 
PBS isn't state run. It's funded by donations.
 
6:33 AM
That explains a lot.
 
The U.S. doesn't have a "state-run" media outlet.
 
Well, it should.
Ha.
 
why does this guy have an array of an array of a vector of strings.
 
obviously, he just loves his strings.
 
@Rapptz WTFception.
 
6:40 AM
Someone basically merged all 3 answers and got upvoted.
 
You know, we can all downvote stuff here.
All we need is a link.
 
the OP is just misinformed
I've tried char name[20][100] but it still doesn't works, that's why I'm trying other options ._. — user1639776 5 mins ago
 
user406009
Love that comment.
 
user406009
Programming by trial and error.
 
lol
 
user406009
6:43 AM
Explains the OP perfectly.
 
argh
left to go to shop : IT'S A SUNDAY
 
@DeadMG Hahahaahaha
Sundays really are your nemesis.
 
fucking Sunday Trading Laws
 
The Evil Government™, again.
 
Do you guys use std before the C functions? Like rand, clock, qsort
 

« first day (687 days earlier)      last day (4262 days later) »