« first day (560 days earlier)      last day (4614 days later) » 

16:01
When I see XCode I always think it's some porn related thing :P
@TonyTheLion ... great, from now henceforth, ill think that too ... my whole life is a lie ...
lol
Hmmm this is interesting
I have +- 100 abilities that inherit from "Ability", whats the best way to organize them in my project so they are somehow grouped ?
Inheritance went out of favor 10 years ago, haven't you heard? ;)
Anyway, you can group them in namespaces, for example.
Yeah that should work, thanks.
I prefer composition to inheritance but it's fairly convenient in my case.
16:10
What virtual functions does "Ability" have?
Couple, use(), wait(), revert(). (game mechanics related)
Why ?
Dere any better design decision to be made :) ?
I use inheritance on a regular basis. Doesn't mean that polymorphic types are involved every time.
Perhaps this is good time to (re)use the term 'subclassing'? Not really sure.
Mhm, i haven't thought of this all that much, it seemed like a natural thing to do ... the "is-a cliche" applies here fairly well.
I mean things like class iterator: boost::iterator_facade</* ... */> .... This is not about is-a vs has-a vs is-implemented-in-terms-of.
@FredOverflow How would you go about creating many abilities with different effects ? (There are certain attributes that the abilities share, like, most of them deal damage, but there are also many unique traits.)
16:18
@ScarletAmaranth I wouldn't know, never programmed such a game before :)
@LucDanton I find that when coding low-level components non-polymorphic inheritance is quite convenient, whereas for high-level class hierarchies composition is often more appropriate.
@FredOverflow Never have i :-/ Oh well, the best way to learn it is to do it :)
@ScarletAmaranth You can pass a reference to the thing that the ability is being used on to an apply function on the ability
user784668
@ScarletAmaranth vector<Effect>?
which is virtual
if you need to call a parent (common damage function or something) call up the chain.. Ability::apply(entityRef)
16:20
@ScarletAmaranth I would probably go for a system where certain functionality can be inserted at runtime. Decorator and visitor come to mind.
@StackedCrooked You can't compose a boost::iterator_facade though.
Interesting, so having a class Ability with a certain "void applyShit() " and then passing in what effects to apply is a better idea ?
user784668
@ScarletAmaranth certainly better than having a gazillion and two oranges of classes that inherit from Ability.
@ScarletAmaranth Some way to iterate over the current abilities and activate, use or unload them.
16:22
@Fanael It's not all that big of a hassle really.
Have I walked into a 'prefer composition to inheritance' argument?
@FredOverflow I tried my best … but now we’re settled with a fascist C++ …
There is no argument about it :) Composition is preferred to inheritance ^^
user784668
@TomW Yes.
just tried to make a C++ logo. Turned out to be very horrible.
16:23
Decorator is useful if you want to enhance abilities. For example a potion that gives you a 20% speed boost is something that can be non-intrusively added using decorator pattern.
@KonradRudolph doesn't look very modern, but still nice :)
@StackedCrooked That's a great idea, thanks.
You can't prefer composition over inheritance when dealing with e.g. static polymorphism :| That was my whole point.
16:24
@IntermediateHacker Ok now that's bad :)
lol
@LucDanton You don't say! :D
@FredOverflow Well, it woulda been modern in 30’s Germany
@KonradRudolph Maybe it'll be modern again in 18 years then? ;)
16:25
o_O
That is a concerning statement that I'm not sure I want to think about anymore, Fred
that's a pacman and a tic-tac-toe board
C# == C++++. D:
cpx
cpx
16:25
C++++
user784668
C--
C++++ is C += 2 ... not too bad i guess :)
cpx
cpx
++ == + in C++
user784668
We need C&& !
16:26
@TonyTheLion I like the idea
@Fanael that's how C++11 must have been called.
C&&: Move away from C!
C *= interest-rate -> nice accumulation
user784668
@classdaknok_t lol, yeah
Cλλ is also appropriate.
@IntermediateHacker o_O
Dat font.
user784668
@classdaknok_t Or C......
@ScarletAmaranth No, C++++ does not compile, at least not for built-in types, because C++ is an rvalue, but the second ++ needs an lvalue.
wait, I've got it!
16:30
@FredOverflow REFERENCE ALL THE RVALUES!
user784668
@FredOverflow Who said that decltype(C) yields a built-in?
@FredOverflow Define ALL the behavior! :)
@ScarletAmaranth Not even Java defines all behavior.
It doesn't?
data races
16:31
:(
@Pubby no that's good, otherwise C++ would have a con Java doesn't have.
@Fanael No sane C++ programmer would define postfix ++ as a member function.
@FredOverflow Why not postfix as member?
C11 did take over many things from C++.
16:32
@classdaknok_t which clearly is impossible
data race = the race "Data" (the Android from Star Trek TNG) belongs to? :)
There is at least one other such Android, right?
Yah, Ganondorf.
Google slaps me with this and this
@Pubby You normally implement prefix ++ as a member function and postfix ++as non-member function (in terms of prefix ++). That's just the way we roll.
user784668
@FredOverflow Not all programmers are sane.
16:35
@Fanael true :(
user784668
We need IOC++CC.
@Fanael that's called Objective-C++.
user784668
@classdaknok_t Not obfuscated enough.
What does IOC stand for?
IOPerlCC would make no sense.
IOCCC = International Obfuscated C Code Contest.
user784668
16:37
@FredOverflow "International Obfuscated C". So IOC++CC would be "International Obfuscated C++ Code Contest"
Kevlin Henney once said that there will never be an obfuscated C++ contest because "there's no challenge" :)
6
what does "^^" mean?
it's a face :)
16:39
^^ = ^_^
Oh hey, Progress Quest is open source.
oh, pardon me for my unimaginativeness.
user784668
@IntermediateHacker Exponentiation.
@CatPlusPlus I didn't expect that.
user784668
@IntermediateHacker (^^) :: (Fractional a, Integral b) => a -> b -> a
16:39
That's two xors :)
Logical XOR.
And there's web version. Which is also open.
constexpr int O_o(int x, int y, int z) { return x ^ y ^ z; }
This calls for a Haskell version.
@FredOverflow make it constexpr and I'm happy.
16:41
HASKELL! RUN!
Where exactly does constexpr go?
Before the return type.
To a bar.
user784668
echo "constexpr" > /dev/null
SOMEBODY is obsessed with Haskell...
2
16:42
@CatPlusPlus constexpr can only go to a compile-time bar, though...

So two Stack Overflow users walk into a bar...

Mar 6 '11 at 15:24, 29 seconds total – 4 messages, 1 user, 12 stars

Bookmarked Mar 6 '11 at 15:41 by Yi Jiang's Proble_

It's better than compile-time hell.
my main problem with Haskell is that because I'm a nerd, I mumble, and people therefore can't therefore tell the difference between that and Pascal
user784668
@TomW I want to meet SOMEBODY, then.
16:43
Is that Haskell Curry?
Yup, got (a picture of) him hanging on my wall. (just kidding!)
@FredOverflow constexpr functions can be executed at runtime.
@classdaknok_t oh yeah
Alonzo church sounds like a religion.
16:44
@classdaknok_t ROFL
any novel witticisms one can make about Haskell, almost definitely don't apply to its homonym, Pascal - so everyone thinks you're a tard
Why is everyone sharing black and white pictures of people I don't know?
Those are pictures of God.
@IntermediateHacker Have you ever heard of lambda calculus? Even 1 + 2 is insanely complicated in lambda calculus, and the second guy invented it :)
lambda calculus has no "integer literals", right?
16:46
@Pubby who's that idiot?
@IntermediateHacker probably someone who calls himself an idiot. Yeah, it's idiotic.
@CatPlusPlus So, you choose your class and you ... wait for the game to play itself :) ?
@IntermediateHacker one more:
16:47
Like a MMO.
@FredOverflow I never really understood what lambda calculus WAS
I've read the explanation
@TomW You just need to understand that it's awesome ;)
It's math.
but I just thought "Does this concept actually deserve a name?"
16:48
It's got something to do with lambdas.
How'd you refer to it if it didn't have a name?
A calculus is nothing more than a system with certain rules in which you can calculate stuff :)
"That thing with anonymous functions" is a name, too.
(I'm a physicist - I tend to see computability problems as an implementation detail)
Is lambda calculus basically just passing functions as parameters?
16:50
Happy wife, Happy life !!!
@classdaknok_t No.
@classdaknok_t that's one of its practical applications
@CatPlusPlus Is it possible to die in ProgressQuest ?
Do you really have to ask?
I'm just wondering :) But yes/no would be actually a shorter thing to type than "Do you really have to ask?" ;)
16:52
Meh maybe I'll learn what it is in a few years.
@ScarletAmaranth Apparently the question bothered him greatly.
A few years? It takes like an hour or two to understand it at a practical level.
@StackedCrooked Yeah, Cats are known to have weird personalities :)
@Pubby Yeah, if I put effort into it. :P
Also, is there any difference between s and cl in Vim?
16:54
@ScarletAmaranth You better apologize sincerely.
@ScarletAmaranth I agree. They eat chicken, for example. 3:
s is character-wise, it doesn't take text object.
@xeo Am I being dumb or is that just an old compiler that doesn't know that syntax
@SethCarnegie both.
@CatPlusPlus But doesn't cl do a character too?
16:57
Imma play Minecraft so see ya
Does anyone here know why this isn't compiling
Is it wrong or is the compiler too old
@Pubby If you really want to waste keystrokes. :P
c is just more general.
@SethCarnegie If initialising an std::array doesn't work, add more braces.
I.e. go with {{ 1, 2, 3, 4, 5 }}
I'd rather bind s to something more useful and save keystrokes in the long run!
The advice holds for objects that themselves hold std::arrays.
16:59
@LucDanton nope, doesn't work still
same error
Bad compiler then.
What about parens ({}) ?
@Pubby nope
(Also, that looks dirty :S)
@LucDanton ok thanks
Xeo
Xeo
17:00
@Pubby No, that would create an initializer list
Parens + double braces?
Xeo
Xeo
@Luct, can't you try with GCC 4.7?
LISP reinvented.
@Xeo I know double braces are supposed to work, but sure.
17:00
@CatPlusPlus no, lisp doesn't use { }
No kidding.
(Also, not by default, but that doesn't mean it can't.)
Xeo
Xeo
I think it's just GCC 4.5.1 that doesn't support that initialization form yet.
Yeah I know
yep, double braces work.
@LucDanton ok thanks then, old compiler.
Xeo
Xeo
17:01
@LucDanton And single?
@Xeo What is rules with initilizer lists?
@Pubby no one knows
> error: array must be initialized with a brace-enclosed initializer
Xeo
Xeo
Ah, so brace elision doesn't work there.
Oh, hey, I have GHC 7.4 here.
17:03
So do I apparently. Is this good?
Does it support inheriting constructors?
Xeo
Xeo
@Seth, why didn't you change the answer instead? The initializer_list roundabout way is not the best that can be
Type definitions in GHCi!
@Xeo because it's your answer, not mine
Blah, Gimp is such a pain to use. Is there a decent MS Paint for Linux?
Xeo
Xeo
17:05
@SethCarnegie I hereby grant you the right to use your new knowledge to improve your answer :P
@Xeo also what is the picture in your avatar? It looks cool
Xeo
Xeo
If I wanted to post an answer, I'd have done so. All you were missing was to remove the extraneous parens
@SethCarnegie Accelerator from the Toaru Majutsu no Index Universe. :)
Wtf, something grabbed the lock for dpkg et al. but didn't release.
@Xeo will read :)
Xeo
Xeo
@SethCarnegie Please read the Light Novel and don't watch the Anime! :)
The adaption is fairly bad
17:08
@Xeo is the manga also bad? I usually read those instead of watching anime
Xeo
Xeo
The manga is so slow in being released. :/
@Xeo oh, it's ongoing?
Xeo
Xeo
And it's not very far into the story either
The Light Novel is so much further
@SethCarnegie Yep
I didn't know とある means "a certain"
++japanese_level
17:18
@Xeo why do you need two pairs of braces when initialising the member of a struct but not when creating a variable like std::array<int, 4> a { 1, 2, 3, 4 }
@Xeo Keeping it stylish...
Xeo
Xeo
@SethCarnegie The second one relies on brace elision, which is allowed in exactly that situation
You can still use double braces
brace elision...
why have I never heard of that
It's more of a C thing. Up until uniform initialization constructors were common for C++ code.
So in this answer:
16
A: C++ vector of arrays

JohannesDUnfortunately, std::array does not have an initializer list constructor. Indeed, it has no user-defined constructor whatsoever -- this "feature" is a leftover from C++03 where omitting all user-defined constructors was the only way to enable the C-style brace initialization. It is IMHO a defect i...

should std::vector<std::array<int, 2>> vp = { {{1,2}}, {{3,4}} }; work?
the answer leaves it unresolved and I don't have a modern compiler
17:24
I think so. I can give it a try.
Accepted.
Opera has been broken on my laptop for quite some time now and Precise Pangolin has somehow made that worse.
Hey guys. a fast q. Would it be faster to use c++ to bind keys to another key than using autohotkey to do the trick. What I want is when I press a it should press space instead e.g.
C++ to bind keys? What?
Well. I want to make a script which would simulate a space pressed when i press the a key fx.
Just wanted to know if it would be faster to use SendKeys method than using autohotkey to do the trick
17:31
Faster as in?
I have no idea what AutoHotKey is but I think it using it would be faster than doing it in C++
AHK can remap keys in a single line
Or just modify the keyboard layout.
yes but would the response be faster if I used SendKeys
how can i modify the keyboard layout
@CatPlusPlus Don't remind me that I spent several hours yesterday trying to figure out how to do exactly that x_x
17:39
@Chrene Why should it? What do you think autohotkey does? (in fact, it probably doesn’t use SendKeys since Windows has better mechanisms of doing that – namely, you can create custom keyboard layouts)
It probably doesn't create a layout.
It involves creating and registering a DLL and then changing global settings and restarting applications.
0
Q: Variable declaration in the switch head?

Johannes Schaub - litbWhile browsing the code of my friend I came to notice this: switch(State &state = getState()) { case Begin: state = Search; break; // other stuff similar } What is with the variable in the switch header? He is using GCC so I think this might be a GCC extension. Any idea?

what is he pulling here
I like the secret tag
({..}) only works on class types
Sup with those flags (which I've invalidated by the way)?
17:55
@JohannesSchaublitb replied. If it's totally wrong then say so quickly so I can delete it quickly :)
@StackedCrooked A variable definition is not an expression.
So... mine is correct then?
It's sound although I haven't checked the references you provided.
17:58
@LucDanton unless the standard I'm using is a wrong version, I think you'd find them to be correct
@KonradRudolph Is that where they put the kids in the meat grinder?
Oh it's not about that, it's whether they're relevant. I'm not checking because well I think it'd be hard to get that wrong.

« first day (560 days earlier)      last day (4614 days later) »