« first day (494 days earlier)      last day (4463 days later) » 

6:00 PM
I sometimes read TVTropes while watching a film.
 
@RMartinhoFernandes - if it's not design-related, I can code. if it requires a lot of focus, I can't
 
@CatPlusPlus You don't need to focus to read TVTropes.
 
I hate my internet alias name... :(
 
@Olumide why do you need a boost version when there are std:: solutions posted?
 
boost::enable_if takes trait type, not trait value.
AFAIR.
 
6:01 PM
i don't like static if
what about static_if
 
@kfmfe04 I don't have the prerequisite libraries
 
or do we want to introduce "keywords with whitespace in it" ?
 
So, typename boost::disable_if<boost::is_base_of<Bar, T>>::type instead of typename boost::enable_if<!boost::is_base_of<Bar, T>::value>::type.
 
AFAIK MS has patented that for C#
 
Or typename boost::enable_if_c<!boost::is_base_of<Bar, T>::value>::type
(disable_if_c, alternatively)
 
6:03 PM
boost::enable_if<boost::not_<boost::is_base_of<Bar, T>>>::type xD
 
disable_if is clearer.
 
user784668
boost::enable_if_c<false>
 
what's THIS
 
A keyword.
 
youre liying to me!? a keyword is always small
 
6:04 PM
It's a large keyword.
 
I'm still confused :-(
 
About what?
 
std::enable_if is boost::enable_if_c. boost::enable_if<T, U> is boost::enable_if_c<T::value, U>.
 
@JohannesSchaublitb static if is not a keyword, it's two keywords
 
I'm still getting a ton of errors -- okay half a dozen
 
6:07 PM
Well, I'm not.
 
would a simple tag-dispatch work for Olumide's problem?
 
@CatPlusPlus can you please clone my code?
 
We can still be guessing, or you could finally post those errors.
 
Lol, I just now realised I've fixed Dietmar Kuhl's post then.
 
6:09 PM
@MooingDuck wait, really!?
 
@JohannesSchaublitb it's two words, it seems obvious to me. It's possible I'm mistaken
 
but I think it is ugly!
 
@JohannesSchaublitb There's a lot of ugly in C++, static if is actually rather neat
 
I've posted my latest attempt to ideone.com/Z9Cpm
I'm still very new to templates :-(
 
boost::is_base_of<Bar, T>::value should not have ::value.
 
6:13 PM
oops - ng - fixing
 
@CheersandhthAlf my bad - closed the tab by mistake!
 
user784668
@Shog9 You know you didn't have to open it again, don't you?
 
@Fanael what fun would that be?
 
@kfmfe04 your solution is a lot less convoluted! :)
 
@Olumide but not working - trying to fix atm
 
6:18 PM
Thanks. BTW, here's my latest version ideone.com/Z9Cpm
 
And not working because?
 
I honestly don't know. As I said, I am still quite new to templates. Still reading the book.
 
Errors. Post the errors.
 
enable_if is right up there with the harder templates to use/understand
@CatPlusPlus they're in the link
@CatPlusPlus prog.cpp:10: error: ‘enable_if’ in namespace ‘boost’ does not name a type
 
Where?
 
6:20 PM
@CatPlusPlus below the code?
 
Those are ideone errors, there is no Boost on ideone.
 
@CatPlusPlus it seems to have included the header just fine
 
boost::enable_if is on <boost/utility.hpp>.
 
Anyway, enable_if is not part of <boost/type_traits>, you need <boost/utility/enable_if.hpp>.
 
@CatPlusPlus ideone has boost for GCC 4.3.
 
6:23 PM
@CatPlusPlus here you go:
`BaseClassSpecialization.cpp:10:53: error: ‘::type’ has not been declared
`BaseClassSpecialization.cpp:10:51: error: ‘>>’ should be ‘> >’ within a nested template argument list`
`BaseClassSpecialization.cpp:15:54: error: ‘::type’ has not been declared`
`BaseClassSpecialization.cpp:15:52: error: ‘>>’ should be ‘> >’ within a nested template argument list`
 
Fix the missing include, and the >> error tells you what to do.
 
@RMartinhoFernandes Thanks!
 
Guys, Question!!!! can std::integral_constant be used for enumerations?
 
@JohannesSchaublitb thats a good question! I'd assume so...
 
6:33 PM
You mean integral_constant<my_enum, my_enum::value>?
 
@RMartinhoFernandes yes exactly!
 
I don't remember seeing any restriction on the type parameter. I'd have to double check, by I think the answer is "yes".
Nope. No restrictions.
 
sometimes you have to face it
1
A: template argument deduction with strongly-typed enumerations

Johannes Schaub - litbI'm sorry, I have to tell you that It is not possible Take the macro, put it into a scary named header and protect it from your colleague's cleanup script. Hope for the best.

lol
 
@JohannesSchaublitb ideone.com/zPAI9
 
6:37 PM
@JohannesSchaublitb Ah, but that's not the same.
namespace std {
    template <class T, T v>
    struct integral_constant {
        static constexpr T value = v;
        typedef T value_type;
        typedef integral_constant<T,v> type;
        constexpr operator value_type() { return value; }
    };
    typedef integral_constant<bool, true> true_type;
    typedef integral_constant<bool, false> false_type;
}
The standard only gives this.
 
@RMartinhoFernandes lulz
 
Anyone know about C# Dictionary<>?
 
@Xaade Yeah.. a little
Btw hi guys
 
6:38 PM
Hi.
 
i can say that at least two peoples do
 
@Xaade me!
Use them a lot for tile mapping in 2d games.
 
3 ppl are "available" lol
 
Is it ok for Factory classes to have arguments to decide which objects to create?
 
@LewsTherin sure
 
6:41 PM
@LewsTherin That sounds useful.
 
@LewsTherin isn't that a major reason for a factory class?
 
@LewsTherin i think that's called an "abstract factory"
they are used to configure and create the actual factories
 
I had it in my code and my lecturer had me change it. Totally confused me
 
like you have a WordProcessorFactory and then have it have functions createPresentationFactory, createCalcFactory, etc
 
@JohannesSchaublitb Well, no I don't do that
 
6:42 PM
@LewsTherin that probably has less to do with having arguments and more to do with you making a mistake
@JohannesSchaublitb I don't think that's right, that'd be like a "meta" factory
A factory factory!
 
Are we talking about Java?
 
That's silly factory.
 
@MooingDuck Nope, he left the function as it is and removed the arguments..
 
i thought that's an "abstract factory'"
 
Have you ever seen a factory producing another factory?
 
6:43 PM
There is factory and abstract factory
 
@LewsTherin I stick by my statement
@JohannesSchaublitb I checked google, you're right
 
@LewsTherin Erm, and what happened to the code that used those arguments?
 
@IntermediateHacker half of us are
 
6:43 PM
@RMartinhoFernandes Read them from a file
 
@LewsTherin either you're instructor is a moron, or (more likely) you had something wrong with your code
 
Mine is definitely not an abstract factory
 
@LewsTherin Maybe reading them from a file was a requirement that you missed?
 
@MooingDuck Or most likely, both.
 
All I do is take in the argument compare with a string to see if it matches then returned the object
@CatPlusPlus Ta better to read from a file as opposed to passing in values.
 
6:46 PM
patternspatternspatternspatternspatternspatternspatternspatternspatterns
 
So many bloody patterns! xD
 
@LewsTherin were you getting the parameters from the command line or cin?
 
@MooingDuck Something like that
 
@LewsTherin blood and bloody ashes
 
@MooingDuck xD
 
6:47 PM
OK it seems I wasn't right
 
@LewsTherin see, that is what was wrong. Not the factory taking parameters.
 
Mother's milk in a cup!
 
@MooingDuck You lost me
The value from the "cmdline" was passed to the factory parameter
 
6:49 PM
0
Q: Advantage of deriving external class from IEqualityComparer<> over overriding GetHashCode and Equals

XaadeI'm need to hash against a member variable instead of the class, so I don't check if the reference is in the dictionary. HashedType { public object Value; public void Serialize(Serializer s) { if (Value.GetType() == typeof(Int32)) { s.Set<Int32>(0); ...

 
@LewsTherin you shouldn't take program settings from the commandline or standard input, they should be read from a file.
@LewsTherin the factory can take parameters, that's fine, but the program should get them from a initialization file.
 
So what's the point of a factory having parameters
Btw I didn't say a command line exactly - I said something like that.. I assumed it was similar..
What of input from a user interface? Like based on the input allow the factory to decide what object to return
 
@LewsTherin The factory can have parameters. If main reads the settings from a file and passes them to the factory, that's totally fine
@LewsTherin generally, settings should be in a file. (I'm going with the assumption this was justified and the teacher is not a moron)
 
@Lews @Inter No ideas?
 
@MooingDuck More likely. So what if I had to decide what object to return from user input or query strings.. what pattern should I use?
@Xaade Sorry none.. I should have known it would be a complex question :D
 
6:54 PM
@Xaade I'm writing an answer, but this part is confusing me "I'm need to hash against a member variable instead of the class, so I don't check if the reference is in the dictionary."
 
@LewsTherin if it needs to come from user input, then that's fine, it's just program settings that should be read from a file
 
@RMartinhoFernandes I'm sorry. I mean, right now, without any work done, it's checking against object reference. So if I have a new object with the same "Value", it won't find it.
 
@MooingDuck That's a little confusing.. what do you mean by program settings as in width height?
 
It's not a factory responsibility to read any files.
 
6:57 PM
> The copyright for the Thai example is owned by The Computer Association of Thailand under the Royal Patronage of His Majesty theKing.
 
@LewsTherin as examples, yes. I don't know if your parameters count, because I have no idea what they are.
 
Is that Thailand thing for real? (Also markdown sucks)
 
@MooingDuck No they're not program settings.. the parameter decides whether data should be read from a particular object.. though the data can be read from any of the objects at anytime depending on the selection.
 
@LewsTherin then how did the instructor make it read that from a file?
 
1h30 left before my exam.
 
7:00 PM
@Pubby Theking is a weird name for a royal, but this is Thailand.
 
lol
 
@MooingDuck The initial problem was how I could get a single database object. He used that with a file. But the next problem cannot be read from a file.. so I was thinking if exceptions can be made - hence me asking the problem..
Did that make sense ha ha
 
@LewsTherin yes, different parameters should be treated differently. The database isn't something to ask the user about. But (obviously) not everything can come from files. Generally, if it can come from a file, it should, if not, it (obviously) can't.
 
@Xaade Answered it.
 
@RMartinhoFernandes accepted it.
That makes sense.
 
7:05 PM
@MooingDuck Ok thanks, I will show her again. I want to see what she's going to say. It's hard applying software engineering to code :(.
 
All MSDN did was tell me how to use a comparer, I dug a lot to find out you can override the methods in the class. I wondered why MSDN didn't mention overriding.
 
Btw, can anyone explain how a Bridge is different from a Strategy Pattern (Which btw is straightforward).. I can't see how Bridge is different though apart from the algorithms aspect
 
@Xaade Somewhere out there it mentions that the default comparer uses the overriden methods.
 
@LewsTherin Because apparently you can build a bridge to nowhere, and that's not a good strategy.
 
@Xaade Lost me there...
 
7:07 PM
Whether that information is in the best place is another matter.
 
huh
 
Oh, what's the status of the DF game, is @MooingDuck next in line?
 
@Pubby was I in line? I installed Dwarf Fortress because I was interested
 
Do you want to be in line? (you can get around ODR if you do!)
 
@Pubby I posted everything here: loungecpp.wikidot.com/df-game-2. Whoever wants to take the next turn can do so.
 
7:15 PM
Yeah, I just wasn't sure who was going next
 
@Pubby you guys are on a far different time schedule than I am, it'd take me forever to get to it
 
Do you guys have any dark background schemes you use with vis studio?
 
@MooingDuck So that's a no? Maybe some people from gaming.se could play.
 
@LewsTherin I used this to make mine: frickinsweet.com/tools/Theme.mvc.aspx.
 
@Pubby Yeah, I guess I can do it. It might take me a few days, but I'll aim for 48 hours.
 
7:18 PM
@RMartinhoFernandes Thanks a lot. That's very very helpful!
 
@MooingDuck So that's a yes? Great! The time doesn't really matter as long as it's within a week.
 
@Pubby unless that's too long and someone else wants a shot
 
@RMartinhoFernandes Whoa, DF is prettier than I thought.
 
cpp2.tar.bz2.tar.bz2? Odd file name
@EtiennedeMartel replaced graphics
 
@EtiennedeMartel Those are not the standard tiles.
@MooingDuck No, it's just cpp2.tar.bz2.
 
7:20 PM
@RMartinhoFernandes not according to chrome's downloader
 
IMO best tileset is paul_10x10.png. Graphics seem to ironically lose information
 
Your browser is playing tricks on you.
 
@daknøk where is that from?
 
@EtiennedeMartel loungecpp.wikidot.com/df-game-1 used the default textures it looks like
@RMartinhoFernandes so long as I can open it: don't care
 
No, the default ones are rectangle
 
7:21 PM
@RMartinhoFernandes why aren't page 1 and 2 linked?
@Pubby well, that comes with the game at least
 
@MooingDuck Oh, I only linked in one direction.
 
@Pubby it's the same one I'm using :D
@RMartinhoFernandes oh, there's the link
 
@MooingDuck Oh, I downloaded it off the wiki.
 
@RMartinhoFernandes The succession game might need a summary/main page
 
@MooingDuck Yeah, this looks like someone pissed in my eyes after eating spicy stuff.
 
7:25 PM
@EtiennedeMartel you get used to it really fast actually.
eh, this might be interesting. Year 2 ends with: "The militia needs proper headquarters for training, and a proper hospital. " I haven't yet learned the military/hospital stuff, that was introduced after I stopped playing.
to the wiki!
 
Mind if I reorganise those pages for you a bit?
 
@MooingDuck I set up a makeshift hospital to heal Huffman McUrist. If you look at the "zones" (i) you can see it on the bottom part of the dormitory.
 
@CatPlusPlus The DF pages? Feel free.
 
@RMartinhoFernandes what's your tileset?
 
7:31 PM
@MooingDuck Phoebus.
 
Too bad Wikidot doesn't allow to nest categories deeper. Oh well.
 
Ah, mayday was the one I used to use. Found it, it's just not on the DF wiki
 
@CheersandhthAlf I wouldn't say unfalsifiable... The point of new "out of the box" theories like MOND and of course M-theory (that's what the kids are calling string theory these days) is to first "reduce" to what is known to be correct, and if possible make a prediction or describe some sort of problematic phenomenon correctly (or at least more correctly than the current, most accepted theory). Often symmetries are used to derive new theoretical principles, to great effect.
 
Ell
hi guys
does a library exist that can parse text using EBNF such as one exists that matches text using Regexs?
 
I've added autonumbering and breadcrumbs!
 
Ell
7:47 PM
you know how grammars can be described with an FSM?
 
evening!
 
Grammars?
 
How goes it everyone?
 
Also most if not all parser generators use EBNF.
 
@RMartinhoFernandes hmm, Phoebus seems to be one of six updated in the last 1.5 years, and is the only one of those with a modified RAW.
 
Ell
7:50 PM
@CatPlusPlus but is there something that can generate a parser at runtime given an EBNF?
never mind, I'm talking out of my bottom
 
Probably.
 
parser generator generates a parser at runtime using EBNF no?
 
Ell
yeah :L well I just thought I have never actually tried to generate a parser so I thought I should actually do some research first :L
 
But there is little reason to use that, unless you want to hot-swap grammars, and only do generic stuff like printing the resulting parse tree.
 
@sehe an relationship diagram I made.
 
Ell
7:51 PM
@CatPlusPlus how about richer regexs?
 
In computer science, a compiler-compiler or compiler generator is a tool that creates a parser, interpreter, or compiler from some form of formal description of a language and machine. The earliest and still most common form of compiler-compiler is a parser generator, whose input is a grammar (usually in BNF) of a programming language, and whose generated output is the source code of a parser often used as a component of a compiler. Similarly, code generator-generators such as ([http://jburg.sourceforge.net/ JBurg]) exist, but such tools have not yet reached maturity. The ideal compiler-...
@Ell read this
 
What about them? If anything, you'd want to simplify PCRE regexes into something that is actually regular.
 
Ell
I have read about them, but haven't got any first-hand experience so there are probably compiler-compiler specific things to think about? Like Bison (is that it?) doesn't take pure bnf does it? It has C mixed in?
Well I mean that could be a use for a runtime parser generator library
 
Why do you want to generate parser at runtime?
What do you hope to achieve with that?
 
Ell
Well it's all in my head at the moment, but like, if something can't be done with a regex
just use a BNF instead, in the same way you would use a Regex.
 
7:55 PM
Then you generate a parser. Doing it at runtime doesn't buy you anything.
 
Ell
How about if you don't know the grammer/bnf/regex/whatever in advance?
 
@CatPlusPlus it buys you faster compile time.
 
Marginally.
@Ell Corner cases.
 
Ell
@CatPlusPlus yeah, it just sounds like an interesting project
 

« first day (494 days earlier)      last day (4463 days later) »