« first day (486 days earlier)      last day (4448 days later) » 

user784668
5:00 PM
@TonyTheLion Yup.
 
@TonyTheLion "similar" yes
 
ok cool
 
Would someone kindly help me with this error:
 
@Olumide can't use [] on a const map. Gotta use find or lower_bound
[] alters maps
 
:-(
 
5:02 PM
With C++11 there's at.
 
user784668
@MooingDuck Or at.
 
@Fanael oh, forgot maps had at. k
 
at what?
 
std::string t = Foo::myMap.at(2);
 
user784668
@Olumide A method called at. some_map.at(some_key);
 
user784668
5:03 PM
It throws an exception if not found.
 
@LucDanton oh, if it's C++11, that explains why I didn't konw about it
@Fanael correct. For non-throwing, use find
auto iter = Foo::myMap.find(2); if(iter != Foo::myMap.end()) {
 
user784668
@MooingDuck Wrong.
 
The order of parameters of std::is_convertible<From, To> is confusing when compared to std::is_constructible<T, Args...> and std::is_assignable<Lhs, Rhs> D:
 
@Fanael that happens
@LucDanton yes
 
user784668
@MooingDuck Unless something changed, you cannot declare a variable inside parentheses.
 
5:05 PM
at doesn't work in MS VS2008
Is there an at in Boost?
 
@Olumide at is C++11, VS2008 doesn't has very little C++11. Use find
@Fanael meh, simple solution
@Fanael it's frequently in a for loop, so I never noticed that rule
 
user784668
@MooingDuck But that's a for, which behaves differently from an expression.
 
Uh, is it not possible to overload constructors on explicit? I'm confused. My non-explicit constructor is getting called and I only have direct-initialisation.
 
//There's probably errors here
template<class K, class V, class C, class A>
V& at(const std::map<K,V,C,A>& m, const K& k) {
auto i = m.find(k);
if (i == m.end()) throw std::out_of_range("key not found");
return i->second;
}
@LucDanton make it explicit and the compiler will tell you where
 
user784668
@MooingDuck std::out_of_range
 
5:10 PM
@LucDanton more likely the compiler things the non-explicit is a better match
@Fanael got too lazy to look it up
 
@MooingDuck Yep, those are templates for bonus fun.
 
@Fanael makes sense
 
Now it's ambiguous. Meh.
 
@LucDanton that's improvement
 
Salut tout de suit. :)
 
5:14 PM
"error ... cannot be overloaded" if I uncomment a SFINAE-ish related type computation. Great.
I guess explicit overloading works for non-template constructors.
Alright, you cannot overload on explicit alone at all.
That's not super ultra convenient for generic code I think.
 
@LucDanton are you sure? @LucDanton
 
user784668
@DzekTrek Merde
 
I only checked what the compiler accepted, not what the Standard says.
 
@MooingDuck @Fanael Comment ca va, mon amis? :)
 
user784668
5:20 PM
@LucDanton Works for me.
 
@Fanael Test case + compiler?
 
what compiler are you using? @LucDanton
 
Snapshot of GCC 4.7.
 
user784668
@LucDanton Oh wait, I misunderstood.
 
5:23 PM
Thanks guys!
 
@sbi depends. most often, whether for learning or for professional development, it is counter-productive to strive for the 100% ideal when one has a solution that works. for professional development it hurts economically, for learning motivation suffers greatly from lack of progress. just my 2c.
 
@MooingDuck NP using translate google ( moreover I use it all the time ), that's the first step towards learning some language, and I don't mean programming one.
 
@DzekTrek I have no real interest in French
@DzekTrek I just amuse myself occasionally with google translate :D
 
@DzekTrek wat
 
user784668
5:27 PM
@DzekTrek Ich denke, dass du aufhören zu vorschützen sollst.
 
user784668
@AlfPSteinbach In short, worse is better.
 
@MooingDuck That's nice too. ;) @Fanael Auf welcher erorterung? @LucDanton it seems you were right.
 
@DzekTrek nuq Hol 'oH vam?
 
user784668
@MooingDuck Is it Klingon? Looks very much like it.
 
@Fanael yeah, hard to find a klingon translator on line
 
user784668
5:46 PM
Okay, gotta go. See ya.
 
@awoodland What's a NARQ?
@LucDanton C++11 is where it's at!
 
I can't disagree with that.
Jan 1 at 9:49, by Luc Danton
Debian-based + gcc-snapshot. Bleeding edge C++11 is where it's at.
 
Didn't know about the throwing at. Nice!
 
mawning
 
mawning
 
6:00 PM
hi
So what kind of romantic adventures did you experience today?
 
euh, none
I had semi romances with LL(1) parsers and Lua.
LOL
 
lol
LL parsers are pretty trivial towrite
 
so is lookahead always 1?
or can it be any number?
 
any
 
ah right
 
6:03 PM
there's even LL(*), so i.e., unlimited lookahead
but at that point, it gets kind of silly
 
what does the LL stand for again?
Left-Left?
 
lookahead left-most
LR being lookahead right-most
 
ah, left-most derivation?
 
yes
 
right
 
6:04 PM
actually, Wikipedia says left as in left-to-right, as in reads the input from left to right
oh well
 
so in a context-free grammar, the context is referring to what ?
the thing you're parsing?
 
previous reductions
when you say context-free, then what that means is that you are perfectly fine to know what you've already seen where you haven't matched it to any rule
but anything that has matched a rule is "context"
so when you say "I know this identifier is a type name because I previously matched the type definition syntax with this identifier in it", that's context sensitive
and when you say "I know this close bracket closes the parenthesis because I've got an unmatched open bracket" then that's context-free
 
because you can deduce it from something already previously matched?
 
no, because you've got the open bracket which is unmatched
let me put it another way
the first requires that you know which identifiers are which, e.g., you can't just go "Identifier", you have to know which identifiers
 
now, when you're parsing, you're taking the language grammar and seeing that the expressions are valid patterns according to the specified grammar, right?
 
6:12 PM
if I say x* y; then you have to know specifically for x whether or not it's a type name in C++
not just identifier in general
that's context-sensitivity
 
@TonyTheLion The whole input, not just expressions.
 
so x has to be identified
 
right
 
in it's context, before x * y can be parsed
 
6:13 PM
the parser has to have the context- what is x and whether or not it already matched typedef int x; or int x;
 
ah I see
 
whereas in Java, say
because you don't have * as a type modifier
it doesn't need to know what the identifier is or what rules it's previously matched containing that identifier
x y; is, and can only ever be, a variable declaration
 
now, does the parser take the grammar and replace its non terminal symbols with the input you've given it?
right
 
no
the parser neither knows nor cares what the non-terminals actually mean, and it doesn't give you the input back
in the most basic case, the parser only says "Match" or "Doesn't match" for the grammar
 
let's say you have if(x == 5) then it will match the if ( <expression> )
 
6:15 PM
but for all realistic parsers, then you write semantic actions which dictate what the parser does when it finds a given non-terminal
 
so in this case, the if is a terminal, and the <expression> is the non terminal
@DeadMG those are the rewrite rules or productions?
 
( and ) are terminals too
 
@TonyTheLion production == non-terminal
and I've never heard of rewrite rules
 
@DeadMG mentioned in the wikipedia page for productions
 
6:17 PM
I'd guess rewrite rules are productions.
 
@DeadMG oh, I thought, I understood productions to be the rules for transforming a non-terminal symbol to a terminal
 
oh
those are only significant for things like Turing-complete (naaastaay) and context-sensitive grammars
they're not relevant for context-free grammars, which is the only kind you want to handle
 
C++ has a context sensitive grammar right?
 
yes and no
 
6:18 PM
ah, so that's more difficult than an context free one?
 
@TonyTheLion much
 
remember that whilst C++'s grammar as a whole is rather context-sensitive, there are large, if not the majority, which is context-free
 
It's more difficult than most grammars out there.
 
so whilst I just told you about a part which is context-sensitive, it's not actually that difficult to resolve
 
@TonyTheLion "most vexing parse"
 
6:19 PM
yea, well C++ has some fairly complex constructs to parse I guess
 
and usually, people factor out context-sensitive parts and just insert some special handling code for it
and then use a regular algorithm like LR or LL to handle the rest
 
@MooingDuck That's just ambiguous and has nothing to do with context-sensitivity
 
interesting
 
but you're parsing Lua, right?
 
6:19 PM
I don't know, GCC's parser is hand-written, I think.
 
@DeadMG I know nothing!
 
Dunno about clang.
 
so when are the non-terminal symbols replaced to terminal symbols, is that part of th e parsing process?
@DeadMG I'm merely trying to understand parsing in general
 
there's no replacing going on
forget replacing anything
all a parser does is go "Well, that matches this rule here, so execute semantic action."
 
ah, so it's merely, matching
 
6:21 PM
Production can result in any number of terminals and non-terminals, but must go from a single non-terminal.
 
@TonyTheLion Usually the parser builds a tree structure of some sort that matches the grammar more or less, for the compiler to play with.
 
hmm, but the parser itself doesn't care about semantics, that's the compilers job I guess
 
Well, it's replacing if you generate words using grammar.
 
yep
 
Parser is part of the compiler.
 
6:21 PM
@CatPlusPlus ah
 
@TonyTheLion That's why they're called semantic actions :P
 
yea, just wanted to confirm my thinking
 
You probably want parser to just construct AST and later operate on that.
 
@CatPlusPlus is there an example of a C++ construct which is like this?
 
What construct?
 
6:22 PM
@TonyTheLion No.
 
I'm not quite sure what you meant with that statement
 
Well, grammar describes a language.
 
that would be e.g. search and replace using regular expressions, for example
you would have to start modifying the source text
the preprocessor does that
 
You can use grammars to parse existing texts, or to generate new ones.
 
right, so not all parsers generate new strings
 
6:24 PM
Parsers never generate new strings.
 
this is what I'm confused about
In formal language theory, a context-free grammar (CFG) is a formal grammar in which every production rule is of the form :V → w where V is a single nonterminal symbol, and w is a string of terminals and/or nonterminals (w can be empty). The languages generated by context-free grammars are known as the context-free languages. Context-free grammars are important in linguistics for describing the structure of sentences and words in natural language, and in computer science for describing the structure of programming languages and other formal languages. In linguistics, some authors u...
 
there's nothing specific about parsers and generating new strings at all
most of the time they generate syntax trees
 
because in here, under "Formal Definitions", rule 3 seems to indicate something is being replaced
 
@TonyTheLion Forget the theory. It's a crock of useless crap, most of which has absolutely no relevance to real parsers.
 
lol
but I like theory :P
 
6:25 PM
in this case, it's not much good
 
You've got an example of deriving a correct word described by the grammar.
 
so how the heck does one understand this stuff if you can't go by the theory?
 
S → aSa → aaSaa → aabSbaa → aabbaa.
 
@TonyTheLion Download a parser generator.
 
Bison?
 
6:26 PM
that would be a good start, since it's LR (more powerful and more flexible) and I'm (fairly) experienced with it
are you on Windows or Linux?
you'll need to use Cygwin if you want to use a reasonable version of Bison on Windows
 
Windows
 
Bison for Windows is about a decade old, if not older
so I'd advise against it, personally
 
Cygwin one works fine.
The generated code doesn't depend on it.
 
hence my recommendation of using Cygwin
 
6:32 PM
and yes, the generated code is completely platform-independent
 
wow
cool
so is compiler theory part of any CS degree ?
 
we did a little bit of it
utterly worthless though
one of the main things I disliked was that at the time at which I was struggling with my Wide grammar, I was doing LR parsing as part of my degree, and it helped exactly nil
the realistic fact about LR parsing is that if you don't have an ambiguous grammar, you won't have a problem, and designing an unambiguous grammar is not part of an LR parsing course
 
so there's nothing genuinely helpful about knowing the ins and outs of LR
 
lol
just do it, is your theory?
 
6:38 PM
oh yeah
especially if you've already got a working grammar from the Lua specification
then it should be a real piece of cake to convert that into a Bison parser
 
right
 
@DeadMG I've actually used parsers a few times. Glad I learned it.
 
I do think that understanding how it works, is helpful
 
what, even though you've never done it?
 
well, no, doing it helps understanding it
It's too abstract to just learn and never do
 
6:41 PM
the LR algorithm, and LR parsers, is full of void* and goto and such ugly things
 
not the kind of thing you want to get into
best to treat it as a black box
if you don't have a fundamentally ambiguous grammar, LR will cope just fine
 
right, I just want to understand the high level concepts of how parsing works, not the low level details
 
LL and LR have pretty different inner workings
LR works by saying "Push shit on stack. Does shit match rule? Yes? Take shit off. No? Error." as a general simplification
and LL works by saying "Push expected shit on stack. Does found shit match expected shit? Yes? Take expected shit off. No? Error."
the problem with LL's approach is how to decide which shit is the expected shit
 
@DeadMG but it's really easy to code
 
6:48 PM
a decision which, in many cases, is impossible
@MooingDuck Oh yeah :D
 
Arg! Why does chroot have to have restricted permissions? :(
 
whereas LR can defer the decision of which rule to match until after all the shit is pushed on the stack
so it can look at the whole contents of what it's found when deciding which rules to look at
 
And again the damn JavaScript this.
What a brain-dead "feature" this is.
 
lol
 
lol
 
6:53 PM
Not that I'm actually "laughing out loud", but yeah…
 
surely, you mean "What a brain-dead "feature" this is."?
 
lol
 
Maybe I should be writing in Haskell and compiling it down to JS.
 
hey right now Im using c++ to open a UDP socket that listens for incoming data....the devices then report to the server, and the server interprets the packets and puts them into the database. Is there a way to bypass this server load and have google handle it?
 
What?
 
6:56 PM
Has anyone tried to write a is_implicitly_constructible or is_brace_constructible trait to check that a type T can be constructed from { u, v, w }? I remember some people talking about that here, perhaps RMartinho and @Xeo?
 
@CatPlusPlus did I not make sense?
 
Yes. What do you want Google to handle? Your application?
 
instead of the c code handling data and interpreting, have google do it
for google maps api
 
@JohnMerlino you'll have to give a lot more detail to what you're doing for us to help. As such, it goes here
 
what kind of detail you looking for?
thats why i dont ask on main forum if i will only get downvoted with vague question
 
6:59 PM
No, you can't get Google to interpret arbitrary UDP packets you send to an unspecified server of theirs.
 
@JohnMerlino If you have a vague question, just asking it here instead isn't going to help you. You need to fix your question.
2
 
You could write your server in one of the languages supported by AppEngine probably.
Other than that, the question simply doesn't make sense.
 
the code opens a UDP socket that listens for incoming data and then interprets packets and stores them in database. The devise is a gps tracking unit. I want google maps do handle this server load instad.
what is vague about this?
 
what the hell you want Google to do about it
it's your problem
 
i dont want the servber load
i want google servers to handle load
 
7:02 PM
I'm sure if you pay Google enough, they'll be happy to write and deploy something for you.
 
we got that far
but I also want a hot sexy girlfriend and it's not going to magic itself out of thin air
 
Who doesn't.
 
I dont want to pay google anything. I want them to do it free
 
@JohnMerlino and I want a pony
 
7:03 PM
they dont need to write the code
 
sbi
@AlfPSteinbach In principle, I agree, but I have learned that, when teaching C++, the anything-that-works attitude of some students usually leads to UB.
4
 
How thoughtful.
 
so basically
 
@JohnMerlino they won't run your code either
 
you want Google to wave their magic wands and do it for you?
 
sbi
7:04 PM
@CatPlusPlus Raises hand.
 
@sbi Liar.
 
so there's no alternatives I have here?
 
is there a way to disable the ping noise? In another room a guy is complaining that I ping him too much, but I'm not going to remember to stop
 
interpreting packets must be done on MY server?
 
@JohnMerlino run it yourself; yes
 
7:04 PM
yes
yes, doing your work must be done on your server
why is this a surprise or big deal?
 
@MooingDuck Next to "all rooms" in the upper left corner.
 
how do others handle server load?
 
by hosting their own servers and paying for it
 
Or paying others to host their servers.
 
or paying a cloud service or hosting company to do it
 
7:06 PM
Reality check: in this world, you won't even be mugged for free.
 
sbi
@CatPlusPlus No, really, what would I want a hot sexy girlfriend for? I'd much rather have a caring, loving, loyal, faithful woman to get old with. <insert outer shell citation here>
4
 
@sbi but in the meantime...
 
I want the devise to report to google rather than my server
the verdict here is its not possible
 
@JohnMerlino We already got that point. Try injecting a little realism into your expectatons.
 
@JohnMerlino sorry, google won't run your arbitrary code for you
@JohnMerlino correct
 
7:07 PM
oh, it is possible, I think
if you pay Google an arm and a leg
same as Microsoft or Amazon
 
@DeadMG oh, it's probably less than a thousand USD a year
 
depends on how much load you're talking about
 
@sbi The age-gap in this chatroom shows... :)
 
sbi
@MooingDuck You forget that I am an old fart, have more kids then many here had girlfriends, and have had enough meantime. By now I want a final solution to this problem.
@Mysticial Indeed.
 
Well, truth is I'd be happy to have one that actually exists.
 
7:09 PM
@sbi well sure. I'm 25 and I want that. But a hot sexy is better than alone.
 
That counts as having a standard, right?
 
@sbi luckily my hot sexy is caring, loving, loyal, and faithful :D
 
sbi
@MooingDuck Well, "hot and sexy" does not necessarily equal "horny", but often, equals "bitchy".
2
@MooingDuck LOL!
 
I cant believe what I am trying to do is not possible
 
@sbi I like my women with a little spice.
 
sbi
7:10 PM
@CatPlusPlus Since you cannot have much fun with a gf that doesn't exist, this should go without saying.
 
@JohnMerlino it might be, but we're missing the details to say for your specific case. In general, it's not possible
 
Just another reality check.
 
@JohnMerlino Of course it's not possible to get someone else to do your work for you for free.
 
they dont need to do work
I just want their server to take load
 
That costs money, too, you know.
 
7:11 PM
which is work
 
Also, you can, there's AppEngine for that.
 
they have to maintain, and cool that server, and pay for the hardware
 
sbi
@MooingDuck There's a lot of possibilities to add spice to a relationship that threatens to become dull. OTOH, it's nearly impossible to tone down the bitch at your side once you two have passed 35.
 
@DeadMG and the sysadmins, and R&D, and accounting....
 
all of that good stuff
 
7:16 PM
never heard of this before
is that just cloud hosting?
something like terremark?
 
actually, Google's AppEngine gives a lot of resources for free (for a one-person doohicky)
 
hmmm
 
@JohnMerlino code.google.com/appengine/docs/quotas.html has the relevant info, but I don't understand several of the resources involved
 
thanks for resoponse
 
7:31 PM
Why does this chat only work with scripting enabled for sstatic.net?
 
CDN?
ask on Meta
 
@StackedCrooked My PC got infected with a trojan horse. Don't ask me how, I didn't do anything nasty!
 
SO serves all static content through that domain.
And JS is static content.
 
@FredOverflow Did it come with chocolate?
 
Chocolate trojan horse. Burns down your city and makes your teeth go bad.
 
7:39 PM
@StackedCrooked Neither chocolate nor roses, just money claims.
Luckily I still have enough Linux skills to restore old images in a matter of 2 minutes.
But I got chocolate for my roommate. Hope she likes it :)
 
Ah, hitting on your roommate?
Fail! Belgian tabloid reports that Whitney Houston reunited with her ex. (The edition was printed on Friday and distributed today.)
 
7:55 PM
hi all! :)
 
sbi
@StackedCrooked Oh, is he dead, too, then?
 
@DzekTrek Nope, nope, nope!
 
Again deaths of people I should know about, but really don't?
 
@StackedCrooked Where? :| :P
 
7:58 PM
set_locked, for one.
 
@CatPlusPlus You shouldn't.
 
Also __shLockVector_H__ is invalid.
 
Inheriting std::vector publicly for second.
 
You probably want locks at higher level than container itself.
 
the fastest way to implement function behavior of such aspiration. @CatPlusPlus
 
7:59 PM
You should use ThreadSafe< std::vector<int > (It's in my Futile library :p )
 
Unless writing and reading from it is really the only thing that's happening.
@DzekTrek Eh, what?
 

« first day (486 days earlier)      last day (4448 days later) »