« first day (467 days earlier)      last day (4464 days later) » 

6:00 PM
Can I make 3D world instead of 2D world by simply invoking glVertex3i(1, 1, 1) ?
 
@kfmfe04 possibly yea
 
@RMartinhoFernandes Haha
 
@kfmfe04 Possibly. But remember that the GPU is very, very well suited to processing queries on the results.
 
@DeadMG aye - all those cores make me salivate
 
But it's not webscale.
 
6:10 PM
it's the headache of using yet-another-compiler and specialized code that keeps me from attempting a big project on the GPU
@RMartinhoFernandes lol - you remind of me this:

http://www.youtube.com/watch?v=b2F-DItXtZs
 
@kfmfe04 That's exactly what I was referring :)
 
@RMartinhoFernandes rofl
 
@EtiennedeMartel That's not about being webscale.
That seems to address some real thing.
 
What is webscale, exactly?
 
6:13 PM
Exactly.
 
Can you be less clear?
 
Mongo DB ftw - lol
 
@EtiennedeMartel No one knows WTF webscale is.
It's some property of NoSQL databases that makes them awesome.
 
Oh, so it's a marketing term.
I thought MongoDB was open source?
 
The video @kfmfe04 posted above is a good "explanation".
> Shards are the secret ingredient in the webscale sauce.
 
6:17 PM
lolol - Shards is another magic word
 
This \u1F4A9 is \u1F34C.
 
6:36 PM
I'm surprised at what people flag sometimes.
2
 
@EtiennedeMartel in chat?
 
How can I turn this into 3D world? Like having a cube or something?
 
@EtiennedeMartel anything with a swearword?
@DzekTrek depends on how you create the view if I recall a class from five years ago
 
@MooingDuck No, I mean when something that isn't spam is flagged as spam.
 
6:45 PM
@EtiennedeMartel do you have an example?
 
Like, "hi".
 
@MooingDuck it is something like this pastebin.com/gZZWSgVT
 
Yes, someone flagged "hi" once.
 
@DzekTrek glMatrixMode(GL_PROJECTION);Projection should be something else for starters. I don't recall what else needs to change
@RMartinhoFernandes that's just silly
 
@MooingDuck No, that seems correct.
@DzekTrek A cube has 8 vertices and 12 edges. You need to supply all those edges if you want a cube.
 
6:47 PM
@RMartinhoFernandes internet verifies that PROJECTION is correct. Shows what I know.
 
Aha, so I have 4 edges and 4 vertices instead
 
@DzekTrek That looks like a square.
 
Any reason why you're learning the deprecated OpenGL API?
 
It is @EtiennedeMartel . :)
 
@RMartinhoFernandes You mean OpenGL 2?
 
6:50 PM
There's a forward compatible subset of OpenGL 2.
 
Ah, so basically what other idea is to make a cube except making a matrix class for it?
 
A matrix class?
 
Hm, wrote a template function that solves A*B/C (about 31 LOC) and made a specialized for int that just uses long long as the temporaries. However, my tests show them to be the same speed, and the specialization might not be portable. Should I leave the specialization or remove it?
 
All you need is 8 vertices, and then provide them in the correct order.
 
maybe something like glBegin(GL_QUAD); to provide?
 
6:54 PM
@MooingDuck Make a bigger_int template and specialize using that.
 
I hate making a tons of vertices ..
 
That takes care of portability issues.
 
with GL_QUAD I will need only 2 vertices ?
 
@RMartinhoFernandes That'd complicate things. It's easier to just add a static assert that says "if this triggers, just remove this specialization"
 
There are 8 vertices on a cube. You need 8 vertices. Don't try to avoid that, you can't.
@MooingDuck lol
 
6:59 PM
Man, this sucks. Looks like OS X 10.6 only supports OpenGL 2.1.
 
Like I said, it has a forward compatible subset, so you can learn modern OpenGL on it, if you stay away from the deprecated stuffs.
 
and it won't work as I expected.
 
Obviously, you can't learn the 3.0+ only features.
 
7:01 PM
Using OpenGL 2 feels like coding in COBOL.
 
It's somehow very confusing.
You deal with one problem, another problem pops up, but that's coding. :)
 
That only happens if you try to solve a problem by changing the code, instead of solving it by thinking about it.
Draw a cube on paper and think about what coordinates the vertices have, and in what order you need to draw them.
 
OpenGL is frustrating when you have 3 issues all of which alone would result in an entirely blank screen
 
Who the fuck thought that glBegin/glEnd was a good idea?
 
7:05 PM
@RMartinhoFernandes I kinda actually like it more with a breakpoints
 
@EtiennedeMartel That could be addressed by a thin C++ wrapper I'd think
 
@EtiennedeMartel You can work fine on OpenGL2 without that. The programmable pipeline already exists on 2.0.
@DzekTrek Well, if you want to solve it the hard way, go ahead.
 
@EtiennedeMartel it makes sense when you see it as a state machine
 
I think I'm gonna need to man up and seriously learn about shaders.
 
7:07 PM
if you know C++ and linear algebra there's not much more to learn :)
 
@EtiennedeMartel this is a nice tutorial that sticks to forward compatible OpenGL 2.1: duriansoftware.com/joe/…
 
arcsynthesis.org/gltut is one I've seen recommended too
 
Thanks guys.
 
hmm, should a fixed point class's default constructor leave the data default-initialized or 0-initialized?
 
Thank you guys. :)
 
user142019
7:12 PM
With "default-initialized" do you mean "uninitialized"?
 
@MooingDuck have a constructor with a boolean and a default value for that which controls what it does?
 
@awoodland That one is good, but it uses OpenGL 3.
 
@WTP I'm checking the spec, but I think I used the words I meant to. In the case that the data is a primitive, then default-initialized is uninitialized, but in the case that it's not, it calls the default constructor.
@awoodland that's an option
 
user142019
ah k
 
on a related note is fully programmable alpha blending possible yet? glBlendEquation seems so limited, but I can't find anything to suggest it's been made programmable recently
 
7:15 PM
Immediate mode is less related to OpenGL being state machine than programmable pipeline.
 
@WTP § 8.5\6: "To default-initialize an object of type T means: — if T is a (possibly cv-qualified) class type (Clause 9), the default constructor for T is called (and the initialization is ill-formed if T has no accessible default constructor); — if T is an array type, each element is default-initialized; — otherwise, no initialization is performed."
 
user142019
nice
 
you could do "programmable alpha" it with FBOs I guess, but that seems less useful
 
@awoodland One thing that helps is to do all your OpenGL calls through a macro or function that checks glGetError after the call and blows up on error.
 
By "blow up", what do you mean?
Exceptions? Assertions?
 
7:18 PM
I have a checkGLerror() function that returns bool but prints a useful message if there was an error, designed to live inside an assert so that you get the real line number to look at in the assertion failure
 
GL errors are useless.
 
Oh, invalid enum, WELL THANKS.
 
@CatPlusPlus It's still helpful to know what call is messed up.
 
Oh, sure, not saying anything at all is much better.
 
7:20 PM
I run under gDEBugger.
It checks every call and no coding required.
 
Dear God! I made some progress. ;)
 
GL_ARB_debug_output is nice, but my drivers don't have it.
 
using just a sheet of paper ;) @RMartinhoFernandes
 
It should have been in the core since 1.0.
 
When in doubt, write it down.
 
7:22 PM
@CatPlusPlus I like your thinking
 
Also, GL_QUAD is deprecated.
In all forms, not just with glBegin.
 
I see.
 
Learn OpenGL with 3.1 Core Profile, it's better this way.
 
You can then go back to 2.0 with little problem if necessary.
 
I wish there was a decent collection of RAII wrappers for OpenGL things
 
It's just as easy to use a GL_TRIANGLE_STRIP to draw a quad as it was with GL_QUAD, anyways...
 
(like textures, buffers etc.)
 
Roll your own!
 
7:28 PM
heh
 
(It's not that hard anyways.)
 
@RMartinhoFernandes I have - 5 times over
 
@awoodland Have you seen OGLplus?
 
@awoodland put it on the net and stop reinventing your own wheel?
 
@MooingDuck it's always tied to a project and "just a quick hack"
 
7:30 PM
I didn't bother with RAIIfying GL because releasing the resources didn't seem very critical, so whatever.
 
@CatPlusPlus that looks promising - there was something before hand that got abandoned years ago
 
@CatPlusPlus there's wrappers all over the internet, I found like 20 since you mentioned that one
 
@CatPlusPlus I tend to use it for image processing stuff so there's 10000 textures in 1 run of the application
 
Most of those wrappers suck.
OGLplus looked usable.
 
anyone here an expert on XPath1.0?
 
7:33 PM
Sure, because we love XML soooooooooooooooo much.
 
@CatPlusPlus You're right, GLT looks abandoned since... 2002
 
I dislike XML but I like JSON.
 
Everyone sane dislikes XML.
 
i know
if i don't have to work with PMD
i wouldn't have to worry about this
this absolutely sent me back to a time when I have to program from only basic logics
and no variables
 
@hatboyzero I found that using STRIP for that can go terribly wonky.
 
7:38 PM
Interview Question: Can anyone plz comment as which one will be faster??
(A) static const int* a = [1,2,3,4,5,6,7,8,0xFF,13,10,0];
(B) int a[] = [1,2,3,4,5,6,7,8,0xFF,13,10,0];
 
Neither will compile, so they're equally fast.
 
@CatPlusPlus well, vertex ordering is key
 
First one is three oranges faster.
 
assume they didnt have any compilation error
 
Xeo
@abhinav That doesn't make sense
 
7:39 PM
Well, assume they're equally fast.
 
@RMartinhoFernandes you get an orange and an apple from me if you say that in an interview
 
Xeo
So, I had a sudden emergency and I'm back. Did you guys make any progress on how to get GCC 4.7 on my vbox? :)
 
Are companies really give people that stupid questions in these dumb interviews?
 
Is that sentence parsable?
 
7:40 PM
@Xeo Nope. But I discovered too late (i.e. after many minutes of build) that fucking clang won't build with Python 3.
 
Xeo
@RMartinhoFernandes You mean the tests?
 
No idea. Something that needs python2 to build.
 
Xeo
IIRC python was only needed for the tests.
 
hey Cat Plus Plus .... a question is a question and every question makes a sense
 
Xeo
Except when they don't.
 
7:41 PM
Not really, no.
 
@Xeo Oh, so skipping those is fine?
 
Xeo
@RMartinhoFernandes I think?
 
Skipping tests is always fine.
 
@abhinav Which is faster? An apple or an orange? <- See, this is a silly question.
 
Especially when they're wasting your time by failing.
 
Xeo
7:42 PM
> Note also that Python is needed for running the test suite. Get it at: python.org/download
 
@Xeo Well, I'm already building with python2, so I won't worry unless it borks again.
 
@RMartinhoFernandes Has anyone really been far even as decided to use even go want to do look more like?
 
Yes, three spoons did.
 
Baby baboon with a spoon on a moon.
 
I'm learning GCC after many years of MSVC. Why won't this compile? ideone.com/ea0fh
 
7:52 PM
Looks like some nasty hidden characters.
 
what, does GCC not like tabs? I retyped the line, still won't compile
 
Doesn't like long long(x)
 
Oh, that's ugly.
 
(long long)(x) fixes it.
Not sure about legality of yours.
 
Also, C casts, ugh.
 
7:56 PM
Don't ask how I managed to decypher that from the cryptic error message.
 
The error still looks kinda wonky to me.
 
@RMartinhoFernandes fixed on IDEOne, not on my machine :/
 
Like there's a character screwing up the encoding.
 
@MooingDuck There are three of those in that line.
@CatPlusPlus It's a GCC error message, what else did you expect?
 
@RMartinhoFernandes got all three
 
7:57 PM
Clang doesn't like it either.
 
@RMartinhoFernandes nevermind, works on my machine. I forgot that running the GCC compiler doesn't force visual studio to save files first, like it does with the native compiler.
 
oh... it seems I missed a lot of funny stuff here
 
Xeo
0
A: Generic visitor base class template in C++ - overload issue

XeoThe compiler doesn't know which base-class' visit function to call. See this question of mine. As such, as you correctly said, you need to make the functions available in the visitor class with using declarations. Sadly, you can't just use using visitor_base<T>::visit...;, as that is not a ...

Magic! Wuzzah! ♥
 
C++ is not for visitors...
 
Visitors are workarounds for languages without pattern matching.
 
Xeo
8:07 PM
Overloading is a bit like pattern matching
just more lenient, conversions and all
 
overloading is static pattern matching
 
Overloading matches on types, not values.
 
Xeo
Well.. that's what we're interested in when using visitors, no?
How would pattern matching on values help?
 
Not always.
Sometimes you're interested in the dynamic types.
 
with visitors you use dynamic dispatching
by using virtual accept, for example
 
Xeo
8:10 PM
Double dispatch
 
@Xeo See that virtual void accept(my_visitor& v) { v.visit(*this); } cruft? That's the workaround.
 
Xeo
Ah
 
Pretty much all design patterns are workarounds for missing language features.
Except singleton, of course.
 
well you can match type-id - it will be "type matching", or value matching, from other side
 
Xeo
no?
 
8:13 PM
@RMartinhoFernandes they aren't
 
template method
of course not every design pattern is architecture pattern
also... memento? flyweight? proxy?
(just looking at behavioral patterns list)
 
Well, I guess I don't know many design patterns.
 
any pattern where you need code some non-trivial behavior can't be language feature
 
You don't need flyweights in Haskell.
You don't need mementos either.
 
8:19 PM
I remembered boost.flyweight...
 
Proxy sounds like some kind of delegation scheme.
 
memento is just a serialization, but in common case you need to write custom serialize() method
 
That's not what it says on wikipedia. It talks about restoring previous states of an object.
 
Xeo
// 20.8.10, member function adaptors:
template<class R, class T> unspecified mem_fn(R T::*);
template<class R, class T, class... Args>
unspecified mem_fn(R (T::*)(Args...));
template<class R, class T, class... Args>
unspecified mem_fn(R (T::*)(Args...) const);
template<class R, class T, class... Args>
unspecified mem_fn(R (T::*)(Args...) volatile);
template<class R, class T, class... Args>
unspecified mem_fn(R (T::*)(Args...) const volatile);
template<class R, class T, class... Args>
unspecified mem_fn(R (T::*)(Args...) &);
I think we had that discussion about member function pointer overloads?
 
serialization saves and restores state
 
Xeo
8:23 PM
@rubenvb See above :)
 
@Abyx Memento seems to be about rolling back changes, not storage.
 
SDL sources are so awful to look at.
 
Why are you torturing yourself?
 
I didn't said "storage"...
 
Serialization is about transforming an object into a storable format.
 
8:25 PM
I have to setup a build system for the damn thing.
 
0
Q: How disastrous is integer overflow in C++?

FredOverflowI was just wondering how disastrous integer overflow really is. Take the following example program: #include <iostream> int main() { int a = 46341; int b = a * a; std::cout << "hello world\n"; } Since a * a overflows on 32 bit platforms, and integer overflow triggers u...

 
Xeo
@FredOverflow You know what undefined behaviour is. Everything can happen, including that your hard drive just implodes. Our your CPU
 
@FredOverflow should we -1 that ?
 
@FredOverflow Guarantees from whom?
 
lol
 
8:27 PM
Certainly not from the C++ standard.
 
But it's just so... shocking, isn't it?
 
I can't believe it's UB
 
Some architectures can trap on overflows.
 
You can always use bigints and poof, no overflows.
 
@Xeo: Thanks for the signed comment, updated.
 
8:30 PM
I believe there should be guarantee that (INT_MAX * 2) == (INT_MAX << 1)
 
Only for unsigned arithmetic (that is, with UINT_MAX instead).
 
But portability to architectures nobody ever heard of!
 
Xeo
0
Q: How to enforce a primay key constraint like behavior for elements of an STL container

user841550Only one element in the container can have the key property similar to how rdbms will not allow you to declare more than one primary key on a table. Example follows using a vector ( please consider using any other container ( std or boost ) that can accomplish the task elegantly. struct Element ...

 
What if someone is using frob's complement?
 
Xeo
Am I right that this guy is exactly describing a std::map?
 
8:31 PM
@FredOverflow You should take a look at the only question that I've asked on SO. A very good example of what can happen on signed integer overflow. :)
 
Anyway, what useful thing would you possibly do with that guarantee?
 
FredOverflow asking about IntegerOverflow on StackOverflow, ha.
11
 
Xeo
@Mysticial I think that's a good duplicate.
 
@Xeo Feel free to link it.
Or maybe I should make that an answer... lol
 
Xeo
8:34 PM
You should also maybe rename that question with a better title
Since you even say that it in any case is undefined behaviour
 
At the time I asked it, I thought signed integer overflow was implementation defined. I didn't think it was that undefined.
 
@Xeo oh :)
 
yeah... typo fixed :)
 
Xeo
@FredOverflow I meant @Mysticial's question
Stop doing that! xD
 
But yeah, @Xeo feel free to rename my question.
 
Xeo
8:39 PM
Too lazy
 
> laziness helped us to stay pure
Quiz time: Who said that?
 
Correct. I think "laziness helped us to stay pure" would look great on a T-shirt. Although it could be interpreted as "too lazy to fuck".
 
@RMartinhoFernandes I suppose you already know this podcast episode?
 
8:43 PM
No, not really.
 
0
Q: sorting a vector in descending order

FredOverflowShould I use std::sort(numbers.begin(), numbers.end(), std::greater<int>()); or std::sort(numbers.rbegin(), numbers.rend()); // note: reverse iterators to sort a vector in descending order? Are there any benefits/drawbacks with one approach or the other?

@RMartinhoFernandes Well, now you do! Happy listening.
 
Is that where that phrase comes from?
 
0
A: How disastrous is signed integer overflow in C++?

MysticialAs pointed out by @Xeo in the comments (I actually brought it up in the C++ chat first): Undefined behavior really means it and it can hit you when you least expect it. The best example of this is here: GCC Fail? Or Undefined Behavior? On x86, signed integer overflow is just a simple wrap-arou...

felt like making it an answer. :)
 
morning
 
@Mysticial And I felt like giving you an upvote.
@RMartinhoFernandes What phrase? Oh, the laziness/pure thing? Yes.
 
8:49 PM
oh cool. thx :)
 
Xeo
@Mysticial lol, I even got pinged by that
 
Wow.
I thought plinks only worked on comments.
 
Xeo
No, I meant from the chatlink
 
@Xeo LOL
 
8:50 PM
The onebox plinked you?
 
Xeo
Aye
 
Lemme test something...
 
Now finally a Lounge title I can get behind
 
I forgot what I was going to test.
 
Xeo
lol
For a robot, you don't have much Cache/RAM, do you?
2
 
8:51 PM
Got swapped out.
 
@RMartinhoFernandes Something about at signs in answers and notifications caused by them maybe?
 
I hate the concept of boxed-typing. If you want a value-type to act as a reference-type, make it a reference-type. Reserve value-types for immutable data.
 
If anyone feels like meta rep-whoring, you can make a post about onebox-pinging.
 
@Xaade What exactly do you mean by value types? The value types of C# aren't immutable, are they?
 
@RMartinhoFernandes I got the question today, why doesn't iter++ go from the end to the beginning without passing the invalid end
 
8:52 PM
0
A: When do structs not live on the stack?

XaadeThe book made the mistake of confusing typing mechanics with scope mechanics. A Value type is not a reference type. It's data is copied when you call a method using it as an argument (without ref or out). Value types will live on the stack in the scope of a method, rather than on the heap as a re...

 
@FredOverflow No, but making them mutable is a big no-no.
 
@FredOverflow They aren't immutable. However, if you have difficulty remembering that they assigned by-value (are copied), then just have them "be" immutable.
 
C++ strings are "value types" without being immutable and I never had a problem with them...
 
Hey this is the c++ talk show.
 
@FredOverflow Everything is a value type on C++.
 
8:55 PM
@RMartinhoFernandes Not if you hide constructors and assignment operators and such and only offer a factory method that returns a pointer to an instance on the heap ;-)
 
@RMartinhoFernandes everything except int& stuffYours
 
@RMartinhoFernandes but they behave like ref type internally, don't they?
 
Ah, took a while for people to chime in contradicting me!
 
42 has some special meaning on internet? 0_o
 
@MrAnubis What exactly do you mean by that?
 
Xeo
8:56 PM
@MrAnubis Not only there
 
@MrAnubis It's not on the Internet. It's on geekdom.
 
@Xaade Why did you answer a 3-year-old question?
 
@FredOverflow but you pass an object by reference if you expect it to change.
 
@RMartinhoFernandes geekdom? what is that , care to tell me please? :)
 
@MrAnubis It's the Answer to the Ultimate Question of Life, the Universe, and Everything in the Hitchhiker's Guide to the Galaxy.
 
8:57 PM
@Xaade so?
 
@MrAnubis Geekdom is the domain of geeks, obviously.
 
@FredOverflow Think of it more like, C# objects are always pointers to objects.
 
@FredOverflow The problem is that in C# you look at assignments as being reference binding, not copies, because that's the most common.
 
The Hitchhiker's Guide to the Galaxy is a comic science fiction series created by Douglas Adams that has become popular among fans of the genre(s) as well as members of the scientific community. Certain phrases from it are widely recognised and often used in reference to, but outside the context of, the source material. Many writers on popular science, such as Fred Alan Wolf, Paul Davies, Max Miller and Michio Kaku, have used quotations from Adams' work in their books to illustrate facts about cosmology or philosophy. Answer to the Ultimate Question of Life, the Universe, and Everything ...
 
@Xaade No but in Java that would be true
 
8:58 PM
@FredOverflow Same way I necro 3 year old posts. By clicking through related links and not realize related != recent.
 
@Xaade Isn't that infinite recursion?
 
IOW, schizophrenic type systems are nasty.
 
@FredOverflow what I mean was in C# ref type hold ref to dynamic allocated memory, in C++ string, vector etc does the same internally , don't they?
 

« first day (467 days earlier)      last day (4464 days later) »