Click here to Skip to main content
15,499,430 members

Comments by Rob Grainger (Top 41 by date)

Rob Grainger 21-Sep-16 11:12am View     CRLF
There should be no need - again, the overhead of searching such a small vector is minimal - the card will likely be in CPU cache, and take a minuscule amount of time to find. Obviously, the recommendations change if the item held in the list is large, but that shouldn't be the case here.
Rob Grainger 13-Jul-15 17:29pm View     CRLF
I'm not sure I'd recommend learning db first at this stage. Code first seems to be preferred nowadays and the emphasis of Microsoft's strategy going forward. Version 7.0, currently under development, seems to be CodeFirst only.
Rob Grainger 22-Mar-15 17:13pm View     CRLF
I don't really understand the question. Why should "1 1 1 1 +" return false? It looks to me like the "+" should apply to the last two operands (1 1), resulting a stack like [1, 1, 2]. Your code, as provided, won't compile as its missing contents of "dstack.h".
Rob Grainger 22-Mar-15 17:08pm View     CRLF
I disagree, for a simple task like this, hand-coding should be just fine. Bjarne Stroustrup's "Programming: Principles and Practice using C++" includes a full example of an expression evaluator implemented without Lex/Yacc like tools. A postfix calculator is a doddle by comparison. Its really not bound to fail. Pretty well every C++ compiler uses a hand-written parser, largely because C++ is an utter bastard to parse using automated tools, so in fact the problem domain of a hand-coded parser is always larger than a generated parser.
Rob Grainger 22-Mar-15 17:00pm View     CRLF
It's unclear to me whether you want to... 1. Just check if the speaker is male or female. Or, 2. Respond to commands from both male and female. (2) is a tall order, and I'd look at third party solutions. (1) may just be feasible. My inclination would be to look at FFT (fast-fourier transform) of voice samples and look for characteristic patterns. It may not be that simple though, consider effeminate sounding men, or masculine sounding women.