« first day (509 days earlier)      last day (4664 days later) » 

21:01
@ScottW With FUD!
Maybe I'm misunderstanding the concept.
You say reflection circumvents too far. I say it doesn't circumvent too far enough.
@Maxpm No. A programming language provides exactly and only the convenient translation of your ideas into CPU-specific code. Their concreteness or not is irrelevant.
After reading the Wikipedia article, I still don't see the point.
21:04
Ok, imagine you want to rent some method. You clearly need some MethodRental class for... Erm, nevermind.
@Maxpm plugins: check whether a given dll is a valid plugin for your program, and then load it
It gives an example of two classes, X and Y, that are used interchangeably. It says a benefit of reflection is that methods only have to be written once to work with both. Isn't that what interfaces/inheritance is for?
serialization: inspect the structure of a type, and generate serialization code for it
@jalf By "structure of a type," you mean a list of its members?
@RMartinhoFernandes Lol.
21:05
@Maxpm Only if they actually share a common interface.
consider another example
exposing objects to scripting languages
@Maxpm for example. And their types. And perhaps also special attributes associated with the type. That's introspection
reflection can totally automate this process, enable ALL THE FUNCTIONS and ALL THE PROPERTIES and ALL THE VARIABLES
Okay. Type introspection seems handy, but what about self-modification?
@Maxpm A list with pretty much all useful information that can be discerned about each member.
but I assure you that exposing C++ to any script language is a bitch
@Maxpm SSE? SSE2? SSE3/SSE4? Drop in correct implementation.
Of course, for SSE specifically, you'd expect the JIT to do it, but in general, the idea is the same
21:08
Reflection is more often used for introspection than modification.
@Maxpm in most languages that have reflection, it's more often about code generation than self-modification
.NET does support code generation, but not modification of emitted code.
generate new code (you already got serialization or scripting language interfacing as example) to perform specialized tasks that depend on the declared types
@jalf Generate new code of the language whose classes/functions are being serialized?
@Maxpm generate code to perform the serialization of an already declared type, for example
often though, reflection is used as a kludge to work around language deficiencies.
21:12
I think you lost me.
You don't have proper generic programming, so hack together some reflection code to inspect a type and see if it satisfies some condition
@jalf Ah.
but occasionally, it's genuinely useful as more than a hack to fix a broken language
occasionally :)
Are there any references on the web that describes requirements for template parameters to STL containers (must be Assignable, etc...)?
12
Q: Real world uses of Reflection.Emit

RyuIn all the books I've read on reflection they often say that there aren't many cases where you want to generate IL on the fly, but they don't give any examples of where it does make sense. After seeing Reflection.Emit as a job requirement for a gaming company I was curious where else it's bein...

@kfmfe04 The standard?
21:15
Thank you for the clarification.
(T)Activator.CreateInstance(...) or Activator.CreateInstance(...) as T?
@CatPlusPlus First one throws if you get the type wrong. Second gives you null.
Should be obvious why I'd pick the first one.
The type has where U : T, though.
So it will always be good.
as looks like more work, though.
First one is faster!!!
Choices, choices.
21:18
Generally the second form is only useful if you're not sure if the type is correct. The point is that you can/should if(result == null) later.
@CatPlusPlus Then why do you need to cast the return?
Because CreateInstance returns Object.
And I have a generic map with less general value type I want to put this into.
Better to cast once than bazillion times.
ok
now I'm really suspicious
now even the cleared 3D render target isn't showing up
oooh
now it's like, kind of working
all the colours are black for some reason and the render target was cleared to black, so I couldn't see the "kind of" part
21:35
now to figure out why half the triangles aren't rendering correctly
@Maxpm Uncle bob calls languages that allow self-modification at runtime "homoiconic".
@FredOverflow Not quite true.
Did he not say that, or is he wrong?
@DeadMG Are they facing in the wrong direction?
I'm sure uncle Bob is aware that those languages referred to as homoiconic are those where the language can be represented into the language.
Okay, maybe he phrased it a litte bit differently :)
21:37
I am not certain
Like in LISP you can build lists and then evaluate them.
ohhhh
Homoiconic <=> code as data.
I set the Primitive type wrong
this example model is a TRIANGLELIST and I had a TRIANGLESTRIP
Was just about to ask about strips.
21:38
right
now the root bone renders exactly correctly
@RMartinhoFernandes The code is data for itself though. E.g. I like using Lua code as data in C++.
now to turn on those other bones and see what they're doing
well, the world matrix computation for them seems to be working
Ok. No more arrows for today. Brain is starting to complain.
21:39
but they no render good
@TonyTheLion We start talking about strips, and who chimes in? :)
@DeadMG "no render good" means what exactly?
there are supposed to be two and only one is showing up
@FredOverflow I had no idea you what you were talking about
also it's position is wrong
@TonyTheLion probably your subconscious at work
21:41
lulz
@DeadMG its
whatever
let's ask PIX wtf's gowan own
hmm
index out of range..?
time to check my DrawIndexedPrimitive arguments
What exactly is this rendering business that you're doing good for?
A game?
21:44
heyyyy, fixed'ski
yes, actually
Cool, what game?
although in reality, it's mostly good for DeadMG™s self esteem
atm, I call it Dark Sky
Because everything erroneously renders black?
it's an RTS in space but with actual interesting mechanics
heh
nothing erroneously renders black anymore
@FredOverflow Damn, you stole my joke.
21:46
strike
I'm not sure wtf went wrong there, but removing the "lighting" calculation solved that problem
I realized that writing a rendering system to render normal-mapped textured Phong-shaded shadowmapped models was silly when I don't even possess any normal-mapped textured models
You don't say.
21:49
@RMartinhoFernandes Doesn't have the same impact without the image macro.
What, that gigantic laughing pear?
No, that's 'lolwut'. You're not really good at this I think.
I'm not a big fan of image macros, no.
damnit
how come when I subtract or add to the Z value of my camera, the model still moves further away?
You're doing it wrong?
21:54
@DeadMG you have an incorect incremental update
Windows seems to think that I will get a negative or positive value in the HIWORD of the WPARAM for WM_MOUSEWHEEL if the mouse is scrolled one way or the other
but no matter what way I scroll it, I get a positive value back out
aaah, fixed'skia
apparently you have to use a special macro to get the mouse scroll value
not the normal HIWORD macro
just cast it to signed, yes?
helps to think about the low level details
microsoft has a tendency to add a ton of complexity on top of very simple stuff
@DeadMG Sounds like a fun API.
leave it at that!
now to discover GLM's support for Quaternions
22:04
@IntermediateHacker then you better don't get caught posting it here
What's with the flagging of old messages?
@RMartinhoFernandes because people failed to flag it earlier?
you know
the GLM reference manual is not funny
the entire documentation refers exclusively to internal types
@DeadMG pretty sure it wasn't intended to be funny
@user1131997 Hey, you still here?
22:10
@DeadMG No, not all of it.
I'm looking at this function and every type is detail::
But yes, docs are not very good.
But the library itself does make up for it.
Hey guys, if user1131997 makes more of a ruckus let us know. I've made a note of it and took care of the message for now. Thanks.
also
how the hell do I rotate a GLM vector3 by a GLM Quaternion?
maybe it wants me to convert into a matrix first?
With multiplication?
22:13
Who's user<RandomNumber>?
@RMartinhoFernandes Nope.
(Also, why oh why doesn't SO force users to pick up a sensible name.)
I found one
but it's not terrifically helpful that they have two sections for Quaternions
@casperOne Cheers. He's an infrequent guest. He's ok since we found out we shouldn't waste too much time. I think.
22:16
Is that the guy from the question where I made the freehand stars?
@DeadMG You can always use Eigen.
oh, no, wait, I lied, actually I need like four different headers, I think
Docs say <glm/gtx/quaternion.hpp> (assuming you're using this one: glm.g-truc.net/api/…).
@CatPlusPlus I checked out Eigen before using GLM. Passed over it. Can't quite recall why
@RMartinhoFernandes I'm not sure. Link?
I like both, really.
now to see how hideously wrong this particular addition to my code goes
@RMartinhoFernandes Amazing. My opinion of him has swung from very low, to 'ok he's come 'round' back to - stop wasting our time :)
That number reminds me of mt19937, so it always looks familiar.
0
A: C++ scope issue in an if statement: create one of two objects

Cheers and hth. - AlfOp's code: if (shippingOption == OVERNIGHT) { OvernightPackage packageObject( // Parameters entered here //); } else if (shippingOption == TWODAY) { TwoDayPackage packageObject( // Parameters entered here //); } // Presumably, process the package here. You might be able to do it like t...

22:20
@RMartinhoFernandes Me too. That's why I conjectured it was a prime. Which it turns out to be :)
^ Why do everyone else recommend dynamic allocation as first choice?
Because people are silly.
Feb 16 at 23:01, by sehe
$ pyecm 1131997
Factoring 1131997:
1131997
hey Alf, you're the Win32 Maestro here, right?
Hey, what about me? :(
22:23
you can be one as well if you like
do you know how to get the mouse movement as a relative amount, instead of just the new position?
lol
Use a macro somewhere!
(Just a guess.)
From window messages? You can't, AFAIK, you need to remember the previous position.
figured so
you can use RawInput, that dishes out relative amounts
RawInput is bit of an overkill, usually.
(Not to mention fun with HID magic numbers.)
0
Q: speedup template function compiling

user1258071I have problem with extremely long compiling time on my C++ code where I use some template functions from external library. Example: //fun.h template <class T> T fun(T in){ ... } //main.cpp #include fun.h class A{...}; int main(){ A a,b; ... b=fun<A>(a); //this line causes the lo...

Is this a use case for extern templates?
22:26
yes
all I'm trying to do is rotate my camera when the mouse moves, like in an FPS
MEh, too tired to answer.
why does that necessitate so many mathematical thingymajiggies :(
CameraManagerSingleton::GetInstance()->Manage()->Rotate(MouseManagerSingleton::GetInstance()->Manage()->GetCoords())
lol
22:29
hey GLM, wtf is wrong with you? can't stack quaternions?
@DeadMG can you teach about quaternions?
teach who what about quaternions?
like what they are, how they relate to complex numbers, what used for, so on?
You can rotate without quaternions, but then you need different matrix for each axis.
22:31
i've never seen a quaternion
I have no idea, I only have a very basic understanding of what they're used for
Quaternions are magical things that allow you to rotate stuff in 3D.
3
That's my understanding.
but they're bloody useless if you have a library that won't allow you to compound them
Er, what do you mean "compound"?
Multiply them?
22:33
yes
apparently not
and I checked both the quaternion header references and didn't come across one
that's a scalar multiply
not a quaternion-quaternion multiply
no, wait, it does seem to specify a * operator
Oh. I really need sleep.
22:35
no, no, you were right
What are quaternions isomorphic to? M4,4 ring?
it does offer *, just not *=
lol
@DeadMG Stop messing with my head.
why would I do that?
@LucDanton Quaternions are 4-vectors. But those used for rotations are only the ones of unit-length.
22:38
> InvalidOperationException: Operation is not valid due to the current state of the object
Wat.
Why would you want to have *= on quats? :S
(On Stack<T>.Peek())
They do form a ring, but I don't think it's the same as M4,4.
@CatPlusPlus Empty?
Peek throws on empty stack?
@RMartinhoFernandes Well no that wouldn't work.
22:39
@CatPlusPlus What would you expect? UB?
No, null.
@Pubby To compose a pair of quaternions, re-using the LHS?
No, .NET is not Java. You don't get nulls thrown down your throat.
But I want null!
No. Null is evil.
In abstract algebra, a magma (or groupoid; not to be confused with groupoids in category theory) is a basic kind of algebraic structure. Specifically, a magma consists of a set M equipped with a single binary operation M \times M \rightarrow M. A binary operation is closed by definition, but no other axioms are imposed on the operation. The term magma for this kind of structure was introduced by Nicolas Bourbaki. The term groupoid is an older, but still commonly used alternative which was introduced by Øystein Ore. Definition A magma is a set M matched with an operation "\cdot" that se...
Dorfmath.
22:42
so in other words
it's all going completely wrong and I have NFI why
"(...) which was introduced by Øystein Ore." (emphasis mine)
@DeadMG National Fraud Initiative?
No Fucking Idea
@DeadMG He's asking you what NFI means.
lol
22:44
hmmm
my depth buffering appears to be a little no worky today
can see the left and right bones through the root bone
X-ray vision!
heh
You mean cancer vision?
for some reason, the application isn't writing to the depth buffer
Isn't that DX job?
22:55
"Let me see if you've got cancer" "Yep, you do now"
Coming in the next release of DF.
@CatPlusPlus As if rotten hearts weren't enough.
@CatPlusPlus Yes. I asked it to nicely, but it doesn't seem to want to.
Use more carrots.
22:57
lol
I have a depth buffer. I set the render states to write to it, to enable it, to reject further-away pixels. I set it to the device. I cleared it to an appropriate value.
not necessarily
but assuming that all tasks were completed before I used it, then that shouldn't matter
Here's a good 10k link for ya. Should petition to get it undeleted for April 1st.
I do clear it every frame
Should I post a screenshot for anyone < 10k?
heh
if there's anyone non-10k here
That'd be me.
23:11
then yes
Eh, do what you want.
see, here's the strange thing
@Mysticial screen yes pls
I cleared the zbuffer to 0 instead of 1, and nothing was rendered because it failed the test
23:12
so the test is working fine
just nothing is being written to the buffer
@ScottW The model is well within the clip planes
right now I have them at 1 to 200, I think
0.1 to 200
the model is only like, 15 units long and starts at ~2, so
posted on March 08, 2012 by Herb Sutter

The spring 2012 meeting of ISO/IEC JTC1/SC22/WG21 (C++) was held on February 6-10 in Kona, Hawaii, USA. Here’s the major takeaway: This is going to be a busy year as investment in C++ across the industry continues to increase, and that’s good news for C++. Here are some highlights from the meeting. Attendance This was [...]

I wonder if that 'question' is a send-up of a preexisting question in the same style.
Hello, sorry to interrupt, got a quick question: in a string you can do "foo %i bar", myInt; to 'put' the int in the string, what is this %i operator called cos it's totally gone from my head and also how to do this for a char if possible like "foo %c bar", '&';?
23:18
that's not an operator or putting it in the string or anything
that is PLEASE OVERFLOW MY BUFFERS printf, which is a function
@RMartinhoFernandes This is a strange one: stackoverflow.com/questions/9625028/…
@TomIngram A format string format specifier
wicked found the reference thanks
argh depth buffer y u no work? :(
23:37
@DeadMG Did you remember clearing it (to the correct value) before drawing each frame?
yes
Hm... did you activate it?
and the cleared values are being tested against, too
if I clear it to 0, then nothing is drawn because the pixels are rejected against the depth buffer
just nothing is being written
Maybe unrelated problem? Lighting perhaps?
@ScottW Yes. The default value is on and I explicitly set it on anyway.
@FredOverflow I don't have any lighting. The model itself renders fine, it's just the depth buffer that's not working.
23:41
> To have any chance of making y be approximately 7, C++1y can add at most one major new language feature, and there are already more language extension proposals than could possibly fit.
Which new language feature would you want to see in C++1y?
I don't think that anything less than a total re-do could redeem C++ in my eyes
I haven't seen a proposal mature enough in my eyes. Except for concepts which I haven't checked. Maybe that's good to go, I don't know. I'd like a proof-of-concepts (sorry) implementation though.
Anyway, libraries, millions of them. Please.
well
I may laugh at my own efforts, but it'd be enough to render Minecraft, give or take
if I fixed depth buffering, anyway
feels kinda embarassing to be out-rendered by Minecraft
the states are set in the shader and at the application level
Xeo
Xeo
Shader debugging is always fun.
@ScottW Yep.
Xeo
Xeo
23:56
@DeadMG Especially given that it's coded in Java, you mean?
@Xeo No evidence there's anything wrong with my shader
@Xeo hehe
don't think that OpenGL cares what language your app is written in
Xeo
Xeo
Okay, rephrase: "render debugging is always fun"
@DeadMG Sure, but still, sometimes I get the feeling MC could be way more performant if it was written in C++. Especially since it seems to eat up 50% of my CPU while idling.
@Xeo heh
Xeo
Xeo
0
A: c++ string array initialization

XeoIn C++11 you can. A note beforehand: Don't new the array, there's no need for that. First, string[] strArray is a syntax error, that should either be string* strArray or string strArray[]. And I assume that it's just for the sake of the example that you don't pass any size parameter. #include &...

Gotta love temporary arrays!

« first day (509 days earlier)      last day (4664 days later) »