« first day (394 days earlier)      last day (4562 days later) » 

12:00 AM
Except car and cdr suck.
 
Hehe, it'd be nice if there were a feature where you could determine which way round an argument pack got expanded!
Like typename ...Args vs ...typename Args or so.
 
@CatPlusPlus depends whether you're referring to the original machine code instructions, or the later lisp functions?
 
@RMartinhoFernandes Be sure to post a link to your code on that question page!
 
@KerrekSB It would be enough to let you do template <typename T, typename... Args> void f(Args... args, T t);. No need for new syntax.
"Contents of Address Register" and "Contents of Data Register" are the worst possible names for head/tail.
 
@RMartinhoFernandes Ah, yes, quite.
 
12:02 AM
@KerrekSB Will do.
 
Maybe (Args... args, T t)f.
 
@AlfPSteinbach The names.
 
@KerrekSB I posted a comment in your answer. Please vote for visibility.
@AlfPSteinbach creat is silly, but it's obvious it is a terrible misspelling of create. car OTOH... LISP has vehicles? And OTGH, cdr.
Should have been car and bus. That would be funny (maybe not).
 
@RMartinhoFernandes Already a step ahead of you :-)
 
12:17 AM
Bus is a car, too.
car and plane!
 
12:31 AM
Dammit, I should finally focus and get to work.
 
So, what's up with all my interview are belong to you guy?
Is there a limit to how much of one's life one may outsource to StackOverflow?
 
Dunno.
TBH I don't remember the ++ thing.
 
0
Q: Most important words in Java

heyI think we should have here a brief dictionary for most important Java words, like instances, objects and so on. But not only words, but examples too of those words.

Does the Java section not have an FAQ part?
Oh, it does.
 
@KerrekSB Every tag has a "faq" tab that shows the most linked questions.
 
Oh. No, that's not what I meant. How does the C++ FAQ work? Is that a special site feature?
 
12:45 AM
No, it's just a tag we use. Everything manual.
@KerrekSB He has 30 questions, 0 answers, and several questions have negative score. If he keeps going, he will be forbidden from asking questions soon.
 
@RMartinhoFernandes Ah, very interesting.
 
I've edited my answer, now you can upvote me and yell at the other guy.
 
I was also wondering if there's a plagiarism thing going on. I mean, he isn't making the slightest effort to appear interested in the material. It's literally "here are some questions someone else asked me".
 
@KerrekSB It's a cool feature because if you want your question asking ability back you need to get upvotes on answers.
 
I'm too lazy to ask questions on SO.
The time I'd spent on preparing it is the time I need to find the answer myself.
 
12:48 AM
@CatPlusPlus Wait, which question? Concurrency overload.
 
Unary operators.
 
@RMartinhoFernandes Yeah, nifty
 
Firefox keeps squiggling 'unary'.
And 'Firefox'.
 
@CatPlusPlus Let me check
 
@CatPlusPlus That happened to me before. Sometimes I ask it anyway and let someone grab the rep.
 
12:50 AM
@CatPlusPlus Hm. There you go. Everyone needs some rep this early in the day.
@CatPlusPlus It should be "unadic", though. As in "variadic".
And "adicity"
 
Wait, it's already past midnight GMT? Dammit.
 
Or "arity"? Then it should be "variary".
 
@CatPlusPlus What's wrong?
Dammit.
 
@CatPlusPlus Can't you tell when your reprecap says "Yesterday"?
 
@RMartinhoFernandes No cap. ;_;
 
12:52 AM
No cap, "recap"!
We clearly need a rep cap recap laptop web app, with tabs.
 
@KerrekSB I only look at that hover thingy once in a while.
 
@CatPlusPlus That means you have a normal personality.
 
That can't be right.
Anyway, I've always seen "arity" as the term used for number of arguments. And then unary, binary, ternary.
Firefox squiggles 'arity' as well. Damn dictionaries, always out of date.
 
@CatPlusPlus But then it should be "variary", too, non?
"-adic" should refer to some sort of modular ideal, like p-adic numbers.
 
Hell if I know. English is not my native language.
 
12:57 AM
"What's the etymology of variadic?" Quick, go ask on PSE.
 
@RMartinhoFernandes I think it's of madupadic or buzzoworese origin.
 
Now even I know you're making stuff up.
 
Wait, I forgot about the FAQ. So how does the C++ site manage to get questions tagged with c++-faq to display on the FAQ tab, without regard to views or votes?
 
Also, I've lost enough sanity points lately to try out hjkl.
Yay me.
Firefox, stop squiggling 'yay', you moron.
 
I'm stuck. I'm writing a multithreaded Javascript parser in Qt... and it's making my head hurt.
I've got syntax highlighting and brace matching working already.
...I'm just getting stuck writing the code-completion engine.
 
1:02 AM
Why do you need multi-threaded parser?
 
What does code completion do, exactly?
 
It completes code, usually.
 
@KerrekSB There's no such thing. It's just a normal tag.
 
@Maxpm It scans source files for symbols (variable declarations, etc.) and then when the user initiates code-completion, a list of matching symbols is presented.
 
It just so happens that those questions are linked to frequently :)
 
1:03 AM
It feels mightily unusual for the movement keys to be in a row.
 
@CatPlusPlus It should be multithreaded because if a user opens a project file with a lot of source files in it, then the parser has to run through all of them - freezing the GUI unless it happens in another thread.
 
@CatPlusPlus But that is normal!
 
...this might not be too bad for Javascript but my editor also supports Python, PHP, etc.
 
Er, what do you mean exactly by "multi-threaded"?
 
Can you imagine what happens when my parser tries to run through the entire Django framework when a project uses it?
 
1:04 AM
@RMartinhoFernandes But sometimes someone posts and says "This is intended for the FAQ". Does that mean nothing?
 
You certainly don't need concurrent parser for it to run in the background.
 
@KerrekSB That's a disclaimer to avoid some avid close voters.
 
@CatPlusPlus The parsing takes place in another thread and the main thread then gets notified when the parsing is complete.
 
It just needs to be thread-safe.
 
@CatPlusPlus It is thread safe.
(At least the part of it I have written thus far - like I said, I'm stuck :P)
 
1:05 AM
@GeorgeEdison So, it's a single-threaded parser.
 
Parsing a file is very isolated process, it's just a matter of returning through a future.
 
@RMartinhoFernandes I guess you could say that - when I say multi-threaded, I mean the application has > 1 thread.
 
But the parser itself doesn't use more than one thread.
So, it's just a normal parser.
 
That is correct.
 
So, why are you not generating it with existing tools.
 
1:07 AM
Existing tools?
...for Qt?
 
Bison generates thread-safe parsers, AFAIR.
 
To avoid confusion, it's not the parser itself I need help with.
 
Well, can generate, the default is silly move-everything-through-globals mode.
 
(In this case parser being the code that extracts tokens from the code, etc.)
My confusion is over maintaining symbol tables, etc. while code is being edited.
 
1:08 AM
Make immutable AST nodes.
 
Qt's editor control (the one I'm using) uses "blocks" for each line of text.
 
Syntax highlighting usually just lexes the source.
 
Make everything immutable!
 
@CatPlusPlus Right, that's what I have right now.
 
@CatPlusPlus But completion needs a syntax tree and a symbol table.
 
1:10 AM
Example: "var \n test = 1;".
As you can see, a newline interrupts the statement.
How does a parser deal with that when it only sees one block at a time?
 
@RMartinhoFernandes I guess.
I don't know if I like the idea of not moving in the Insert mode.
I keep pressing u to go up.
It doesn't work that well.
0
Q: How I can master nested for?

omaarI totally understand the purpose of nested for, yet I do not feel I have "mastered" them. Does anyone have some really good problems or readings involving nested for. I program in C. Thanks.

People have weirdest questions sometimes.
 
Does he include "It had been done. " in every question?
 
@CatPlusPlus I love this idea of people believing that you can somehow "master" something and tick off a box somewhere. "Integers: done. For-loops: done. Pointers: tba. Nested for-loops: Must ask on SO."
@CatPlusPlus Yep
The entire preamble is templated.
 
Maybe he's GoT fan.
 
1:15 AM
What's up with upvoting of a terribly off-topic answer?
 
@GeorgeEdison i imagine by (0) not parsing in hard-set "blocks", or reading more when it runs into a "missing whatever" error at the end of a block; (1) considering "var" by itself an error; and (2) ignoring whitespace
 
We should start collecting funny quotes from SO questions.
 
@CatPlusPlus "Gymnasts of Thailand"?
 
I still remember the expression "object has wonked out".
 
@KerrekSB Serial upvoters are a plague.
 
1:16 AM
@CatPlusPlus In a Java question, for sure?
Or maybe OLE
 
That I don't remember.
I think it was C++ question.
 
I don't do Java questions.
 
@RMartinhoFernandes No, I meant, someone post a really off-topic answer to Mr Interview question and then we can support it...
 
I don't do Java.
 
1:17 AM
@GeorgeEdison In Soviet Russia, Java does you.
 
You've killed the conversation.
 
I'd say there's a genuine case to be made that the guy isn't actually asking any questions. He's just posting, "the following question exists" over and over.
 
The var keyword must always be followed by an identifier in Javascript, correct?
 
@GeorgeEdison Is that an interview question, too? ;-)
Interesting, actually, does JavaScript have a context-free grammar?
 
What kind of employer would be asking me to write a multithreaded parser?
 
1:22 AM
@GeorgeEdison A serious one! :-)
 
Right...
 
If you're writing a parser, no doubt you have a copy of the language standard in front of you...
I'm just looking for a copy now.
 
I did for Python when I wrote its lexer.
 
@KerrekSB Look for ECMAScript.
@KerrekSB I tried, but I ended up making a serious answer.
2
A: What happens if RTTI is used for distributed applications in C++?

R. Martinho FernandesI would answer "F. None of the above". Did it ask for a justification? A. RTTI does not have standardized run-time behavior. The result of typeinfo::name is implementation-dependent. But pretty much everything else about RTTI is well-defined in the standard. B. RTTI uses too much memory...

 
0
Q: Woriking with list, permorfing arithmetic logic in python

haea ohohSuppose I have make huge number in list, and I want to make another one which also added with the huge number list here is the code for list A: [109, 77, 57, 34, 94, 68, 96, 72, 39, 67, 49, 71, 121, 89, 61, 84, 45, 40, 104, 68, 54, 60, 68, 62, 91, 45, 41, 118, 44, 35, 53, 86, 41, 63, 111, 112, 5...

Yay for proof-reading.
 
1:30 AM
@RMartinhoFernandes Ah, got it. 12.2.
 
"This is a question from an interview. Describe yourself in three words."
This should be the next one.
 
Cat Plus Plus!
 
2:21 AM
0
Q: prevent code or function from executing more than once

user765368I have a question. Is there a way to prevent a code or a function within a code from running more than once even if I re-execute (or reload) the php file? I mean, can I restrict someone from executing a php script more than once? I can't seem to find the way to do this. Thank you

Yay for context-free questions.
 
Aaaah, PHP questions.
You evil person!
0
Q: When can `typename` not be replaced by `class`?

RioI already know in many cases that class cannot be replaced by typename. I am only talking about the opposite: replacing typename by class. Someone pointed out that only typename can be used here: template<typename param_t> class Foo { typedef typename param_t::baz sub_t; };...

He copied an example from a question that explains it, and asks for an example where typename has to be used.
My brain just malfunctions.
This is unprocessable.
 
@CatPlusPlus That question just doesn't make sense...
Or rather, I can't make sense of it.
I'm just reading this question again after it was listed on the SO Blog. The second answer about JavaScript is phenomenal: '5' + 3 is 53, but '5' - 3 is 2. Awesome.
 
morning
 
any openGL programmers here?
 
Sortof.
 
2:34 AM
Hi.
 
morning
oh I already said that
 
Lol.
I see your internal timing is off, too.
@KerrekSB OP disregards everything they've seen and insist something is fine, because their compiler happens to accept it.
I've unmapped arrow keys. Now I won't be able to do anything. Yay.
0
Q: correct class inheritance

user788462I've written some code that allows the term 'job' to be used universally to perform a unique task. The specific jobs can be chosen through setting an initial variable "job_type". From that initial variable a particulay subclass is chosen to perform the appropriate job. Maybe the code will make mo...

These guys are ridiculous. It looks like someone unleashed Java programmers on .
 
@Srivigne I can't decide whether I love or hate openGL.
 
Don't worry, it's legal to do both.
 
It's incredibly frustrating and yet rewarding at the same time.
 
2:43 AM
It's an API, what's there to love.
 
yes, my internal timer is quite off
it seems to range from 27 to 30 hours a day
right now I'm trying to push it a little more so that it's shifted all the way back to normal
 
I do that at least twice a month. It doesn't last long.
 
mine's like that almost all the time in winters
 
0
Q: Do we need to know the concrete class of exception so that the exception handler can handle it?

user1002288This is an interview test C++ question not a homework. The interview had been done. Which of the following statements describe correct methods of handling C++ exceptions? A. Once an exception is thrown, the compiler unwinds the heap, freeing any memory dynamically allocated within the bl...

"The interview had been done."
 
I do this I have no idea.
 
2:47 AM
@CatPlusPlus Everything is better when made by a factory. Especially if it is wrapped. What we really need is an abstract auto-boxing factory wrapper.
 
-7
Q: What happens if RTTI is used for distributed applications in C++?

user1002288This is a question from an interview: Which of the following statements provide a valid reason not to use RTTI for distributed (i.e. networked between different platforms) applications in C++? A. RTTI does not have standardized run-time behavior. B. RTTI uses too much memory. ...

why was this question closed?
and downvoted seven times?
the OP's asked like, ten questions in an identical format, but none of them got the same response
 
Because we felt like it.
 
@KerrekSB Oh, not again. I'm nuking this forever.
 
@DeadMG because everyone loves RTTI and they are insulted by the question.
 
@DeadMG If you think about it, it's not a question. I mean, it's not a question that the OP has, or is interested in. It's much rather an announcement that says, "There exists a question."
 
2:48 AM
yeah
 
@Pubby Mostly because it's an utterly stupid question.
 
so why not go back and downvote and vote to close all of his questions like this?
 
Too lazy.
 
@CatPlusPlus I suppose cats cannot understand love.
 
Also, will probably trigger a warning flag for mods.
> Why this question is being closed as duplicate ? That thread doesn't answer OP's question. I recall there is a corner case where you can only use typename and not class. – iammilind ↵ 2 mins ago
I just don't have words.
 
2:52 AM
and when the mods see that he's basically asked the same question seven times
they'll ignore the warning flag
 
Oh, that's actually interesting: Apparently GCC accepts typedef class T::type type;, but only when the type is of class-type. Is that standard?
 
no
 
@KerrekSB Guessing its leftover from C
 
@Pubby Uh, how would any syntax or semantics involving class and :: be leftover from C?
 
I already said in the comment there, it's probably because of struct foo x.
 
3:02 AM
@pubby why you couldn't decide to love OpenGL ?
 
class foo x; has always been legal. Wouldn't class T be legal then?
 
There, if anyone wants to follow suit, there's now one "too localized" close vote on every question on the first page of Mr. Interview's question list.
 
@RMartinhoFernandes Sounds apropos.
 
Argh, I think I'll have to rebind u after all, I just keep pressing it.
 
@Srivigneshwar It's a pain to debug.
 
3:04 AM
agreed :(
 
You can debug OpenGL?
 
gDEBugger.
Just not the newest AMD version.
 
gDEBugger can't catch compile time mistakes
 
It's integrated with VS and doesn't work.
What compile-time mistakes?
 
@Pubby That's what a compiler is for, no?
 
3:06 AM
Off-by one, negative/positive, using wrong buffers, etc
 
Debuggers usually don't catch compile-time mistakes. You catch them, by looking into the running software with debuggers.
 
Anyway, I always thought the tool of choice for hunting bugs in OpenGL was the shotgun.
 
I will try gDEBugger..
 
No, that's for hunting dinosaurs.
For bugs you want flamethrower.
 
That gave me an idea: shotgun that fires flames
 
3:09 AM
lol..
 
How does that work?
 
Apropos dinosaurs, this LP is brilliant: forums.somethingawful.com/showthread.php?threadid=2818186
Incendiary pellets, obviously.
 
@CatPlusPlus What's the "unusual health display system"?
 
A tattoo.
 
now i feel am not alone !! How I missed this c++ lounge .. :/
 
3:12 AM
Cool, Bill is sweeping up the interview questions (stackoverflow.com/q/8116725/46642)
 
Dunno if the links in the thread were updated, but he's uploaded in on YT: youtube.com/…
 
I just realized that vimeo and viddler are two entirely different sites
 
What gave it away? The different names? :P
 
Awesome:
> This account is temporarily suspended because of low-quality contributions. The suspension period ends in 7 days.
 
3:16 AM
Argh... is there something like an lvalue_cast? I want to make this for-loop work:
  for (std::string line;
       std::getline(std::cin, line);
       vv.push_back(std::vector<int>(std::istream_iterator<int>(const_cast<std::istringstream&>(std::istringstream(line))),
                                     std::istream_iterator<int>())
                    )
       ) { }
But the iterator requires a non-const reference in the constructor.
 
A std::stop as a counterpart to std::move?
 
@RMartinhoFernandes Yep :-)
std::stay
 
And then follow with std::sit, std::play_dead, std::roll_over, and std::good_boy.
3
 
OK, what'd be the next best thing... can the string stream go somewhere into a nearby scope?
 
Dammit, I wanted to say that.
 
3:20 AM
@CatPlusPlus Mwhahaha! Star it.
 
Fine. You win this time, but the game's ain't over. shakes fist
 
@KerrekSB Can you try with std::ref?
 
@LucDanton How exactly?
 
Mmh, won't work, it expects an lvalue.
 
It returns rvalue reference_wrapper, which needs to be handled specially at that.
How would that help? :P
 
3:24 AM
It implicitly converts.
 
Well, the reference wrapper behaves just like the wrappee...
 
No, it needs to be unpacked manually.
 
maybe std::cref
 
You can't emulate references, because you can't overload the dot.
 
// access
operator T& () const noexcept;
It converts. It doesn't emulate anything.
 
3:25 AM
Hahaha: use of deleted function ‘void std::cref(const _Tp&&)
 
Oh, it's operator T? I thought it was operator(). Derp.
 
Who would have thought that constant rvalue references would see some use?
 
@KerrekSB Good QoI :)
@CatPlusPlus There's get, too.
 
Damn it. We really need std::stay!
 
I'm terrible at this.
 
3:26 AM
Try std::forward<std::istringstream&>(blah). That's not really clearer or shorter though...
 
Can't you cast from an rvalue ref to an lvalue ref?
 
I'm also terrible at hjkl. I manage to get where I need to be, edit stuff, go back to Normal, and then I press u to go up, and facepalm.
Every. Fucking. Time.
 
> if the second form is instantiated with an lvalue reference type, the program is ill-formed.
Dammit, won't work either.
 
Because j is down, and I'm a gamer.
 
3:28 AM
Oh, right, it's above j.
 
I'm entirely willing to const-cast until the cows come home, but it has to be doable somehow...
 
I think the Standard is trying not to provide this functionality you know.
And I don't blame it.
 
I think I could live with undo being only on Ctrl+Z.
 
I do.
 
And rebind u to up.
 
3:28 AM
I want one-line parsers.
 
Oh noes! A Ctrl mapping!
 
Mwahaha.
 
(Yes, I know the standard mapping for redo is Ctrl+R)
 
I use CUA shortcuts by instinct, anyway.
 
Got it!
 
3:29 AM
@KerrekSB I recommend template<typename T> T& ref(T&& t) { return t; }. You can return std::reference_wrapper<typename std::decay<T>::type>, if you want to match std::ref, too.
 
template <typename T>
struct stay
{
  T & x;
  stay(const T & t) : x(const_cast<T&>(t)) { }

  operator T&() { return x; }
};
 
So you're making k right?
 
Just need a wrapper to deduce the type.
 
Yeah.
 
@LucDanton Does this work?
 
3:30 AM
@KerrekSB Yes.
 
I don't use left and right much. Inside a line I move mostly with f and w and friends.
 
Can you say the relevant line then?
Just ref(std::istringstream(line))?
 
Yes.
Accepts any kind of parameter, returns reference to that parameter. Not terribly safe.
 
Hah. Amazing. Leave it to M. Danton :-)
I never play it safe.
 
safety is for noooooooooooooooooooooooooooooooooobs
 
3:32 AM
No.
Safety is for experts.
 
I'll post it!
 
Noobs do all kinds of unsafe crap.
 
Luc:
Shouldn't the return type be typename std::remove_reference<T>::type &?
 
It feels much better to have them shaped like arrows.
 
Or will this always match the right way?
 
3:37 AM
Due to reference collapsing rules, it ends up having the same return type.
 
@CatPlusPlus What?
 
Oh, that.
Get used to it (or to your own bastardized version), and then one day you'll find yourself typing stray js outside vim.
 
But you had the right insight in being careful, with the std::reference_wrapper version you want to peel the reference (except I was using std::decay and not std::remove_reference, which is not as correct).
 
@LucDanton Yeah, we're safe here, because of the single &.
 
3:40 AM
Oi, it's the original version that's bastardised arrows!
Preciousss arrowsss.
 
But, but... damn, I really can't think of a reason to claim hjkl is better other than "I'm used to it!"
 
hjkl puts the two strongest fingers on the most used keys when editing text
 
Really? What are those?
(The most frequent letters in English are ETAONIS)
Why the heck do I know that?
 
The strongest fingers are pinky and ring finger
 
I meant, what are the most used keys?
 
3:45 AM
Well, I should say most used direction. Up and down.
 
Which finger is the ring one?
 
The one with a ring.
Oh, I definitely use up/down a lot more than left/right. Left/right are highly inefficient.
 
With arrow keys your middle finger does all the work
 
With arrow keys I use the middle finger, the index, and the ring finger.
 
Good lord, who comes up with those names.
 
3:48 AM
Wait, did you say that the strongest fingers are the pinky and the ring finger?
Am I wrong, or is the pinky the small one on the outside?
 
They call them fingers but I've never seen them fing... Oh, there they go.
 
I have no idea which is index and ring.
 
@RMartinhoFernandes I was joking. The strongest are the pointer and middle. Not counting the thumb.
 
Silly names.
Can't we just number them.
 
@CatPlusPlus Index is on the inside.
 
3:49 AM
0, 1, 2, 3, 4.
 
The one you point with.
 
I call it digitus secundus manus
 
So 3 is the ring one?
 
Yes
 
If thumb is 0.
 
3:51 AM
Of course it's 0.
 
Well, you could pick the pinkies for 0.
 
It's not fit to be the first.
 
Are we talking about right-handedness?
 
The issue is hand-agnostic.
 
I've avoided saying "left" or "right" and used "inside" and "outside". Don't tell me that doesn't work for all humans.
Oh, wait, palms down.
 
3:53 AM
That makes no sense at all
 
Inside palm up or palm down?
 
Inside and outside are ambiguous, too.
 
Silly humans.
 
I guess ventral and dorsal are available, unless someone is holding their hands over their heads.
 
room topic changed to Lounge<C++>: 5AM finger discussions. [c++] [c++11] [c++-faq]
Oh, you can use :edit to open files. Why do I keep using :open which doesn't do autocompletion.
 
3:56 AM
Learn and embrace :tabe[dit].
 
I had no idea you could do :open.
 
@LucDanton Oh, that's useful, too.
Well, I was using tabnew, but didn't know it takes a file argument.
 
gt/gT to get around tabs.
 
It makes sense now that I think about it.
 
And obviously, <count>gt to jump to tab <count>. (It's 1-based, btw)
 

« first day (394 days earlier)      last day (4562 days later) »