« first day (89 days earlier)      last day (4861 days later) » 

6:00 PM
"strncpy was initially introduced into the C library to deal with fixed-length name fields in structures such as directory entries. Such fields are not used in the same way as strings: the trailing null is unnecessary for a maximum-length field, and setting trailing bytes for shorter names to ...
...null assures efficient field-wise comparisons. strncpy is not by origin a ``bounded strcpy,'' and the Committee has preferred to recognize existing practice rather than alter the function to better suit it to such use. "
(C rationale)
@TomalakGeretkal i meant it won't necessarily read sizeof(T*) bytes
sorry for the confusion
 
So it won't reinterpret_cast?
 
@sbi It's just a minor point really. I would rather memmove be mentioned instead of strcpy.
 
@Tomalak: reinterpret_cast is not a runtime operation
 
@DeadMG Never said that it was...
 
sbi
@DanielTrebbien Well, I guess then that down-vote must be kept, since I don't think that this would make sense in the light of the original question.
 
6:02 PM
at least, not in the pointer context
 
@JamesMcNellis haha. Do people ever get something done before the deadline? I rarely see it.
 
@TomalakGeretkal sure it will. it will reinterpret the value of the pointer. as being the value of a different pointer type.
 
so it won't have to read anything at runtime
 
@jweyrich I do. Well, I did it once...
 
Given U* u = [whatever];, reinterpret_cast<T*>(u); should be the same as *static_cast<T**>(&u);, no?
 
6:03 PM
But it won't reinterpret the bit-pattern by using the representation of the different pointer type. I think that's what the "reinterpret" in "reinterpret_cast" means
 
is that static_cast legal?
 
@DeadMG Of course not. But the executable might when using the resultant pointer.
What would be illegal about that static_cast?
 
well
 
Well, aside from that T != U
 
I'm fairly sure that static_cast requires that the pointer types be related
 
6:03 PM
@Joha: Nah, hard to see where I put the SO code delimiters. Will edit.
 
@sbi Well, I think that I should get rid of it. You fixed the min problem.
 
@DeadMG: Perhaps so. Consider it pseudo-code in that case. It should make the point sufficiently.
 
@TomalakGeretkal nope
definitely not :)
 
I'm trying to understand (a) in what way reinterpret_cast is different from what most people expect (b) what most people expect, and (c) whether this means I have to stop telling people not to reinterpret_cast pointers.
 
6:05 PM
You are indeed thinking of reinterpret_cast<T*&>(u);
 
o.O
I always thought the reference was implied.
 
damn you all
I had some code I was going to write
now I can't remember what it was
you're distracting me from mah work :(
 
most people don't see that reinterpret_cast<NonRefType>(x) will read the value of x using x's type first
@TomalakGeretkal not at all
 
i.e. that int x = 3; reinterpret_cast<bool>(x) = false; would be bad and wrong but not create a new object
 
@TomalakGeretkal that's not valid at all.
both can't be integer types
 
6:06 PM
@jweyrich Oh... This interview is depressing. He says about auto:
 
Well, whatever types
 
> This is the oldest C++0x feature; I implemented it in 1983, but was forced to take it out for C compatibility reasons.
 
I picked int and bool arbitrarily
 
yeah
that does indeed suck, James
I was amazed when he wrote that
 
James: Saw that :)
I giggled because it just shows how little they care about C compatibility now, despite supposedly maintaining it as much as possible.
I mean, nothing's changed!
 
6:07 PM
yeah
 
@Johannes: How is reinterpret_cast different from static_cast then?
 
nothing's changed
there have only been two major C standard revisions since then
 
@TomalakGeretkal static_cast<float*>(someIntPtr) won't be valid at all
 
@JamesMcNellis Which interview?
 
reinterpret_cast "can do it"
 
6:08 PM
@JamesMcNellis Just read that too. Maybe his ego was kinda exploding at the moment? haha.
 
@Johannes: So reinterpret_cast is only different from static_cast in that the type requirements are more lenient?
 
@Tomalak: No
 
@TomalakGeretkal Oh, they still care (about some things, at least). Asynchronous thread termination was removed because the C committee didn't like one of the two approaches and no one else liked the other approach (or, so I was told...)
 
also it can convert from pointer to integer. static_cast can't do it either
@TomalakGeretkal exactly
 
@Johannes: I do not believe you!
 
6:08 PM
if you have base, and reinterpret_cast to derived, I'm pretty sure that it won't adjust teh address
 
@Johannes (obviously I kind of have to)
 
whereas static_cast would
 
@DanielTrebbien There's a link above of a new interview with Bjarne Stroustrup about C++0x
 
also, reinterpret_cast<T*>(0) is not required to produce a null pointer but the same done with static_cast is
 
@TomalakGeretkal static_cast will generally do adjustments on pointer values. like when casting up or down a hierarchy. reinterpret_cast will generally not.
 
6:09 PM
Well I'm glad that reinterpret_cast for pointers still doesn't make much sense
What Alf said
 
(c++03 has non-normative text that says it shall produce a null pointer, but no normative text backing it up, and c++0x completely removed that footnote nonsense)
 
Surely if the two pointer types have different sizes, then you're in trouble...?
 
not necessarily
it's about whether the value can be represented, not about the size of the representation
 
imagine having an int* having sizeof(int*) == 2 and a sizeof(void*) == 4.
 
6:12 PM
0
Q: Status & Contents of TR2 W.R.T. C++ Specification

John DiblingReference Link: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2849.pdf I am trying to gather information about TR2 and how it relates to the upcoming C++ Standard, if it does at all. Here are my questions so far. If I've missed any important questions, please answer those as well. ...

 
How do you post questions like that?
 
with sizeof(int) == 2
 
@TomalakGeretkal Have the link in an own message
 
And how do I stop the feed from popping up all the time. It won't go away
 
@Tomalak: Just copy the URL & paste in to chat
 
6:12 PM
@TomalakGeretkal you need to post the question url as mere constituent of a message
 
Hmm I've done that before and it didn't happen >.<
ok, odd.
@JohannesSchaublitb ok...
 
you best not "enable desktop notification" lol
and then, imagine 0x1 for int* represents address 2, 0x2 represents address 4, 0x3 represents 6, 0x4 represents address location 8 etc...
all addresses that int* (which would only have 2 byte resolution) could store could also be stored by a void* (which needs 1 byte resolution), but it would still be only half as big as a void*.
 
that's fine
what about the other way around
still can't figure out how to disable that damned feed
 
so the requirement that reinterpret_cast<T*>(u) requires both pointers have the same sizeof isn't really correct. it merely requires T to be able to represent all the values of u (in other words, T shall not have stricter alignment requirements than u).
lol
 
sure
the target type must be at least as wide, right?
 
6:22 PM
width doesn't have to do with what and how many values can be represented at all. bool can only represent 2 values, still it's at least as large as char which can represent at least 127 as many values
 
uh
 
i guess that should be 127 :)
 
yeah
 
Did one of you guys d/v my question? If so, is there some way you'd like me to improve it?
3
Q: Status & Contents of TR2 W.R.T. C++ Specification

John DiblingReference Link: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2849.pdf I am trying to gather information about TR2 and how it relates to the upcoming C++ Standard, if it does at all. Here are my questions so far. If I've missed any important questions, please answer those as well. ...

 
pfft
i give up
 
6:24 PM
lol
 
@JohnDibling I upvoted. I wonder why someone downvoted.
 
I'm happy to edit it if there's a problem with it
 
@JohnDibling: How do you "resolve" floating-point imprecision?
That would be like "resolving" the problem of numbers having numeric value
 
@Tomalak: Good question, i've edited my post
 
6:26 PM
lulz
 
@Tomalak: But you might resolve it with a different binary representaton
 
@JohnDibling: I guess. Chances are 0%.
 
at least with user defined literals and literal types + constexpr we get ability to define such ourselfs
 
@JohnDibling: I am sure that C++ will never use anything other than the common low-level IEEE representations
 
@Tomalak: How do you know this?
 
6:27 PM
@JohnDibling: I can see the future.
 
"I'll have what he's having" :)
 
I want to see apfloat and apint in the language.
You know, useful things.
 
i surely see that you can do #define FLT(X) decltype(X _myflt) and then you can say template<typename Float> void f(); and pass f<FLT(3.1415926535)>()
 
@JohannesSchaublitb I surely see that that is frakking ugly
 
_myflt could be a constexpr function returning a type encoding the float at compile time
 
6:29 PM
@Johannes I do worry about your sanity.
 
similar beauty as the metafloat library, just better compile time haha
 
lol
 
@TomalakGeretkal hmm the simplest possible implementation maybe would be template<char...> struct string {}; template<char ...D> constexpr string<D...> operator "" _myflt() { return {}; };
although that wouldn't do any lexing of any kind so it's prolly a poor initial attempt
alright, "Alles was zählt" time :)
 
@litb: beer-o-clock? :)
 
lol
 
6:36 PM
@JohnDibling Cheers. I’m already having one ;)
(to aid concentration, of course)
 
@JohnDibling tv-soap time :)
 
of course :)
 
sbi
@KonradRudolph You make me envy you. I'm still at work.
 
@sbi To be honest, so am I … working from home on my master thesis
 
sbi
6:53 PM
@KonradRudolph Yeah, but I can't have a beer at work! :)
 
@sbi (disregarding that it’s thursday) don’t you have “happy fridays” (or whatever they’re called) at work? I had this in England and found it rather cool … company-sponsored booze while programming :)
 
lol
 
@Konrad that's pretty rare
@Konrad though a collective pub trip ~3.30pm on a Friday is less rare :)
 
@TomalakGeretkal Those are great, too
 
sbi
@KonradRudolph Whatever it is, we won't be having it at this company.
 
6:57 PM
Pubs is one of the things I really evny England for … there’s no decent pub in Berlin
 
sbi
@KonradRudolph That's hilarious. There's probably several thousands of pubs in Berlin. There ought to be one or two for everyone.
 
By the way, is anybody else as annoyed as I am by the flood detection?
0
Q: Defuse flood control in chat

Konrad Rudolph[This must have been mentioned before but I’m unable to find it.] After you post a message in chat, it takes a few seconds (3?) before you can post again. You can submit the message but it will be retained and you need to wait for the amount of time, and click on a link to re-send it. I get the...

@sbi Well, I mean English pub. With the flair and the good food. I was surprised by the high quality food I got in English pubs
(Not to deny that there are very good bars in Berlin. But I’ve yet to find the kind of pub flair)
 
Good evening all.
 
sbi
@Konrad BTW, I thought you were in Potsdam?
 
@sbi Huh? What gave you that idea?
 
sbi
7:03 PM
@KonradRudolph I dunno. Looking at your profile I see you studying at the FU. Huh. Sorry, must have gotten mixed you up with someone else.
 
yes, I am
 
-1
A: Detecting const-ness of nested type

Tomalak Geret'kalBecause references are not const. :) You have a ref-to-const (consider a rough analog, int const*, where the pointee int has a const context, but the pointer itself does not). The standard mixes terminology here, but I avoid the term "const ref" which is highly misleading. References are inhere...

Noah's up to downvoting again it looks like.
He's really starting to piss me off.
 
sbi
@TomalakGeretkal Actually, those down-voting runs (as well as up-voting ones) are detected by a nightly script and reverted. Isn't that happening to you?
 
@sbi: I did notice that a lot of downvotes from last night had gone today, so possibly so.
 
sbi
If not, raise a flag to get a moderator's attention.
 
7:07 PM
I gave you an upboat to keep you going until the script chimes in :)
 
sbi
@TomalakGeretkal Yep. When that happened to me, I flagged for a moderator and he told me to relax, and it was indeed reverted within 24hrs.
 
when do downvotes get reverted?
 
sbi
It went like this for a few days, then whoever did that gave up.
 
@sbi lol k
@sbi But if it's a one-time downvote, then he'll get away with it!
 
there have been times when I downvoted all existing answers to a question
 
sbi
7:08 PM
@DeadMG Whenever that script runs. I think it was referred to as "at night", but I have no idea according to which timezone.
 
mostly, though, because they were just all wrong
sorry, sbi
 
@MooJuice lol thanks
 
I meant
under what conditions do downvotes get reverted
 
DeadMG, did you provide a reason for your downvote?
 
sbi
@DeadMG I was told there's a script that detects when someone goes on a rampage and votes on many questions and answers of someone else. I don't know whet else it detects.
 
7:10 PM
I'd prefer that votes remained in place, pending moderator attention. I'd hate to think that a situation like DeadMG's would result in valid downvotes being undone for no reason.
 
what downvotes?
I haven't done any downvoting
and what situation of mine?
 
You said you downvoted all existing answers to a question (validly).
 
oh that
 
@TomalakGeretkal Agreed.
 
I mean, you're taking my word for it that they were valid
 
7:10 PM
However, from what I've seen of SO so far, the software is pretty intelligent so it's probably not a problem in practice. Just makes me a bit nervous.
 
but from memory, they were all blatantly wrong
 
sbi
@TomalakGeretkal But you know how this site is run. You cant even fetch vote counts without a delay slowing you down, just in case someone was up to something.
 
@sbi: :)
 
I wish the site was more permissive and flexible
I hate not being able to edit comments or reverse downvotes after a certain time
it's exceedingly irritating
 
Ah yes, he's definitely on a run.
I suppose if you know that the downvotes will get undone, and you get a childish kick out of seeing someone panic like this in the chat room, there's no harm in downvoting all someone's answers
 
7:13 PM
oh man
like now
 
Oh well, he'll only get himself banned.
 
0
A: The use of getters and setters for different programming languages

DeadMGDepends on how abstracted you need. For example, I recently needed a getter and setter in C++ when abstracting a Text object. The Direct3D text object just held a string Text member variable. The Direct2D Text object however had to be recreated and recached and that kind of thing. If I had opted ...

I upvoted the first answer
I want to downvote it
but re-reading the question
but I can't
 
sbi
@TomalakGeretkal If several of you guys think it's him, and if the evidence (you've all be discussing about him) is so obvious, why don't you go and just ask him about it?
 
what
@sbi He's not exactly been a nice person to talk to.
@sbi And I don't know enough about SO to really prove it, either.
 
The logs would show spurious downvoting.
If nobody ever flags it, nothing would ever be done.
Why not message a mod, explain your concerns politely. At least bring it to their attention. If it's nothing, it's nothing... but if he's being a dick, then it'll surface.
 
sbi
7:16 PM
@TomalakGeretkal You don't need him to be nice. Just a "BTW, is it you who's been down-voting us since that incident?" under one of his questions should trigger a response. (I wouldn't tell him that a script reverses these, though. Might give him ideas.)
 
I did a "flag" action.
Cheers guys
 
sbi
@DeadMG 'course you can! Make a dummy edit, explaining why you do this, and change your vote.
 
what, edit his post so I can change my mind?
isn't that abusing my ability to edit other people's posts?
 
@DeadMG I'd consider it so.
 
I mean, I could edit it and put a full stop on the end or something
and then reverse my vote
 
7:18 PM
Oh, you could do that.
 
but that's abuse, imo
 
sbi
@TomalakGeretkal I don't think this will gain you much except a moderator telling you to wait for that script. But then, maybe with the penalty box they now actually do something about these.
@jweyrich And? Are you going to take it?
 
of course
 
sbi
@DeadMG That would be cheating.
 
instead, you guys could all kindly upvote my answer :P
and drown his
 
sbi
7:19 PM
When I've done it, I've done publicly, giving a clear message in the edit summary.
 
@DeadMG, lol
There, have an upboat.
 
yay
 
(I did actually read it)
 
swoosh swoosh
wait a minute
you forgot the oars!
 
@sbi I'm considering. The problem is that I'd probably join as intermediate (not jr, not sr). I'd also probably become Sr (or better) in few weeks, but hey, I need to pay my bills.
 
7:20 PM
/ \
there :)
 
lol
thanks
 
sbi
@DeadMG I made that dummy edit and explained in a comment, why I did it. I don't know Python and don't feel confident enough to judge for myself.
 
This is excellent: "I thoroughly disagree with this answer and feel that a downvote would be appropriate. Unfortunately, I already upvoted you. I think that this is blatantly wrong"
 
I already noticed :P
 
That would put a dent in my ego for the day.
 
7:23 PM
just happened to flip the page
 
sbi
@jweyrich Yeah, something to pay the bills can be quite assuring.
 
the thing is, encapsulation is completely language independent
I mean
 
@sbi The prevailing sentiment in the Python community is that the programmer is not a baby and doesn’t have to be taken by the hand. Thus no privacy
stupid people
^^
 
languages with properties don't change the encapsulation values of their getters and setters, they just make the syntax easier
whether or not Python as a community wants encapsulation is another matter
 
@sbi quite hard to find C++ (or even C) jobs around here. Sad. What do you work with?
 
7:25 PM
while get/set is only slightly more encapsulated than a private member variable
it definitely is slightly more encapsulated
in my opinion
 
sbi
0
A: The use of getters and setters for different programming languages

sbiActually, getters and setters (as well as public properties hiding these) are very little imporvment over public variables, and a pretty good indicator for quasi classes.

I keep posting that link.
 
@KonradRudolph I worked with python some months, and this was something that really bothered me. This and that python raises exception for nearly everything! cry
 
overuse of exceptions is normally a BAD, BAD sign
 
sbi
@KonradRudolph Well, isn't C++ known for letting yourself shoot into your foot, if you insist, rather than taking you by the hand to guide you through the minefields?
 
@jweyrich I try to use Python as much as possible and this is one of the things that really bothers me as well. Python’s far from perfect but there are a few really compelling ideas behind it.
 
sbi
7:28 PM
@jweyrich What do you mean? VS2008.
 
So, that's the power of SO's real-time chat. Post a link to an answer a chat-member has a valid opinion on, ensure it's the only one with any votes. Corruption, I say!! :P
 
yes, C++ is legendary for not exactly protecting against Machiavelli
hahaha moo-juice
that's not fair
 
@sbi I hear you. I’m still getting segfaults in my code despite not using pointers anywhere.
 
@sbi oh, I meant your area/sector. What kind of software?
 
sbi
Jan 9 at 19:28, by sbi
document processing
:)
 
7:30 PM
blimey
 
@sbi oh pardon me :)
 
that sounds
um
fascinating
 
boring as fuck
ahem
 
if you're into that sort of thing
document processing, that is. not fuck.
 
lol
boring as fuck actually sounds like a rather strange phrase to me
3
or, rather, quite insulting to your partner
 
7:32 PM
Yeah, you know you're doing it wrong when she lies there saying "Peach. I think I'll paint the ceiling peach."
 
yeah
 
sbi
@KonradRudolph Do you? Mhmm. I was once proud to have not checked in a single segfault/AV for more than 6 years - despite a lot of pressure to improve performance. (My tests caught one before I checked in about once or twice a year, though.)
 
@DeadMG you know, these fucking juniors.
 
"boring as fuck" != "boring as fucking"
@MooJuice lol
 
lol
 
7:32 PM
lol
 
have to admit
 
@sbi That's not so impressive. It's actually impossible to check in a segfault or AV.
 
it is incredibly off putting when she wants to discuss something completely unrelated
 
@sbi It is, however, possible to check in code that may trigger one. :)
 
Ok, question time... for all of you.
 
sbi
7:34 PM
@DeadMG Well, if the processing is done highly parallel by agent in a distributed system across the network, then that becomes quite interesting, actually. (I'm not into any of the actually processing algorithms. I usually work with the infrastructure.)
 
@sbi Well, I have multithreading (without a library – I am the library) and unchecked array accesses, coupled with a flawed smart pointer implementation that I’m relying on, but that I heavily suspect is buggy
 
What was your first task in your first commercial C++ position? I remember, with high hopes I went in to my first C++ position and was tasking with removing certain lines from a shitload of SQL statements.
tasked*
 
The problem is that all these failures are heisenbugs. As soon as I attach a debugger or run the code through valgrind it comes up clean.
 
@sbi: Man, I love concurrency
 
"@sbi I hear you. I’m still getting segfaults in my code despite not using pointers anywhere."
"@sbi Well, I have [...] a flawed smart pointer implementation that I’m relying on, but that I heavily suspect is buggy"
nice
 
7:35 PM
getting the most efficient concurrent setup is interesting, difficult work
my university doesn't do a concurrency module :(
 
sbi
@KonradRudolph Ah, subtly buggy smart pointers are a hell to work with. Throw them out: stackoverflow.com/questions/1437053/boost-advocacy-help-needed/…
 
@TomalakGeretkal Believe me, not my choice. I have to work with the architecture I’m given
 
@DeadMG Overuse of anything is bad.
 
there is that
but I wish I got to work with concurrency more often
 
@sbi: That quote gets a downvote for saying "STL".
@KonradRudolph Lying in the channel was a choice. :)
 
7:37 PM
pretty sure that the guy quoted designed the STL
or something like that
so when he says it, I think he actually means STL, and not, C++ Std Lib
 
@TomalakGeretkal Ah, that. Not a lie. The smart pointer is a bit weird … it doesn’t abstract pointers, it abstracts references
 
@MooJuice my 1st task was to find and eliminate memory leaks. haha
 
Ouch.
 
So the pointer is initalized via Holder(object), not Holder(pointer-to-object)
 
sbi
@TomalakGeretkal Wow, yeah. Scott got it wrong! (In his defense, this is a very old quote of him.)
 
7:38 PM
@jweyrich, I guess you're pretty good at finding them now, then? :)
 
@MooJuice at the time, there was no valgrind.
 
the smart pointers in C++0x are rather nice
I even use them with Direct3D and a custom deleter
 
@MooJuice if they're explicit caused by the code in question, or wrong usage of syscalls, I generally find them.
 
@sbi :)
@KonradRudolph !
no wonder you're having problems
wtf
 
a smart reference?
lolwot?
 
sbi
7:40 PM
@jweyrich In a company I used to work for I was handed the task of fixing the leaks in an XPath implementation that operated on a proprietary DOM implementation. I poked at it with a fork for an afternoon and proposed to re-write it from scratch. It took me two weeks, but that was probably much faster than trying to clean up the mess of that guy who had done it.
 
Here’s the documentation. Have a laugh
 
um
what the?
 
@Moo: My first task was to change the font of a little window that displayed real-time stock quotes
 
In defense of the library (which otherwise rocks), this class is due for replacement. Unfortunately, it’s used all over the place and replacing it is a major obstacle
 
John: I prefer that first-task to finding memory leaks...
John, though perhaps not as challenging :)
 
7:42 PM
dependable, accurate smart pointers are key to all non-leaking strategies
 
@sbi ouch. XPath brings me bad memories of libxml2.
 
if you can't trust your smart pointer, you don't stand a chance
 
sbi
@jweyrich It was an XPath 1.1(?) implementation, though (and I was to leave out a few esoteric corners, too), not that weird stuff they came up with later.
 
also, sbi, I have a question for you
the post you referenced about quasi-classes suggested that their setters should return void
does that mean that purely by allowing method chains, a class is non-quasi?
 
@DeadMG As far as I understand, that’s just referring to the typical setter implementation, not passing judgement.
 
sbi
7:53 PM
@DeadMG Where?
Um, is everyone busy reading or why did it get so quiet?
 
playing starcraft 2
 
sbi
@DeadMG What, everyone but me??
 
huh
 
@sbi I thought you were the one who was still at work? (looking at the clock, not likely)
 
I just lost, thanks to checking this channel too much during the game
:(
 

« first day (89 days earlier)      last day (4861 days later) »