« first day (889 days earlier)      last day (4067 days later) » 

3:00 PM
The boxes look identical... Almost.
 
@StackedCrooked You can go beyond that to how the processor actually executes the generated machine code and the difference increases even more.
 
@R.MartinhoFernandes Yeah, vitamin overdose.
@R.MartinhoFernandes Right, there's that as well.
 
Just look at all those weird questions Mysticial answers.
 
@StackedCrooked People can be picky about how many vitamins are in their pop tarts
 
user784668
Brown sugar?
 
3:01 PM
I hope there's a whole range
 
So comparing assembly is not proof that one program is faster than another?
 
user784668
Horse and coke mixed?
 
@StackedCrooked You can use it to prove they are the same.
 
Ah, indeed.
 
Something else requires more careful analysis.
Anyone that comes up with the "I like C because it's close to the machine" line is an idiot that has no idea what happens after they hit "Compile & Run".
5
 
user784668
3:03 PM
I prefer writing in CPU microcode.
 
@R.MartinhoFernandes This.
 
user784668
@StackedCrooked The only way to prove that one program is faster than another is to measure.
 
@StackedCrooked And the thing is, if you have the skills to do that kind of analysis, you should be probably writing in assembly anyway.
 
You can compare assembly with Coliry btw. (This one shows loop unrolling at -O3).
 
user784668
@StackedCrooked also outdated GCC :P
 
3:05 PM
@Fanael Yes, 4.7.2.
Coliru is using gcc 4.8 since yesterday evening.
 
4.8 isn't out yet.
 
user784668
@R.MartinhoFernandes It is.
 
I had to build it myself though because there were no binaries available yet.
 
user784668
@R.MartinhoFernandes gcc.gnu.org/releases.html
 
user784668
3:06 PM
@R.MartinhoFernandes GCC 4.8.0 March 22, 2013
 
user784668
@StackedCrooked I always build GCC myself. For Windows, that is.
 
@StackedCrooked I've never heard of this "Coliry".
 
has anybody tried the concepts-lite build?
 
@DeadMG Ah. I haven't slept much.
 
user784668
@DeadMG Y and U are close to each other
 
3:16 PM
@sftrabbit One problem with that, in my opinion, is that the motivating examples can just as well be implemented with current techniques (type traits, tag dispatch, etc..).
 
@R.MartinhoFernandes Liar.
 
@StackedCrooked No, they cannot.
 
@StackedCrooked There's a lot of new stuff
 
The motivating examples often show nice errors and shit.
 
@R.MartinhoFernandes That took longer than I expected.
What if they would use function objects instead of functions. They could then inherit the correct implementation object by using sfinae-based type selection.
Just random thoughts. I don't know the intricacies well enough to seriously debate about this.
 
3:22 PM
It's not about power. It's about expressiveness. Mostly..
 
Yeah, concepts are also more self-documenting.
 
Have you seen the new requires-expression? It's interesting.
requires (T a, T b) { int = {a.something(b)}; }
this is an expression that will be true if a.something(b) is a valid expression with type int
 
what
so a bit like std::is_same<int, decltype(a.something(b))>::value ?
but not constexpr
 
exactly, but you can do more with it
sorry, it is a constant-expression
 
I'm happy that in C++11 I can finally inherit from int.
By using std::tuple<int>.
The only thing missing is #define int std::tuple<int>
 
3:28 PM
@StackedCrooked why only in C++11?
can't you use boost::tuple<int> in C++03?
 
boost::tuple is not part of the C++03 standard :P
 
meh.
 
You could use std::vector<int> though. But that's a crappy workaround.
 
Ell
Why would you inherit from int?
 
@sftrabbit And so is std::is_same<int, decltype(a.something(b))>()
 
3:30 PM
std::tr1::array<int, 1>
 
@Ell Can easily happen in generic code.
 
Ell
Accidentally? o.O
 
user784668
@Ell Foo<int>
 
std::tuple<T, int> inherits from std::tuple<int> :)
 
3:32 PM
@StackedCrooked Bug.
 
Ah, ok.
 
@StackedCrooked Definitely a bugaroo
 
user784668
@StackedCrooked report eet
 
Like I said, 4.8 isn't out yet.
It's in beta/RC now.
 
user784668
@R.MartinhoFernandes It is released.
 
3:33 PM
I don't care what they call it.
 
It's out, but it's still in a buggy, like a baby.
 
GCC x.x.0 is always crap.
 
Potential runtime bugs are even scarier.
 
Ell
I'm building that concepts lite one
 
3:34 PM
@StackedCrooked And the benefit is...?
 
3 mins ago, by R. Martinho Fernandes
@Ell Can easily happen in generic code.
 
@LightnessRacesinOrbit Equality and no more discrimination, you racist.
 
is that like a rassist?
 
Ell
does dx11 have thread local state? like opengl does?
 
@R.MartinhoFernandes s/x.x.0//. There, FTFY. :-)
 
3:36 PM
Right.
 
user1357851
5407 entries of love found, slightly less (5032) entries of hate found. But whole 6826 damn given
 
@StackedCrooked haha
 
@Ell Yes.
ID3D11DeviceContext, I believe.
but it's not really like OGL
 
@Telkitty Now make pretty graphics like they are benchmarks.
 
3:37 PM
@DeadMG What's the difference?
 
user1357851
@StackedCrooked I think I need more parameters than 3 to make it pretty
 
Just make shit up.
 
@R.MartinhoFernandes ID3D11DeviceContext isn't really thread-local, it's "One thread can use each context at a time". So at different times, each context could actually be used by any thread.
 
It occurs to me same-name parameters in non ctor methods can be a bad idea.
 
afaik, OGL's thread-local state is both almost entirely hidden, and hard-wired to each thread.
 
3:39 PM
@Telkitty lol, you can subscribe on that
 
@DeadMG That is exactly the same as OpenGL. Impressive.
 
@Telkitty Edward Tufte claims there's only one good use for pie charts: to express "100%".
 
user1357851
@JerryCoffin maybe we should force people to use only 3 words on this chat: love, hate and damn
 
2
A: Force all && to be executed?

AlonThere is a much nicer trick, instead of using && between all the functions, just use one & static_cast<bool>(f(args)) & static_cast<bool>(f2(args)) ... will run all operations regardless of the result :)

<sigh>
 
3:43 PM
Here's a quiz.
Please don't cheat.
How may files are in boost? Give an estimate.
 
2456
 
user1357851
@StackedCrooked which version of boost
 
@AndyProwl I feel bad for you
 
More concretely: how many header files are inserted in /usr/include. Latest version.
 
@StackedCrooked I'd go with 5, as a base-10 logarithmic estimate.
 
user784668
3:44 PM
@StackedCrooked 6.66e5
 
@R.MartinhoFernandes Base-ten again?
 
user1357851
3837 ... or between 100 - 20000 to be precise :p
 
100.000
 
@StackedCrooked you mean only in the base directory?
 
@sftrabbit Yeah, that's painful
 
3:45 PM
@bamboon What is the base directory?
I mean all headers in the boost folder.
 
@Telkitty If you think you can force much of anything here, I certainly hope you're wrong.
 
@StackedCrooked ah ok
 
@R.MartinhoFernandes So IOW, instead of having a real C++ object you can use, you have to dick around with setting and getting invisible magic state somewhere else.
 
@DeadMG Blah blah.
 
/opt/local/include/boost $ find . -type f | wc -l
    9271
/opt/local/include/boost $ find . -name "*\.hpp" -type f | wc -l
    9000
 
3:47 PM
@StackedCrooked I'm gonna go with 0 (because I use it on Windows, with no /usr/include present).
 
It's over 9000!
@JerryCoffin Ok, you win by default
:P
I was suprised though. I didn't think it would be that much.
 
Dammit, that's 4. I was close though. Missed by one.
 
user784668
[/cygdrive/c/mnt/data/devel/boost/1.53.0] [last error=0]
>> find ./boost -type f | wc -l
9300
 
user784668
@StackedCrooked liar
 
@StackedCrooked That's not /usr/include!
 
user1357851
3:50 PM
I was so right ... sooo right :p
 
user1357851
5 mins ago, by Telkitty
3837 ... or between 100 - 20000 to be precise :p
 
user1357851
see it is between 100-20000
 
@Telkitty You were not the closed though.
 
I only have 1.49 here. Need to install a new one.
$ find /usr/include/boost-1_49/ -type f | wc -l
8789
$
 
user1357851
@StackedCrooked (100+20000)/2 = 9271 (+10% GST)
 
3:51 PM
For Pong, should I use 30FPS or 60FPS?
 
@Pawnguy7 You should do 14.721 fps -- exactly what the original Pong did. And you should change your name from Pawnguy to Ponguy.
 
user1357851
Oh boost has statistic stuff
 
user425495
Is it possible to implement a class that can be constructed by an initializer_list, such as: Foo my_foo = { 1.0f, 2.0f, 3.0f };
 
@Fanael :P
 
3:54 PM
@JustinS yes.
 
user1357851
:8445649 e is not log 10 based
 
user784668
@Telkitty it is
 
user425495
Abyx: is there a resource for doing so? I'm butting my head against the wall atm I thought declaring something such as Foo(std::initializer_list<T> d) would be straight forward
 
Did boost 1.50 break something?
 
@R.MartinhoFernandes Undoubtedly broke something.
 
user1357851
3:55 PM
@Fanael e = 2.71xxx
 
@JustinS std lib headers?
 
Ok. Telkitty wins with 3837 followed by Bamboon with 2456.
 
@JerryCoffin What do you mean?
@StackedCrooked I missed by one!
 
user784668
@Telkitty scientific notation has nothing to do with e
 
user1357851
The number is an important mathematical constant, approximately equal to 2.71828, that is the base of the natural logarithm. It is the limit of as approaches infinity, an expression that arises in the study of compound interest, and can also be calculated as the sum of the infinite series :e = 1 + \frac{1}{1} + \frac{1}{1\cdot 2} + \frac{1}{1\cdot 2\cdot 3} + \frac{1}{1\cdot 2\cdot 3\cdot 4}+\cdots The constant can be defined in many ways; for example, is the unique real number such that the value of the derivative (slope of the tangent line) of the function at the point is equ...
 
3:56 PM
@R.MartinhoFernandes It broke the record of the most recent boost release.
Or it broke all the files in to multiple pieces.
 
user142019
@AndyProwl I upvoted the second answer.
 
0
Q: C++ Compile Errors 'In file included' and 'instantiated from here'

user2020058I'm trying to create an ordered Binary Search Tree by creating the tree and then passing the root Binary Node into this function. The tree's height is given by the integer from cin. I can't seem to figure out this error and any help would be appreciated. g++ -Wall -g BinarySearchTree.h BinaryTre...

 
user142019
Because people who read it actually understand what's going on.
 
Well that was fun
 
user784668
@StackedCrooked actually, the compiler's right. 12.9/3: For each non-template constructor in the candidate set of inherited constructors other than a constructor having no parameters or a copy/move constructor having a single parameter, a constructor is implicitly declared with the same constructor characteristics unless there is a user-declared constructor with the same signature in the class where the using-declaration appears. // cc @R.MartinhoFernandes
 
3:58 PM
@R.MartinhoFernandes I mean given its size, any change made is bound to break something (maybe not in it, but for code used as widely as Boost, there's going to be some code that depends on any bug you might fix).
 
@StackedCrooked where is my silverbadge?
 
@bamboon In your mom.
 
Why does ios_base::read take char * instead of unsigned char * ?
 
@sftrabbit LOL
 
4:00 PM
@Fanael Hmm..
@Fanael Those incantations again.
 
what the fuck? = chemistry. fuck the what? = biology. the what fuck? = physics.
 
user784668
The first one works because of most vexing parse.
 
@Zoidberg Thank you, I was not looking for upvotes though, just wanted to let out some frustration cause some people actually like the accepted answer
 
Ugh, I shouldn't have -j4ed that build.
 
I tend to ^C that away and pretend everything is fine.
 
user1357851
4:06 PM
For those who care, there is a large version of my avatar (me pointing finger at my pet wild Australia magpie in the backyard). The magpies are very smart, and can be highly aggressive at times.
 
user1357851
 
user1357851
This bird sing for food ... like an artist/geisha/singer and can understand hand gestures
 
1 hour ago, by StackedCrooked
300×225 picture of person, 2304x1728 picture of duck eating bread. Typical.. :)
Btw, GCC 4.8 is the first release which is compiled with a C++ compiler.
 
@StackedCrooked Courtesy of clang
 
user142019
@AndyProwl oh I didn't even notice it was yours lol.
 
4:12 PM
@Zoidberg lol not that I mind it
@sftrabbit " I must be a magician"
:D
 
@AndyProwl Yeah, not the word I'd use.
 
@sftrabbit I'm sure that when facing the same error again, he will try hard rebooting and recompiling several times hoping his magic will eventually work
 
user784668
@StackedCrooked which has to be compiled. GCC 4.7 stages 2 and 3 were by default compiled with a C++ compiler.
 
@AndyProwl ...and, of course the obligatory: "(sigh c++)" to make sure everybody knows it's really all the fault of the language! :-(
 
@JerryCoffin I missed that one... priceless!
 
4:24 PM
Is there any sort of cross platform assembly? I mean to say, in the form of assembly (things like mov, etc), but still cross-platform and can be compiled to native and/or real assembly?
 
LLVM IR
 
@Pawnguy7 Sure. Pascal P-codes, Microsoft .NET's IL, Java byte codes, LLVM IR, and roughly 14 gazillion others.
 
Ruby.
 
Can you actually program in IL though?
 
@AndyProwl: I will have to check the assembly, but I've just done 4 series of 50 benchmarks on your solution and this one (without the static_cast, as f returns a boolean), and this one is 7.5% faster than yours (g++ 4.7.2 with -O3). — Vincent 4 mins ago
Is this possible?
 
4:26 PM
if you really want to
 
@Pawnguy7 If you want to, yes. Just for example, a few .NET programs generate IL on the fly.
 
@Pawnguy7 What would make this impossible?
 
For some reason I was thinking you would need something to compile the IL, but you don't.
 
@Pawnguy7 You do need LLVM to generate native assembly from IR.
 
The machine can't eat IL.
 
4:28 PM
Doesn't the JIT do it?
 
What does it matter?
 
@Pawnguy7 Depends on what you mean.
 
@AndyProwl I s'pose anything's possible, but it sure doesn't seem at all likely.
 
My dad was about to attempt to improve his 10 year old PC with a 10 year old 64MB graphics card
 
There is an assembly language that you need to compile with something like ilasm.
 
4:29 PM
Ah.
 
Writing binary IL by hand is a bit over the top.
 
@Pawnguy7 Well, yes, but then you need a JIT.
 
Then again, I guess I may as well go specific as possible - this for learning purposes. Not like I am going to make something usable in assembly.
 
When doing it from a .NET program you use the types in System.Reflection.Emit and it generates the binary bits on the fly.
But it's often easier to use System.Linq.Expressions for most tasks.
 
Ah.
Does anybody know what assembly would work with Windows 64-bit?
 
4:31 PM
Generating classes, or doing unorthodox things with the IL are probably the only two reasons to use IL.
 
@JerryCoffin He's going to put the benchmark on LWS, I'm curious
 
user784668
@Pawnguy7 AMD64 assembly?
 
user784668
@AndyProwl He compiled your function with __attribute__((__optimize__("O0"))) :P
 
@Fanael lol
 
As I read it, AMD64 is, give or take, a 64-bit adaption to the 32-bit x86. Is that assumption correct?
 
user784668
4:33 PM
@Pawnguy7 Pretty much, yes.
 
Would x86 still work?
 
@Pawnguy7 Give or take. There are a few incremental upgrades, for example, more registers, SSE2 guaranteed, that kind of thing.
 
user784668
@Pawnguy7 If WoW64 is installed, then yes.
 
user784668
And WoW64 is installed pretty much on every 64-bit Windows except some specific server setups.
 
@Pawnguy7 The OS provides an abstraction that allows it to execute 32bit processes on a 64bit OS. Else, it would be virtually impossible to push out a 64bit OS.
 
4:34 PM
I see.
I was wondering which would be better, for learning purposes.
 
Go with 64.
 
I see.
 
user784668
AMD64 instruction encoding is fucked up.
 
Luckily only (dis)assembler writers need to mess with it.
 
there's no reason to use x86 instead of x64
but there's also little reason to learn assembly unless you're writing a code-generating backend, because basically nobody ever actually writes hand-rolled assembly now
 
user784668
4:36 PM
@R.MartinhoFernandes I'm writing a JIT assembler.
 
user784668
@DeadMG it's good to know SSE instructions when using SSE intrinsics, though
 
hmm, the intrinsics offer a higher-level view, though.
it's still a ways up from assembly itself
you can use them perfectly well with just the reference on MSDN
 
I just thought of something. In my Pong, the ball, when moving, checks if it hits the paddles. But the paddles also check if they hit the ball (on the top sides). How do I avoid this circular dependancy?
 
As you do with any circular dependency: break it on one side.
Unlike circles, circular dependencies have distinct sides, so you can always pick one to break.
 
Any idea which one to break?
I think for the normal collisions, the ball checking it is good, as generally the ball hits the paddles, not the other way around.
 
You can always have it checked at a higher level instead.
 
the simpler approach is
 
@StackedCrooked haha, that's nice.
 
1. Move all objects. 2. Check all objects for collision.
 
Hahaha I love Blizzard. I destroyed a car in a mission and it spawned a marine that yelled "My car man, I just paid that thing off" and he started shooting at me
 
4:41 PM
The approach I generally take is, move a pixel at a time and check if you hit it.
 
fuck pixels
 
Given that, in the future, I may have blocks in the center as well that must be checked for.
 
@Pawnguy7 Also the walls.
 
Top-bottom?
 
@DeadMG Too small for my tastes.
 
4:42 PM
@Pawnguy7 And the sides, to tell if the goal has been hit.
simple fact is, every object in Pong can collide with every other object, basically.
 
Give or take, yes.
 
user142019
@R.MartinhoFernandes That's what she said!
 
so resolving this one circular problem ain't gonna help you
 
Are you saying, I should make some sort of collision detection class that knows about all and does it for them, more or less?
 
user784668
@AndyProwl lol, he ran away
 
4:44 PM
@Pawnguy7 Yes.
 
Oh. I just remembered why I use by-pixel: to avoid the dreaded "I went so fast, I just went through the wall" bit. And I don't know how to impliment collision line detection.
 
@Fanael lol, seems so
 
1. Move every object in the scene if required. 2. Build quadtree from bounding boxes. 3. Observe collisions through quadtree.
 
I haven't ever made a tree... seems they are often used, though. Perhaps I can find a tutorial.
 
also
"I went so fast, I just went through the wall" only happens when you don't tick fast enough. If you're doing a Pong game, you could easily get 1k ticks/sec.
or a simple clamp of the position to inside the walls.
or simply draw a ray between the new and old positions and check if that ray intersected anything
 
4:48 PM
Doesn't that limit the potential speed?
 
@Pawnguy7 No, not really.
 
I like when I solve design problems by realising the problematic feature isn't needed.
 
@R.MartinhoFernandes I like that too.
 
I see.
 
user784668
@DeadMG fix your timestep!
 
4:49 PM
@Fanael I do.
 
So, you recommend moving, then checking collisions and working backwards?
 
yes.
 
user142019
Why am I watching a TV show about flowers.
 
in a Pong game it will be trivial to tick fast enough to avoid going through objects, and in addition, if such a thing happens, you can simply raycast to detect it
 
@Zoidberg Because its light is hitting your retinas.
 
4:51 PM
@Zoidberg Because you're gay.
 
@DeadMG Raycast?
 
@Pawnguy7 Also known as lazor throwin
 
1. Draw line (ray) between A and B. 2. Determine if ray intersects objects.
 
Ah.
I thought raycasting could also be used for lighting somehow. I guess it could in the same way.
Kind of neat.
 
Yeah, lighting is pretty much just lazorz being thrown around.
Can't stop the photons.
 
user142019
4:57 PM
It's raining photons. Hallelujah, it's raining photons.
 

« first day (889 days earlier)      last day (4067 days later) »