« first day (641 days earlier)      last day (4289 days later) » 

5:00 PM
@R.MartinhoFernandes no, we're just trying to figure out where the error was
 
@MooingDuck oh, I can honestly say that I was beginning to scratch my head about what you were really saying.
 
@Drise once you get it working, you should probably replace the function pointers with std::function. Then it can take functionoids and lambdas and whatnot.
 
@MooingDuck C++11? No bueno. Also, first is a dumb container, it doesn't need to know how to read.
 
on an unrelated note, I have no freaking idea how std::function works it's magic.
 
Standard abstract base + templated deriveds type erasure.
 
5:02 PM
@MooingDuck "in a documented manner characteristic" is kinda of odd statement, pretty much you can write a compiler documenting that it might crash upon any given code to grant it the possibility to crash whenever it wants to.
 
@Drise oh right
 
is that sentence correct?
not talking about the grammar
 
@refp yes
 
@refp If it crashes with valid code, it's not compliant.
 
@refp "characteristic of the platform". So a compiler is allowed to crash on Unix; on Windows it's encouraged to BSOD.
@R.MartinhoFernandes yup, much better. Thanks.
 
5:04 PM
@R.MartinhoFernandes Valid code could exceed an implementation limit (and there's almost no lower limit on the implementation limits).
 
@R.MartinhoFernandes right, but how can it call functionoids? It needs a T* as well as the T::func() in the un-erased part. That's what I got stuck on.
 
@JerryCoffin Right, I should have said something else.
@MooingDuck ?
 
@R.MartinhoFernandes I can't figure out what the members of std::function must be, nor how std::function::operator() calls a functionoid. (since it's a member function)
 
@MooingDuck you supply a T * at construction or when calling.
 
@MooingDuck f().
Yes, you should facepalm really hard now.
 
5:07 PM
@R.MartinhoFernandes alright, I'm writing it myself, to see if there's really no problem, or to show my confusion, one of the two
 
@refp You can argue that a "hello world" program is technically a conforming implementation of C or C++, with the proper documentation (which is basically: "in case of invalid input, the output of 'Hello, World!' is to be interpreted as a diagnostic.")
 
@MooingDuck I'll be back in a bit. I hope we can find some solution to this.
 
@MooingDuck consider how you'd implement a std::function just for signature void (*)(). You have an abstract base with virtual void call() = 0, and deriveds for functions and member functions.
 
Is there a C++ standard class or struct that refers to a point or size ( int x, int y ) or must I roll my own?
 
pair?
 
5:10 PM
@JimNorton std::pair<int,int> or std::tuple<int,int>? But I'd take a look at boost.geometry
 
@JimNorton Pretty much need to roll your own, though std::pair<int, int> is about as trivial as rolling your own can get...
 
@JerryCoffin Ok thanks :-)
 
@ecatmur as I code it, I see the problem. I was thinking of the std::function base calling a static member of the function_impl, but it doesn't, it calls a member function, which allows it to access the data etc. Don't know why I thought it was static.
 
@R.MartinhoFernandes it's interesting what "characteristic of the platform" means, though. Is a compiler that contains a security hole (so compiling untrusted code could give an attacker shell) a non-compliant implementation?
 
You mean, like kt's?
 
5:14 PM
kt?
 
Such a compiler violates the as-if rule.
Oh wait, you mean, assuming UB?
 
Well, gotta go for a while. Later, all.
 
Well, in that case yes.
For a program with UB, pretty much any piece of executable code you throw it at behaves in a conforming manner.
After all, you're all getting bogged down on a note, and ignoring the actual definition: "behavior for which this International Standard imposes no requirements", i.e., truly anything can happen.
 
So let's say I have:

pair <int, int> size (120, 140 );
How do I reference each int in the pair individually?
 
5:20 PM
size.first and size.second.
@JimNorton Don't take this as a RTFM, but... well, it is ;) en.cppreference.com/w/cpp/utility/pair
 
@R.MartinhoFernandes Thanks... is there a good link that discusses this?
Ah I read your mind. :-)
 
thank you!
 
I'm actually converting my fairly small C application to C++ now. My boss gave me the go-ahead. So I am now excited to be doing it. I expect I'll have a few newb questions...
 
5:22 PM
@JimNorton "converting" C to C++ usually becomes "total rewrite" fairly quick.
@JimNorton place to start: anywhere with the word "free"
 
@MooingDuck Depends on how you define "convert".
If it's "make it compile", then it's easy.
 
@Mysticial true
 
@ecatmur better now?
 
@Mysticial Add a few casts here and there. Done :P
 
Yeah, pretty much.
 
5:23 PM
random question: thoughts on the penn state scandal?
 
@Mysticial It already compiles using a C++ compiler... but I'm converting some structures and free functions to classes etc. So mostly a rewrite.
 
@refp What I said above. You're all ignoring the actual definition and focusing on the note.
 
I write a lot of code that gets compiled both as C and C++. So you'll see me using mallocs with casts. * gasp *
 
The standard imposes no requirements.
 
@AgainstASicilian Heads should roll!
 
5:24 PM
@R.MartinhoFernandes I'm going to quote you on that one in the post, seems like a valid point.
 
@refp absolutely
although "characteristic to" -> "characteristic of"
 
oh sorry, will fix it
 
@MooingDuck now write a constructor template<typename T> function(T *, void (T::*)())
or don't, but you can see how that'd work
 
@ecatmur oh right, forgot that part
@ecatmur wait, I thought it just took functionoids. Does it also take arbitary member functions?
 
@R.MartinhoFernandes stackoverflow.com/a/11546378/1090079 you have officially been quoted.
 
5:30 PM
Hmm, Quiznos Sub. How... somewhat adequate.
 
@EtiennedeMartel But they have a PEPPER BARRRR.
 
@AgainstASicilian Yes.
 
.hpp or .h?
 
@JimNorton I use .h.
@R.MartinhoFernandes So, how's ogonek going?
 
@MooingDuck oh yeah, that'd be boost::bind. Anyway.
 
5:33 PM
@EtiennedeMartel Ok that seems to be the most common...
 
Ugh. They must block gravatars at the university. raises first Assholes!!
 
WTH is a gravatar?
 
Your avatar thingy.
My avatar thingy.
 
@JimNorton the site that runs our pictures
 
Everyone's avatar thingy.
"Globally recognized avatar"
 
5:34 PM
@JimNorton hpp if it's not C-compatable
 
@MooingDuck got it.
@MooingDuck So a gravatar is to pictures what OpenID is to id's?
 
@JimNorton yes
 
@JimNorton You have a wordpress acount?
 
@Drise Not on wordpress.com
@Drise Why?
 
F VC right in the A
 
5:39 PM
Can I create a wordpress blog on wordpress.com and get a gravatar?
 
Also: Tell me if I'm wrong. std:set: A container to be used to create an ordered link list of objects.
 
@Drise std::set is a search tree, not a linked list.
 
red-black treee
 
@JimNorton Generally where gravatars are used.
 
@Drise Wrong, the correct answer is 42
 
5:40 PM
@FredOverflow Fuck.
 
@Drise you're wrong :D
 
@Drise Good answer!
 
Fuck it, I still got an 85.
 
@Drise On what?
 
My second exam of the semester in the class I'm more concerned about.
 
5:44 PM
0
Q: Image Manipulation - is this a for-loop issue?

medivhI have an image that I'm trying to blur out, but it ends up looking very weird indeed: What I DO is this: I take each pixel, and I average its value on a color-by-color basis with the values of all adjacent pixels. Or so I think. But there's clearly an error in there, and I suspect there's a ...

pointers!!!
 
NO! I refuse to #include <windows.h>:
 
@Drise you aren't going to get far with that attitude
 
@Drise RAIIIINBOWS
 
Xeo
fuuuuuuuck
I have a problem
 
@MooingDuck Honestly, I prefer Qt.
 
5:47 PM
@Xeo Are you gonna tell us what it is?
 
Would would you create a private constructor for a class as opposed to a public constructor?
 
@JimNorton only if you didn't want it to be publicly constructable in that way
 
@DeadMG bad
 
Xeo
@FredOverflow got lucky, was just a broken USB cabel
write/read errors all over the place when I tried to copy / delete anything on my external HDD
 
@MooingDuck hmm ok... I'll make both constructors, one with arguments and one without public.
Or should the one without arguments ( the default ) be private?
 
5:51 PM
@JimNorton I can't give any advice when you haven't told us what you're trying to do. In general, all constructors are public. Though there's many common situations to make them protected or private.
 
-7
Q: write an algorithm that counts the unique values in a list of integers?it has to be in any programming language

user1336967the unique value is the single value with no duplicate {2,3,5,3,1,6,5,6,3,6,7,4} returns numbers of unique values is 4 can anyone help , please

That's one quality question.
 
@MooingDuck Ok I will post a class definition shortly.
 
@JimNorton don't actually need the class definition, just... in what ways do you want it to be publicly constructable, and what ways to you want it to not be constructable?
 
@EtiennedeMartel I'm just finishing up all the character property tests. Then I'll start on the boundary algorithms.
 
Wow, that Shell arcticready hoax is... really stupid.
 
5:52 PM
@MooingDuck Singleton
 
Once that is done, shit just got real.
 
@Drise eh, that's one.
 
@MooingDuck Honestly, I don't know enough about C++ yet to know how I want the constructors. :-(
 
@JimNorton in general, make all constructors public
 
@JimNorton Don't fall for it! Use .h++ like a real man.
 
5:57 PM
@R.MartinhoFernandes not .hplus+?
 
@R.MartinhoFernandes Do you have an idea on how we'll be able to render Unicode characters on the GUI?
 
@FredOverflow That's not an answer, that's a thesis.
 
@EtiennedeMartel Sorry, I'm only handling the Unicode handling part, i.e., not fonts/glyphs. But I'm tackling boundaries first because grapheme clusters are important for rendering.
 
@SamDeHaan I even cut two pages before posting that ;)
 
5:59 PM
@R.MartinhoFernandes I understand. I was only asking if you thought about something.
 
@FredOverflow I'm half tempted to downvote for being too wordy :( I can't read all that.
 
@MooingDuck Nobody is forcing you to read the whole thing.
 
@FredOverflow I didn't, but it's tempting
@FredOverflow but if it's 19 pages, is it really helpful?
 
@MooingDuck It's only 10 pages on my monitor :) But yes, I think (or at least hope) it is helpful to understand move semantics in its entirety. It's a pretty complex topic after all.
2
 
@EtiennedeMartel Ah no. I must admit I'm a total noob when it comes to that. I was hoping one of the people we have with more graphics experience would tackle that.
@FredOverflow I wonder if C++17 will have attack semantics.
 
6:03 PM
How about woof semantics or proof semantics?
 
Ell
hey guys
 
hi there
 
@R.MartinhoFernandes Maybe @DeadMG or @Dom can figure it out.
 
Ell
anyone know of any easy and quick GUI library? not necessarily for c++, could be for ruby/python/something easy to learn and quick. I just hate the archaicness of wxwidgets and stuff :L
 
6:05 PM
@EtiennedeMartel Doing your own font rendering is beyond nasty.
 
Ell
I would use ruby's shoes but there is no documentation since the creators internet-sucide
 
if you're on Windows you can use DirectWrite which comes with that stuff
 
Ell
oh also it should be cross platform and have a permissive liscence :L
 
but IDK about the other plats
 
hai puppy
how goes it?
 
6:06 PM
@Ell Mono runs WinForms!
 
flump
 
(WinForms on Mono sucks, btw; as much as like the project as a whole, the WinForms part is something I definitely don't recommend)
 
@DeadMG Hmm, it's Google time.
 
Ell
6:07 PM
I'll check that out
and a ruby gkt port
 
0
A: Can someone please explain move semantics to me?

JohnMove Semantics: Something that should have been in the language long ago, but added recently because we C++ developers ran out of tricky optimizations to distract us from getting our boring, real work done. Perhaps this will be a 4th rule in the rule of three? Now we can waste a lot more time c...

^ lol
 
@DeadMG Hmm, looks like there are a bunch of libraries about rendering FreeType fonts with OpenGL.
 
Xeo
@FredOverflow err...
Flag, downvote, delete.
 
@EtiennedeMartel I don't think there's any decent cross-platform one. I'll link to my evidence...
 
Xeo
1 delete vote left
 
Ell
6:11 PM
@R.MartinhoFernandes isn't pango what you want?
 
See last section.
 
@FredOverflow ah damn it, I completely forgot about that one haha
 
@R.MartinhoFernandes I found sourceforge.net/projects/ftgl and code.google.com/p/freetype-gl. I don't know how good they are though.
 
@FredOverflow btw, did you see my update on your question regarding lvalues as rvalues in return?
 
Oh, I haven't done any shopping myself, but Nicol did and didn't bear fruit.
That's why I'm not optimistic.
 
6:13 PM
@refp Everything illegal except for the parens? Yes. Already upvoted.
 
@EtiennedeMartel Anyway, start by culling away those that depend on compatibility functionality.
 
@Xeo nailed it
 
That should be a definite no-no.
 
@FredOverflow exactly! I re-read the standard snippets, dug a little bit deeper and discussed it in here (people came with good advice (special thanks to @Xeo)), really thought I had it correct the first time
 
It means, it works fine when i Run using flash builder. But after build release if i open main.html it just opens a blank page. I would be glad if you help me out instead of lowering my points. — Umar 35 secs ago
 
Lies, all lies.
"*not a gif" checks file name ...tumblr_m05dcznvBs1r8vfr7o1_r1_400.gif
 
@refp And yet, g++ accepts it. Stupid compilers, always ignoring little details of the standard :)
 
@FredOverflow haha yeah, though I'm not sure which one is correct and not.. I mean, the behavior used by g++ is a good behavior from a developers point of view
 
@refp It lets you accidentally write unportable code.
 
6:18 PM
@StackedCrooked That monkey is pissed.
 
@EtiennedeMartel Reminds me of someone.
 
@R.MartinhoFernandes sure, but what I mean is that the behavior used by g++ should be written in the standard, I'm not saying that it's a good thing that g++ behaves this way since it's illegal according to the standard
 
@EtiennedeMartel I'd say it exceeds grumpiness.
 
6:20 PM
Dude... the first proposal for move semantics is almost 10 years old, and we are still learning how to use it correctly and idiomatically...
 
@FredOverflow We are? Because the move semantics idioms are pretty easy to come by right now.
 
@DeadMG We all know you and me have mastered them already. Don't be condescending, okay?
 
@DeadMG Pffft... everything is trivial to the omniscient DeadMG ;)
 
I am far from the only one who knows how to use an rvalue
 
Hey guys. Bounty on offer for answering a windows crypto API question stackoverflow.com/questions/11479190/…
 
6:24 PM
@DeadMG Okay, suppose you write a template<typename T> class Foo with a T member. How would you write the constructor?
 
assuming that I wish to directly construct the member with anything that was passed?
 
@DeadMG Do I smell perfect forwarding? :) Suppose I want one constructor, not a constructor template.
 
such a moral conundrum
 
yep
 
I don't know whether PSU deserves death penalty
 
6:26 PM
@FredOverflow Well, that's not doable.
oh, no, wait, I lie
Foo(T t) : mem(std::move(t)) {}
 
Right, except being inefficient if T isn't move-enabled. Then the good old const T& would be more efficient.
 
You can't have the cake and eat it.
 
Why not? Can't I simply order a second cake after eating the first one?
 
well, I can't magic your non-movable types into moving.
 
2 mins ago, by FredOverflow
@DeadMG Do I smell perfect forwarding? :) Suppose I want one constructor, not a constructor template.
@FredOverflow You said one.
 
6:28 PM
either you perfect forward with a constructor template, or you take by value and move.
 
Also, explicit.
 
and not every idiom can cope with non-idiomatically-written code.
 
How about Foo(std::conditional<std::is_move_enabled<T>::value, T, const T&>::type t) : mem(std::move(t)) {}? Of course, we would have to add std::is_move_enabled into the standard first :)
 
no
the second should be T, not T&&.
 
Can you overload on T and const T&?
 
6:33 PM
It wouldn't be an overload. std::conditional chooses one.
 
Oh right. Silly.
WTF is "other uppercase".
Doesn't look right to me. It keeps screaming "why the heck aren't you just perfectly forwarding"?
 
But yeah, perfect forwarding is probably the best choice. I surrender.
 
> Other_Uppercase B C Used in deriving the Uppercase property.
Great.
I can cut this one then.
 
Oh crap, I implemented a teeny tiny toy FP language a couple of days ago (I'll call it TTT FP), and now I suddenly realize it has dynamic scoping :)
 
@EtiennedeMartel The first one had the last update back in 2008, and has comments saying "I just hope it will be made compatible with openGL 3 someday." :(
And the other one seems to be stuck on compatibility land as well.
 
6:40 PM
Well, shit.
 
ewwwwwwwwww
oh I guess the lib's own API isn't that bad...
 
I'm having trouble convincing my boss that the code he sent me doesn't compile. (I think he sent a pre-tested version). virtual ~COIF {Uninitialize();} is the first problem. He's telling me I must have messed up the project settings >.<
 
@DeadMG Ah, don't be put off but the glut crap. It's just a lib made for quick demos.
(Even if people try to treat it seriously)
 
Oh, rendering text in OpenGL.
I've been there.
I resigned and used a bitmap font because fuck you OpenGL.
 
6:43 PM
And you've come back.
 
@R.MartinhoFernandes Hmm, the "draw" function takes a std::string. I wonder how it handles Unicode.
 
"Oops, we guess we didn't think about rendering text. Who needs that anyway."
@EtiennedeMartel UTF-8 or not at all.
 
read the comments.. what the flux does OP want from me?
1
A: Is it possible to see the inherited background color of a div?

refpThe method everyone will recommend, which sadly won't work in all cases.. You could traverse up the node-tree using the elements parent-property, checking if there is any element that has an explicit background-color. The problem with this approach is that elements set to reside outside of thei...

 
Xeo
1
Q: How to call a constructor in another constructor in c++

bsb3166was struggling these days. The problem is the constructor calling. I wrote a piece of code like: class Foo() { private: int _n; public: Foo() { Foo(5);} Foo(int n) {_n=n;} } When I constructed a Foo object outside using the default constructor: Foo* f = new Foo(); I suppose v...

uuuh...
 
http://pastebin.com/jakmB92k
So what is wrong with the definition of size in the header file?
 
6:47 PM
std::pair
Everything from the standard library is in the std namespace.
And yeah, you have all the rights to bitch at GCC for the helpful errors.
 
@R.MartinhoFernandes ahah... that did it.
thank you.
 
It's a ritual. If you bitch enough about the unhelpful errors it will eventually comp... no, wait, nothing happens.
 
@JimNorton The robot knows everything, he's the MAN
 
@ManofOneWay I've seen that to be true. :-)
 
And he's a very kind robot as well
 
6:51 PM
@R.MartinhoFernandes I've used GLUT before, it's not bad at what it's intended to do.
 
@ManofOneWay Thanks.
 
Dammit SO stop logging me out.
 
@JimNorton Yeah, that's true. But you'll see lots of people trying to use it far beyond its purpose.
 
Oh god, now I've got the class definition done, now for the real fun part.
 
hwat is a cairo image?!
 
6:53 PM
@R.MartinhoFernandes It's a great tool for learning OpenGL
 
@ManofOneWay He's the MANROBOT.
 
@JimNorton meh, I avoided GLUT from the get go, didn't want anything to do with it
 
He sure is
 
ah
 
6:54 PM
GLUT is terrible and you will learn nothing useful with it.
 
@R.MartinhoFernandes very helpful, thanks
 
@CatPlusPlus It's not meant to learn anything about it.
@melak47 :)
 
@melak47 My CairoImage class is just going to be a thin wrapper around the Cairo 2D Vector library parts that make up an image.
 
wow, people do know how to communicate: stackoverflow.com/questions/11548287/…
 
6:57 PM
@PatrickBassut Wow, that is just gibberish
 
Anyone mind taking a look at my sidebar at stackoverflow.com/questions/11545316/… (keep scrolling)? My brain hurts from standard lawyering and I want to make sure I've understood it right.
 
@PatrickBassut Looks like someone's resume.
Oh, god, what is this? Is it Standardese Day today? I can't look at it any more.
 

« first day (641 days earlier)      last day (4289 days later) »