« first day (430 days earlier)      last day (4518 days later) » 

Xeo
12:00 AM
Ah
 
@EthanSteinberg "gotoing"? You mean "going-to"?
 
user406009
goto-ing. As in the using of goto for control structure.
 
@ManofOneWay Pretty well. I believe I will get a bounty on soon :)
 
@Xeo At least I think that's the case; it could be that there's a clause that says goto invokes value-initialization or so...? But I very much doubt that.
Let's see what valgrind says! :-)
 
finally... repcap reset...
 
user406009
12:01 AM
@RMartin Ehh, how else would you be able to use different types in glVertex arrays without a void*?
 
user406009
Having 5 copies of the glVertexAttribPointer function would be no help.
 
it's called "overloads"
 
@EthanSteinberg It's not a pointer. It's an integer, like 5.
Tomalak posted a comprehensive where can I use goto answer. You could look that up.
 
it's this thing that most new languages support
 
@EthanSteinberg And you could do it like you do in everything else in that API: suffixes.
 
12:02 AM
Oh, it's actually a compiler error!
 
@EthanSteinberg That's how it works with almost every other function, dude.
 
user406009
@RMartin I actually prefer the non-suffixed version. All of the suffixes crowd the api.
 
@EthanSteinberg Errr... why did you ask this if this doesn't actually compile?
 
better than having to cast an integer to a pointer
 
glVertexAttribPointer(0, 4, GL_FLOAT, false, 0, (void*)sizeof(float) /* does this look okay to you? */);
 
user406009
 
user406009
I was wondering how this worked.
 
man
I dislike semantic analysis
it's ugly
 
user406009
@RMartin It was originally intended without vbo's if I remeber correctly.
 
user406009
Then you would actually be passing in pointers.
 
Xeo
@Kerrek: Interesting fact on the static const int thing: In C++03, GCCs limitation was conforming. In C++11, it's not anymore.
 
12:06 AM
I know it's original intention. That's how I learned OpenGL the first time.
 
if you have a function that does a new job, then make a new function
don't just try and shoehorn an existing one in
 
It doesn't change the fact that it became crappy now.
 
@Xeo So how is it now?
 
A glVertexAttribOffset instead would work much nicer.
 
user406009
@RMartin What if it was an intptr_t? Would you be happy then?
 
12:08 AM
no!
a type is an integer, or it's a pointer
naming it intptr_t doesn't magically make it not fucking the type system up the arse with a giant pink dildo
5
 
@EthanSteinberg No.
It should be a GLsizei.
 
user406009
Yeah, well I guess you still have the option of encapsulation then.
 
@DeadMG That's a very interesting way of saying it.
 
Xeo
@KerrekSB See my comment on deft_code's answer
 
@DeadMG Why pink?
 
Xeo
12:12 AM
@RMartinhoFernandes Because pink is the new black.
Damn, again only 100 rep gain yesterday oO
 
giant pink dildos came to mind because I saw Saints Row on the Steam sale
 
Ha! I got 105!
 
200 :) hate me now!
 
Xeo
@Mysticial All my hate. ♥
 
12:15 AM
Ok...
 
2
A: use of bit-fields in c++

refpSaying that bit-fields has some hidden benefits is sadly quite far from the truth according to me, it would be better expressing the hidden drawbacks of their use. To answer your question; yes, of course you can write your own algorithms to handle these bit-fields of arbitrary length as someth...

what do you guys think of that answer? does my hate against the use of bit-fields shine through too much?
 
don't hate on the bit fields :(
 
and of course the shorter less elaborate answer (just linking to a webpage you'll find after a second at google) got the "acceptable" answer mark..
I spent about 8 minutes tweaking that answer so that it made sense..
 
Hate on the bitfields!
The things are nasty.
 
Hate on everything!
 
12:19 AM
I hate the Internet.
I don't get it though, was my answer really that bad that everyone is up-voting the other one?
fcukingshiznitfuck.
 
user406009
Bitfields are a pretty bad section of C++ though.
 
The best answer does not always get accepted
Blame humanity.
 
user406009
Usually a std::bitset or a union/varient solves their problems much more cleanly.
 
but now I'm talking votes.. fields like people tend to think "this has more votes than that answer, of course I'm not gonna read the 2nd answer but just up-vote what the crowd thinks. I don't wanna be alone!"
 
I don't always read all the answers.
 
12:23 AM
I think most people feel like they can only upvote one answer per question. And when they see an answer with high vote count, then they will upvote that one because with so many votes, it's probably a good one, right?
 
@EtiennedeMartel That is totally true... See this...
91
A: What is the difference between str==NULL and str[0]=='\0' in C?

Mysticialstr==NULL tells you whether the pointer is NULL. str[0]=='\0' tells you if the string is of zero-length. In that code, the test: if ((str == NULL) || (str[0] == '\0')) is used to catch the case where it is either NULL or has zero-length. Note that short-circuiting plays a key role here: T...

 
Xeo
Voting is broken on SO anyways
 
Somebody posted a better answer than mine, and it even got accepted to bump it to the top
yet I still got more than half of the upvotes on it after it got bumped to the top
 
Xeo
@Mysticial At least you got the populist badge out of it
 
Votes attract more votes.
Quoting the Standard also attracts votes.
 
12:25 AM
sometimes I get furious when this happens, and I delete my post.. if the world don't appreciate what I write they might as well not even have the option to read it..
 
user406009
@Etiennede But Mysticial's answer does manage to better explain the reason in less words.
 
Apparently it didn't work in my case
I quoted the standard TWICE GOD DAMN IT!
 
@Xeo :) When it was accepted, it was 8 vs. 64
and now it's 31 vs 91
 
from now on I'm just going to post links to external sites that I find after googling the question title
 
oh, thanks to whoever upvoted it! Brings me a bit closer to a badge. :)
 
user406009
12:29 AM
@refp Does not work when the question already has those links in the question.
 
Woot! I got to 1000 rep in Meta!
 
I should write a bot that does exactly that for me, please: let's turn SO into a "Hi, can you google this for me" service
 
@RMartinhoFernandes Told ya you needed a free-hand pony!
 
@EthanSteinberg of course the bot will handle those kinds of situations, since I don't ;-)
 
So, you're going to use robots, for evil?
 
12:30 AM
@RMartinhoFernandes Isn't that redundant?
 
@EthanSteinberg though the links I provided in your thread was already on my mind before I googled to find them
@RMartinhoFernandes is there any other use case for them?
 
user406009
Exploring mars.
 
Building cars.
Launching missiles at afghan farmers.
 
Ok. But don't ask why there's a revolution going on when the time comes.
 
user406009
Launching missiles at mass murderers.
 
Xeo
12:33 AM
 
Touhou? Oh dear.
 
@EthanSteinberg exploring mars, and then build a super awesome cannon aimed that earth..
 
Xeo
@EtiennedeMartel No, not "oh dear". It's "fuck yeah!".
 
@Xeo Fuck 'em up.
 
@refp Hey! Why are you revealing our hypothetical secret plan?
 
12:35 AM
I'm sorry, I only listen to real music and play with real games.
 
@DeadMG: As per stackoverflow.com/q/8568763/845092, why did you ask glowcoder to leave the comment thread?
 
because he was being a colossal prick
"Oh, I can't read the question tags to see the language, so I'm just going to assume it's my favourite. Oh, wait, it isn't? I guess you're all idiots then and I hope you enjoy your inferiority."
 
user406009
glowcoder was wrong about that too.
 
user406009
C++ will almost always crash, compilers usually mark arrays to cause out-of-bounds errors to crash.
 
besides, you can trivially use .at() to get bounds checking if you want it
 
12:41 AM
And no one stepped in to fix boolean to bool?
 
user406009
Yeah, but usually the stack trace with a debugger is much more useful than the exception.
 
@RMartinhoFernandes The original code never had a boolean, or indeed, a bool in it
 
And yet some of you will gladly edit a space into an answer just to get a badge.
</snarkiness>
And yet some of you will gladly edit a space into an answer just to get a badge.
 
I certainly won't
 
Xeo
@RMartinhoFernandes >_> <_< >_>
 
12:43 AM
I thought spaces didn't count for edits
 
StackOverflow, the therapist's couch?
 
The rapist's couch?
 
yeah baby, raep mah code
 
Xeo
Anybody mind helping me out here? stackoverflow.com/q/8568435/…
 
no
 
12:45 AM
lol
 
Xeo
:(
 
@Xeo Nice try.
 
Xeo
Now even more realistic. I just noticed the … in the actual shortening are a single token, not three consecutive dots
 
@Xeo It's an ellipsis.
I made a promise that I would lead a certain user into that site, and that looks like a neat way of doing it. Hmmm.
 
@Xeo It's called "ellipsis".
 
12:47 AM
oh, I didn't even click the link, lol
 
Xeo
Blahblah
 
I don't understand this question
 
user406009
I thought extern was deprecated and horrible in many ways for templates.
 
Xeo
No, not that I know of
export is removed from C++11, yes, but extern is just fine
 
12:49 AM
Extern templates is a new feature of C++11. So not deprecated, quite the contrary.
 
@EthanSteinberg That's export.
 
Xeo
@LucDanton Huh? Afaik, you could always extern your templates instantiations
 
I thought compilers supported it for years
which is why you could always do it
 
@LucDanton: Do you have a ready-made tool for tuple slicing in your asset box?
The self-incrementing Int class comes to mind so you can say tuple<R...>(get<Ints>(t)...).
 
@KerrekSB Nope.
But yes, indices<Indices...> (what you're referring to right?) would allow writing an implementation. I think.
 
1:01 AM
Can you give make_indices (or whatever) the start index?
 
make_indices only yields indices<0, ..., tuple_size - 1> in the current version.
 
Well, that should be easily adaptable anyway.
 
@KerrekSB Using std::make_tuple would get past the problem of computing the right tuple type.
template<typename Tuple, int... Indices>
auto splice_tuple(Tuple&& tuple, indices<Indices...>)
-> ...
{
    using std::get;
    return std::make_tuple(get<Indices>(std::forward<Tuple>(tuple))...);
}
Return type problematic though. I have a tuple_element for that.
A 'simpler' solution would be to assume std::tuple as the parameter type and decltype the return expression without caring for ADL by using std::get directly.
 
Use Johannes's "hidden-ADL-namespace-trick".
 
I seem to have forgotten what it is. A clever using declaration somewhere?
 
Xeo
1:11 AM
@LucDanton Isn't there tuple_element in the stdlib?
 
@Xeo Yes, but it's strictly a metafunction and doesn't really 'work' with std::get.
 
8
A: How do I write an ADL-enabled noexcept specification?

Johannes Schaub - litbI think I would move it into a separate namespace namespace tricks { using std::swap; template <typename T, typename U> void swap(T &t, U &u) noexcept(noexcept(swap(t, u))); } template <typename T> void swap(my_template<T>& x, my_template<T>&...

 
@Xeo The type of std::get(std::make_tuple(42)) is int&&, whereas the type of std::get(some_tuple) would be int& (assuming auto some_tuple = std::make_tuple(42);).
@RMartinhoFernandes I'm glad some of my memory neurons still fired up.
 
1>LINK : fatal error LNK1000: unknown error at 00B7A9FC; consult documentation for technical support options
:(
 
Xeo
1:19 AM
lol
 
@KerrekSB Are you writing an answer regarding the tuple splicing?
 
at least when my app crashed at run-time, it was my own fault
 
@LucDanton I've been not writing one because I am expecting him to write it. He already has all the info needed.
 
ooh clever topic
ithink
 
1:26 AM
@RMartinhoFernandes Who?
 
@LucDanton @Kerrek.
@CatPlusPlus Didn't you set it?
 
i dont know im drunk
 
whisky inhibits your punctuation
 
@RMartinhoFernandes Oh wow I'm dumb, since I've been expecting an answer from Kerrek I just assumed your message was his.
 
1:26 AM
scientficly proved
 
I don't see your scientific credentials
 
He's a cat drunk on whisky. What more credentials do you need?
 
anyone use iAds in their iPhone apps?
 
What the heck is that?

iPhone / iPad

Apple iOS development chat. This room has a FAQ at ios-develop...
 
@RMartinhoFernandes that room is empty, thought i'd ask here.
 
1:32 AM
well, it's not going to magically increase the number of people who can answer your question by finding a bunch of unrelated people
I never understood why people do this
 
k thanks
 
@Wezly You didn't check if the room was empty in the first place.
 
"Oh, well, I guess that my intended audience is empty. I guess I'll just find some other people who have absolutely no interest and try there."
 

 jQuery

This room is often empty cept rlemon. he's always here.
Maybe you should try this one.

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Or this one.
 
don't say that, you're just making things worse
 
1:34 AM
Those aren't empty.
 
just accept that at 1:30 AM, you won't get far
 
I'm pissed off.
 
I'm pissed off
 
Don't fucking try to correct a pissed off man.
 
I wasn't correcting you, I was merely stating the truth
 
1:35 AM
Oh.
 
which I felt to be well-timed
 
For all we knew, maybe you were pissed.
 
Ok, the intruder seems to be gone now. I can relax.
 
lol
I'm just irritated because this is supposed to be the easy part
and the code just won't... flow
 
should a C++ compiler be generating default assignment operators for abstract classes that have no assignment operator?
 
1:37 AM
yes
the assignment operator and having some pure virtual functions have absolutely nothing to do with each other
 
How could you write the assignment operator of derived classes?
 
will it still do so if I give it an S T::operator=(const S&)=0;?
 
Granted, though, assignment and polymorphic classes don't play well.
 
@RMartinhoFernandes the abstract class derives from a base class that has a virtual assignment operator
 
still slive
 
1:40 AM
Then you can't prevent your class from having one.
@CatPlusPlus That's not a word.
 
@CatPlusPlus Drink much more and you won't be.
ok
 
Oh, "alive".
 
accessibility is a property of a reference, not of an object
 
well, the other remotely close typo would have been something like "saliva"
but I figured that that made significantly less sense and was also not a meme
 
1:42 AM
Yeah, I suck, I get it.
 
by the way
is it the lazy man's approach to memory management to just stick an owning pointer in some other object somewhere
 
There's a lot of "some" in that sentence. You need to be more specific.
 
well, I'm building my semantic analyzer, and instead of having like map<string, shared_ptr<namespace>> I've got map<string, namespace*> and store the unique_ptr in the semantic analyzer class
effectively, I'm using one big-ass memory arena, I guess
 
If the map doesn't outlive the analyzer, it seems fine.
Why not make the map own it?
 
1:46 AM
yey
 
reference cycles
 
What about map<string, unique_ptr<namespace>> and non-owning ptrs for references?
 
could do, I guess
 
The ability to forward declare enums is cool.
 
I prefer to just not have to declare shit
 
1:51 AM
Yeah, but C++ sucks. What else can I say?
 
lol
join me in doing something about it :P
 
I thought you wanted to do this yourself.
 
sbi
Wow, that rant of mine against SO's "fraud prevention" certainly went all ballistic.
 
mmh
 
You're still up this late? Isn't it like 3AM over there or something?
 
1:56 AM
I didn't want to start putting stuff up all about it before I was confident in it
@sbi linky?
 
sbi
@RMartinhoFernandes In fact, I just came home. :)
 
but I'm certainly considering being a bit more open about it now
 
Xeo
@DeadMG The 13 star thing in the starbord
 
sbi
@DeadMG Starboard, 13 stars.
 
ah that
well, all I can say is that I totally agree with you
 
Xeo
1:57 AM
> The alchemy that sacrifices several hundred million lives to give birth to one moment of pleasure.
That's certainly an interesting view on masturbation.
(Don't ask me where I read that.)
 
rofl
 
Browsing 4chan?
 
that's just silly
 
@LucDanton I'm in the middle, but now GCC says, sorry, unimplemented: mangling overload
 
even if I argued that every ejaculation which didn't produce children was murdering my sperm
then it'd still be silly because even if I was trying to impregnate my wife, only one of them would ever become a child
 
1:58 AM
Store them!
 
sbi
I have been at a company I used to work for, which had their traditional end-of-the-year/xmas festivity. It was great, I'm slightly drunk, and I just took my former boss home in the bus using my monthly public transport ticket (which allows you to take someone at night and weekends). It was great, and I don't feel like going to bed yet.
 
I do have an arbirary slicer, slice_tuple<Integers<1,4,11>>::make(t).
 
sbi
I'm sure I'll regret that, though, when my alarm rings in like 6 hrs.
 
The problem lies in coupling that to the range generator
 
2:00 AM
I have several functions whose return type is something like std::tuple<decltype(std::get<Ints>(Tuple()))...>
 
I might go to macdonalds and buy some food
 
Xeo
At 3 am?
 
they're open till 230 and it's 2am here
 
Xeo
In Berlin, McDonalds only has open till 2am
 
2:00 AM
Silly Easterners.
 
Xeo
Ah, right, GMT+0
 
Here it's open until 3.
 
but I could use something hot and I figure that since they're still open
 
Microwave!
 
sbi
@DeadMG I'm sure we'll hear you whining about your stomach for days, if you do this now.
 
2:01 AM
@KerrekSB Oh haha, I had a variation on that one except about manging dotstar.
 
I rarely complain about it these days
but macdonalds is fine now that I stopped ordering chips
which is fine because they're not tasty anyway
 
Xeo
They're salty, and that's about it.
 
agreed
not like English Chips
 
What are English Chips?
 
They're large. Also I don't remember if there's a specific sauce to go with.
 
Xeo
2:06 AM
Screw it, McDonald's in Berlin only opens till midnight sunday-thursday, and till 2am on friday and saturday
Well, apart from those 24h ones
But I don't got any of those near me
So I'd have to go by train
 
user406009
@DeadMG I know this is 11 minutes later, but for your map why don't you just use boost::ptr_map?
 
Xeo
which don't run anymore after 1 am
And it is suck.
 
That expression is definitely a meme now.
 
Xeo
Atleast in this room
 
0
Q: lvalue required as left operand of assignment (C program)

ElleaI am getting an error of "lvalue required as left operand of assignment". It assigns to the line: if(ch=='.' || ch=='"' || ch=='(' || ch=')' || ch=='!' || ch==',' || ch=='?' || ch==';') { etc } I just want to check if the character I'm looking at is equal to any one of those characters. Any i...

am I missing something? chr=')' shouldn't cause an error, right?
 
2:21 AM
No. It assigns ')' to ch and then converts it bool. ')' converts to true.
 
Xeo
@Pubby If ch is const, it does.
 
No, it's precedence!
 
Xeo
D'oh, read that too
Damn precedence rules.
 
holy shit... somebody double gold badged here...
100
A: how to empty an array in JavaScript

Matthew CrumleyIf you need to keep the original array because you have other references to it that should be updated too, you can clear it without creating a new array by setting its length to zero: A.length = 0;

 
Xeo
"m@", that's clever
 
cpx
2:26 AM
So, It becomes (ch=='(' || ch)=')'!
 
0
A: lvalue required as left operand of assignment (C program)

R. Martinho FernandesYou should fix the = to be ==, like others said. The weird error you're getting is due to || having higher precedence than =. Your expression is being evaluated as: (ch=='.' || ch=='"' || ch=='(' || ch) = (')' || ch=='!' || ch==',' || ch=='?' || ch==';')

Boats.
 
Xeo
@RMartinhoFernandes You know @Seth has said that in a comment?
 
seth has higher precedence than robot aparently
 
@Xeo I was writing my answer at the time!
 
Xeo
Yeyeye
 
2:30 AM
-6
Q: How to access an index in a vector without segfaulting

zebraI know this is simple, so I apologize in advance. I am segfaulting when trying to access a vector by index. For example... vector<float> some_vec; int i = 0; for (some iterator loop here) { //snip some_vec[i] = some_float; i++; } What am I doing wrong?

 
if ch was const, it would still be lvalue, right?
 
If the object ch were const, then the expression ch (the name of the object) would still be an lvalue, yes.
 
cpx
It would still expect an lvalue though
 
That used to be Arsenal, but someone decided to censor "arse".
 
what's that screen?
 
2:36 AM
> Over the weekend a temporarily over-zealous profanity checker took offence at certain programme titles. The altered titles have been swiftly an*lysed and we're fixing any remaining glitches.
 
Xeo
@RMartinhoFernandes lol'd
 
hi
remember me
am the guy without punctuation m,arks
ohlook theres one
thats ufnny
alchohol is bad kids
dont drik
 
back
 
@CatPlusPlus are you friends with the guy who uses ellipses instead of question marks...
 
@RMartinhoFernandes How to write C++ with less error?
Is there anything wrong with my answer here? It's an ugly question, but I thought the answer made sense.
 
2:46 AM
I think you don't address the actual question, namely, if the code is UB
which it isn't
fugly, and obfuscated, yes, UB, no
 
@DeadMG I'm saying that "it's fine", though...
Maybe I should make it clearer
 

« first day (430 days earlier)      last day (4518 days later) »