« first day (1038 days earlier)      last day (3893 days later) » 

12:01 AM
@sehe What is the deity for farting?
Thor might make a quick reappearance.
Got to go. It was fun, all but R.'s link, that was just plain evil.
 
12:31 AM
@DeadMG And then fuck 'em up with a Swarmer
 
> Then you say you also can't read the constexpr version, which is hilarious, because it's a one-liner loop on modulus, suggesting that you really shouldn't be writing a software blog.
Yeah.
I guess he is.
 
<limits> has everything <climits> has except the one thing I need.. CHAR_BIT..
 
12:47 AM
Oh, you mean 8 ?
:P
 
yeah
Sometimes I feel like just putting 8 there, doesn't really matter :P
 
Out of curiosity, on which machine is a byte not 8 bits?
 
according to SO C++ pedants many.
 
if you develop for calculators or mainframes from the 90's or before
 
@nightcracker who develops for calculators?
 
12:55 AM
people working at texas instruments I dont know
 
@Rapptz out of curiosity are there actual platforms that have non 8 bit bytes ?
 
yes
 
@nightcracker are the basic calculators , programmed or hardwired?
 
programmed usually on a very very small chip
 
12:57 AM
anyway imma.. you know. Put an 8 there and call it a day
 
@Rapptz that page says C++ standard says a byte must be 8 bits, AFAIK the C++ standard says a byte is the smallest addressable memory unit and sizeof(char) == byte
 
yes
but it's at least 8 bits per byte.
You can have more than 8 bits per byte.
(Hence.. CHAR_BIT)
 
oh so a platform that has byte < 8 is not supported by C++ ?
 
nop
or C
 
POSIX mandates CHAR_BIT == 8
 
1:00 AM
Sanity mandates CHAR_BIT = 8
 
yeah, fuck > 8 bit bytes.
 
Therefore, POSIX = Sanity.
 
Ahahahaha no
 
1:11 AM
@nightcracker Maybe, possibly, arguably, in one respect, yes. In general, far from it.
 
I just can't get enough of this intro
 
1:33 AM
argh stomachpocalypse
 
1:45 AM
@DeadMG whats wrong with your stomach ?
 
gallstones, supposedly
 
just nuke it
 
@DeadMG isn't that like totally treatable ?
 
nah, pretty sure the dog will die
 
@A.H. Supposedly. But my doc doesn't seem to eager to actually get on with that. Surgery can have some very unpleasant chronic side effects of it's own.
 
1:54 AM
isn't it possible to "vibrate" the gallstones away into dust using some echotherapy?
 
go for the surgery. my wife suffered with gall stones for almost a year before they figured out what was wrong. after surgery, she was soooo much better.
no more finding her curled up in a ball crying on the bathroom floor.
 
@nightcracker Only some kinds. But even if it were, since I've had them for two and a half years, I'd just gall up some new ones.
 
Boo batteries in my controller are dying, and I forgot to buy rechargeable ones.
 
wasn't there a non surgical option as well ?
 
(And a charger)
 
2:00 AM
@A.H. Doc told me to lose some weight first. It's been about four months and 36 pounds since then
 
get a second opinion
 
aye
to be honest
I'd go for the surgery in a second, but some of the side effects can apparently be not only nasty, but rather chronic.
 
chronic diharria ?
 
yeah
I hate diarrhoea and frankly, trading the stones for long-term diarrhoea is not necessarily what I would call a "win".
 
#winning
 
2:05 AM
0
Q: Singleton, shared_ptr, raw pointer, or other pointer?

DanB91class GameBoy{ public: GameBoy() :cart(new Cartridge()), mmu(new MMU(cart)), cpu(new CPU(mmu)) {} void step(); //steps through one instruction const CPU::State &getCPUState() const noexcept; void loadROM(std::string fileName); private: std::sha...

lol
GameBoy class!
 
Had korean BBQ buffet on Friday, ended with a sore stomach and painful tummy, but went on overnight hiking trip on Saturday anyways. Experimented with fire (BBQ in the wildness), hit my own hand with a rock while setting up the tent. Now my whole body aches, also have sore tummy and sensitive, wounded hand.
although they are pretty much all my own fault
 
@Rapptz why the shared pointers?
 
I don't know.
 
and why does he say that it should be used sparingly ?
 
@A.H. They should be. The situations that require shared_ptr rarely come up in practice, unique_ptr is good for almost all scenarios.
 
2:25 AM
argh, stoopid interwebs, hurry the fuck up
 
@R.MartinhoFernandes are you saying that unique ptrs are bad?
 
I'm saying to stop thinking of whatever pointers first.
Just use normal C++
 
you mean non pointers?
won't work if its a base class
 
Won't work if a dozen other conditions too...
Still, should be the default option.
 
2:41 AM
0
Q: Whats the use of DETECT and getmaxx() and getmaxy() in c++?

DINESH PRABUI am new to c++ programming. Could you please tell me the use of DETECT and getmaxx(),getmaxy() functions in C++ and how to implement them? Thanks in advance. -Dinesh

what the fuck
 
@Borgleader perhaps C++14
 
If it was C++14 why would he want to know how to implement them?
the implementation would be provided
 
What causes stoi to throw?
 
plus, these don't sound "standard-y". I can't see in which context a getmaxx would make sense in the c++ standard lib
 
2:47 AM
nvm got it
 
I read Scott Meyers' drafts for the auto and rvalue refs items in EC++11 and, even though nothing was new to me, seeing all the corner cases exhaustively explored in the same place makes me sick. C++11 has so many mistakes that don't have a source in C or C++03 :(
 
:(
What kind of mistakes? (Also it seems more and more like EC++11 is going to be a book I'll have to read multiple times)
 
Gonna take a wild guess, universal references, hiding the copy constructor, expecting universal references to be r-value references, using auto with an initializer list but not with templates.
etc
 
The corner cases everywhere, and the messy interactions between the new features.
 
So you're saying they botched it?
 
2:51 AM
What @Rapptz said
 
Despite those corner cases, I still think C++11 is pretty good.
Reference collapsing is a bit messy.
Though I do wish brace-init could be deduced from templates to initializer_list<T>, or at the very least if not that remove it from auto.
 
@A.H. here's your answer
AFAICT they're functions from Turbo C Graphics. — Brian Cain 1 min ago
if he's right anyway
 
lol
 
They do remind me of that.
 
hes probably right
 
2:58 AM
I wish we could close as "Read the fucking documentation"
 
@Borgleader Borland Graphics Interface (BGI) to be exact.
 
or "don't use a 10yr old compiler"
 
@Borgleader 10? BGI would be closer to 20.
 
Oh god...
 
@Rapptz one of the most annoying is auto breaking with proxies like vector<bool>::reference or expression templates.
 
2:59 AM
@Borgleader its easy for beginners to mistake tools provided with an IDE/ compiler/ toolset for a standard part of the language
 
@A.H. Still it has to come with some sort of doc. Plus, why would you use something this old?
 
@R.MartinhoFernandes Ah yeah. When I actually experienced it I wished I could have your proposed operator auto().
 
@Borgleader old book / crappy professor
 
Apparently Turbo C still has a lot of use in Indian universities.
 
Yeah that much is obvious by the amount of questions on SO about turbo c from indian users
But why would they use such an old compiler?
 
3:02 AM
Morons.
 
crappy professors
all the good ones emigrate
 
I don't like catch's expression thingy.
i.e. this
 
Make your own, you're always bored anyway ;)
 
except it failed with std::vector and stuff
 
Oh boy, ambiguous op<<
'Here, have a look at these 5215 overloads and find out where you fucked up.
 
3:09 AM
the errors when I use catch get so big that I can't even scroll up from my command line to see them
:(
Ugh. In C++11 this is actually prohibited due to a defect in the standard, and you technically have to use s.begin()[ 1 ] = 'a'; But it's not worth worrying about. — Potatoswatter 1 min ago
lol
 
vim saves it all. And forces you to watch it scroll for hours. Ugh
 
don't use vim :P
@Rapptz lol really?
 
No it's a joke
Shame on you for asking. slaps wrist.
C++'s not that crazy!
 
lol @ the follow-up comment.
Hello all.
 
Hello
 
3:14 AM
Hi Mark!
 
I've been out then Google plunges? What a coincidence!
:P
As of C++14, [] also performs bounds checking. — Potatoswatter 44 secs ago
^ It does?
Seriously?
 
He is on a trolling spree I think
 
@MarkGarcia Don't flatter yourself, @Mysticial dropped a pepsi can in the server room and the google servers hickupped for a few minutes ;)
 
lol
 
@Rapptz Try -fmax-errors=3 (or so).
 
3:17 AM
@Borgleader Nice. Now we know he isn't just working on YT. :)
 
@JerryCoffin thats useful to know
 
@MarkGarcia constexpr const_reference operator[]( size_type pos ) const; only change from C++14
 
constexpr revolution!
 
@Rapptz constexpr ? : O
 
Oh I think he's serious
 
3:19 AM
@MarkGarcia Yes: "Returns: *(begin() + pos) if pos < size(). Otherwise, returns a reference to an object of type charT with value charT(), where modifying the object leads to undefined behavior."
 
@Jerry that only helps keeping the terminal buffer clean, though.
 
I wouldn't say that's bounds checking.
 
@Rapptz That isn't the bounds check itself, but it has to check the bound to give that behavior.
 
@JerryCoffin Hmmm... I wonder how the check would affect performance on correct (no overrun) code.
 
3:21 AM
@Jerry it can just keep the null Terminator right there
 
@R.MartinhoFernandes Yes, but it's enough to let you scroll back to the beginning (in most cases).
 
It still doesn't throw, does it?
 
no throwing
like I said, only change I found was making it constexpr const.
 
@Jerry bit the juice on GCC errors is at the end!
 
@R.MartinhoFernandes It's required for all pos >= size, so unless you're prepared to store numeric_limit<size_t>::max()-pos NULs, you need to do a bounds check to implement it.
 
3:23 AM
Hm.. the change.. is silly. I don't really like it
 
@Jerry is it? I don't have the standard on hand here, but I'm pretty sure the function had a Requires clause
 
@R.MartinhoFernandes This limits the number of errors reported, not the length of an error message (though I haven't checked whether it still traces all the way back to get the "instantiated from..." part.
@R.MartinhoFernandes Ah, quite right: "Requires: pos <= size()"
 
Violating a Requires clause is UB. The described effects need not apply.
 
I think I need some caffeine...
 
s/some/more/
 
3:25 AM
1 Requires: pos <= size().
2 Returns: *(begin() + pos) if pos < size(). Otherwise, returns a reference to an object of type
charT with value charT(), where modifying the object leads to undefined behavior.
3 Throws: Nothing.
4 Complexity: constant time.
 
@MarkGarcia I haven't had any caffeine (recently enough to still be in effect) so, in essence, any would be more.
 
C++14 draft
 
lol
1 Requires: pos <= size().
2 Returns: *(begin() + pos) if pos < size(). Otherwise, returns a reference to an object of type
charT with value charT(), where modifying the object leads to undefined behavior.
3 Throws: Nothing.
4 Complexity: constant time.
 
@R.MartinhoFernandes At least none required. Of course, the undefined behavior when pos>size() could include throwing.
 
3:26 AM
My C++11 draft says the same thing
anyone have an older draft? (N3376)
 
@Rapptz I have n3337, which says the same. I don't have it handy, but I'm pretty sure the standard itself requires the same.
 
So.. basically no bounds checking?
 
Nope.
Potatoswatter missed the forest for the trees.
 
Doing a quick look, I do have a copy of n3290 handy though (final draft that became the standard, with no further changes, if I'm not mistaken). It has the same requirements.
 
Hmm... In the "returns a reference to an object..." part, the container must return some valid reference of some object (not temporary). With that, it implies returning a reference to a pre-allocated object or a global variable.
 
3:33 AM
@MarkGarcia Yes -- basically, std::string is required to store a NUL at the end of the used part of the buffer. It'll normally return a reference to that, just like it would to a character in the string.
 
@JerryCoffin Oh. The terminator is used. I see.
 
It has to be a null terminator at the end of the string for all but empty strings.
Other requirements elsewhere (data) leave no other option.
 
In theory, it could get away without a terminator part of the time, but quite a bit of the spec is basically written assuming it'll always store a terminator, and it does have to at least have the space allocated at all times, so it can write the NUL terminator on demand, with no possibility of an exception from re-allocating space.
 
That requires locking though.
Only Hell++ would be that bad.
 
@R.MartinhoFernandes Yeah, probably.
 
3:37 AM
Hmm maybe you can get away without the locking
It's a benign race, I think.
 
0
Q: Anyone want to be a awesome person and turn this into C++ code for me?

Shane RossOMFG, it would help me out a lot. Thank you vury vury much. @echo off :choice set /P c=Are you awesome??? [y/n] %NL% if /I "%c%" EQU "y" goto :yes if /I "%c%" EQU "n" goto :no cls :yes echo "DAMN RIGHT!!! :D" pause exit :no echo "LIES!!!" pause cls goto :choice

 
if a bool expression is done at compile-time, say void f() { if(bool_expr_compile_time) return; else { ... } } can I assume f() will be a no-op by any decent optimising compiler?
 
Who wants to be awesome?
 
Both threads would try to write the same value and then read it right back. That should be fine on most architectures.
 
I read that as "run this C++ code for me"
 
3:41 AM
@Rapptz I think you would even get a warning about dead code
 
WTF. -12 votes.
 
@R.MartinhoFernandes I don't actually :P
 
@R.MartinhoFernandes I suppose it's technically UB, but I have a hard time imagining an architecture where you'd get anything but the NUL terminator you expect.
 
@MarkGarcia It isn't even funny.
Therefore, I didn't feel bad about my dv.
 
@MarkGarcia Ah fuck it. I'll give him one more -1.
 
3:44 AM
Silly me, thinking the downvotes would stop (or at least slow down) once it was closed.
 
@JerryCoffin :)
 
> viewed 25 times
15 downvotes
 
lol
 
To OP: we already are awesome!
 
Pretty shitty question.
Well, now it's -16.
 
3:45 AM
@Mysticial That's a pretty impressive percentage, now isn't it?
 
:)
 
@Mysticial Did you give it a downvote?
 
@MarkGarcia I'm not nearly awesome enough to answer a question like that.
 
27 views and -16
 
@Rapptz nope
 
3:46 AM
Help, 16 doesn't go into 27.
 
View counts are heavily cached
 
I told someone to look something up and they did. heh
 
@Rapptz Maven't you paid attention? @Mysticial likes his multiple of 5 score enough that he won't downvote anything short of the devil himself demanding that we all write PHP.
 
Was it 2girls1cup or something?
 
@R.MartinhoFernandes I'm only that cruel on Saturdays.
 
3:49 AM
@JerryCoffin Question downvotes are free. :)
 
@Mysticial Oh yeah -- I'd forgotten that.
 
ROBOT
shouldn't you be in bed or someshit?
 
As of C++14, [] also performs bounds checking (but not the same way; it returns '\0' for out-of-bounds indexes). — Potatoswatter 36 mins ago
 
@DeadMG Shouldn't you?
 
I never heard about this O_o
 
3:51 AM
@JerryCoffin Gallstones.
 
@chris We just discussed it.
 
@chris Scroll up a ways -- already discussed.
 
I would miss it.
I was bowling.
 
@chris What was your score?
 
@JerryCoffin Umm 100 and 90 or something like that. I suck at 10-pin bowling, and this was better than last time.
 
3:54 AM
I 500k cookies per second :D
 
@StackedCrooked No fair, I'm only 45k.
 
And 18 time machines.
 
holy cockfucking shit, I should go to bed.
speaking of which, I'm going to bed.
wish me luck with the sleeping
 
I just woke up.
@DeadMG Good luck with the sleeping!
 
@chris Hey -- now that's the range where I might almost be competitive (or would have been the last time I tried to bowl, 30 years ago or so).
 
3:56 AM
So basically it returns char() (s/char/CharT) when pos == size and that's what was misinterpreted?
 
@DeadMG Luck.
@chris So basically there has to be a terminator on the buffer, and it returns a reference to it if that's the index you give.
 
@JerryCoffin I've been doing 5-pin for quite a while now. I somehow always manage to split my right thumbnail and rub off the side of the thumb when I do 10-pin.
@JerryCoffin Yeah, I knew that needed to be there before, which is why &s[0] is officially safe now, as opposed to C++03, where it isn't guaranteed.
Heh, I learned most of it from a question I asked.
 
@chris Not only asking a meaningful question, but also learning from the answer? You are hereby banished from SO for the next 17 years (or milliseconds, if you insist).
 
@JerryCoffin Hmm, ok.
Oh wow, someone voted to undelete the batch to C++ thing.
 
Hm
 
4:08 AM
@MarkGarcia make your example use a pointer to something not newed and the problem becomes more explicit, I think.
 
@R.MartinhoFernandes Thanks. I'll try to do that.
@R.MartinhoFernandes Done.
 
Oh I see, stuff's been changed...
 
4:24 AM
0
Q: Nice way to portably "assign within conditional expressions" without warnings (or pragmas)?

MehrdadI have a piece of code like this: bool finished = false; for (Iterator i = begin; i != end || (finished = !finished); finished ? i : ++i) { // (body) } The goal is to execute the body for all iterators including end(). The loop is nice enough, but I get "assignment within conditional expr...

The loop is nice enough, they said.
 
lol
The loop looks like it can be rethought.
 
lol
 
@R.MartinhoFernandes What the fuck for loop
 
@Rapptz yeah, typical XY
 
Is there anybody had program project for car navigation belongs to opensource code?
 
4:30 AM
@Rapptz you have a typo in your comment
 
thanks, fixed
 
Hell, use an index!
 
Anyone know offhand how I'd "zip" two lists [(Int, Int)] and [Int] into a list of triples [(Int, Int, Int)] in Haskell? (zip of course produces a list of nested tuples) I figure's probably something easy I'm missing, but not finding anything on Hoogle
 
@R.MartinhoFernandes dafuq
 
@MarkGarcia don't tell hell what to do!
 
4:33 AM
lol
Implicit pun!
 
@robjb zipwith? or wtv its called?
 
@NeilKirk: That only works when this loop isn't nested inside other pieces of code. Otherwise I'll have to pass lots of parameters just for this. — Mehrdad 1 min ago
I read 'this code is a horrible mess and I want to shut up a warning on it.
 
@Borgleader Not sure, still pretty new to the language, I'll check it out
 
Me too :P
 
@rob triples are bastard child and don't get much love. But zip3 or something.
 
4:35 AM
@R.MartinhoFernandes Haha yea that's what I wanted, thx.
 
May need some unzip as well.
 
I don't really know yet how to define any sorts of complex data structures
So I'm using lists and tuples for everything :\
 
so that mess of a for loop is just to iterate on all iterators?
 
Yay! 4K reached!
 
gratz
 
4:37 AM
cg
 
@robjb im trying to code it right now
 
Thanks.
 
@borgleader I decided to learn it by tackling projecteuler.net, but I'm having a headache implementing QS for problem #3
 
I'm looking for some opensource project about car navigation which works with aid of gyroscope or accelerometer, but faild to find it in current popular website i.g. github. anymore, some website is banned in China, so could someone give me a help to seek some project like this. help, help, help
 
I think I'm the only regular on here that has >= 300 solved on PE
 
4:38 AM
Nice
 
my multiplication's off :(
 
Eh?
 
@DarkHorse open source gps ?
 
What do you mean by QS?
 
@Rapptz I have a personal letter from Euler awarding me 500 meaningless internet points (true forward thinking having sent it ~300 years before the internet was invented).
 
4:41 AM
exactly it's navigation @A.H.
 
@DarkHorse does this help? first google result....
 
You can do PE 3 with tail recursion.. I.. think..
don't quote me on that
My multiplication doesn't work with numbers.
I don't get it
It works with strings
 
@Jerry I wrote a letter to Euler awarding him 600 Internet points. I wonder what he did with the remaining 100.
 
@R.MartinhoFernandes Quadratic sieve ... I realize it's overkill for the problem but I wanted to implement it
 
Thanks, But I need car navigation rather than smart devices
@A.H.
 
4:44 AM
like display on the windshield ?
 
@R.MartinhoFernandes I think he left them to Carl Gauss (figured he didn't need many, since he'd get real rep all by himself).
 
yeah @A.H.
 
@DarkHorse that exists ?
 
I think so. @A.H.
 
@DarkHorse link me one
 
@robjb ideone.com/GBlugc zipWith example for what you asked
 
Ah, very nice
 
@A.H. I have not yet find one like that, this it the reason I came here to get a help from you guys
 
Never used zipWith before so that's instructive :)
 
Me neither, until 5 min ago, but I read about it
 
4:55 AM
Triples are abominations!
 
@R.MartinhoFernandes s/Triples/Tribbles
 
Oh that Mehrdad is a known 'troublesome' asker, right?
 

« first day (1038 days earlier)      last day (3893 days later) »