« first day (294 days earlier)      last day (4669 days later) » 

2:01 PM
Good grief, singleton defenders.
2
BUT CAT, SINGLETONS BLAH BLAH [list of examples].
 
@CatPlusPlus Where? Where? Send the raptor after them!
 
what's wrong with singletons?
 
Everything.
 
what's the alternative?
 
@Kometes Proper design.
 
2:06 PM
@Kometes everything.
 
Ha, that's an old question.
 
@Kometes depends. The lazy solution is to just use a global instead. Then you've eliminated half the downsides of singletons. The better solution is to just pass your dependencies as function arguments where needed
 
Again, the "only need one" argument flying around. A horrible distortion of the "must not have more than one" argument, which is somewhat less stupid.
 
also jalf.dk/blog/2010/03/… for a bit more detail on the singleton thing
Ugh, what are the rules for visibility of typedefs in a lambda? If a typedef is defined in the scope where the lambda is defined, can the lambda see it?
msvc doesn't seem to think so
 
I'd find that intuitive (it being visible).
GCC is cool with it.
 
2:10 PM
@jalf GCC has never complained to me about the visibility of a typedef. Don't know about the Standard.
 
I've never read @jalf's singleton article before. I really like this line:
> When was the last time you saw some­one acci­den­tally invoke std::ostream() << "Hello world";, when they intended to write std::cout << "Hello world";?
> +1 just because you're litb. – dauphic 7 mins ago
Hey!
 
MSVC hates lambdas
they're implemented, and they're awesome, but lots of niggling annoyances
 
> Or use the Mono­state pat­tern, or what­ever you feel is the clean­est solu­tion.
@jalf I think Monostate shares the same issues with singleton.
 
2:28 PM
Here's a random musing on "unsung hero": I have the impression that certain communities (tags) have a much greater focus on relatively simple, low-concept "how do I do this" questions which are essentially "write-only" and rarely of interest to others -- I guess and are prime examples, but possibly also -- anything were lots and lots of people have casual interest but don't really have foundational or architectural questions.
So you can easily answer tons of questions there which are all accepted, but never upvoted because they're not fundamentally interesting.
 
You mean, noobtags?
 
@RMartinhoFernandes Hehehe. Well. MySQL is a legitimate program, so I'd hesitate...
 
@KerrekSB Lots of MySQL users are PHP programmers.
 
By contrast, I imagine that it's pretty much impossible to be an unsung C++ hero.
 
@KerrekSB I think @Tony has that one.
 
2:30 PM
I'm a C++ hero!
 
@DeadMG No doubt :-)
 
noobtag, noun, a tag with an endless stream of newbies, and where many of those newbies stay newbies for a long time.
 
@DeadMG You can be the unsung DeadMG++ hero
 
and don't you forget it!
don't think that DeadMG++ has any heroes right now
and if it ever gets any, I certainly won't be unsung
 
cough, cough
Maybe I'm catching a cold. I shouldn't have been outside in the rain.
 
2:32 PM
owned
rain > Martinho
 
@RMartinhoFernandes Yeah, that sort of makes sense. I mean, I'm not surprised that lots of people have basic questions, because of the ubiquity and the low entry barrier to LAMP and all. But I'm sort of surprised at the relative lack of deep, cool questions. Maybe I just don't see them, though.
@DeadMG You can't sing at your own coronation, you know that
 
lol
 
@Tony: congrats on the C++ bronze badge!
(I noticed you had 99 upvotes, so I went looking for an answer of yours to upvote.)
 
Could I bribe someone into upvoting this old answer of myself? I could get a "self learner" badge with one more upvote, and the program is genuinely useful, too :-)
 
not convinced about the anti-singleton arguments
 
2:41 PM
Which do you find weak?
 
@KerrekSB Done
 
@KerrekSB Yeah, I also find that Windows is too aggressive when paging stuff out.
 
@KianMayne Yay, thanks! I should upload that program to github. Maybe others might find it useful, too... and I really wonder if a similar problem arises in Linux.
But I've never found myself waiting for every open desktop application to come back from disk in Linux for any significant amount of time
 
@KerrekSB My experience tells me that Linux is much more conservative.
 
@RMartinhoFernandes Conservative which way round?
 
2:44 PM
Conservative in the use of the swap file.
In Windows, minimizing an application will lead to its swapping out very soon.
And then when you restore it, if it's something heavy, like say, Visual Studio, or a virtual machine, you're bound to get bored waiting for it to come back to life.
 
I admit that when I see more than 0 bytes of swap space in use with top I immediately worry that I'm doing something wrong.
 
A thing that surprised me is that Windows runs so much more smoothly when you don't override the pagefile settings
 
the only pagefile settings I changed was to move it off my SSD
 
But SSDs are so much faster!
 
2:48 PM
fiddling with max/min sizes on it just makes Windows freak out
and page everything all the time, apparently
 
yeah, but it's also much smaller
and I don't feel the need for a fast page file
Windows is going to be written with the assumption that loading from the page is slow
 
@RMartinhoFernandes Yeah, that's definitely happening all the time
 
Plus, until Steam allows fine-grained installation of games you need all the room you can scrounge on the SSD. Obviously.
 
@jalf What setting do you recommend?
 
yes
 
2:51 PM
@jalf Interesting. Do you have a possible explanation to offer? Or maybe just a speculation?
 
it's not like I can afford to put all 200GB of Steam games on my 64GB SSD
 
@KerrekSB I think he's suggesting whatever the default is.
Something like "Let Windows manage this crap".
 
sbi
There goes my relaxed weekend.
 
What went wrong?
 
@KerrekSB "Let Windows manage..."
 
2:54 PM
@jalf Hm, let me check... Oh, I think I wanted my swapfile on a separate partition, so the default settings were out.
 
sbi
@RMartinhoFernandes The mother of two of my kids just called. She's sick. I need to take the kids. That means I won't get much done in the garden this weekend, I'll have to provide three meals a day, bully kids to bed... <sigh/>
 
And not sure exactly why, I just noticed that when I tried to set it to sensible values, based on all I know about how an OS works, and what hardware I have, I got a reasonable amount of paging. When I set it back to "Windows Managed", my harddrive literally spun down and went into sleep mode while I was playing high-end games
 
You can pick the partitions and select "system managed size".
 
I only noticed because the game stuttered 40 minutes later, because it had to spin up the harddrive
 
@sbi Employ your kids to answer PHP questions on SO so you can cap
 
2:55 PM
that pretty much converted me instantly. Since then I haven't changed the pagefile settings away from default
 
One meal for every 5 upvotes
 
sbi
@KerrekSB No, I wouldn't do that. I love those kids, you know. No PHP for them, if I can help it.
 
I can't really think of a good explanation, other than maybe Windows uses a different swap policy when you set a specific size, like then it assumes that it has to use the whole swap file all the time
 
@KerrekSB Gosh, you're... mean.
 
didn't realize that you had kids with more than one woman
 
2:56 PM
@jalf Very interesting. Unfortunately I also cannot set the value back to "managed" because there's not enough space :-(
@jalf That'd be weird, but plausible
@RMartinhoFernandes Come on, PHP
 
sbi
@DeadMG There aren't so many women in western country who would want to have more than three children.
 
@sbi Love is fine and well, but reputation points...?
 
true
 
@KerrekSB you can tell it which drives to use, and then let windows manage the size on each
 
@KerrekSB nice :)
 
2:57 PM
that should have the same effect
 
sbi
@KerrekSB It's just SO. Get a grip. There's a life outside SO.
 
@jalf Yeah, I left mine as Windows Managed size on my mechanical drive
 
@jalf Theoretically.
 
@RMartinhoFernandes yeah, probably. Unless Windows interprets it differently
 
@jalf Right, I saw that, but I'm currently on "[D: 1536-2048]", and I cannot say "let Windows manage" because of not enough space (1.5GB RAM).
 
2:58 PM
@KerrekSB free up some disk space? ;)
 
@jalf The story of my life.
 
hehe
 
Someone showed me a really cool disk space usage visualization tool once that showed file sizes by area. That was awesome and would be really useful now.
 
good day, what's new?
@sbi oh rly?
 
3:00 PM
@KerrekSB Like this?
 
Als
I am pissed
 
@Als why?
 
The radial chart is cooler :P
 
Als
3:01 PM
@TonyTheTiger: People can't stop voting on the Is 0 an octal literal answer
 
@RMartinhoFernandes Interesting. Well, any will do, but I need to see individual files.
 
@Als haha
why is that a bad thing?
 
The radial chart of Filelight can be navigated. It runs on KDE though, so no luck for Windows.
 
@Als isn't it just a matter of looking up in the spec exactly how literals are parsed?
 
It's another one of those nothing-special answers that everyone keeps voting up.
 
Als
3:03 PM
@jalf: Exactly! @TonyTheTiger: Because I don't see how it interests 121 people
 
@Als well I don't know
 
Als
121 atleast I should say
 
it's just one of those random facts that are merely interesting to know
 
Als
@TonyTheTiger: Why? Would you look at 0 in a different perspective now?
And if yes How so?
 
@RMartinhoFernandes oh thx
 
3:05 PM
@jalf I tend to upvote answers which dig up relevant quotes from the Standard.
 
Als
@LucDanton: You are are a Standerdese fan
 
@Martinho it doesn't say I have a new badge...
:(
 
Als
did i spell it correctly?
@TonyTheTiger: What badge?
I noticed i got one today let me check
 
33 mins ago, by R. Martinho Fernandes
@Tony: congrats on the C++ bronze badge!
 
Als
Prof reader puff puff
 
3:07 PM
@TonyTheTiger It takes sometime.
 
oh I see
 
But you have 100 upvotes on C++ answers, which is the criterion for it.
 
So, it must be coming soon.
 
Als
@TonyTheTiger: I thought you already had one
bronze is 100
silver is 400
 
sbi
3:08 PM
@LucDanton I rarely upvote answers that only quote the standard. We need to answer questions because the standard is not readable for everyone. It needs to be interpreted. It's fine to back up what you say with the standard, but you need to explain what it's all about and you need to put it in context.
 
Als
& Gold is 1000, *displays his shiny gold badge ;)
 
@sbi I agree. "tend", so subject to my discretion :).
 
@Als no I don't have one; I have one for C#
 
Als
@sbi: I shall add though Sometimes the standard states it in very explicit ways where no explanation is needed.
@TonyTheTiger: I earned mine while you were in US
 
@Als oh I see; hahah
 
sbi
3:09 PM
@Als Yeah, sometimes a single sentence from the standard explains it all. But often it doesn't.
 
Als
@sbi: Agreed, And sometimes its too damn complicated to understand as it is unless you break your head over it for quite sometime
@TonyTheTiger: Yup, I remember being behind you on rep by atleast 5k when we got acquainted for the first time here.
 
0
Q: Are C++/C multidimensional arrays special cases of ragged arrays?

Johannes Schaub - litbI had a discussion with a buddy about whether C++ and C multi-dimensional arrays are special cases of ragged arrays. One point of view was A multi-dimensional array is not a ragged array, because each element of the multi-dimensional array has the same size. In a ragged array, at least one el...

@Als and now you got way ahead of me
I wonder if @Johannes is playing us again
 
Here's a good rule of thumb: @Johannes is always playing you.
 
Als
he is a player
His Q's are often probing deep corners of the standardese & unanswerable
I look at them just as a passing breeze.
 
From his SO profile:
> Sometimes, I'm trolling.
 
Als
3:14 PM
@RMartinhoFernandes: It should be modified as Always Trolling
 
I wonder, how does Nullable<int> make the value type Nullable?
C# this is
 
It has compiler magic behind it.
 
Als
@TonyTheTiger: I am illiterate in C#
 
And I think some runtime magic too.
You can make something very similar by yourself, but not quite the same.
 
hmmm
magic eh
 
3:18 PM
That part of making it nullable is easy.
It's mostly the null propagation that gets tricky to do without magic.
 
null propagation, what do you mean by that?
 
Als
hmm I can only nod helplessly at this C# conversation.
Oh btw, You should go to C# room if you want to talk about it
 
@TonyTheTiger int? x = null; int? y = 10; int? z = x + y; <- this makes z null.
 
Als
This is C++ err...zoo...We just have Bunga Bunga parties here.
 
@Als what languages do you know?
 
3:20 PM
@Als That makes sense, somehow.
 
Als
@TonyTheTiger: c, c++, shell scripting, pro c, little bit of sql here and there
 
Pro C is that C/SQL hybrid from Oracle, right?
 
Als
@TonyTheTiger: Not too many, I have played with Android before too
 
@Als ohhh
 
Als
@RMartinhoFernandes: Yup, that's right, It is an Oracle proprietory, embedded sql actually
@TonyTheTiger: Android is remarkably easy & in demand.
can someone change the room title to Bunga Bunga partay ofcouse no offence meant to anyone
 
3:24 PM
room topic changed to Lounge<C++>: Bunga Bunga partay!
 
@Als never tried it; haven't a clue
 
@Als Why would it be offensive?
Is there a hidden meaning I'm not aware of?
 
Als
@RMartinhoFernandes: Berlo seems to be romping with it in Italy
I don;t know if Italians find it offensive
 
Als
 
3:28 PM
> (...) a naked party involving a lot of activity (...)
 
Als
haha
 
Als
After dinner naked party involving lot of girls
and lot of activity
I am surprised You guys are not aware of it?
 
Honestly, I thought it was some African thing, with bongo drums or something.
 
Als
@RMartinhoFernandes: There has been an international furore over this for a long time now
 
3:30 PM
I never heard the term before.
 
Als
I am a bit surprised you have not @RMartinhoFernandes
@RMartinhoFernandes: google gives About 3,120,000 results
 
I'm used to being the last to know. I keep saying I should pay more attention to the news, but I never come around to it.
 
honestly? Burlusconi has been like that since I've been alive
if you're Italian, either you vote for him or you don't- it's not like a new sex scandal is a change of character for him
 
Als
@RMartinhoFernandes: So now you know what Berlo is getting being in politics and We silly C++ programmers aint :P
@DeadMG: Apparently, Berlo learned Bunga Bunga from Gaddaffi or so they say, So @RMartinhoFernandes, You may be right about it's African origins
 
Bunga bunga is a phrase of uncertain meaning that dates from 1910 if not earlier. By 2010 the phrase had gained popularity in Italy and the international press as well, when it was used by the Italian Prime Minister Silvio Berlusconi to refer to his alleged sex parties, which caused a major political scandal in Italy. Early use In 1910 a group of English friends, including Virginia Woolf and her brother Adrian Stephen, pretending to be the Prince of Abyssinia and his entourage obtained permission to visit HMS Dreadnought, then one of the world's most powerful warships, in Weymouth i...
> For the erotic South Korean arcade game, see Boong-Ga Boong-Ga.
 
Als
3:35 PM
haha @RMartinhoFernandes, Imagine Berlo trapped in S.Korea seeking Bunga Bunga
They might get him a video game lol
 
> It "is said to be a sort of underwater orgy where nude young women allegedly encircled the nude host and/or his friends in his swimming pool", "an African-style ritual" performed for male spectators by "20 naked young women", or erotic entertainment hosted by a rich host involving pole dancing and competitive striptease by skimpy-costumed "women in nurses' outfits and police uniforms" — but topless women, the prize being prostitution for the host.
 
Als
@RMartinhoFernandes: You are doing an excellent job of extracting the raunchiest parts for display here :P
Well done
:)
 
I wonder what "competitive striptease" means.
 
Als
@RMartinhoFernandes: We should ask @TonyTheTiger, he is our resident expert on matters involving Sex or anything related to that.
goddamn I am pissed
Why would someone downvote this
6
A: What will be the output of C?

AlsThis code is causing an Undefined Behavior. Order of evaluation of arguments to a function is Unspecified in C/C++. This leads to a Undefined Behavior. An Undefined Behavior means anything can happen and the behavior cannot be explained or defined within the realms of the standards specified for ...

 
because it's a horrendous question?
 
Als
3:40 PM
I demand to know what is wrong in this answer!
 
The OP shows absolutely no research at all
oh, the answer? no idea
 
Als
@DeadMG: Can you spot any mistakes in this answer.
I mean truly, I just want to know if there is anything wrong
I don't care of the votes as such, but I just feel a strong undercurrent on the downvoting thing
 
no mistakes
the downvote was probably random, happens all the time
 
Als
@DeadMG: It happened exactly After I voted to close a very similar Q as duplicate of this.
 
I don't think it's actually UB. Is it not unspecified behaviour?
 
Als
3:44 PM
And yet another downvote
uh
 
it's UB
 
Ah, I see Oli has commented on that already.
 
most definitely undefined, undefined, and more undefined
 
Als
Unspecifed behavior due to argument evaluation + Undefined Behavior due to Sequence points
 
Honestly, I don't care much about the difference between unspecified and undefined behavior. I don't want either near my code.
 
Als
3:46 PM
Some jerk downvoting just for fun or jealousy.
 
@RMartinhoFernandes Then how do you pass arguments to a function?
 
Als
I want to know the reason.
 
@LucDanton I don't put side-effects into it, thus not relying on order of evaluation.
 
@RMartinhoFernandes But anytime you pass multiple arguments to a function, there's unspecified behaviour :|
 
@RMartinhoFernandes but it's still unspecified :)
 
3:47 PM
your program still has unspecified behaviour, you just don't depend on it
the two are not identical, although practically you may well view them that way
 
My functions always take a single argument! :P
No, not really.
 
lol
 
Also I don't think Oli's comment is correct. UB stems from interleaving modifications with an assignment or some such. But I don't want to argue that really.
 
you could curry them and enforce your own order
no, it is definitely undefined
++ is both a read and a write, so it's illegal to do anything except read it again without a sequence point
as soon as you write it twice, you invoke UB
 
@DeadMG The justification is incorrect, the conclusion might not be.
 
3:50 PM
no, the justification is totally correct
 
> What's more, there are no sequence points, and the code is modifying i multiple times. That part is undefined.
What he said.
 
is completely and totally correct
modifying i multiple times without an appropriate sequence point is undefined
 
Als
hmm..
 
if i was a UDT, then the user-defined function call would be a sequence point and the behaviour would be merely unspecified
 
Well I can't think of a way to modify without reading and writing (as you previously said) so I'm not sure on what ground I'm standing.
 
3:52 PM
that's because you're not :P
 
Not sure?
 
Not standing.
 
not standing on any ground
damn
I know the logic I want to write, but it seems like I haven't properly supported it
at least, not this cleanly
 
Oh yeah, I remembered the ground I was standing on.
 
rofl
 
3:56 PM
i.e. I re-read that Sequence Point FAQ because I never try to remember the finer points.
 
I know exactly what you mean, but that's still hilarious
"Oh hey guys, I remembered the floor."
 
Now the Standard in §5/4 says
  1) Between the previous and next sequence point a scalar object shall have its stored  value modified at most once by the evaluation of an expression.
 
yes, that's true
 
@DeadMG That's why I asked "Not sure?", the phrasing weirded me out.
Now I'm just rolling with it.
 
lol
 
3:58 PM
9 mins ago, by Luc Danton
Also I don't think Oli's comment is correct. UB stems from interleaving modifications with an assignment or some such. But I don't want to argue that really.
And that's why I didn't want to argue it.
"at most once", really?
 
yes
 
Als
looks like some other users share the same thinking as you @LucDanton
 
I think I've read that FAQ 3 times already. Time to not remember the details again.
@Als It's a kind of morbid fascination that prompts me to dissect the details down to the core.
 

« first day (294 days earlier)      last day (4669 days later) »