« first day (1398 days earlier)      last day (3556 days later) » 

4:00 AM
Speaking of Bounty
What happens if the grace period ends?
 
WTF are these edits???
 
Bounty either disappears is or half-auto rewarded.
 
@Mysticial Thank you. I'll be here all week. Don't forget to tip your waitress.
 
I feel rather dirty for answering a question for the bounty
But all the answers were pre C++11 so I didn't mind
 
@Rapptz At one time, I'm sure MrGomez would have given you counseling about that.
 
4:03 AM
Ah yeah.
Kind of impressive (?)
All the bounties he got were from a rather diverse topics.
 
Yeah, it was impressive.
 
> 62 Earned bounties for 12,250 reputation
 
Woah.
 
All his answers seem pretty high quality.
Not bad.
 
He beat Jon Skeet by quite a decent margin on a fairly regular basis for a few weeks, and then poof, he pretty much completely disappeared.
 
4:08 AM
Everyone burns out after a while... almost.
 
lol. Not even a single tag badge.
Pretty diverse, yes.
 
Jon Skeet's been getting topped by the same few people in the week charts recently.
 
lol he answered a C++ question without knowing C++
 
^^ This guy... is insane.
 
posted on August 14, 2014 by Scott Meyers

I don't have Clang here (Windows ghetto, sorry), and I haven't been able to find an online Clang compiler that has the Boost headers available, so I'd be grateful if somebody would run the following program under Clang with the latest Boost and let me know (as a blog comment, so that people will know that the work has already been done) what the output is. Thanks. Scott #include <iostrea

 
4:09 AM
BalusC, Amsterdam, Netherlands
500k 110 1448 1781
^ Huh, haven't noticed that guy...
 
whoa
> 157 Earned bounties for 14,975 reputation
 
Many of the top users are inactive. Part of the reason is the question quality.
 
@Feeds Coliru!
 
@Mysticial Yeah--20+ answers a day on a regular basis. I'm not sure I ever did that, not to mention doing it routinely.
 
Practically speaking, I'm basically inactive as well. Except that I come to chat and occasionally cast a close vote and maybe an answer.
 
4:11 AM
@MarkGarcia Leave a comment then.
 
@MarkGarcia Coliru doesn't have access to boost, does it? Also uses gcc, not clang
 
Oh, guess Coliru is missing that particular header
 
@Yuushi You can use Clang easily.
And I use Boost on there from time to time.
 
@Yuushi It also has boost, though interestingly it isn't available..
 
4:13 AM
@chris Ah, I didn't realize that it also supported clang/boost
 
@MarkGarcia It's just that header. I subbed in preprocessor.hpp as a test.
 
@MarkGarcia I posted a comment.
 
I believe Scott’s program requires Boost 1.56 for that include to work.
 
it seems spammy though
but he did ask for it
so w/e
 
I did notice that Coliru's Boost.PP was missing a configuration thing for variadics.
 
4:14 AM
Scott's on a deadline.
 
Man
I can't edit my comment.
Terrible.
 
Okay so you posted the comment
 
@chris Ah, that question...
 
@StackedCrooked We need you quick
lol
 
@StackedCrooked Now's your time to shine!
 
4:15 AM
@LucDanton Yeah it does.
 
The integrity of the lounge depends on Coliru having Boost 1.56.0 before Scott notices
4
 
@Mysticial Oddly, I've been a little more active recently--I'm probably back up to averaging an answer every day or two.
 
Unless we don’t get it right in time, then it’s just Rapptz’.
 
@MarkGarcia You can still #define it yourself, but I don't think that's all too good.
 
I have integrity regardless of what Scott thinks of me!
 
4:16 AM
Wait, isn't there a include this other source file technique in coliru?
 
good luck including all of boost/type_index
 
You can copy stuff around and use a ‘local’ path.
 
Preprocess them!
 
I still don't know the difference between boost/type_index and <type_index>
Maybe Luc knows and could fill me in
 
At first sight, it would be ‘boost/’. Possibly the brackets, too.
@MarkGarcia That could work.
I don’t have 1.56 either.
 
4:18 AM
I don't have boost 1.56
I have 1.55
 
GCC trunk currently breaks my stuff so I haven’t been too keen on upgrading.
 
I have 1.56 but for Windows.
They have a separate download for nix.
 
Yeah, STL released a new distro
 
@Rapptz More seriously and without knowing anything about the former I assume it’s to give a somewhat portable alternative to people. It’s not uncommon when it comes to Boost.
 
@Rapptz Similar to <type_index>, but doesn't require RTTI, allows removing cv-qualifiers, and I'm pretty sure a few other things I don't remember.
 
4:21 AM
sounds lame
 
No RTTI!
 
As lame as using Boost.Regex when <regex> is not available?
 
Well Boost.Regex is actually useful.
<type_index>? Not so much :v
 
Luc made me laugh... do they have <regex> in gnu yet? Last I heard in 2013 wasn't available
 
4.9
 
4:23 AM
Yes
 
I don’t see the appeal in reinventing struct my_own_type_index { std::type_info const* info; }; every time.
 
don't use it though
it's utter crap
i.e. super slow
@LucDanton Also, Boost.Regex implements PCRE which <regex> doesn't :s
> @Rapptz: I tried Coliru before posting. The Boost headers aren't available there, at least not by default. I had not heard of Wandbox, but the Boost version they have there is 1.55, and Boost.TypeIndex is new to 1.56, hence my request to run the code with the latest Boost.
 
Yeah. Boost.Containers has interesting containers, but it also has a vector. As in, something that mimics std::vector.
 
It seems Scott uses Coliru.
@LucDanton I know.
 
@Rapptz Jerry has outlined some things that Boost.TI can do that differs from std::type_index.
 
4:27 AM
Yeah I saw.
 
Complaining for the sake of complaining?
 
I don't recall complaining, just sharing my opinion.
 
Fair enough.
 
tbh the only substantial benefit that Boost.TypeIndex seems to offer is demangling and no RTTI.
which I suppose is cool but I've really rarely needed type_index except once
 
So I tried to preprocess type index using GCC for use with Clang...
 
4:29 AM
lol
 
Keeping in mind that Boost does demangling now. So you can still stick to std::type_(index|info) and have pretty names.
 
And also on windows, for linux.
Sorry Scott.
I hope there's an emulation mode for preprocessing or something.
 
g++ -E?
 
@Rapptz I mean, emulate preprocessor variables for Unix, etc.
 
ThePhD has written a demangling thing that works on GCC/Clang/MSVC
it's somewhere in my repo
 
4:32 AM
Eh, even if I did have 1.56 I think I don’t have Clang on my system currently.
 
@Rapptz "demangling thing" So if it's ThePhd then its quite ambiguous? :P
 
nah it works
 
Dang it
I removed a C++ tag and was counting on my dupe vote to not be OP
Guess you need to refresh in between or something
 
lol I think he does it manually
that documentation is fairly bad though imo
 
4:37 AM
@Rapptz Given a hard way and an easy way, he does seem to take...a third way that's harder still.
 
@JerryCoffin Ah, good thing the flags are UNDNAME_NO_* instead you needing to specify everything.
 
3
A: Demangling in MSVC

Igor SkochinskyIt seems UndecorateSymbolName/__unDName can't handle function-local names. If you move the class definition to the global scope, .name() will return already demangled name (use .raw_name() to get the mangled name). To demangle the (global) raw name manually, you need two changes to your code: 1...

 
@Rapptz Of course.
 
seems like it's rather crappy
he does some things manually I guess
 
@Rapptz Wait. One function for all compilers?
 
4:43 AM
@Rapptz Not really. That's just getting it from a std::type_info, which VC++ already demangles automatically. For gcc/Clang, it calls __cxa_demangle.
 
Oh.
 
@JerryCoffin Ah.
 
Given how straightforward it is, I'm left wondering if he really wrote it... :-)
 
I don't think this code is actually used.
 
lol
 
4:45 AM
or well, it is but it's usually superseded by the string provided by the user rather than this automatic guess
 
@Rapptz He does also have some manual demangling code, but it's not at all clear that it'll ever be used. In particular, if you try to use anything except VC++, g++ or Clang, you'll get to: #error Compiler not supported for demangling.
 
wth that flag
 
Can constructors be constexprs?
 
yes
 
It may, however, be that the intent is that external code only ever calls the demangle, and get_type_name is purely for use by demangle. Offhand, it looks like he's probably trying to turn their string that's intended to be human-readable into something that could (for example) be an identifier, so he removes "class" and replaces "::" with "_".
 
4:54 AM
yeah the point was to make the name be used as a lua identifier
 
@Rapptz are there restrictions to what kinds of constructors can/can't be constexprs?
 
@Rapptz Ah--fair enough (but the demangling itself is still really handled by (code supplied with) the compiler.
 
that header is something I don't look at because it's never used
it's changed a bit
so I don't pay attention to it
@anthropomorphic has to have an empty body and all the members have to be literal types
 
@Rapptz does "literal types" mean "not template types"?
 
no
lol
A literal type is any of the following

    void(since c++14)
rip
 
5:00 AM
@Rapptz I read void(since c++14) as a function signature...
 
@MarkGarcia the compiler would too, modulo the minor detail that ++ would be rejected in an identifier.
 
I'm probably a compiler.
Or at some point, programmers really become compilers.
 
@MarkGarcia I'd rather have a compiler that was a programmer.
 
A compiler that could write the code for you given a basic english explanation of the problem
Some day it will be real
 
@anthropomorphic Honestly, I kind of doubt it. English is sloppy and ambiguous enough that we often have to use something more formal to explain things to another programmer. So, the computer would have to get quite a bit better at understanding than most people for this to have a hope of working.
 
5:06 AM
But then again, natural languages are so complex, it'd be too easy to cause bugs via faulty word choice/grammar.
 
‘Police help dog bite victim.’
2
 
@LucDanton well done. That made me laugh.
 
Those machine learning guys are probably solving the wrong problem all this time.
@LucDanton Believe me, people here speak English almost exactly that way.
 
@LucDanton Or that old standby--the challenge is simply to identify each word as a noun, verb, adjective, adverb, etc. in both these sentences: "Time flies like an arrow. Fruit flies like a banana."
 
> Reading and writing HTML code is a skill vital to the economy, experts say source
9
lol
 
5:10 AM
wat
 
...and the article is about cybersecurity
 
but but isn't the relation between cybersecurity and HTML obvious? :P
we can h4x0r all your internetz with HTML
 
that is one terrible, terrible article
 
fuck man
I want to play Smash 4
:(
 
@TonyTheLion That's why you don't assign your reporter with a liberal arts degree to write a tech article.
 
5:18 AM
Valid point
 
What happens to throw statements when -fno-exceptions is set?
Does the control flow still continue?
 
@anthropomorphic Much better than assigning somebody with a technical degree to write the article. Somebody with a liberal arts degree might accidentally be at least semi-competent. Anybody who has a technical degree and is even close to competent is going to have better things to do, so if they have a technical degree and they're available, it's pretty much proof that they're grossly incompetent.
 
error: exception handling disabled, use -fexceptions to enable
     throw "error";
           ^
I.. see.
 
3
A: With "-fno-exceptions", what happens with "new T"?

Michael KristofikIt's not a definitive answer, but the GCC Manual (see the section "Doing Without") has this: Before detailing the library support for -fno-exceptions, first a passing note on the things lost when this flag is used: it will break exceptions trying to pass through code compiled with -...

this gives some idea
 
5:25 AM
It’s listed as a code-generation option, so that error makes some sense.
 
@LucDanton This makes the top answer really misleading and ruben's comment correct.
 
Eh, libstdc++ is something different though.
 
I was wondering what would happen if someone would use -fno-exceptions in my code
Good to know it fails
 
The manual says you do have to compile it again. Then I assume a failed new results in a call to __throw_bad_alloc (as usual), which apparently aborts in that case.
> For GNU systems, all appropriate parts of the GNU C library are already compiled with -fexceptions.
 
C library? wot
 
5:33 AM
This stuff is finicky.
@Rapptz Code generation still needs to take steps to correctly propagate exception info, if I read that right.
C language code that is expecting to interoperate with C++ should be compiled with -fexceptions. This will make debugging a C language function called as part of C++-induced stack unwinding possible.

In particular, unwinding into a frame with no exception handling data will cause a runtime abort. If the unwinder runs out of unwind info before it finds a handler, std::terminate() is called.
libstdc++ manual on -fno-exceptions and similar.
> GNU systems re-use some of the exception handling mechanisms to track control flow for POSIX thread cancellation.
@Rapptz The exception system, while not part of the language proper, is still used it appears.
 
Well, it's getting late. I need sleep. TTYAL.
 
Adios.
 
Good night.
 
6:39 AM
why do I remove and re-add markers on the map when I can just show and hide them?
 
@LucDanton Damn, I was going to post it as “Andrei has joined the Dark Side”
 
7:03 AM
Is it possible for C functions to be macros (in particular, printf)?
 
@Rapptz A lot of ctype.h is usually implemented with macros. For printf, I'm not sure.
 
I wanna name something printf (under a namesapce)
stupid preprocessor
it seems it is not a macro
 
@Rapptz Yes.
 
@LucDanton I don't know if it's feasible considering printf was in C89 but variadic arguments for the preprocessor wasn't until C99.
in theory the macro could have used compiler extensions though
unless you're replying to the first part :v
 
yeah, also the fact that there'd be little point. Saving a function call when it needs to make a syscall anyway...
 
7:12 AM
An object-like macro could still be used though.
Also yes.
 
I guess an evil standard library could do #define printf my_internal_printf
but that's evil :(
too evil really
 
#ifdef printf
   #error("Bad library. Bad!")
 
Hang on, it’s more hilarious than that.
> Any function declared in a header may be additionally implemented as a function-like macro defined in the header, so if a library function is declared explicitly when its header is included, one of the techniques shown below can be used to ensure the declaration is not affected by such a macro.
So you go e.g. (foo) and you bypass the macro, and you get the function that still must be present!
@Rapptz Also I think I misunderstood you. You said ‘C function’ but you’re still speaking of a C++ program right?
 
yeah
 
Because I think in C++ that’s not actually allowed at all. I.e. it’s all really functions.
 
7:19 AM
what will cause the address of an object to become 0xc0 and similar?
 
Ell
Nout
 
well isn't printf considered a 'C function'?
i.e. if I #include <cstdio> or <stdio.h> does it follow C rules or C++ rules?
 
I don’t know. I don’t think I understand the question.
@Rapptz When writing a C++ program, you follow the rules of the C++ Standard. Likewise for C.
 
I guess.
 
for C++, it's not actually guaranteed to be visible at global scope, from memory
as in, it is required to be in namespace std, but not required to be hoisted out from that
 
7:22 AM
Depends on the include.
 
yes, for <cstdio> I mean
 
> As I wrote on Facebook: y'all must call me Dr. Dre from now on. I'm a doctor and I need an American nickname! —andralex
 
Dr. D
 
7:49 AM
lol
26
A: Where can I find a large AJAX loader .gif?

SklivvzTechnically this is a correct answer: http://www.londontown.com/references/directory/images/big-ajax-loader.gif I will post more images in this answer as (and if) I find them. http://www.sofa-framework.org/design/loading_wh.gif

 
0
A: Private embedded shopify app

kartsimsI am stuck with the same problem and tried different things... As stated on this forum post by a "Shopify Employee", it seems to be possible for a private app to be embedded. I can't find how though. True private applications do not use OAuth and do not get listed in the Shopify admin, howev...

This isn't an answer, but it's not one of those low quality 'not an answer' things so I feel bad if I flag it.
 
meanwhile, Libya is trying to get rid of the fighters for democracy who helped to overthrow the bloody Gaddafi Regime - uk.reuters.com/article/2014/08/13/…
 
@Rapptz Yeah, it's nicely formatted (no edits!).
@Rapptz But that exclamation with a space before it. Kill it with fire!
 
As I recall those are allowed. As long as they help towards an answer (I have no idea if that’s the case here though).
 
anyone here got a section symbol I could copy paste? :)
§§§
free section signs
 
8:01 AM
Just in case… ¶
 
@Rapptz Simoleons!
Though I also like calling it X-COM money.
 
0
A: Is there any reason to check for a NULL pointer before deleting?

R SahuThis is what the draft standard says about calling delete on null pointers. 5.3.5 Delete 6 If the value of the operand of the delete-expression is not a null pointer value, the delete-expression will invoke the destructor (if any) for the object or the elements of the array being deleted...

I found this on the 'new answers to old questions' mod tool
 
@Rapptz I think it's @Mysticial's favorite tool.
 
He said he doesn't like it actually
It's entertaining atm.
 
Oh.
 
8:07 AM
Damn, I used to be able to input the currency sign before :( Not sure what happened.
Anyone followed what happened to Scott? I’m about to start compiling Boost 1.56.
 
he got his resolution
 
@LucDanton He got an answer.
 
godbyk said...
Running clang++ version 3.5.0-svn213717 under Ubuntu 14.04, your program outputs the following:
T = Widget const*

param = Widget const* const&
August 13, 2014 at 9:46 PM
Scott Meyers said...
@godbyk: That's the kind of output I was hoping for. Thanks very much!
 
Wtf am I talking about, I still have no Clang.
 
dyp
8:25 AM
Hi
 
JBL
Hi!
 
dyp
There's an interesting question buried under quite some noise here: stackoverflow.com/q/25301302/420683 Can we somehow improve it?
 
Have to manually delete the project-cache.jam so that b2 finds my newly installed dependency, lovely.
 
8:40 AM
17
A: Why do my dwarves climb trees?

Paul ZClimbing trees is meant to be a feature if your dwarfs can't get to their objective any other way. However, their aggressiveness in climbing up a tree and refusing to come down is a known bug. Often changing their labors around temporarily, or temporarily giving another dwarf the job they refuse ...

lol I love how the answer is essentially
"That's a bug. THIS IS DWARF FORTRESS!"
 
8:53 AM
hiya
 
9:06 AM
@Rapptz apparently Belgium has some pretty historical mobile network coverage :)
 
Ah hello.
 
Ell
Hi
 
Hello.
 
@MarkGarcia Don't what
 
@CatPlusPlus You mean chromium embedded framework right?
 
9:16 AM
Yes
 
Don't expect for embedding native stuff inside web stuff to be easy, unless you meant WebGL.
 
I'm embedding web stuff in native stuff
Well, C# probably, but still
 
Well that's great.
 
morning
 
Could use Awesomium but I'd rather try CEF first
 
9:20 AM
cef?
 
As I've experienced though, CEF isn't really optimal when combining native and web stuff. It's really useful for something like embedding a help page, but for side-by-side, there's so much to deal with.
 
hmm, chromium embedded browser
 
Just an advise, always use AJAX. Don't be tempted to handle ANYTHING from the render process.
 
If there existed a good OpenGL UI framework
 
I've not seen one for DX either.
near as I can tell, they're all "game developers" who try to work on that stuff, and produce game-quality results.
 
9:23 AM
There are lots of crappy ones.
 
I'm using CEF and it's quite OK.
 
> What do you call a dog with no legs?
> It doesn't matter, he won't come anyway.
 
such joke
 
lol
 
nice one
 
9:34 AM
-2
Q: Calculate Pi to N number of places

grahamI am trying to work out how to calculate Pi to N decimal places, I think the default DP's for a float/double is 5 and then you have setprecision() however these are obviously inadequate, I need infinite number of places. Also would anyone have any idea of how to code something like y-cruncher?

> Also would anyone have any idea of how to code something like y-cruncher?
 
Mysticial should be a reason to flag for offtopic for Pi questions
 
what if this was posted on the programming contest site
 
unwinnable because Mysticial
 
been done
 
9:38 AM
oooh
 
> HipChat is a hosted private chat service for your company and team. Share ideas and files in persistent group chat rooms, video chats, and more. Get your team off AIM, Google Talk, and Skype – HipChat is built for business.
 
> I need infinite number of places
lolwut
 
"Hip" "Business"
 
HipChat is for hipsters
 
Ye it stands for ‘hippopotamus’.
 
9:39 AM
@LightnessRacesinOrbit You didn't downvote it!
 
@Rapptz I'm still debating it
 
seriously the answer is utter crap and a rant in disguise
 
tell ya what I'm going to get into an edit war instead because that answer's just irresponsible atm
actually no that needs downvoting yeah
1
A: Use int or char in arrays?

cmasterWhile the answer really depends on the CPU and how it handles loading storing small integers, you can assume that the byte array will be faster on most modern systems: A char only takes 1/4 of the space that an int takes (on most systems), which means that working on a char array takes only a qu...

o.O
 
> And most codes are memory bound on modern hardware.
lol
 
Didn't know "codes" is now a buzzword.
 
9:44 AM
Has been for a while
> A char only takes 1/4 of the space that an int takes (on most systems), which means that working on a char array takes only a quarter of the memory bandwidth.
This isn't true, is it?
I thought CPUs typically work in words
 
my thoughts too
 
Buzzwords be annoyings
 
:18285707 Right, so..
 
Eh, bandwidth...
 
Xeo
Booored. Sleeeepy. Don't wannaaaaa
 
9:45 AM
@Xeo hi
 
Xeo
I might have to take some vacation soon
 
> might
 
@LightnessRacesinOrbit Though I think it would be the same bandwidth, though with ~%25 percent the time compared to reading ints.
 
> Objects in C++ cannot modify their this pointer. As a consequence, they cannot change type in mid-usage. However, ptrToClass can change, allowing an implementation to delete itself and to replace itself with another instance of another subclass of AnotherExampleClass.
So terrible
 
Xeo
wtf
 
9:47 AM
Wow.
 
Xeo
Please, please tell me ptrToClass is a pimpl-thing, and doesn't actually point to the same place as this...
 
@LightnessRacesinOrbit Sure (in fact, they use cache lines which are even bigger), but you only need to request a quarter as many of them, assuming that the extra space in an int is unused.
 
btw, in my experience references in C++ almost always get optimised, even at -Og they make debugging a pain so I have to use -O0 to remove the "optimised away" message.
can get quite annoying
 
@Rapptz I try hard to keep myself away from debugging at that level.
 
Kind of a shame.
 
9:49 AM
hey guys
 
My references only get optimised half the time, because half the time I'm using them as class members (as opposed to convenience names inside functions, which is the other half of my usage)
 
struct ngx_cycle_s {
    void                  ****conf_ctx;
 
well since C++11 I've taken a liking to doing auto&& x = expr;
 
should i start learning the new things in c++11 or is it ok to stay in c++?
 
9:51 AM
@ChemiCalChems c++11 IS c++.
 
@ChemiCalChems C++11 is C++.
 
i know
i mean c++99
 
C++11 has been making in-roads in many places, and is very nice regardless of adoption. Go for it.
 
What Luc said.
 
@ChemiCalChems With your avatar I thought you were telkitty.
 
9:52 AM
lol
@LucDanton thanks for the help ill go for it
 
@Rapptz But values.
 
@ChemiCalChems Never heard of C++99 tbh
 
@ChemiCalChems It's C++98 (or C++03 I suppose).
 
pre-C++11
 
9:54 AM
sorry for my fails
c++03 i use... i feel like such a noob now
 
As a heads-up C++1y (tentatively C++14) is well under way, too.
 
@TonyTheLion Shame that's not valid HTML
 
@LucDanton so i maybe should wait for c++14? or the next update?
 
Why???
 
Wait for C++99
Maybe they'll get around to modules
 
9:56 AM
@ChemiCalChems C++14 is a minor update to C++11.
 
(Still no concepts though)
 
No. It’s all incremental really—you don’t waste anything from learning about ‘previous’ versions.
 
@LucDanton thats what i was thinking
better not waste time in learning new stuff when im coding a game
 
@LightnessRacesinOrbit Oh. I actually forgot to downvote. Thanks for linking.
:P
 
9:58 AM
Yeah wouldn't want gamedev code quality to suddenly improve
11
 
> Turbo CCCC++++
 
@LightnessRacesinOrbit The guy put up a bounty to prevent closure and deletion. The bounty ended so people closed it etc.
 
Oh. He actually just copied it from the question.
 

« first day (1398 days earlier)      last day (3556 days later) »