« first day (1134 days earlier)      last day (3821 days later) » 

user3010322
4:00 AM
They've taken type, typeid, type_info, and type_index
 
tuple_type
 
user3010322
Perhaps true_type? :P
 
user3010322
WAIT that was taken
 
user3010322
FFS.
 
meta_type
 
4:00 AM
I'd just go for type_info2 for now.
 
user3010322
Lame.
 
user3010322
Something this great needs to have a better name.
 
type_t`?
 
user3010322
runtime_type, is not too bad.
 
user3010322
@DavidKron Usually for typedefs.
 
4:00 AM
@ThePhD THis
@ThePhD nullptr_t is a typedef :O ?
 
user3010322
typedef decltype( nullptr ) nullptr_t;
 
user3010322
It'salso used for tag types, like std::nullopt_t and std::in_place_t
 
user3010322
But I like std::runtime_type
 
Yeah thats awesome
 
_t isn't for typedefs, it's for type, really.
 
user3010322
4:02 AM
Descriptive and not full of lies like type_info.
 
well... it has info
 
user3010322
Oh, oh yeah
 
Literally to much
 
user3010322
Implemented-defined name
 
anna ni issho datta no ni
 
user3010322
4:03 AM
WOW SO USEFUL WOW.
 
Its just the functionality that is miss....suck
 
user3010322
Anywho, I'm gonna look over std::type_info and std::type_index and merge their APIs so we can one consistent, non-bad runtime_type
 
user3010322
Then I'm going to add it to DeadMG's thread
 
user3010322
@DeadMG You already got a response from David Krauss
 
Thats me
Jk
I think you should mention in the title that it is a dynamic "is_derived" tough
 
4:11 AM
Hey, guys! I have a problem with GetOpenFileName, after calling this function std::ifstream can't open file, is_open() is always returning false, but before calling GetOpenFileName its working fine.
 
@Sheppard_ What is GetOpenFileName?
Are you under the impression that the Windows API is somehow inherent to C++?
 
@LightnessRacesinOrbit It's an identifier.
 
Guessing its a macro
 
@LightnessRacesinOrbit yes, its WinAPI
 
Anyway, more than likely you have relative vs absolute path issues.
 
4:14 AM
There's probably a GetOpenFileNameA and GetOpenFileNameW.
 
OPENFILENAME struct dump after calling - i.stack.imgur.com/pVZLs.jpg
 
And they are probably both macros
@Sheppard_ aaa yes, thats what we wanted to see
 
@DavidKron lol
This is the most useless screenshot I've ever seen.
 
user3010322
GetOpenFileName is probably acquiring some kind of lock, maybe.
 
It doesn't contain anything relevant.
 
user3010322
4:15 AM
Why is he mixing WinAPI and std::ifstream
 
user3010322
Pick one.
 
@StackedCrooked Oh, you had null values? How could i not have guessed that...
 
@ThePhD im using WinAPI just for selecting path to language file
 
He's trying to open a file two times. But the second time it fails..
 
ehm ehm, close
 
4:17 AM
@StackedCrooked no, that is other files - one is config.ini, second ru.lng
 
@Sheppard_ Just leave the winapi be okay?
 
user3010322
So it's opening two completely unrelated files,a nd without giving us code OR asking a question on Stack Overflow, you want us to figure out what might be wrong with your code?
 
And don't suck.
 
@DavidKron ... WinAPI is not good....
 
@ThePhD Thats not completely right, you forgot the screenshot!
@Sheppard_ Its most certainly good! Just not on....Well most aspects!
 
4:19 AM
mmmm....cinnamon roll
 
what is nature what is porn NSFW but it's Saturday ^_^
 
Okay, i'll write my own procedure for file selection.
 
@Telkitty It's still Friday here
 
@Sheppard_ I see. You are taking the procedural approach.
 
4:21 AM
laggots :x
 
@StackedCrooked nope, its just test c&p from MSDN.
 
cuz c&p coding is always the best way to go
 
@Telkitty That's not porn. That's partially naked women.
 
what could go wrong.
it's all in the motherfucking null pointers.
 
@ThePhD The compiler still knows that it's null, but it's not allowed to treat this as a compile-time value.
 
user3010322
4:26 AM
@StackedCrooked Yeah, I figure.
 
user3010322
@StackedCrooked Sexy.
 
user3010322
So that's where the optimizer kicks in
 
user3010322
and just inserts a dead code section
 
But there is a linker error when using -O0
 
user3010322
4:27 AM
Yeah
 
user3010322
So it's an optimizer dealio
 
user3010322
Can't factor that into static_assert, I guess
 
Nope.
"What you are is lonely." Is this correct grammar?
I like it.
Another one they use is "All I want to get is a little bit closer."
 
user3010322
Ugh
 
user3010322
WIll I really have to use a std::unique_ptr inside of this thing
 
user3010322
4:36 AM
just to have the vtable?
 
user3010322
Seems gross.
 
I've used boost::variant a couple of times as an alternative to base-class + virtual methods,.
 
@ThePhD No way to reference vtable directly, unless you want to implement your own.
or fall back to implementation-specific details of course.
 
I found that replacing virtual method with std::function is faster as long as you make both the constructor of your class in the header inline, use lambda to initialise the std::function, and also inline the wrapper method which calls the std::function..
 
@StackedCrooked Er, I highly doubt that you have an effective test that shows that.
 
4:43 AM
@DeadMG I just posted it.
MacPorts build of GCC 4.8.
 
@StackedCrooked And as I expected, it's not a fair test.
 
Wow, you decided quickly.
 
there's not much there to read.
 
And that makes it unfair?
 
no, I decided it's unfair because of what I read.
it was merely quick to show it was unfair because it was quick to read basically the whole thing.
 
4:45 AM
I must be getting tired.
 
basically, you cheated because there's no state.
the general case of std::function is a virtual call.
 
It uses argc, which is unknown at compile time.
 
yes, but that's function argument, not function state.
basically, the lambda you provided can be converted to a function pointer.
so all you've really proven is that a function pointer is faster than indirecting twice to a function pointer.
 
the vtable also has no state.
 
which is pretty obvious.
@StackedCrooked It has a vtable pointer.
look, all I'm saying is that std::function has some SBO optimizations for small states.
 
4:49 AM
So I'd need to handicap the std::function somehow in order to make it fair?
 
which you've succeeded in triggering.
but it's not generally applicable.
if the functor was 2KB in size, you'd probably see a much more even result, because the std::function would have to not employ those FP-specific or small-functor-specific optimizations.
not to mention the more complex issue of, for example, copying a std::function implementation that employs SBO vs the time of copying a vtable pointer, which is known POD... etc.
so even if the std::function could be called faster than the vtable, it certainly can't be copied or moved faster.
so the performance considerations would be more complex even then.
 
My app is not working properly, how could it not be working properly? I am depressed
 
also
I might mention that as the compiler sees the whole implementation of std::function in each TU, it has a much better shot of performing highly aggressive inlining that can see through your indirection.
this would obviously also not be fair to the vtable.
 
But, inlining can give the compiler a little too much information.
GCC is too damn smart.
 
well, that's what you've chosen to give it :P
 
4:53 AM
It tends to optimize everything away.
 
well, strictly, you do have a bit of an arbitrary test.
what I would suggest is- generate array of N random numbers, something big enough like 100.
capture that array by value to make sure the lambda is big enough.
then return the sum of them plus argc.
that should at least eliminate the unfair SBO optimization.
 
@DeadMG In my experience, class which have virtual methods often are non-copyable.
In any case. I measured for use cases which are relevant to me.
 
@StackedCrooked Yes, but you can copy a pointer to it in trivial time with memcpy().
a std::function not so much.
 
huh?
copying a pointer with memcpy?
 
@StackedCrooked Is it that obvious?
 
4:55 AM
well, what I mean is, the implementation of copying a pointer could be considered to be through memcpy() since a pointer is a POD.
 
@Jefffrey yeah, just making the point that speed of copy is not really relevant for my use case
 
but a std::function is a complex type which entails all sorts of code-generation headaches that you don't want to think about.
 
Oh I see.
However, I'm not copying.
 
I see.
 
But you are right.
 
4:56 AM
@StackedCrooked No, I mean: I don't get the connection between "class with virtual functions" and "non copyable class". :/
 
In other places of my code I have a concurrent_queue<std:::function> which handles 160k functors per second (up to 1 million). And malloc/free is major overhead.
 
well, all I'm going to say is that if the test you've shown reflects your real use case, then std::function is faster than a vtable for that use case.
it does not prove that it is faster in general.
@StackedCrooked What size are the functors? Zero?
 
I replaced it with concurrent_queue<move_on_copy<std::function>>.
I know it's dirty, but hey.
 
I don't blame you.
concurrent_queue, AFAIK, doesn't really play well with moves which is a big pity.
at least the MSVC one doesn't.
 
@DeadMG Their size is not the same always. (I don't know what their size is actually.)
 
4:59 AM
well
all you'd have to do is establish an upper bound that covers most cases.
then you could author your own std::function that has SBO for that size.
or just author your own std::function that has SBO up to a templated size, and crank the size up until the malloc/free calls stop being reduced.
 
Usually the state of the function is a lambda.
How do I copy this in to small buffer? Just memcopy on aligned storage ?
Oh, probably with placement new.
 
@StackedCrooked realistically, boost::variant is probably the easiest way to do that, though it comes with overhead.
wait, boost::variant uses the heap when copying, nevermind
 
@StackedCrooked Yes.
 
@MooingDuck it does?
 
user3010322
Well, all I know is having a std::unique_ptr is pretty whack for this implementation.
 
user3010322
5:04 AM
A function pointer would probably do the trick.
 
@StackedCrooked Yes. Strong exception guarantee when involving SBO is, er... problematic.
@ThePhD So back to implementing your own vtables then
 
user3010322
It's the overhead of "new" I'm not liking.
 
I think our tenants hate me, even though I did nothing wrong. Maybe I am too young to be a landlady, but that isn't my fault.
 
honestly?
come back to it later if it proves to be a performance issue.
 
@ThePhD did you see Alexandrescu's talk about hand-crafted vtables used at Facebook?
 
user3010322
5:05 AM
Or I could just get it right the first time.
 
user3010322
@StackedCrooked Handcrafted vtables?
 
or make a global constant, like I dunno, runtime_type::impl<T>::constant.
 
The guy who I sold my old macbook to told me the machine was great, better than he expected.
 
@ThePhD yes
 
user3010322
@StackedCrooked Nope, what was the jist of it?
 
5:06 AM
@Telkitty then why did he sell it?
@ThePhD the vtables were hand-crafted
 
user3010322
Sounds messy.
 
It is.
 
user3010322
Thankfully, I don't need to do all that.
 
user3010322
Just follow @David's example
 
However, it was probably the most entertaining talk.
 
5:07 AM
@StackedCrooked he bought it, read it again.
 
@StackedCrooked I sold my macbook to him, he bought it. I told him to call me if there is any problem, he sms-ed the second day told me the macbook was great
 
Oh, I didn't see the 'to'.
 
user3010322
@Telkitty Why did you sell it, then?
 
YEAH!
You evil woman.
 
Hello, Lounge!
 
5:09 AM
While I search for context for PhD's problem, is it easily summarized?
 
@ThePhD f*cking apple doesn't allow me to develop anyone for ios7 on it. And I could not downgrade my iphone to ios6 from ios7
 
user3010322
@MooingDuck Oh, the problem is already solved. o_o
 
by DeadMG of course.
 
If you type downgrade in to Google, what are the auto suggestions?
 
user3010322
"downgrade ios"
 
5:11 AM
@MooingDuck consider changing the d to f in your name?
 
user3010322
"downgrade iphone4"
 
user3010322
"downgrade windows 8"
 
"downgrade ios7" for me.
 
@Telkitty I get called "Mooning Duck" quite often
 
5:12 AM
I would prefer Fucking duck.
It's a f*ing duck!
 
@DeadMG oh my...
 
it works.
 
user3010322
@DeadMG Your damn skippy it works /cc @MooingDuck
 
user3010322
The interface is exactly like std::type_info
 
user3010322
Just wish I could get rid of that stupid uninitialized error.
 
user3010322
5:19 AM
There we go
 
user3010322
Fuck uninitialized errors.
 
@ThePhD It looks like you are emulating boost::any.
 
user3010322
I was actually going to build my any on top of this.
 
user3010322
So I could ask for a base pointer, and get it.
 
Btw when you post these strange code samples I never know if you are serious or just fooling around.
TIP: convolution is not a good problem-solving strategy.
However, you are free to do what you want.
 
5:23 AM
@StackedCrooked I seriously did create something new.
 
user3010322
We're not fooling around.
 
You did?
 
user3010322
I'm being completely serious.
 
user3010322
This solves my "how do I get the base class of another class at runtime" issue.
 
The base class is known at compile-time. Why would you ...arg!
 
5:23 AM
@StackedCrooked I did.
 
That's nice.
 
basically, you can implement any_cast so that any_cast<Base*> succeeds if the Any holds Derived.
 
@StackedCrooked type was erased, don't know the base type at compile time
 
erased to what?
to void*?
 
@StackedCrooked probably erased_any_interface*
 
5:27 AM
@StackedCrooked It can be (e.g., DCT and FFT are fine ways to implement convolution).
:-)
 
@JerryCoffin I'll need to google that.. I always do :D
> Symmetric convolution and the discrete sine and cosine transforms
> convolution is a mathematical operation on two functions f and g, producing a third function that is typically viewed as a modified version of one of the original functions, giving the area overlap between the two functions as a function of the amount that one of the original functions is translated.
hm..
 
@StackedCrooked fast fourier transform and discrete.... something transform
I seem them all over now
I just have no idea what they are or what they do
but apperently it's magic and awesome and fast
 
@MooingDuck Discrete Cosine Transform (used, for a couple of examples, in JPEG and MPEG).
 
user3010322
@MooingDuck @StackedCrooked @DeadMG The tests are showing good: coliru.stacked-crooked.com/a/a1e8073f675cf8c1
 
user3010322
This should definitely be implemented for std::type_info
 
5:30 AM
is tortiseSVN buggy, or do I have to keep cleaning/updating because the repository is large
 
user3010322
Could finally maek it worth it
 
runtime_type is supposed to be an enhanced std::type_info or something?
 
@StackedCrooked is an enhanced type_info.
 
@MooingDuck The most common use (for either FFT or DCT) is taking a complex wave form, and breaking it down into various frequencies of sine waves. FFT also forms the basis of most algorithms for multiplying huge numbers (e.g., probably the single biggest piece of code in the mini y-cruncher Mysticial posted a few months ago was an FFT routine, and most of the optimization work was on the FFT).
 
user3010322
@DeadMG Posted the implementation in the google groups. :D
 
5:34 AM
@ThePhD you're not letting the grass grow under your feet are you :D
 
@JerryCoffin so when I was trying to detect frequencies in my audio data last week, FFT was the way to go?
 
user3010322
@StackedCrooked Never! I'm using it in my engine right away.
 
user3010322
God, I've been waiting for this for so long.
 
user3010322
Finally, a way to stick it to the snobby C++ standard and it's crappy implementation of RTTI.
 
@MooingDuck I must not have been around when you were doing that (I don't remember seeing it), but yes, that sounds quite reasonable.
 
5:35 AM
@JerryCoffin it was at work, not in chat. If you saw, I would have been scared
 
scarred
 
@MooingDuck Ah, that would explain my lack of seeing it.
@StackedCrooked They probably wouldn't have left very many (visible) scars.
 
So more like internal bleedings?
 
@StackedCrooked Yeah, something like that.
Maybe a few broken ribs, who knows.
 
user3010322
5:46 AM
Hey @DeadMG, what should the type that uses an == predicate to check if the type is derived be called?
 
user3010322
type_base_equals ?
 
user3010322
is_derived ?
 
user3010322
The struct name, that is
 
no fucking idea
zats not my department.
 
user3010322
=[
 
5:47 AM
I only abuse the shit out of things.
it's someone else's problem to handle the result.
 
I have risen
 
user3010322
CAT!!!
 
user3010322
We've broken the C++ type system!
 
oh hey cat.
 
What the fuck. It's 6:48 already
 
user3010322
5:48 AM
In a good way!
 
@CatPlusPlus please ignore everything the PhD has been talking about for the last few hours
 
user3010322
NO!
 
user3010322
Looka t it.
 
@ThePhD Er, I enhanced it.
 
user3010322
Look at it and weep tears of joy.
 
5:48 AM
@ThePhD The twist: it was broken all along
 
user3010322
@DeadMG Hey, I was contributing too. :c
 
This C++ assertion library has a website which hurts my eyes.
 
nah, the only one who contributed even a little was robot.
I came up with all the rest.
 
That's not the worst website
There was some guy with a pink background
 
user3010322
5:50 AM
I think for the struct name
 
user3010322
I'll go with is_inherited
 
user3010322
I think that makes the most sense.
 
@CatPlusPlus Then there's the old standby, Comeau.
 
@JerryCoffin Eh, that's just "raw 1999" not "I want to claw my eyes out"
Though that sticky blinking "Comeau C/C++ is $50 for most platforms. Order Now!" is incredibly funny
It doesn't even have a border, it's just blending with the rest
 
@CatPlusPlus Bad enough to be embarrassing, especially for what was (at least at one time) one of the best compilers on the planet.
 
5:53 AM
Something I see a lot of: people ignoring .
@JerryCoffin We have Clang now.
 
@DeadMG that was a best practice question, not pasted broken code
and it wasn't even really a question
 
as if I care
 
If you have to ask, then it's probably not a best practice
 
if you have to ask then don't ask here
cockfucking sick as usual.
 
@ScottW Fucking does help that (and exercising the other 4 hours a day is good too).
 
5:56 AM
Time to finally get the server running
 
user3010322
Whoa.
 
user3010322
These results are pretty fucked up. o.0
 
user3010322
I think my catch type is wrong. SOmeone take a look:
 
user3010322
 

« first day (1134 days earlier)      last day (3821 days later) »