« first day (502 days earlier)      last day (4446 days later) » 

5:00 PM
@Mahesh 21.4.8.2 [string::operator==] and 21.4.7.9 [string::compare]
Although I looked for C++11. I don't think there's any difference with C++03 in this case.
std::basic_string has always had its bloated interface :|
@RMartinhoFernandes Haha, I have one up on you with my literals now: I support all string types for operator"" _s!
 
@LucDanton First it had a bloated interface. Then they made it an STL container :P
 
@DeadMG I'm looking at the char traits requirements (for the first time) and it's hard to see the point to all that machinery tbh.
 
@LucDanton By "const charT *" in the standard, do they mean that it can be either const char * or const wchar_t * ?
 
@Mahesh Ah, that's because this is the specification for template<typename charT, /* ... */> std::basic_string.
Since std::string is std::basic_string<char, /* ... */> then in this case charT will be char whereas since std::wstring is std::basic_string<wchar_t, /*...*/> then it's wchar_t.
Does that make sense?
 
@LucDanton Yes. Templates aren't my stuff. Need to learn them sooner.
 
5:20 PM
> The simple template stuff is simple. The hard template stuff is hard.
3
Anyone knows who said that? :)
 
let me guess, bjarne?
 
nope
hint: he's from the UK
 
@FredOverflow SO user ?
 
I don't know, let me check...
nope, at least not under his real name
Okay, here's a picture of him:
 
@FredOverflow He should have lost most of his hair learning harder part of templates. Just kidding.
 
5:28 PM
Actually, he has :) The picture is quite old.
Kevlin Henney is an author who writes on the subject of computer programming in C and C++ for magazines such as the C/C++ Users Journal, Application Development Advisor, JavaSpektrum, C++ Report, Java Report, EXE, and Overload. Henney is a member of the Association of C and C++ Users, and gave the keynote address at the 2001 ACCU conference on the subject of writing less code, because "there is no code faster than no code" and "less code, equals less bugs" (of which he is an active presenter). He is also a regular speaker at OOPSLA, most recently speaking at OOPSLA 2005. In October 20...
 
@FredOverflow Started reading the short story on his blog :)
 
@FredOverflow Huh, he looks like himself?
 
Didn't he have sufficient web space for a long story;? :)
 
1
A: Forwarding Constructor with CRTP

Cheers and hth. - AlfYou need to let your cloning "middleman" class forward constructor arguments. Disregarding some corner cases that's easy to do in C++11, but not so easy in C++03 or with a current compiler that doesn't yet support C++11 argument forwarding, such as Visual C++11. One way to do that in C++03, usi...

^ Comments?
 
@CheersandhthAlf Too sophisticated for my current state of mind. But it sure looks impressive, so I gave you a +1.
 
5:35 PM
@FredOverflow Well, it is a short long strory :)
 
Hey guys do you mind if i ask a quick question...
 
@ShamariCampbell All this time I was asking questions. Shoot for it and we always have @FredOverflow to help :)
 
haha :) ok here goes
i have a vector which holds many characters
and i find a character for example N
and when found i get the position i.e 3
 
@CheersandhthAlf I'd prefer an inherited constructor here, I think.
using Base::Base; inside Clonable right?
 
@LucDanton I didn't think of that. I don't think it had even been proposed in 2010.
 
5:42 PM
I cannot comment on the variadic template emulation because my eyes water when I take a look at the code. Sorry!
 
Also, today one would not use std::auto_ptr.
 
so then i subistute that into another for loop so it loops 3 times and i ouput the characters before N and i also check wether certain characters appear before N and even when those certain characters do not appear it executes the if body and else body
is the only wat to stop that by using a break;
is the only wat to stop that by using a break; ?
 
@CheersandhthAlf Well it's worth it as a comment to the OP.
 
@LucDanton :D
I'll edit
 
@Mahesh
 
5:47 PM
done
 
@CheersandhthAlf Do you use that pack elsewhere in your code to e.g. forward argument packs? I seem to recall you've used it for your named parameter idiom(?).
 
I did use it for something, after all I wrote it before the clone posting. But I can't recall.
 
Heh.
Oh, I missed that Boost.Context had passed review and had been accepted.
 
@ShamariCampbell sorry.
 
@Mahesh sorry for? or did you not see what i wrote?
 
5:54 PM
Yes.
 
@ShamariCampbell Could paste the code at codepad.org, what you are trying to do ?
Time for lunch. See you guys in an hour
 
Hello!
 
6:37 PM
Sup.
 
I have a crazy idea. Expressing rendering pipeline as a Haskell expression, and generating Cg/GLSL/possibly software fallback from that.
(Also I'm working on a game UI in Unity, woo.)
 
Nothing's up.
 
How is this upvoted?!
1
A: Closing Userform Excel VBA

user1209721Unload Me only works when its called from userform self. If you want to close a form from another module code (or userform), you need to use the Unload function + userformtoclose name. I hope its helps

 
Somebody clicked the ^ button.
 
6:39 PM
I mentioned in the question
@daknøk haha
For me it's actually a boat :/
 
You mean the ⛵ button.
 
Shame the chat's not in Symbola :/ Well kinda lucky, I just used stylebot to change it and holy crap it's bad
 
@CatPlusPlus ohhh Haskell, I'll join you :)
 
Also Unity is silly. You need Pro licence to use version control the project.
 
Somehow until a few years ago I was not aware of the Pink Floyd album "Obscured by Clouds" from 1972. It's right between "Meddle" (1971) and "Dark Side of the Moon" (1973). How was it possible to be unaware?
 
6:42 PM
sucks
 
Otherwise it's a mess of required, unmergeable binary files.
I hope we'll get that licence soon.
 
@CatPlusPlus yeah. I hear you can use svn with some trickery. Something about clearing some cache or another before committing, but seems stupid as hell
 
We tried removing the cache, it breaks in fun ways.
 
BREAK ALL THE THINGS
 
@CatPlusPlus I once toyed with the idea of writing a functional shader language. So silly that Cg and GLSL and all those are all basically dialects of C, on a platform where you don't really have much in the way of side effects
 
6:46 PM
functional shader language. FSL
 
They'd be functional if they weren't pseudoimperative.
 
@CatPlusPlus yeah
 
Replace mutable local variables with function composition and pretty much done.
 
6:47 PM
I primarily would like to get rid of differences between Cg and GLSL in a nice way.
But it could have additional benefits, like testability outside of GPU environment, and that software emulation thingy.
Another thing that occurred to me while learning Unity — I've never considered Mono as an embeddable VM.
 
is Unity hard to learn?
 
Well, scene editor is one thing, scripting layer another.
The latter is C#, Boo or JavaScript derivative.
 
Never heard of Boo language
 
I won't be using editor much, but it doesn't look too complicated. For a 3D editor.
 
@TonyTheLion from what I hear, it's remarkably easy. Before Unity, I'd have sworn no one would ever make a game engine that actually delivered on the promises of being accessible and at the same time reasonably flexible
 
6:53 PM
I'm Boo'ing it anyways
@jalf ah right
 
Boo is Python derivative with static typing/type inference for .NET.
 
but I've never used it myself
 
I suck at graphics anyways, so I won't bother with it
I'll just learn OpenGL for now
 
Well, in Unity you don't really go to OpenGL level, like, ever.
 
it's probably a better way to learn graphics than plain OpenGL imo
since it's always more motivating if you're actually getting stuff done, and there's no reason to fret over all the silly low-level details to begin with
 
6:54 PM
Shaders are generated from their custom declarative language.
Most rendering stuff is set in the editor.
 
@jalf yea but I like fretting over low level details :P
 
Unity API is fairly high-level, AFAIK.
 
sbi
@jalf, you here?
Oh, yeah.
 
No, there's only jalf's ghost.
 
I'm just learning to understand it, not because I necessarily want to make a game...
 
Ell
6:55 PM
i dont understand shaders :s
 
@sbi yup?
 
@Ell They take input and produce output.
Like, whatchyacallem, functions.
 
sbi
Well, I just stumbled into this, and started to read more of what Rachel has written on MSE. If you think MSO is bad, read that.
 
@TonyTheLion well, just keep in mind they're separate goals: learning about graphics vs learning all the low-level details of OpenGL. You can do either one without the other, so focus on the one you actually want to achieve :)
 
Ell
are they compiled? I swear that only the sources are distributed? And I dont understand the difference between pixel/vertex shaders? How can a vertex have a colour?
 
6:57 PM
"Pixel" shaders are called fragment shaders, they don't really operate on single pixels.
 
@jalf yes.
 
@sbi ah, interesting post. I'll check more of what she's written later
 
Cg is usually precompiled, but GLSL defines no binary interchange format.
So GLSL shaders are usually JITted on the spot.
 
@CatPlusPlus oh wow
 
@CatPlusPlus and it's driving everyone who uses them seriously mad ;)
since it affects load times quite a lot
 
6:58 PM
strange how something like a shader is JITted
 
@Ell well, how much do you understand computer graphics in general?
 
Ell
so is "Pixel Shader" and incorrect term or just another name for "Fragment Shader"
 
doesn't JIT add overhead?
 
There are extensions for binary shaders, AFAIR.
 
Ell
@jalf not a lot particularly. There is a graphics pipeline which consists of several stuff, you input vertices and they go through each type of shader.... or something :S
 
6:59 PM
JIT means "just in time". Don't think "compiling to native machine code". Think "compiling".
 
ultimately, a scene is made up of triangles, defined by 3 vertices each. The vertex shader processes vertices (transforming them from their world coordinates into screen space coordinates, basically determining where the triangle will be drawn)
the pixel/fragment shader is then called on every pixel covered by that triangle, and produces the output color of that pixel
 
Shaders are compiled to GPU machine code.
 
except that it's called a fragment, not a pixel :)
 
There are also geometry shaders for some time.
 
@jalf why this strange naming convention?
 
7:00 PM
They run between vertex and fragment in the pipeline.
 
Ell
how does the vertex shader know where to put the triangle? lots of maths?
 
@TonyTheLion fragment,s you mean?
 
@jalf yup
 
Fragment might be more or less than a pixel.
 
afaik, it's because they're not truly pixels yet. Another triangle might be drawn on top of of what you're drawing
and only the topmost becomes a pixel
the pixels are the ones physically shown on your screen
the fragments are basically pixel candidates
 
7:01 PM
> In computer graphics, a fragment is the data necessary to generate a single pixel's worth of a drawing primitive in the frame buffer.
wikipedia ^^
 
or that :D
 
so the fragment is basically the data that is needed to create a single pixel
 
yeah, but even that is a kind of odd distinction since the data needed to create a single pixel is basically its color. Which is also what the pixel itself is usually said to be
 
In computer graphics, a fragment is the data necessary to generate a single pixel's worth of a drawing primitive in the frame buffer. This data may include, but is not limited to: * raster position * depth * interpolated attributes (color, texture coordinates, etc.) * stencil * alpha * window ID As a scene is drawn, drawing primitives (the basic elements of graphics output, such as points,lines, circles, text etc ) are rasterized into fragments which are textured and combined with the existing frame buffer. How a fragment is combined with the data already in the frame buffer depends o...
it says in here what the fragment data consists of
approx
it's more than just color description
 
hmmm... But the output of a fragment shader is basically just a color. I guess the definition has drifted a bit over time, as graphics hardware has evolved
since all those things are basically what the fragment shader takes as inputs, before producing the single color output
anyway, it hardly matters much. The fragment shader produces things that are basically pixels, except they haven't been rendered to the screen yet :)
 
Ell
7:07 PM
so what input does it get? Do they all share a common public interface?
 
Rendering forms a pipeline.
Fragment shaders get what the earlier stages produced.
 
@Ell that varies. They take whatever inputs are passed to them from the previous stage in the pipeline
 
vertex >>= geometry >>= fragment >>= screen
 
Ell
hmm okay
 
Well, render target not screen.
 
Ell
7:09 PM
if you dont write a shader, is a default one used? As in, if you write a basic opengl programme (like a spinning triangle)
 
It'll probably be off-screen framebuffer.
No.
 
@CatPlusPlus Since that's not using >>> do I have to assume that each stage returns its input as well as adding new information?
 
There was a fixed-function pipeline in OpenGL, but it's removed from the Core Profile.
 
in the traditional (DX9) model, it was basically vertex shader(generates position,color, texture coordinates, lighting info such as surface orientation), gets passed to the rasterizer which interpolates all these properties (since each fragment is located somewhere in a triangle between three vertices, it takes the data from those vertices, and interpolates it appropriately, and then passes the result to the fragment shader
 
@LucDanton Well, uniforms are available across the entire pipeline. Plus, every stage has outputs which can be used as inputs later.
I didn't think too much about that expression. :P
Maybe arrows would fit better, dunno.
 
Ell
7:12 PM
so if no shaders are used, what is the pipeline?
 
@CatPlusPlus Aight, nice metaphor Haskell metaphor here, I can see there's a lot of threading the inputs/outputs.
 
@Ell on todays gpus, shaders are always used. Then they just use a default vertex and fragment shader which behaves like gpus did before they got programmable
 
@Ell Cthulhu. It devours everything and outputs nothing.
Pass-through shaders are dead-simple.
 
Ell
right, so what is an example of when to use a different shader? dont you just change the coords or texture? etc.
 
Coords or textures are vertex attributes.
They come along to the pipeline, shaders just manipulate them.
You'll probably want different shaders for different effect combinations.
 
Ell
7:16 PM
@CatPlusPlus can you give me an example of a different effect combination?
 
AA, motion blur, HDR, this sort of stuff is implemented via shaders.
 
@Ell depends. Keep in mind that shaders are basically unique programs. They can do anything you want them to. But often, you want to compute some kind of lighting dynamically, so you pass the shader information about the position of light sources, and it figures out how the triangle should be lit.
 
@CatPlusPlus Is there a requirement that e.g. shaders for the same stage are commutative?
 
or it might look data up in a texture, and use that not just as a plain texture to render onto the triangle, but as additional parameters controlling the rendering logic
 
@LucDanton They have fixed order.
 
Ell
7:17 PM
i dont understand how you can get pixels out of coordinates of lights & triangles, I mean, there must be a hell of a lot of maths? Equations, angles of light beams and whatnot (raytracing? o.O)
 
Makes sense.
 
@Ell yeah, but mostly you just fake it
 
I think you can have multiple vertex shaders, for instance, but dunno how that's specified to work, really.
 
come up with some maths that give you results that look good
doesn't have to be physically correct
 
Ell
@jalf with slightly less complex equations?
 
7:18 PM
@Ell yep
 
Ell
ah kk
 
@Ell See e.g. Phong shading and lightning.
There are probably more complex models, too, if needed.
Raytracing is usually not done in real-time applications, because it's still expensive as hell.
But does produce much better quality.
CGI films and whatnot are most likely raytraced. And they take hours rendering each frame.
(Compare that to 60FPS game).
 
On 6 screens, IN 3D!
 
Ell
Isn't there an nvidia card that does realtime ray tracing?
 
Dunno. They probably still compromise a lot to make it real-time.
 
7:25 PM
@CatPlusPlus not much. Proper realtime raytracing is more or less possible. But (1) we don't have hardware designed for it like we have for rasterization, and (2) even if we did, there are things that can't be done efficiently with raytracing, just like there are things that are hard to do efficiently with rasterization
it's not the holy grail
 
There is no silver bullet, eh?
 
Goddamn dorf collapsed the ceiling on his head.
 
home.comcast.net/~tom_forsyth/… might be an interesting read
@LucDanton did he get hurt?
 
Doesn't look like it, although he fell unconscious.
 
so what's the problem? :D
 
7:27 PM
He's my sole miner. Time spent unconscious is time wasted.
 
One miner?
Crazy.
 
Nah, it's fine. Was.
 
Xeo
See, there's your problem. "It's fine until it fails."
 
It's fine until the ceiling collapses.
 
I think I accidentally collapsed a ceiling no more than thrice in all of my DF career. Not much of a career, but still.
All that just for a stupid pond.
 
7:33 PM
I collapse ceilings all the time. Most straightforward way to dig out big multilevel rooms :D
 
Yeah, accidentally.
 
and of course, it's fun to watch what happens
 
Meh, why isn't there a nice, C++ API to Mono.
Fugly C everywhere.
And looks awfully like Glib.
 
why does std::vector<wchar_t> v((std::istreambuf_iterator<wchar_t>(file)), std::istreambuf_iterator<wchar_t>()); prepend "00" to every byte in "file"?
why doesn't it simply write 2 bytes at a time into "v"?
 
Can you clarify? Where do you encounter those 00?
 
7:40 PM
wchar_t is not a byte.
 
lets say I have a file with just unicode bom
 
Also, wchar_t sucks.
 
"fe ff"
then I want v[0] = "fe ff"
but what I get is
v[0] = "00 fe", v[1] = "00 ff"
 
Also, this isn't decoding routine, it's naive read.
 
?
 
7:41 PM
Don't try to implement Unicode yourself.
 
Let me check.
 
And for the love of Cthulhu, don't use wchar_t.
 
@CatPlusPlus to some extent, one has to
 
ICU or Boost.Locale.
Go, use.
 
haven't got regex8u to work from ICU
 
7:42 PM
@ronag What's the type of file?
 
Cue ifstream.
(If so, use wifstream. But that code still sucks.)
Also ICU does have regexes.
 
I wonder how full my local swimming pool is at 6:15 AM on a workday
 
@CatPlusPlus I can't find an overload of operator>> taking wchar_t& though.
Attempting to reproduce.
 
@DeadMG These days swimming seems to be popular. But probably it won't be too crowdy at that hour.
 
well, I'd love to swim, but I'd really rather do it alone, which I'm sure shocks you
 
7:48 PM
I'm shocked that you don't prefer to bathe in the sweat and urine of others.
 
fair enough
 
@StackedCrooked Must smell bad.
 
files type is wifstream
 
@EtiennedeMartel I heard it provokes bestiality.
 
otherwise (std::istreambuf_iterator<wchar_t>(file)) wouldn't work
std::wifstream file(initialPath + L"\\" + filename);
std::vector<wchar_t> v((std::istreambuf_iterator<wchar_t>(file)), std::istreambuf_iterator<wchar_t>());
v;
is what I'm tyring
 
7:51 PM
Can't repro, sorry.
Oh wait, I used std::copy.
 
But that should work.
 
Nope, doesn't make a difference.
 
hm
 
@EtiennedeMartel Changing variables is unscientific!
 
@LucDanton Not in this case, I'm pretty sure that the std::vector constructor and std::copy require the same in terms of iterator parameters, so I'd expect them to be completely interchangable.
 
7:52 PM
First byte of my text file is 0x61, first element of the vector is 0x61.
 
@ronag Did you remember to #include <iterator>?
 
1 min ago, by Luc Danton
@EtiennedeMartel Changing variables is unscientific!
 
No I didn't
 
@LucDanton You're unscientific.
 
How dare you!
 
7:53 PM
Inorite
 
You're going to need to resolve this dispute in the Octagon.
 
Your mom's unscientific.
 
I need to avoid work less
 
Avoiding work is good.
 
depends on if you need to get it done :P
 
7:57 PM
Evolution favored lazy people.
That's the best excuse ever.
If I work I'll risk becoming extinct.
 
But if you don't you risk becoming homeless.
 
@EtiennedeMartel I'm lucky being a programmer then.
 

« first day (502 days earlier)      last day (4446 days later) »