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

5:01 PM
World
 
My three active open-source projects all have different organizational schemes because I started them at different times and had three different opinions about how to best organize them. They grow off of each other so I keep going back and forth between them. What a fucking mess.
 
well, I know what your OCD will have you doing this weekend :P
 
I think he's been at it for a few weeks now. Every time I asked him about ogonek lately he's been in the process of restructuring it
 
user784668
Crap.
 
5:07 PM
Perhaps I'm finally understanding why I find this job so frustrating
 
user784668
libstdc++ debug mode doesn't allow me to replace its assert
 
@Fanael I'm quite sure #undefing assert is UB.
 
user784668
@milleniumbug I don't want to #undef assert
 
@milleniumbug Debug mode tends to have less UB: a common thing is to define certain classes of UB to be certain failure.
 
Hmmm, I wonder if my compiler warns on this.
 
5:13 PM
class UB
 
user784668
So apparently I could do that only through a huge hack.
 
user784668
#include <bits/c++config.h>
#undef __glibcxx_assert
#define __glibcxx_assert whatever
#include <the rest of files>
 
user784668
At least if I understand the headers correctly.
 
user784668
Meh.
 
user784668
Why can't they provide _GLIBCXX_DEFINE_THIS_MACRO_IF_YOU_WANT_TO_OVERRIDE_WHATEVER_ASSERT_EQUIVALENT_W‌​E_ARE_USING_INTERNALLY.
 
5:24 PM
@Fanael That would be too easy.
 
Oh my, creating new sequence types when you have adequate building blocks feel so nice.
 
Ell
I want to see some of that code
 
I still need to genericize it more, though.
I found a new pattern.
 
user784668
Genericize all the things!
 
user784668
@R.MartinhoFernandes whacha writin?
 
5:27 PM
I think I need a template <typename... Properties, typename Seq> unspecified with_properties(Seq&& s); now.
@Fanael Finally pushing ogonek forward again.
But first, I need to make sure it at least compiles while non-generic.
 
@R.MartinhoFernandes <3 I think it might compile with VS2013 RTM, provided Microsoft keeps its promises.
 
Xeo
@R.MartinhoFernandes What kind of properties?
 
@Xeo Static tags to enable certain optimisations (mostly of the "skip that shit, I did that already" kind). Right now I have three such static properties: well_formed, which all results of decode functions have; normal_form<N>, which all results of normalize<N> have; and casefolded, which... yeah you get the idea. with_properties is the final missing piece in the machinery I currently have.
And then I have rules among them too. For example normal_form immediately implies well_formed.
 
Cube World!
 
@R.MartinhoFernandes You have something to do it like has_property<MyProperty, Properties...>() ?
 
5:32 PM
@ThePhD Yes.
 
@R.MartinhoFernandes Sharepls? <3
Wait, why am I asking to share. It's probably completely uncompilable with MSVC. =[
 
user784668
@ThePhD Get a C++ compiler.
 
@Fanael Ha har. >_> DirectX only works well on VC++ right now, soooo.
 
user784668
0
Q: Qt isVisible() before setVisible()?

baptxIf we don't know if a Qt element is visible or not, is it preferable to check if it is before using setVisible() function? Is there any performance difference even if not important? if (ui->elem->isVisible() == false) ui->elem->setVisible(true);

 
user784668
5:34 PM
Microoptimizing GUI calls, are we?
 
Xeo
@Fanael You don't know what setVisible might do under the hood.
(Although it should really check for itself.)
 
So I just make a new type that derives from a property tagger and from the sequence it tags and BAM, it works.
 
user784668
@Xeo I don't care. I'd care if GUI was the bottleneck in any of my programs, but it's not.
 
@Fanael The shit people do because ~~purrformance~~
 
> if (ui->elem->isVisible() == false)
 
5:37 PM
So now I can skip validation on any type where is_well_formed<T>() is true.
 
University smell.
 
Or I can fail compilation if you try to normalize a sequence that isn't well-formed.
So sweet.
 
@R.MartinhoFernandes How do you transport the properties through?
 
Ell
Sounds pretty funky
 
2 mins ago, by R. Martinho Fernandes
So I just make a new type that derives from a property tagger and from the sequence it tags and BAM, it works.
 
user784668
5:38 PM
@R.MartinhoFernandes nice
 
See with_properties above, which is the final piece.
 
=[
 
user784668
C++ type system can be pretty awesome if used properly.
 
@ThePhD Why =[?
 
@R.MartinhoFernandes Just a thought that occurred to me. Like when I was messing with tuple and friends in MSVC, I was considering that if I potentially did not order my properties and then derive correctly, I could end up using extra bytes for the empty tag types.
 
5:39 PM
template <typename Seq, typename Props>
struct awesome : Seq, Props {
    using Seq::Seq;
};
 
user784668
@ThePhD I don't remember having any trouble using it under GCC. And even Clang.
 
Cube World's store backend broke.
I WANT TO BUY IT AND I CAN'T
 
@CatPlusPlus Calm down.
 
@CatPlusPlus Pat pat. There, there. Hexa-whatever is still there.
@Fanael o.0
Show me your magic.
DO IT.
 
Ell
Who want s to help me understand 20 lines of what seems to be nonsensical preprocessor? coliru.stacked-crooked.com/… I can read it, I just don't understand reasoning :(
 
5:41 PM
I'll hook up GCC to VS proper if I can use DirectX x86 and DirectX x64 with MinGW and Clang.
 
@ThePhD See above: I only derive from two types: one will almost never be empty (Seq) and the other is always empty (Props). So I can work around MSVC's limitations by inheriting Props, Seq instead (IIRC it only does EBCO for first base, right?)
 
You can always use C COM API.
 
@R.MartinhoFernandes I think it's left-to-right, and it quits if anything from the left to the right of the inheritance is non-empty.
@Xeo knows more.
 
@ThePhD Well, whatever the right order is, I can pick it.
 
Yay~
Then I just have to get rid of the using.
And then TAADAAA.
 
5:43 PM
I have a bounded set of properties though.
 
Xeo
@R.MartinhoFernandes But what if Props and Seq already got to second base?
 
user784668
@ThePhD #include <d3d9.h>
 
user784668
Or 10, or 11.
 
Xeo
@R.MartinhoFernandes nvm
 
5:43 PM
Props is always empty and Seq is never empty (well theoretically it could be, but WTF).
 
:jokesiren:
 
@Fanael And you can link to the libraries?
 
Ell
what does Seq stand for?
 
And compile a program using DirectX Calls? Because I try that and the linker explodes.
 
user784668
@ThePhD Yes.
 
user784668
5:44 PM
@ThePhD Yes.
 
@Ell Sequence.
 
Sequoia.
 
Ell
Ahh ofc
 
@Fanael :O What GCC Version, from who's build repo?
 
@Xeo Hahaha that flew way over his head xD
 
user784668
5:44 PM
@ThePhD Both are irrelevant.
 
@Borgleader Oh, it was a joke?
 
=l
 
user784668
@ThePhD Just be sure you're using relatively recent MinGW-w64.
 
@R.MartinhoFernandes I think so
 
5:45 PM
I use std::thread too, so I guess I'll grab Rubenvb's MinGW builds?
Or @CatPlusPlus you said there was a different MinGW distro provider somewhere out there?
 
user784668
@ThePhD good choice
 
I thought he made a double entendre with "getting to second base"
 
rubenvb doesn't make builds anymore.
 
Xeo
@CatPlusPlus He does again
 
He... doesn't?
Oh.
 
Xeo
5:46 PM
@Borgleader Yes.
 
user784668
@Xeo Does he?
 
Xeo
@Borgleader Now I want to make a homerun joke.
@Fanael He said he's been convinced by the mingw people to continue.
 
@Xeo s/convinced/held at gunpoint
 
Xeo
Or so I remember, anyways.
 
5:47 PM
@CatPlusPlus MinGW by default at this point as std-thread, right
 
0
Q: Are there any performance benefits when using x += 1 instead of x = x+2?

MinelavaI am confused whether or not it is advisable to use x += 1 or x = x+1. I know that they both produce the same results. In practical terms, are there any performance gain when using x+=1 instead of x = x+1? Will it make my program run faster?

^^ damn deleted before I could open
oh wait... undeleted?
 
@ThePhD No idea.
 
Ok, time to start another compiler-aided refactoring.
 
Xeo
Aw, he got it right in the question body.
 
user784668
Sorry for editing the title.
 
5:49 PM
@Xeo Look, it's AS3! You can answer this!
 
Hahaha.
@CatPlusPlus I'll just stick to rubenvb. <3
 
Xeo
@R.MartinhoFernandes Spoiler alert: The former is probably faster.
 
Or, maybe I'll get both.
Try to use both.
 
Xeo
AS3 does weird things to what you'd think of as equivalent expression
 
@Xeo Oh gosh you serious?
 
5:50 PM
seh versus sljl ?
Those are... exception mechanics, right?
 
> GCC Threading Model: Win32 is default while POSIX allows C++11 threading.
 
Xeo
@R.MartinhoFernandes switch vs if-else-if-else vs ternary op, guess which breaks out as hilariously slow
 
user784668
@ThePhD SEH on Win64.
 
user784668
Contentious on Win32.
 
Bleh. Looks like I'll just do POSIX SEH
 
5:51 PM
-2
Q: c++ Payroll Program "I have too many files."

user2419571To make a long story short, my class had our first project the ol' payroll project. I don't have a problem with any of my code. For our project we had to have a series of headers and source files. Acmepayroll.cpp, CommissionWorker.cpp, HourlyWorker.cpp, WidgetWorker.cpp, and MAnager.cpp. Along wi...

 
SEH is zero-cost.
 
^^ walls and walls of code
 
user784668
@CatPlusPlus SEH is zero-cost on everything except IA-32.
 
@CatPlusPlus what?
 
@Xeo Switch?
 
5:52 PM
SEH?
 
Ell
What is the best way to make a compile time map between enums and types? I thought of making a EnumType<MyEnum e> then specialize for each value of e. Is there any way easier?
 
Dunno, GCC doesn't have SEH exceptions on x86.
 
user784668
@Mysticial Windows exception handling mechanism, "Structured Exception Handling".
 
ah
 
@CatPlusPlus it stinks on x86
 
5:53 PM
@Ell Sounds easy enough.
 
Xeo
@R.MartinhoFernandes Ya.
 
@jalf So SLJL for x86, SEH for x64?
 
DW2 for x86 if you don't care about foreign frames.
 
That doesn't really impact the written code, does it?
 
Xeo
@AndyProwl: my_tuple : element<Is, Ts>... + get(element<I, T>&) > recursive solution
:P
 
user784668
5:53 PM
@ThePhD ya, it doesn't
 
@CatPlusPlus Foreign frames?
 
Frames compiled without DW2 support.
 
Also, fuck. I just realized if I'm going to use GCC, I'm going to lose all of my step-through VS debugging...
 
Ell
@ThePhD you can still use gdb!
 
user784668
@CatPlusPlus if you care about foreign frames, neither is actually good, because you may skip some SEH and therefore leak, or leave the foreign code thinking you're still in a callback, or something
 
5:54 PM
Write better code.
 
Mmrrrrppph. Don't know if I can take that hit...
 
Hi all I just want to try building simple web page app using c++ any advice ?
 
@Xeo That's too compact for me to understand :)
 
user784668
Therefore DW2 > SJ/LJ.
 
@MuadhProgrammer Woah.
My advice is "don't".
 
Xeo
5:55 PM
@MuadhProgrammer Yes, don't use C++.
 
@MuadhProgrammer Yeah. Don't.
 
Ell
^
 
Xeo
@AndyProwl Hey, it's just derived-to-base conversion
 
How do people come up with these ideas.
 
why no , It just to try
 
JBL
5:56 PM
@Mysticial Holy molly ! "Here, read through these 3000 lines of code".
 
user784668
@jalf The cost is not that big, it's like one memory write to set up the handler. Basically you're wasting one cache line. That's nothing compared to setjmp/longjmp.
 
@AndyProwl It basically uses overload resolution to get "constant time" random access on a pack of types tagged with indices (the bases of the tuple).
 
@Xeo I don't speak your genius language :) Don't mind me, I'm simple
 
Xeo
@AndyProwl struct X : A, B, C{}; A getA(A const&); X x; getA(x);
Just that with indices.
 
Facebook build the site with C++
 
Xeo
5:57 PM
To only make one of the bases valid.
 
No, they didn't.
 
Xeo
@MuadhProgrammer They compile their PHP to C++, but that's it, AFAIK
Something like that, anyways.
 
C++ is literally worse than PHP for writing webapps.
 
(HipHop)
 
5:58 PM
@MuadhProgrammer GitHub built the site with Ruby.
 
Nevermind, I'm slow
 
I can spout more random facts if you want.
 
@R.MartinhoFernandes do it, you won't
 
user784668
@R.MartinhoFernandes Do it, everybody likes random facts.
 
@R.MartinhoFernandes Ok Thanks
 

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