« first day (415 days earlier)      last day (4531 days later) » 

6:00 AM
ah, that was one of the issues with scala, I remember now!
 
@robjb have you used it? I know you asked about it earlier
what what?
 
I toyed around with it for about 2 weeks
Then got distracted by school
 
@keithlayne What was the issue with Scala.
 
they said that using lambdas or something made for bajillions of class files because they were implemented using anonymous classes.
 
6:02 AM
So?
That's how they're implemented in C#.
And C++.
 
how does C# compile though? is it still .net bytecode these days?
 
@keithlayne Yes.
 
Yea
 
yeah, but lambdas in C++ are much saner IMO, except for the syntax
 
How much saner?
They still generate types.
 
6:03 AM
I want to write [](int x) -> auto {}
 
Sometimes you can. [](int x) { return x; } is valid and returns int.
 
yeah, but in c++ types can exist purely at compile time and go away nicely, right?
 
Is serial communication in C++ very complex? As in, is the best solution usually an existing library?
 
I was just being stupid, duh
 
@keithlayne In C# and Java they can go away at JIT-time.
(aka Just-in-Time time.)
:P
 
6:04 AM
asshole
 
lol
 
I never really thought about how stuff like functor structs affect code size
 
@robjb Boost.Asio.
The C++ standard library is pretty small, especially when compared to the loads of .NET and Java stuffs.
 
Well that right there is probably a good enough reason for our project to have used C++ in the first place.
 
you talking serial devices, or am I confused?
 
6:07 AM
Yes
 
Java has that out of the box?
 
No, we had to use a library too
But that was after we spent a month fiddling around with an implementation for the devices we wanted to control that was in C
 
as in, JNI for each platform?
 
No JNI
Well actually, RxTx probably uses JNI to accomplish its goals
 
that's what I meant
 
6:09 AM
Yes
 
@robjb Oh, then that's not Boost.Asio :)
 
I can't see how else it could work for both platforms
 
In C# you have this baby: msdn.microsoft.com/en-us/library/…
Never used it, though.
 
they use CVS and apparently have no web access to the repo. How 1998 of them.
 
I know, ugh
We should have spent more time prototyping the language we wanted to use
And we would have spent much less time choosing the frameworks
 
6:11 AM
now would that work on mono, or would it need special magic?
 
Well that's what I was wondering, but we could have at least tried it on Mono before going with Java :/
 
@keithlayne SerialPort? Dunno.
 
learn from every experience, right?
 
Got check their supported stuff checklist.
 
It would probably just have its own Mono implementation, I expect
Last I recall WPF / EF were the major things missing
 
6:12 AM
I don't think SerialPort is standard, but they implemented a lot of the extensions.
 
Oh
When you say standard, are you talking about the C# language standard? How much of the .NET libraries aren't considered "standard"?
 
For me, the only reason to do anything in Java at this point is for Android. I'm sure there are some really good other reasons, but I'm not thinking of them.
 
Seems like they support it.
 
@keithlayne A lot of other embedded devices I would guess
 
@robjb The CLI standard has a list of libraries.
 
6:15 AM
I'll have to look that up
 
Mono implements all those.
 
yeah...not my thing so much, but android is ubiquitous
and I just don't see why you'd put a jvm on an embedded device. maybe i r dumb
I feel like doing a Qt program now
 
@keithlayne Now we're back to the "write once run anywhere" idea
 
I think I'll write an Uno clone for the kids
 
Sounds fun
 
6:17 AM
> The Base Class Library is part of the Kernel Profile. It is a simple runtime library for modern programming languages. It serves as the Standard for the runtime library for the language C# as well as one of the CLI Standard Libraries. It provides types to represent the built-in data types of the CLI, simple file access, custom attributes, security attributes, string manipulation, formatting, streams, collections, among other things.
 
I honestly would take Qt over Java as far as that goes
@RMartinhoFernandes that is a lot of words but doesn't say so much
 
Well, the real list is a bunch of XML files.
Do you want me to post that?
 
lol
 
at ease, soldier
 
6:18 AM
It's silly if you ask me.
But then the spec would have gazillions of pages.
 
Heh
I think I'm off to get some sleep
 
I'm going to make a language where everything is a class derived from a common base class...we'll call it Object. Object will be a singleton.
later dude
 
rofl
 
Good talking, tty guys later
 
6:21 AM
@RMartinhoFernandes is there a concept of linking in the .net world?
 
You mean partial compilation?
 
maybe
 
It is supported, but it's an obscure practice. The compilers are very very fast.
 
I would say Java always does partial compilation, but never links
 
They don't optimize much, just leave it to the JIT.
 
6:23 AM
in .net does everything end up in an executable
 
that's kinda where I was going about the proliferation of anonymous classes in java / scala
 
Or a "module", which is the result of partial compilation (kinda like a .o). But no one uses these.
@keithlayne Oh, I see, the compiler output is a folder with a gazillion files!
 
yeah, it would piss me off
 
There are no "class files" in .NET.
 
6:25 AM
okay...that sounds much more appealing than the java model
the java kids maybe think of the link step as running jar
having tons of structs/classes/types/whatever has less (overhead in my mind) than in java (parens for clarity)
 
Well, you never see those generated classes in .NET. Not unless you crack open a DLL and go look for them.
 
right on
monad time. Get the butter.
 
hopefully I'll just get it so I don't pester you with questions
 
 
1 hour later…
7:53 AM
Another bracket matching problem??
 
 
1 hour later…
8:58 AM
It just occurred to me that the terms i18n and l10n are pretty ironic.
 
reminds me of Alanis Morrisette
 
> Is acceptable in cases where RAII is not applicable. (Please, don't ask... not everybody in my company likes object-oriented programming and RAII is often seen as "useless school stuff"...)
Sigh.
 
mawning
 
2
Q: Is `catch(...) { throw; }` a bad practice?

ereOnI've had an argument this morning with a coworker who claims that all catch(...) are evil and always wrong. While I agree that catching ... without rethrowing is indeed wrong, I however believe that using constructs like this: try { // Stuff } catch (...) { // Some cleanup throw; } Is a...

@TonyTheLion Hi.
 
@RMartinhoFernandes do you ever sleep? You always seem to be up?
 
9:08 AM
Right, except when you guys are complaining that I'm not here.
:P
 
@RMartinhoFernandes lol
 
oh lol
 
But yeah, I've been running long days.
 
9:20 AM
@RMartinhoFernandes I don't think that was an exact duplicate.
 
Me neither.
 
@StackedCrooked great, now I have an "earworm"... (what's the correct term in English when you can't get a song out of your head?)
 
An earworm can be replaced with a different earworm.
Arrg, now I have it too.
 
sbi
@TonyTheLion Martinho doesn't sleep, he recharges. :)
 
> Actually, my coworker designed his own exception class which does not derive from std::exception and tries everyday to enforce its use amongst our codebase. My guess is that he tries to punish me for using code and external libraries he has not written himself.
Man...
 
9:31 AM
I'm so glad I don't work in a software team :)
 
sbi
@StackedCrooked An earworm can be replaced by a bablefish. (I'm not sure it's preferably, though, to be able to understand what the two Russian grannies had to discuss so loudly in my city train car this morning.)
 
Did they say "Nastrovje"? :)
 
A bablefish is a fish that babbles?
 
@RMartinhoFernandes it's a translator website
:P
 
That's "babel".
 
9:34 AM
like the tower?
 
And like the babel fish that act as universal translators in the Hitchhiker's Guide to the Galaxy.
 
a book I've never read
 
you should
how can you call yourself a geek otherwise?
 
I don't.
I'm a C++ programmer, isn't that enough humiliation already? ;)
3
 
well, you are ;)
 
9:36 AM
No.
 
anyway, it's required reading
 
Mandatory.
 
any opinions (positive or negaive) on the boost unit testing library?
 
sbi
@FredOverflow I wouldn't need a translator for that.
@RMartinhoFernandes No, it's a fish that translates the babbling of two old Russian babushkas.
 
@RMartinhoFernandes I mean, all the finger pointing and "Ha ha, your array access is unchecked and you have to delete your objects manually!" can get to you sometimes... having to explain vectors and RAII to Java programmers again and again is exhausting... so I don't wear my C++ T-shirt anymore in public. It's just not worth it.
(I don't actually have a C++ T-shirt ;)
 
9:39 AM
Where can I buy one?
 
I think the only official C++ merchandise were some buttons printed back in the 80s.
 
can you imagine how long it would take ISO to come up with a t-shirt design?
 
That's the least they could do for not giving us modules.
 
A C++ "tour" T-Shirt with the 10 most recent committee venues or something would be quite cool, I guess.
 
sbi
@FredOverflow Actually, I think Babel was the Hebrew name for Babylon, the city the tower was in.
 
9:42 AM
@sbi Isn't that also where the whores lived? :)
 
And people too.
 
@FredOverflow wasn't that sodom and gomorrah?
 
sbi
@RMartinhoFernandes Only a robot would note that people lived in a city.
 
@FredOverflow Do you mean Sodom and Gomorrah?
 
@awoodland I guess 13 years.
The Whore of Babylon or "Babylon the great" is a Christian allegorical figure of evil mentioned in the Book of Revelation in the Bible. Her full title is given as "Babylon the Great, the Mother of Prostitutes and Abominations of the Earth." (; transliterated Babylōn ē Megalē, ē mētēr tōn pornōn kai tōn bdelygmatōn tēs Gēs.) Symbolism The Whore is associated with the Antichrist and the Beast of Revelation by connection with an equally allegorical kingdom. (The word "Whore" can also be translated as "Idolatress"). The Whore's apocalyptic downfall is prophesied to take place in the hands of...
 
9:43 AM
@StackedCrooked There were no famous whores there, AFAIK.
 
@sbi lol
 
sbi
@FredOverflow I have a C++ shirt. Well, sort of. It says Effective C++ Technical Reviewer. A gift from AW.
 
Speaking of whores...
0
A: Convert this line from C++ to C#

R. Martinho FernandesThe str - 1 line obtains the pointer that is one character before str. It is effectively obtainging the original pointer that was passed as a parameter, because it was moved one character forward with ++str a few lines before. A quick-and-dirty conversion would look like this: string Match(stri...

Oops, I dropped that link.
;)
 
Okay let's see, what would you like to see on a C++ T-shirt? I would like some hints at RAII, the rule of three, lambdas, temporaries, move semantics, copy and swap, SFNAE and undefined behavior, of course.
Oh, and int main(), of course.
 
I'd be happy with a couple of nasal demons.
 
9:46 AM
@sbi Really? How awesome is that?
@RMartinhoFernandes Can you photoshop some nasal demons into this picture?
 
sbi
@FredOverflow You need to eat a lot for such a t-shirt. I'm not sure even XXXL would provide enough space fir all this.
 
@sbi Was it only printed in XXXL, or are you really that enormous?
 
@FredOverflow I work exclusively with Paint, so the quality may not be what you expect. I'll give it a try anyway.
 
I guess the actual size is XXXL++ :)
 
sbi
@FredOverflow Please check which of your messages mine refers to.
 
9:48 AM
lol
 
@sbi oops
 
sbi
@FredOverflow I freely admit that I need XL, though. :(
 
I'm quite skinny, I only need M.
 
sbi
@FredOverflow I'm not sure. I usually don't wear it. I did wear it at Scott's seminar, though. :)
 
@sbi Did he like it? :)
 
sbi
9:49 AM
@FredOverflow So was I at twenty something.
@FredOverflow Well, he made them give one to me, so I guess he liked me wearing it. We didn't talk about it, though.
 
0
Q: Perl - 2's complement modulo 256 - C++ equivalent

user1081275I'm working with a Perl script to send values from USB to Arduino, part of the script is a checksum to error check the vals in the protocol. I would now like to send the data from one Arduino to another so I need to write the equivalent line in C++ $checksum = ((($val1 + $val2 + $val3 + $val4 + ...

Is there something I'm missing?
 
sbi
 
@sbi So he didn't say "What an awful shirt, please take it off right now?" ;)
 
sbi
@FredOverflow He probably thought it would be much more awful had I taken it off. :)
 
I find it hard to find a nice witty example of idiomatic C++ code that would fit on a T-shirt.
 
9:53 AM
How about a palindromic lambda? :)
 
@Fred: done.
 
lol
What is that, a hippocampus? :)
 
No idea. Googling for pictures of "nasal demons" gives lots and lots of irrelevant crap.
Including Iron Man and hot women.
 
How about you photoshop a huge nose above Bjarne, making him the nasal demon? :)
 
I think I have the perfect picture for that.
 
sbi
9:56 AM
@StackedCrooked I guess the TMP equivalent of "Hello, world!"(Factorial<>) would fit.
@RMartinhoFernandes I now expect you to post @Fred's profile pic...
 
@xeo i gave answer
 
@sbi Oh yeah, that would be cool!
@sbi Are you implying I have a huge nose?
 
sbi
@FredOverflow I'm not sure, I'd call a "Hello, world!" program cool.
@FredOverflow I was implying something about @RMartinho, not about you. (chat.stackoverflow.com/transcript/message/2017585#2017585)
 
Doesn't work very well.
 
chuckles
Now make a recursive one where I come out of my own nose!
 
10:02 AM
I don't have 1337 Paint skillz, really.
 
Anyway, I probably wouldn't want to wear such a T-shirt, I'm afraid :)
 
sbi
@FredOverflow Ugh. Now someone pass me the brain bleach, please!
 
Ok, I'll go back to coding now.
 
duuuuude :)
 
sbi
Uh. Gross.
 
10:14 AM
I wouldn't be surprised if someone flagged that :)
 
sbi
And to think that you guys once censored my pic of a dead kitten...
 
Hey, it was Fred's idea!
-1
Q: How are expressions containing multiple ++/-- operators evaluated in C/C++?

KishanSuppose that you have a C statement like, int res = ++a + a++ + a++ + a++; Usually, expressions on the right hand side of = operator are evaluated in left-right order. If you manually evaluate it with some value,say a=10, its evaluated as 11+11+12+13. But when executed as a program statement, ...

 
@RMartinhoFernandes I didn't specify any snort.
 
@FredOverflow That's a green rubber rope.
 
10:18 AM
riiiiight...
 
Anyway, please close that as dupe before people close as not dupe.
Nevermind, that was quick.
 
sbi
@RMartinhoFernandes I think "It was his idea!" was heard a lot at the Nuremberg trials.
 
@RMartinhoFernandes Why would something get closed as "not dupe"? :)
 
@FredOverflow Well, last time there was a ++++++++++ question we had to reopen it and then close as dupe.
 
What was it closed as? Not constructive?
 
10:23 AM
NARQ
 
By the way, someday I'd like to close a question about destructors as "not constructive" :)
@RMartinhoFernandes a++++ does not even compile for scalar types.
> Usually, expressions on the right hand side of = operator are evaluated in left-right order.
Where do people get these ideas?
 
@FredOverflow Other languages?
(Java, C#?)
 
Okay, and who actually writes a++ + ++a in such languages? :)
 
I prefer a++ + ++a * 2.
You have no idea how many C# and Java programmers get that one wrong.
 
> I often use funny and convoluted expressions like a[++i] = i;, to make myself feel better.
lol
@RMartinhoFernandes What do you mean, wrong?
Is the result equal to 3 * initial_value_of_a + 4? :)
 
10:27 AM
Let's make a = 1. I bet that close to 50% will answer that the result is 8.
@FredOverflow Where did you get the 3?
 
@RMartinhoFernandes a + a * 2 -> a * 1 + a * 2 -> a * (1 + 2) -> a * 3
@RMartinhoFernandes I would say the answer is 7.
 
@FredOverflow Oh, but what about the increments?
 
I thought you were only interested in the result, not the side-effects.
a will be 3 after that.
 
But you can't eliminate common factors there.
It's 1 + 3 * 2.
 
I noticed that many beginners seem to be confused about the difference between "result" and "side-effect".
@RMartinhoFernandes Which is 7, as is 3 * 1 + 4, so my formula seems to be correct :)
 
10:30 AM
Riight.
Wait.
How does that work?
How did you get the 4?
 
I "simplified" a++ + ++a * 2 to a + (a + 2) * 2.
 
a + (a + 2) * 2 -> a + 2 * a + 4 -> 3 * a + 4
104
Q: Undefined Behavior and Sequence Points

Prasoon SauravWhat are "Sequence Points"? What is the relation between Undefined Behaviour and Sequence Points? I often use funny and convoluted expressions like a[++i] = i;, to make myself feel better. Why should I stop using them? If you've read this, be sure to visit the follow-up question Undefined Beha...

I hate to say it, but I don't think this standard-quote-ridden FAQ is very helpful for beginners.
(Are FAQs supposed to be helping beginners?)
 
@sbi wow
 
sbi
10:37 AM
@FredOverflow I fully agree. Why don't you write a comprehensible answer? (I have provided several shorter answers to already answered FAQs.)
 
@sbi Sure, let me put that onto my todo list.
0. make todo list
1. write comprehensible answer to UB FAQ
 
#0 seems already done. Get cracking on #1.
 
sbi
@FredOverflow 2. delete todo list
Damn.
 
gotta leave for work in 20 minutes
8
Q: Object-Oriented Suicide or delete this;

Armen TsirunyanThe following code compiled with MSVC9.0 runs and outputs Destructor four times, which is logical. #include <iostream> class SomeClass { public: void CommitSuicide() { delete this; } void Reincarnate() { this->~SomeClass(); new (this) SomeClass; } ...

lol @ "object-oriented suicide"
 
Not that again!
 
10:44 AM
old?
 
Not old, but... not very tasteful.
Wrong choice of words.
 
lol
Let me post a picture of Herb with a mustache, then:
tasteful?
Dang, "C++ Concurrency in Action" has been postponed again.
 
Again? Next year, then?
 
Oh, Herb Sutter will release "Effective Concurrency in C++" in one year!
@RMartinhoFernandes December 28th
 
Oh, that postponement was done some time ago now.
 
10:51 AM
was news to me
 
It's sad, because I won't get it for Christmas.
 
Let's hope it'll be published before C++1y :)
@RMartinhoFernandes You could ask your family to postpone Christmas until the book is published.
 
Then it takes 3-5 days to arrive.
That would put Christmas after the New Year.
That would be too weird.
 
Or they could buy you the electronic version right now.
 
I want trees!
Also, no one is buying it for me.
I am.
The Spanish only exchange their gifts on the 6th January.
 
10:57 AM
Then you should emigrate to Spain.
 
11:17 AM
@FredOverflow Where did you read that?
 
 
1 hour later…
12:21 PM
anyone worked with Qt?
 
I did.
Not that much, but I believe I went trough all the most common stuff.
 
Anyone didn't work with Qt?
 
0
Q: Qt Gridlayout doesn't realign GUI elements

Tony The LionI have the following code in the ctor of my main window widget, in my Qt App. No matter how I align the buttons added to the QGridLayout, they always stay in the upper left corner, on top of each other. Can anybody tell me what I've done wrong, I can't find it. btn_File= new QPushButton("&...

my question
I'm baffled
 
Neat, there's a Python 3 to Haskell compiler.
 
12:31 PM
@TonyTheLion: Sorry, I don't remember Qt good enough to answer that. What happens if you add your widgets to (0, 0) and (1, 0) instead ?
 
Is the parent widget large enough?
 
@ereOn same
 
@TonyTheLion QGridLayout constructor takes int nRows = 1, int nCols = 1 . You didn't provide them so you have a 1x1 grid.
 
Btw I wonder why Qt uses signed integers to indicate row count and column count.
 
12:37 PM
@StackedCrooked doc.qt.nokia.com/latest/qgridlayout.html I don't find that ctor here
@StackedCrooked hmm no idea
 
@StackedCrooked probably just because why not. You're unlikely to have over 2 billion rows ;)
and then you can detect invalid values, instead of jsut having them wrap around to a huge positive number
and maybe because they want to interop with languages that don't have unsigned ints
 
@TonyTheLion Sorry, apparently I was looking at Qt3 documentation.
 
this is really strange
 
What is the proper english name for a software that helps you manage your banking accounts and expenses (you know, when you have a credit card ticket and you want to "register" it somehow to know at any time how much you spent) ?
 
BankManagerSingleton.
No, wait, that's Java.
Personal finance software?
 
12:48 PM
@RMartinhoFernandes: Haha :p That whould be BankManagerSingleton.GetFactory().GetSingletonInstance().CreateFluent(true);
@RMartinhoFernandes: Personal finance software sounds good. Thanks. Do you know any such software that would be open-source/web based ?
 
No, I don't know any.
 
I'll try GnuCash
(At least, the proper name helped me finding a list of softwares. Thanks again)
 

« first day (415 days earlier)      last day (4531 days later) »