« first day (314 days earlier)      last day (4636 days later) » 

9:00 PM
If it weren't sorted, you could have used std::count_if(first, last, [](int i){ return i < 6; });
 
ugh fucking youtube being slow as shit again, :(
 
It is a 2d int array ..I am trying to see which sorting routine is fast to sort them
 
std::sort
 
I have a[] [] = 2 5
 
sbi
@TonyTheTiger That particular video took ages to load, really. I let it buffer while I did something else. Afterwards I saw the download option right below the tags.
 
9:01 PM
@NicholeGrace that makes no sense in any language.
 
sbi
@Potatoswatter You should see DeadMG++.
 
@sbi What, did Prolog corrupt his mind?
 
say i have these coordinate points (2,6) (3,2) (2,2) (3,3) i want to sort them as (2,2)(2,6) (3,2) (3,3)
sory that was a typo .before
 
If those are stored as std::pair or std::tuple then std::sort will do 'the right thing'.
 
9:04 PM
That's a 1D array of points, not a 2D array of ints.
 
sory im a newbie bare with me :)
 
"bear with me"… bare with me is a different kind of proposition.
4
 
:)
english is not my native lang ...thanks for the correction :)
 
@sbi whats up with DeadMG++ ?
 
sbi
9:16 PM
@TonyTheTiger I dunno. Never saw it. And except for one person, I believe nobody else saw it either. It was just the first weird language I could think of. (That says something about the guy. I mean, we were just discussing Brainfuck.)
 
yea lol
so trying to download that youtube vid now, watched half and then it suddenly stopped
the download isn't fast either
but I'm also downloading the second Going Native edition from Channel 9 :)
 
@sbi oh thx
template <typename T>
typename T::result_type negate(T const &t)
never seen a function with typename at its beginning, is that cause T is a dependent name and result_type is something I don't know?
 
Indeed.
 
so where does result_type come frome then?
 
9:21 PM
@TonyTheTiger T.
 
is that something supposed to be part of any T you pass as a template arg?
 
sbi
@TonyTheTiger typename T::result_type is the result type. It's just a type and it has (almost) nothing to do with it being a function.
 
@TonyTheTiger If T does not contain a member type result_type, then you get SFINAE.
 
Assuming, struct example { typedef int type; }, then consider negate(example {});
 
hmm interesting :)
you know what, the job interview inspired me to start learning again. heh :)
2
 
9:24 PM
usually we just say type, not result_type.
 
sbi
The thing is that T is a template parameter. When the template is first parsed (when the compiler encounters it first, no parameters given yet), the compiler knows nothing about T, so result_type is a "dependent type". It might be the name of a member function or a static member. That's why you need to slap a typename in front of that type: to tell the compiler to expect a type there, so it can parse negate() and check whether the code makes any sense.
@TonyTheTiger Those are the best ones.
 
if you omit typename it thinks that you are declaring T::result_type and wants to see a semicolon afterwards
 
@sbi oh thanks, :)
 
sbi
@JohannesSchaublitb Uh oh. The syntax errors where the compiler is confused by not seeing a semicolon are the worst you can run into with C++. My students were always totally baffled when I explained to them why the compiler will complain about a missing semicolon by spitting out a very nasty and totally unrelated error message in a totally different header than the one where they forgot the ; at the end of a class definitions.
Those error messages are so unpredictable, so arbitrary, I was always looking forward to be the shiny knight saving them from a seemingly hopeless situation. :)
 
9:32 PM
@sbi why are those particular error messages so complicated though?
is there a technical reason?
 
the typename ones... several compilers will already tell you the straight reason
like "you aremissing typename here"
 
no the semicolon missing ones
 
in many cases at least
 
sbi
@TonyTheTiger You need to play with VC, which doesn't properly implement two-phase lookup, and gets this wrong, and accepts the most hilarious "code" in a template, only too make it explode right into the faces of the users of your oh-so-clever template library, sending you back to the drawing board, because you missed that illegal dependency, to appreciate the value typename.
 
GCC errors seem pretty reasonable…
 
9:35 PM
@sbi oh I see
 
sbi
@TonyTheTiger You forget the semicolon at the end of a class definition in one header. The compiler, expecting an identifier for an object of the just-defined class, will happily keep parsing to the in the next header (the end of a class definition is often the last thing in a header), where it encounters int f(), and wonders what the f is supposed to mean. So it tells you it encountered an f, where it expected a ; or a , (or some other clever message), not mentioning the class at all.
The first times this happened to me, it stole me incredibly amounts of time. I remember spending whole workdays trying to figure that out.
 
"Sometimes life's going to hit you in the head with a brick, don't lose faith" - Steve Jobs
woah, I like that speech :)
 
i'm going to post a question i think
 
sbi
@TonyTheTiger I kinda suspected that. :)
 
@Tony - I like the imagery. Especially after discovering that you can't access the filesystem on an iPad without jailbreaking it.
Okay, so I primarily came into development through web UI and JavaScript. Is it weird that I find Java overly rigid compared to C++? My coworker thinks I'm nuts. Granted I know less about C++ than Java which I'm clearly going to have subvert from it's typical paradigm somehow if I'm ever going to write an Android app.
 
9:45 PM
i asked it
0
Q: Dominance in virtual inheritance

Alf P. SteinbachWhat are the C++98/C++03 standard's and the C++0x future standard's exact rules for dominance in virtual inheritance? I'm not asking for just the specific paragraphs, although I'm asking also for that (somewhere in section 10, I'd guess). I'm asking also for the consequences of the standardeese...

 
sbi
@ErikReppen Wow. You seem to be more enlightened, enlightable, than I am. Much more.
 
@ErikReppen it's the trend, new stuff is artificially handicapped
 
@sbi Thanks a lot for that video; inspiring words :)
 
@sbi It is a Quality of Implementation issue though. There's nothing preventing the compiler from inserting a do-nothing token at the end of every header. It could easily detect a missing semicolon, but e.g. Visual C++ does not.
 
sbi
@AlfPSteinbach Of course it is a QoI issue. But it is so much easier with other languages to get those quality error messages.
 
9:49 PM
@ErikReppen I say "fuck Java" :P
 
@ErikReppen I agree, Java is a very rigid and inflexible language compared to C++. Of course, some people would say that Java has other advantages to make up for that (I don't think it does), but it's hard hard to dispute that C++ gives you more, and more varied, tools to solve problems
where java usually just tells you to define a deeper class hierarchy and write another 200 lines of boilerplate code
 
when it all boils down to it, there's boilerplate :P
 
huh, nobody's answered my qyestuin yet. i thought it was pretty instant.
 
I can't remember what dominance means in an inheritance context
 
9:52 PM
Hiding.
Doesn't it?
 
What's really frustrating is seeing all these Apple fans act like its a feature Apple is working hard to add any day now. More frustrating than that is trying out Honeycomb on a Samsung Tab and liking everything except for the embarrassingly clumsy swipe-action (minor detail). Thus I'm thinking C++. And robots. With whiskey. And hookers.
 
found yesterday that in C++0x you can say reinterpret_cast<int>(42)
I have no idea why that is useful
 
And I don't think I've ever actually used virtual inheritance outside of a few learning exercises
2
 
@JohannesSchaublitb What does it guarantee? That the roundtrip conversion be a noop? lol
 
@jalf it means that a member name of a derived class that has a virtual base class hides a virtual base class member name, even if the virtual base class member name was also found directly by walking along an alternative path in the base classes tree
 
sbi
9:55 PM
@jalf I did us it somewhat, but that was when deep inheritance hierarchies still en vogue. many of you had yet to learn to use the bathroom then. :)
 
@jalf: u use it for dominance, i.e., for inheriting interfaces.
 
@LucDanton it means that the result is 42
 
@JohannesSchaublitb probably just a generic programming thing. You can write code where, depending on template types, your cast may end up looking like that, so it'd better compile, even if it isn't useful in itself
 
@jalf why would I reinterpret_cast from a generic type to another generic type?
 
dunno
;)
well, you might reinterpret_cast from a literal to a generic type, perhaps?
 
9:56 PM
and expect it to work if I pass two ints and acknowledge it to fail when I pass an int and a long? that's weird
 
sbi
What's happened to your typing, @Alf? I liked you much more when your typing didn't seem to imply you are a 17 year old script kiddie in desperate need of a new keyboard.
 
wat u meen?
 
u meen teen
 
sbi
@AlfPSteinbach You know, for a moment there, I considered to plonk you for that.
 
9:58 PM
lol
when is it more appropriate to mod-flag a chat message than to spam/offensive-flag it?
 
i like words that only occur in the index of the standard. like "dominance". and "linker".
 
sbi
@AlfPSteinbach And "u" and "meen" and "wat"?
 
wut?
lol
 
google changes behavior when you put at "define" in front of the word
i was wrong about "linker", it's not there
i thought i remembered it
 
10:09 PM
hmm
i read through "Linkers and Loaders" now and finished it. great book
 
You can search for "define:wut" also (google.com/search?q=define:wut).
 
i was trying to keep up with these mysterious library matters
 
@joahnnes: well it if it ain't defined by the standard, it doesn't matter :-)
 
@JohannesSchaublitb Linking errors is something that they don't tell you about in school.
@TonyTheTiger btw, what did the eye-doctor say?
 
10:34 PM
@StackedCrooked I didn't go :(
silly story
 
10:47 PM
Life is full of silly stories.
Actually, I think my life is just one silly story.
 
sbi
@StackedCrooked True. Here is the silly story of how Steve Jobs came up with the iPad.
 
for some reason, in the last month or so I haven't been able to get to bed before 2am, cause I don't feel tired
very annoying
 
@sbi interesting!
 
sbi
@StackedCrooked Yeah, isn't it? I meant to watch that talk for years, and tonight I finally do it.
 
10:52 PM
:P
 
sbi
BTW, I cam across it (again) via this speech. which I thought would be a stark contrast to Steve's. It turned out it is, but not in the bad and silly way I thought it would.
@TonyTheTiger You laugh, but I gonna suffer for it badly, in a few hours when those pesky kids are tugging at my sheets.
 
@sbi oh :(
 

« first day (314 days earlier)      last day (4636 days later) »