« first day (587 days earlier)      last day (4360 days later) » 

4:00 PM
Until it gets two stars.
 
:) no more starring now
 
@RadekdaknokSlupik Exactly what I was just thinking and did.
 
:(
Lexer works. Now I need to write a parser. :(
 
Ooh! Compiler design!
 
Weekend!
Well, I'll have to take my work with me
 
4:02 PM
How do compilers manage to provide useful diagnostic messages at different stages? How do they know where an AST node lives in the source?
 
@Maxpm Where? What? Who?
@Maxpm Ermm... because they keep track of it?
 
even I knew that :P
2
 
@Maxpm clang saves about everything it finds in the AST. In the past it even stored comments in the AST. And tokens have source location information (file, offset, row, column).
 
@RadekdaknokSlupik Yarr looks like it works :-)
 
@RadekdaknokSlupik Wow. o_O
 
4:03 PM
@DeadMG lol
 
go on, star it, make me look like a numpty
 
AST ? Atlantic Standard Time ?
 
@RadekdaknokSlupik "Offset?"
 
@Maxpm number of bytes from the beginning of the source code.
 
Oh, for more efficient access?
 
4:04 PM
int main() {} offset of the ( token would be 8.
 
@DeadMG I had done so already. You know that.
It's how the Lounge works.
 
@Maxpm Yeah, and easier access.
You don't want O(n) time for finding the offset of a token when you can do it O(1).
 
@RMartinhoFernandes Indeed. I was trying to gain it additional stars so I could then edit it into "Your mum's a whore" or something like that
 
Offset is not strictly needed for diagnostics.
 
4:06 PM
Makes sense. For multi-token constructs, does it just pick one token to show you?
 
@RadekdaknokSlupik If you store an array of lines, or line start information, (row, column) is enough.
 
What multi-token constructs?
 
@Maxpm that's what we have an AST for. :P
Or if you care about the tokens you can use a CST.
 
@RadekdaknokSlupik A Cock Syntax Tree?
 
4:08 PM
I'm not sure I follow how an AST helps with that.
 
a Clitoris Syntax Tree?
 
@DeadMG concrete syntax tree.
 
@DeadMG Yes, as opposed to an Ass Syntax Tree.
 
a Clandestine Secret Threesome
damnit lion, y u so late today
 
4:08 PM
@Maxpm if you have the offset of the beginning of the first token and the offset of the end of the last token, you can use libclang to tokenize everything in between.
It's called a range.
clang.llvm.org/doxygen/… see the last function.
 
My stomach is broken it seems. I've been in pain all day :S
 
if i would like to start c++ from starting then which video ,books,artical,blog need to refer ?
 
1172
Q: The Definitive C++ Book Guide and List

grepsedawkThis question attempts to collect the few pearls among the dozens of bad C++ books that are released every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a good C++ book...

And don't buy anything by Herbert Schildt.
 
The "Beginner > Introductory" section to be precise.
 
It seems a little messy to store tokens with AST nodes. Isn't the whole point of an AST to break away from the structure of the source? An AST node doesn't necessarily correspond to a token.
 
4:15 PM
I deny that!
 
@Maxpm You need it to go from AST problem to a real physical location
 
@RadekdaknokSlupik :if u have any idea about video tutorial then give any video series suggestion
 
@Maxpm every AST node corresponds at least to one token.
Either one, or a series of tokens.
 
I don't think C++ can be learned properly from a video.
 
I don't think C++ can be learned properly.
3
 
4:17 PM
if u have any book of c++ then u would mail me
 
Emailing a book is quite difficult.
4
Especially when they have hard covers.
 
@RadekdaknokSlupik I'm a living counter-example, no?
 
I don't think C++ can be learned.
 
on the gandhipratik65@gmail.com
 
Thats illegal :)
 
4:18 PM
Hmm, maybe not living, but at least a counter-example.
@ScarletAmaranth Thinking in C++ is freely available online.
 
@ScarletAmaranth not if the license of the ebook allows it
 
Spambots come in.
 
@RadekdaknokSlupik Well, every AST node can be associated with at least one token, if necessary. But that's a little artificial. To me, it would make more sense to give every node an optional begin- and end-offset.
 
hahahah
 
@prjndhi just buy one or pirate it if you have no money.
 
4:19 PM
A few days ago, I made a claim that I consider knowledge of using owning raw pointers to be "advanced" C++ knowledge, about the same as writing a template class, in debate with a guy who said that understanding raw pointers should be before smart pointers. What are the thoughts of people in this room on that?
 
Templates are way more basic than raw pointers.
 
@Maxpm So, instead of associating AST nodes with tokens, you want to associate them with characters in the source?
 
@Maxpm Offset of what?
You don't have characters, you only have tokens.
 
But raw pointers are fun. Templates (and their compiler errors) make me cry.
 
@CatPlusPlus If the tokens store the physical location, you have the characters.
 
4:20 PM
@MooingDuck that's controversial in pedagogical circles - the top down vs bottom up approach
 
Templates are funsies.
 
@RadekdaknokSlupik No.
 
@MooingDuck It seems strange to me that one of the fundamentals of C++ is considered to be advanced.
Encouraged or not, it's a core language feature.
 
Pointers are definitely advanced.
It's not C.
 
@Maxpm I use a car without knowing anything about the engine, I consider owning naked pointers about the same
 
4:21 PM
You can live without pointers for a long time.
 
I think I'd probably avoid it as long as possible and then teach both at the same time
 
@awoodland I understand that, I wanted thoughts of people in the room
 
@Maxpm Fundamentals of C != fundamentals of C++
 
i.e. you learn pointers by making a simple smart pointer
 
@MooingDuck I think one should learn iterators and dynamic storage handlers first.
 
4:21 PM
@awoodland both what?
 
Pointers aren't even difficult to learn.
 
Pointers are full of quirks.
nullptr, lifetime.
 
so you see the value of the smart pointer/RAII idiom at the same time as the "under the hood" magic
 
@Maxpm harder than smart pointers, and then people don't use smart pointers.
 
The need of dereferencing.
 
4:22 PM
@MooingDuck Wut?
 
@MooingDuck Standard library, templates, expression templates and SFINAE. Then raw pointers.
 
@RMartinhoFernandes I feel like people who learn raw pointers first might be prone to not using them as much.
 
Oh, I read that wrong.
 
@CatPlusPlus @RadekdaknokSlupik My proposition is to give a node an optional range of characters in the source file that the UI underlines if that node is found to be erroneous.
 
@DeadMG I think SFINAE is more advanced than raw pointers, but that's not relevant to the discussion as a whole
 
4:23 PM
I guess an optional range of tokens would do the same thing.
 
SFINAE first. Then templates.
 
@awoodland the question is basically about "my first C++ program". Do you teach them raw pointers or smart pointers first?
 
Hello world. Duh.
 
Hello world uses a pointer.
 
@MooingDuck when is the first time you need a pointer at all? After references, and members
 
4:24 PM
@awoodland I was self taught from a pre-STL book, my experience wasn't normal :P
 
@RadekdaknokSlupik uses != needs to know
 
@RadekdaknokSlupik Don't use main(argc, argv), they don't need it, duh.
 
@CatPlusPlus std::cout << "Hello, world!\n";
 
@CatPlusPlus I thought the discussion was the string literal decaying to a pointer
 
No pointers here.
 
4:25 PM
`"Hello, world!\n" decays to a pointer.
 
They don't have to know that.
 
@awoodland owning pointers
 
You don't understand pointers? Owned!
 
Lies to children.
 
But what about when the compiler gives them an error about "this weird thing called char*?"
 
4:26 PM
#include <iostream>
int main() {
    std::cout << 'H' << 'e' << 'l' << 'l' << 'o' << ' ' << 'w' << 'o' << 'r' << 'l' << 'd' << '!' << '\n';
}
Mwhahaha.
 
Besides, C++ sucks. Teach them Haskell.
2
 
Besides, C++ sucks. Teach them C.
 
Not funny.
 
COBOL.
 
4:27 PM
FORTRAN
 
Microcode.
 
@RadekdaknokSlupik Too easy.
 
4:27 PM
Assembly
 
@CatPlusPlus Meh. Not portable.
 
@RadekdaknokSlupik The only thing you can teach them is pretty much Hello world.
 
@SamDeHaan whistling 9600 baud modem?
 
@RMartinhoFernandes and they wouldn't understand it in the first ten years.
 
So, you get one hour of Malbolge class, and it's over.
 
4:28 PM
"Copy-and-paste this and you have a hello world. End of tutorial."
 
@CatPlusPlus that's true - the first thing pretty much has to be toolchain and environment
 
2 days ago, by DeadMG
@RMartinhoFernandes "Do C instead" is the important, useful part of the answer.
 
lol
The puppy will be quoted out-of-context on that for a long time.
 
4:30 PM
2 days ago, by DeadMG
which makes mentioning B a waste of time and not recommending C a failure
 
I wish starred quotes looked a bit better on the right hand side
 
Boost y u no move ctors.
4
 
@awoodland To meta!
 
Cannot use = default as the body my move ctor because of scumbag boost::optional.
 
4:35 PM
I was half hoping someone would quote that so I can star it and have that statement come out at the end of the chain
 
@RMartinhoFernandes: How's that range thing? I'm redoing windows right now, could use a direction.
 
Trying to convince GCC to accept the code :S
Also stomach pain isn't helping.
 
@RMartinhoFernandes I would know.
 
> 'std::unique_ptr<glskel::window>' is not derived from 'std::initializer_list<_Tp>'
Thanks a lot.
 
lol
 
4:43 PM
@CatPlusPlus Btw, you pulled out the docs so I have to ask you about pump_events and poll_for_event.
(I'm working with the glskel code, no Qt installed)
 
pump_events gets events from the OS to window's internal queue, poll_for_event works only on the internal queue.
 
Both are blocking?
 
Neither.
 
poll_for_event returns false and doesn't touch the argument if internal queue is empty.
pump_events runs only long enough to empty OS queue.
 
4:45 PM
For a range I'll need a blocking one.
 
wait_for_event does blocking poll.
 
Ah, thanks.
 
That's why it returns event by value.
do_pump and do_pump_block are the actual pumps.
 
hmm. Replace all cosnt_pointer -> const_pointer. 1 replacement. I'm getting better!
 
@MooingDuck :abbr cosnt const
 
4:55 PM
0
Q: Need resource key from property (not value). Reflect or not?

XaadeConverter: var desc = DependencyPropertyDescriptor.FromName(_TargetPD.Name, _TargetObject.GetType(), _TargetObject.GetType()); if ((desc) != null) { var expression = _TargetObject.ReadLocalValue(desc.DependencyProperty); if ((ex...

 
ah, I only replaced in selection. In Current Document was 112 occurrences replaced. That's more like it.
 
#define cosnt const
 
WTF GCC, who are you kidding?
 
So what do you think. Is it better to reflect over a class that MS made internal, or hijacked a converter, and have it change the value to some class you can access levity.
 
@Cat woot, got it.
The bare minimum loop now looks like this:
    for(auto event : *window) {
        if (!boost::apply_visitor(visitor, event)) break;

        gl::Clear(gl::GL_COLOR_BUFFER_BIT);
        window->swap_buffers();
    }
 
5:02 PM
That should probably be this:
//
for(auto event : *window) {
    if (!boost::apply_visitor(visitor, event)) break;
}
//
gl::Clear(gl::GL_COLOR_BUFFER_BIT);
window->swap_buffers();
 
@RMartinhoFernandes hmm, that's pretty neat
 
@CatPlusPlus That'd only draw stuff when you close the window.
 
you don't want to draw stuff for every event though
just once per frame
 
Ideally you'd process all events and then draw, whether you want to block or not.
 
yep
 
5:03 PM
Hmm.
 
It doesn't have to block, though, methinks.
Could return empty range when queue is empty.
 
@RMartinhoFernandes heh, nothing worse than when people come up with an important use case you hadn't anticipated, which makes your code uglier ;)
 
So maybe for (auto event : window.events(poll/wait))?
 
@jalf But it was so pretty! Who cares about not working?
@CatPlusPlus I'll try that on the weekend. I'm going back home now.
 
In fact, we could have window.process_events(poll/wait, visitor).
 
5:06 PM
@RMartinhoFernandes That's the spirit!
 
Also, by then Qt may have finished downloading.
 
@RMartinhoFernandes then you can start building it?
 
Oh, building Qt, you mean.
 
It's only 200MB or something, are you on 56.6kbps or what.
 
It's downloading at ~200kB/s.
And there's Steam fighting for bandwidth to download Civ5 too... whistles
 
5:09 PM
man
why did I download those additional episodes of Peep Show?
 
Because you're stupid?
Just a guess.
 
yeah
 
Ell
ahh undefined reference to vtable :O
 
now I'm just sad
 
5:15 PM
Finally I got diagnostics to work.
 
Anyway, bye.
 
bb
 
Hey @Chet GTFI.
 
howdy
 
5:16 PM
Chetting along?
 
indeed
 
brb I need to shit like a dog.
Probably TMI, but I don't care.
 
lol pretty much
afternoon Fred
 
Ell
Why do I get undefined reference to vtable? (simple example pastie.org/3967229 - 15 lines). I have googled but I can't find a general cause of errors - they all say its a linking problem
I don't understand what is wrong with that simple example?
 
because you havne't implemented any member functions in your base class
 
Ell
5:27 PM
oh :L
 
the compiler has no idea it's supposed to generate the vtable until it sees a decalration from that class
implement the destructor, recompile and boom you're done
 
Ell
So it needs a declaration? I have an abstract base class, which is more complicated than this giving this error :s
 
@Ell You can just define a do-nothing destructor somewhere outside the header
So that vtable has a place to land
 
Ell
right kk, so its just something outside the header
 
you have an abstract base class with a concrete destructoor
provide an implementation of the destructor (or any of it's member functions) and it will link.
 
5:30 PM
@Ell Use Ideone so we can see the actual error messages.
It will compile and run your code online.
 
Ell
wait a second I think I've nearly fixed it :L
done it :) I didn't realise I had to put stuff in source files, thank you :)
 
Have I missed anything besides @DeadMG talking about whores, clitorises (sp?) and cocks? :) What was the verdict on the Singleton discussion?
 
0
A: C/C++ syntax for functions returning function pointers

DeadMGIn C++, the miracle of templates can make this a tad easier. template<typename T> struct add_pointer { typedef T* type; }; add_pointer< add_pointer< add_pointer< int(float) >::type(double) >::type(int) >::type wow;

help against the C sheep plix
 
where did the whores go?
 
Amsterdam.
 
5:37 PM
@ChetSimpson So tempting... must let it pass
 
Miracle of templllaaaaates.
 
@deadmg lol like a bad burrito
 
um, how do I get Google to switch to English? I'm in Rome right now, and for some reason I can't find the button to switch Google to English.
And I can't read Italian... :(
 
Ell
www.google.co.uk?
 
@ChetSimpson Babylon?
 
5:44 PM
@Mysticial Search Settings -> Languages.
 
@Maxpm And what is that in Italian? :)
 
@Ell thx :)
@FredOverflow lol Exactly. :)
 
One of the languages is "Elmer Fudd."
 
@FredOverflow Sumeria
 
Second tab down.
 
5:46 PM
@Mysticial add ?hl=en or &hl=en (depending on whether or not there already is a ? in the url) to the url.
Nevermind.
 
@RadekdaknokSlupik Thanks. I was looking for that initially since I expected it to just redirect me back to Google Italy. But it didn't.
 
@Mysticial Google ain't IGN.
If I go to IGN it redirects to the UK edition. Then I click "International edition" and it redirects me to the UK edition.
Stupid idiot who implemented that.
 
At first glance I thought a girl had finally entered lounge<c++>, then I realized it was just @Mysticial's new gravatar. dammit.
2
 
@IntermediateHacker :P
 
I am so unmotivated today
 
5:50 PM
That's because of the temperature.
 
is Windows always LE?
 
LE? Leaching EnourmousamountsofRAM?
 
@IntermediateHacker lol
 
Good one. >_>
 
@RadekdaknokSlupik little endian
 
5:51 PM
Depends on the architecture, I guess.
 
Windows is x86 only, I think. So, uh....
 
@Maxpm x84, x64, and... one other. Arm?
 
Wonder if it's still available for MIPS
 
Windows supports ARM now.
 
Also: big endian sucks.
 
5:52 PM
And supported Alpha and something else before.
 
wiat. not MIPS. DEC Alpha
 
NT supports both endianness modes, most likely.
 
Wikipedia says x86, x64, Arm, and Itanium.
 
USed to run on PPC as well
 
Anyway, I wouldn't make any assumptions about it. They are not portable.
Maybe they're gonna run Windows on PowerPC machines in the future and then you're screwed. xD
 
5:54 PM
I didn't know Itanium was discrete from x86.
 
@Maxpm I think it's a superset
 
think I'll stick with the super mc6809e I'm running
1.87mhz of PURE power!
 
Basically I'm trying to figure out if I should bother making my yet-another-unicode-string library handle strings in the "other" endianness or not by default.
 
@MooingDuck Meaning users of your library will choose between one or the other, or it will transparently support both?
 
5:57 PM
@Maxpm They redesigned the ISA to have explicit instruction-level parallelism and other stuff
never really took off though
 
@MooingDuck UTF-16 and UTF-32 require you to support different endianness modes regardless of the platform
 
@CatPlusPlus Now that I think on it, you're right.
@Maxpm if I support both, they'd simply be two different types that could (explicitly) convert back and forth.
 
@Maxpm It's a completely separate instruction set. A weird VLIW thing, which had some x86 emulation built in which performed like crap
 

« first day (587 days earlier)      last day (4360 days later) »