« first day (991 days earlier)      last day (3950 days later) » 

3:01 AM
If all he wants is to strip off the 0x, surely that ought to be easy enough to do in C++.
It's certainly easy enough in C# </snicker>
 
Had to write a class. :p
 
eh?
I was under the impression that it didn't output the 0x to begin with
 
Well, if you're going to separate it in a function.
 
I could not imagine any software would print out IDs in hex
 
well I'm off to bed
wish me luck
 
3:16 AM
Sleep long and pain free :)
 
Good night.
 
3:49 AM
Hai @ScottW <3
 
did you cook a gourmet meal?
 
4:04 AM
every room is dead and i'm so freakin bored
 
 
5:12 AM
lol I forgot I have put feeds on to my plonk list
 
@CCInc It is pitch black. You are likely to be eaten by a Grue.
 
the chat has been quiet lately
 
@JerryCoffin nice
 
@Telkitty猫咪咪 LOUD!!!
 
5:20 AM
YEAH!!!
 
@StackedCrooked So, come commiserate with me. I spent nearly the entire day having to read Java code, with the monotony broken only by a little Python, and a tiny bit of RoR stuff. Why do I subject myself to this?
 
@JerryCoffin We all have days like that.
 
but java code should be easy for C++ developers ...
 
@StackedCrooked Unfortunately, I have at least a few weeks of this before I get back to something at least semi-pleasant.
 
imagine you are a Java developer reading C++ code :p
 
5:25 AM
@JerryCoffin Better Java than php.
 
Coffee at work and later beer at home helps to compensate.
 
user142019
watno
 
user142019
PHP > Java
 
@MarkGarcia Thank you -- that honestly does make me feel better, now that you mention it.
 
user142019
Java is unreadable and unwritable. PHP is just unwritable.
 
5:26 AM
@JerryCoffin It would make you feel much better for you to know that what I'm doing is php stuff. :)
 
anyone here is actually working on C++?
 
@ScottW We share the same suffering. :)
@Telkitty猫咪咪 I still do C++. Open source/pet project stuff.
 
@Telkitty猫咪咪 Yes and no. Most of it isn't particularly complex or hard to understand, but it's still painful to have to read a 200 line file, and try to keep myself from thinking it should only take 10 lines (or less) to do that.
@Telkitty猫咪咪 Not for work (right now) anyway.
 
@JerryCoffin I know that feeling. And Java is the worst violator in this regard.
And instead of fixing it, they add stuff to the IDE like "Generate getters and setters..."
 
I've learned this the hard way: The best way to code with php is to not do server-rendering stuff that interleave php with html. The worst way to work with php is to maintain code written by others (what I've written too, TBH). sigh
 
5:31 AM
@StackedCrooked Yeah --about the worst I've seen, anyway. Worse still is that that same 200 line file is repeated with only the most minute changes, 20 times over.
@ScottW I've heard of artificial intelligence, but has somebody actually built an artificial hater? What for?
 
php is a sink. The hallmark of write-only programming.
 
@ScottW Hmm...now that you mention it, I guess you could use artificial hatred when writing soap operas (or professional wrestling episodes, I guess...)
 
@JerryCoffin while read i ; do echo I hate $i ; done
It works :P
 
@MarkGarcia APL is write-only. PHP is merely...complete shit.
Now that I think a moment, that's wrong though. PHP isn't really even complete shit. It's incomplete shit. If it were complete in any meaningful way, it would be better.
 
Cool. wtfjs for php: phpwtf.org
 
5:52 AM
Does anyone know of any nice GC/RTS's written in C++ not C? All the ones i think of off the top of my head are C or Forth..
 
@ScottW That strategy never failed me yet.
 
@ScottW Relevant: vimeo.com/22053820
 
GC/RTS?
 
garbage collector, run time system
Probably 'or' would have been more appropriate than '/'
 
It's a pity that Lounge<C++> is not valid syntax.
 
Lounge<CPP>?
 
@StackedCrooked Can be, I think, if C is a constexpr.
 
@MarkGarcia Aha!
That's interesting.
 
Can't. It's const. :p
lol
How dumb I am to even try it.
Can do Lounge<C++>: coliru.stacked-crooked.com/…
9
 
user142019
6:12 AM
Morning.
 
@MarkGarcia nice!
 
@StackedCrooked Oh. You can even remove cpp in that and still have the code compiled.
 
At least it's got highlighting with that warning! :D
 
user142019
I want my Gentoo back dammit.
 
user142019
6:15 AM
I really need to buy some good hardware and assemble a powerful desktop computer.
 
@MarkGarcia 'increase this by one please'... 'erm, 42?'
 
Hmmm... The code actually says more. "C is dumb", and cpp is unused in Lounge<C++> as we like to talk about, well, penises.
@thecoshman Yeah. It has always been the answer!
:)
@StackedCrooked Wait. No main()! Coliru can do code with no main() function!
 
With the -c flag it only compiles to .o file.
 
Oh. Ahahaha!
 
6:42 AM
Heh.
Trickery.
I must have been very angry to say that thing on the starboard.
But I've already forgotten what I was upset or annoyed at in the first place. =[ (or maybe =], because that's a good thing?)
 
running app on device kept on freezing my mac and PC alike
it is not my app
come over :p
 
@Telkitty猫咪咪 Wait, how is that even possible?
 
yes, for some reasons, when I run the apps on devices (iphone, Android & Window's phone) for too long, it will freeze my PC/Mac occasionally
it does not freeze my phone
just PC/Mac
I am forcing close my PC/Mac 10+ times a week nowadays
sad ...
 
7:10 AM
o.0
You must be doing some extremely weird shit.
 
web query & database operations ... nothing else more comlicated
lol, have fun
I am off for a jog soon too :p
 
Weee~
@R.MartinhoFernandes What's the usual interface for ranges? Is it the same as iterators except you have an explicit operator bool on the range for checking whether that range is valid or not? Or... is it something else entirely for C++?
 
JBL
7:33 AM
Mornin'
 
7 hours ago, by Lightness Races in Orbit
im wondering how to write a q so that inside stack overflow i could do sth like : 'help me plz' and then get my codez plz hep — Lightness Races in Orbit 3 mins ago
gone :(
also, lol:
@LightnessRacesinOrbit: If you don't know the answer then no need to give suggestions.Other people know what I'm talking about. — Satya Kumar 2 hours ago
 
JBL
Meh. Why isn't there a very simple "We don't write code for you" flag, or something like that ?
Most of the time, I don't know how to flag these kind of questions, either with "too broad" or "Unclear".
 
@JBL the new "Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work." off-topic reason is pretty good for that
 
JBL
@LightnessRacesinOrbit Oh I didn't see the choice given after choosing "Off-topic".
 
"show me minimal code so I can make started"... ok then... int main(){return 0;}, now off you trot
3
 
JBL
Haha !
"But it does nothing !"
 
not even sure if you need the 'int' is that auto deduction thing a C thing?
 
JBL
Merciful, you even spare him the arguments of main.
 
@thecoshman A C keyword for an automatic storage variable. Pretty redundant.
 
... fairly sure those are optional
 
7:44 AM
@JBL and the return 0
int main(){} is minimal
 
JBL
@thecoshman Indeed.
 
@jalf main(){} is pushing it too far though right?
 
JBL
Well, it's the "minimal" code strictly speaking.
 
well, you can't go giving them code that doesn't compile :P
 
@JBL int main; // shorter and compiles, behaviour implementation defined... (will usually does quit, but so does int main(){})
 
7:47 AM
@thecoshman it's not C++
 
@LightnessRacesinOrbit didn't think so
 
JBL
@not-sehe Chances are that the guy will compile + link altogether.
 
<tomalak> main() {} <geordi> error: ISO C++ forbids declaration of 'main' with no type
 
@JBL Yeah? This compiles and links. What's your point?
 
ah, there we go, chat mod back running
 
7:50 AM
<tomalak> int main; <geordi> Undefined behavior detected.
 
:) I called it.
 
<tomalak> -c int main; <geordi> Success
that's the point
(-c compiles only)
@thecoshman what does it do?
 
I think, the program is just implementation defined. The runtime is undefined.
 
@LightnessRacesinOrbit keyboard shortcuts
 
any good ones?
@not-sehe eh?
you're not-making sense
 
7:52 AM
@LightnessRacesinOrbit :) When does Geordi 'detect UB'? I reckon that's runtime, not link-time?
 
What's the distinction? Either a C++ program has undefined behaviour or it doesn't
 
I know. My claim is it compiles and links. Your claim is it doesn't, at least not without protesting.
 
So you're asking about geordi's UB-detection mechanism's scope? I dunno =)
 
g++ -std=c++11 compiles and links this fine for me.
I can even run it, without 'observable' differences (except maybe an unpredictable exit code, which I haven't checked). Of course, it will more like /abort/
 
Well g++ -std=c++11 doesn't inform you about UB
Whether geordi is correct about the UB is up for debate
 
JBL
7:55 AM
@not-sehe Uh, with msvc-2012, I get an unresolved external reference :/
Oh right...
 
@LightnessRacesinOrbit Gah. "I know". That's not my claim. Read closely:
8 mins ago, by not-sehe
@JBL int main; // shorter and compiles, behaviour implementation defined... (will usually does quit, but so does int main(){})
^ The UB was acknowledged right from the get-go
 
JBL
U as unspecified ? or undefined ?
 
Though it's not spelled out in 3.6.1, a non-freestanding implementation appears to require a definition for main. Any other scenario is not mentioned, and thus undefined; consequently, all these different behaviours are compliant.
@not-sehe implementation-defined != UB
 
Mmm. Actually I snap-judged it Implementation Defined
 
JBL
(Also, I thought that UB didn't prevent linkage, just that at runtime, anything could happend)
 
7:56 AM
@JBL UB doesn't mandate either. UB can prevent your fingers from linking with your hand if it wants to
 
I suppose it may be UB depending on the implementation / lol
 
JBL
@LightnessRacesinOrbit Ok.
 
UB can be handled with a compilation error, or a spectacular nuclear explosion
it's not restricted to doing nothing or anything at runtime
 
JBL
Duly noted.
Esp. the nuclear explosion, looks totally badass for a program bug.
 
JBL
7:59 AM
Not enough nasal demons.
 
2000
A: What is the name of this operator: "-->"?

Charles SalviaThat's not an operator -->. That's two separate operators, -- and >. Your condition code is decrementing x, while returning xs original (not decremented) value, and then comparing the original value with 0 using the > operator. To better understand, the statement could be as follows: while( (x...

2000, bitch!
 
JBL
I'm tempted to upvote just to break that perfect number.
 
totally prove stackoverflow is silly and not to be taken too seriously :p
 
0
Q: Incrementing reference variable doesn't work

Lightness Races in OrbitThe following code is supposed to output 6, but instead it outputs 5. I can't figure out why. What's going on? #include <iostream> template <typename T> void foo(T& y) { y++; } int main() { int x = 5; // Why won't this line work???/ foo(x); std::cout << x; } Live demo

trollololololololololol
 
8:15 AM
post imcrement?
 
@LightnessRacesinOrbit Oh you! lol!
 

Indian Enthusiastic Programmers

Anyone can join, it's not only for indians. Room is most acti...
 
the frustrating thing is I can't write an answer and take credit, as that would spoil the effect
 
opposed to to Indian can't be fucked programmers?
 
but I hid the answer in the question's source just so I can prove later that I knew all along ;)
@thecoshman :)
 
JBL
8:16 AM
What a troll.
How you do even get upvotes for that is completely beyond me.
 
It's a good question, regardless of the fact that I know the answer
Lighten up
 
JBL
@Lightness etc., y = y++ is UB no? — Bathsheba 14 secs ago
How cute
 
JBL
@LightnessRacesinOrbit Erm... How could you even end up getting that trigraph in a comment in actual code ?
 
Xeo
@JBL You don't, really.
 
JBL
8:20 AM
@Xeo That was rethorical.
 
@JBL It's question recursion!
@Xeo what?
You thought I'd let people think I didn't know already?
 
Xeo
@LightnessRacesinOrbit Meh, no fitting close reason for "troll" :/
 
at least downvotes should work
 
JBL
Oh! What an interesting and neat feature. — Lightness Races in Orbit 2 mins ago
STAHP IT !
 
haha
Look, there's nothing wrong with a bit of theatre. litb does it all the time with his "trick" questions
nobody downvotes him
 
8:22 AM
i did
 
JBL
@LightnessRacesinOrbit I still laughed :)
This blew my mind. Can you imagine receiving this sort of problem in a job interview or something?! Probability of looking stupid = 100%. — Ed King 32 secs ago
2
I will remember that huhu......
 
Xeo
@JBL If any interviewer ever asks such a question, I'll walk right out.
 
Xeo
This is basically a glorified bug report for the pretty printer syntax highlighter...? (Not sure whether to +1 or -1.) — Kerrek SB 35 secs ago
haha
 
JBL
@Xeo That could be exactly the point.
 
8:27 AM
lulz
 
@LightnessRacesinOrbit: Maybe this should be called a "smug report". — Kerrek SB 4 mins ago
^ love that one /cc @KerrekSB
 
that question could become a trick interview question
 
> Super, du hast die erste Runde erfolgreich beendet!
I'm good at teh English
 
@LightnessRacesinOrbit Thank you. :)
 
JBL
8:33 AM
0
A: Incrementing reference variable doesn't work

DRCprobably your comment is interpreted as a treegraph that "deletes" the function call. http://ideone.com/sU4YGc works for me deleting that ??/ in the comment. // Why won't this line work? foo(x); see also Purpose of Trigraph sequences in C++?

 
@MarkGarcia np ;)
 
JBL
> Probably [...]
 
JBL
Oh gosh treegraph
 
Does anyone use that trigraph stuff any more, on anything?
 
Does anyone ever stop asking that question? --> Stack Overflow :)
 
JBL
@MartinJames Hipsters.
 
Xeo
Oh noes! @MarkGarcia linked my bearded-lambda question. :>
 
Quick, C-W it before anyone gets anymore rep!
 
8:38 AM
@Xeo :)
@Xeo Also, do you know of more tri/di graph hi-score questions out there?
 
44
Q: Weird use of `?:` in `typeid` code

Johannes Schaub - litbIn one of the projects I'm working on, I'm seeing this code struct Base { virtual ~Base() { } }; struct ClassX { bool isHoldingDerivedObj() const { return typeid(1 ? *m_basePtr : *m_basePtr) == typeid(Derived); } Base *m_basePtr; }; I have never seen typeid used like that. Why doe...

nice
 
I finally upvoted the Robot's beard-answer. It is kind-a stylish after all
 
three off-topic votes on my question! what is wrong with people! such grumpy losers
 
JBL
Trolling is off-topic on SO ?
 
8:42 AM
first I heard of it
 
JBL
Damn.
 
@not-sehe got pwned
 
Xeo
@not-sehe Wait, so that comment of yours was made without giving an actual upvote?
 
@LightnessRacesinOrbit It's a debug me question! :p
 
@Xeo Indeed!
 
8:42 AM
@MarkGarcia meh - okay there's scope for that
 
JBL
Damn, I missed Mr Detective.
@LightnessRacesinOrbit If you already knew the answer, why didn't you answer your own question? — Dukeling 19 mins ago
 
@Xeo I was doing him a favour: why upvote on a day where the Robot was obviously already rep-capped? I can do it months later, instead. Which I just did. Q.E.D. /cc @R.MartinhoFernandes
@LightnessRacesinOrbit mmm? Did I miss something :) Lemme check my inbox
 
actually, the trigraph ??/ doesn't eve get to the compiler, the substitution is made by the preprocessor — Stefano Falasca 2 mins ago
 
@StefanoFalasca precisely what I said. The compiler sees a '/' — not-sehe 4 secs ago
@LightnessRacesinOrbit ^ You guys need reading comprehension
(Self-pwnage in action. Tiring)
Schneier on Security: Security Analysis of Children http://www.schneier.com/blog/archives/2013/07/security_analys_4.html "I childproofed the house THREE TIMES, but they keep getting in!"
^ This rings so familiar.
 
@not-sehe pfft ;P
 
8:56 AM
@not-sehe Your other self.
 
@MarkGarcia's having fun with ASCII art, I see
 
@LightnessRacesinOrbit Hey. I can't help it that you pedants have such low bars for "fun".
@jalfd Impressive! I waited 22s and it DIDN'T even display the login form! Enterprisey! #anoperatorwillbewithyoushortly #yourcallisimportant
 
@LightnessRacesinOrbit I could do elaborate ones, but they'll sure obscure the content of the answer. :)
Anyway, I'm leaving that answer in the hands of Stack Overflow. Have some work to be done.
 
9:20 AM
question was called "Passing stl argument to struct" originally >.<
 
@LightnessRacesinOrbit I saw that lol.
 
9:48 AM
-1
Q: Read whole std::ifstream to heap

user968243I cannot work out why this isn't working. From what I can tell, it doesn't appear to be reading the whole image file... Though I cannot tell. I basically have some raw image that I'd like to read onto the heap. unsigned char* ReadImageFromFile(const char* FILENAME, unsigned int SIZE_BYTES) { ...

The code in that question is so wrong...
 
JBL
Was looking at it.
Blergh
 
user142019
Morrrrrrrrrrrrrrrrrrrrrning!
 
@rightfold morning :)
 
@Griwes it's not that bad
 
user142019
@NikiC I read PHP has yield now. Amazing.
 
9:55 AM
will it yield to common sense?
 
@LightnessRacesinOrbit It is. malloc, totally unnecessary unsigned forcing him to cast to char * (?), C-style casts, MACROCASING, not checking whether any of those operations were successful.
 
@rightfold Yep. To be more precise: I implemented it :)
 
@Griwes You're right about (some of) those things. However, fundamentally, it should "work" to a degree.
 
user142019
@NikiC Is the implementation efficient or crappy?
 
@Griwes It's not totally unnecessary if that's what kind of data he wants in the buffer.
Casting to char* with read() is just something you have to swallow.
 
9:56 AM
@LightnessRacesinOrbit Yeah, but since when does "should work to a degree" implies "not that bad code"?
 
@Griwes I'm just saying that I've seen much greater WTFs on SO
 
Nah.
That goes without question.
 
s/a // # FTFY
 
@rightfold It's efficient enough ^^ A good bit faster than implementing normal iterators at least
 
user142019
Great.
 
9:58 AM
@LightnessRacesinOrbit Thanks.
 
user142019
@NikiC Is it fun to work on PHP implementation or is it a nightmare? How are the internals?
 

« first day (991 days earlier)      last day (3950 days later) »