« first day (1475 days earlier)      last day (3470 days later) » 

6:05 PM
2K messages per day is ~1 message every 43s
there are 1.440 minutes per day
interesting stats
 
OK, i haf dun teh hacks. I have Admin privilege again:)
 
6:20 PM
nice
 
I have a need to learn C++, but I don't think I need all 1000 pages of Bjarne's book. It's embedded programming, basically C with Classes. Is there a suitable book or other resource available that strips C++ down to its bare essentials?
 
user1804599
Bare essentials require templates, so not C with Classes.
 
@RobertHarvey Why don't you think you need a 1000 pages of Bjarne's book?
 
Damn well better not. Otherwise, I declare your language a big, bloated mess.
Compare K&R.
 
lol @ "my"/"our" language
 
6:27 PM
@RobertHarvey if you think C++ is C with classes, then you are completely missing the entire point of C++. C++ is a Responsiblity(or Resource) oriented language
 
Did I mention embedded?
 
Also you should indeed declare C++ a big bloated mess.
It's what it is.
 
user1804599
@RobertHarvey hey my language is Scala not C++ fu
 
@RobertHarvey and that changes the power of the destructor how....? I wasn't aware that it stopped working when I targeted MIPS
 
Where's that relevant 21daysC++nogo comic strip?
 
6:29 PM
To give you an idea, one of the aerospace companies has their own C standard. It forbids things like memory allocation in a loop, and recursive calls. That sort of limits your options.
Pretty sure a lot of what you guys talk about in here they don't use.
 
user1804599
Then it's not a C standard.
 
AFAIK aerospace companies use Ada or some saner language.
 
user1804599
@Jefffrey NASA uses Scala!
 
It's standard C, all right. They just don't allow certain "styles."
Ada is pretty much gone, since the Ariane 5.
 
user1804599
A dialect of C that does not allow dynamic allocation in a loop is not C.
 
user1804599
6:30 PM
It's a silly dialect of C.
 
Not a dialect. A restriction of usage. Think: hard real-time.
 
@RobertHarvey Going with C++ pretty much ensures even more casualties
 
Well, C++ is what Lockheed is asking for.
Some of the folks in The Whiteboard are suggesting that no modern engineer would be caught dead working in C, so they have to put C++ in their job listings, but much of the legacy stuff is still C.
 
@RobertHarvey well you have two choices as I see it, A) you can use typesafe C or B) you can take advantage of the most powerful feature in C++ (destructors)
 
user1804599
C is for fools.
 
6:33 PM
Destructors are probably alright.
 
user1804599
Using C is an instant security vulnerability.
 
@rightføld Ah, there's ways to fix that. :)
 
Like not using it.
 
@RobertHarvey I still use C for legacy maintenance. OK, projectile-vomit all over display, but my customer has a shotgun to my head:(
 
@RobertHarvey then I suggest you read Bjarne's book, it has less to do with the craziness you think it does and more to do with using C++ in a Sane manner
 
6:34 PM
OK.
 
lol
 
Right, that's one mod less for a couple months.
 
4275
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 published 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 well-written...

 
Yeah, saw that.
 
@RobertHarvey we would get a LOT less stupid questions in if people would start there first
 
6:36 PM
@RobertHarvey AFAIK whatever book is in there is recommended officially by the Lounge.
 
So basically you're saying that I need to learn the whole toolshed, and not just some of the hand tools.
 
@Jefffrey I'm not sure if that's a good thing or not..
 
If a book is not there, then there's a 97% that the Lounge would not approve it.
@RobertHarvey Of course.
 
10 mins ago, by Robert Harvey
Damn well better not. Otherwise, I declare your language a big, bloated mess.
 
C++ is not a language you just "pick up".
or "start coding right away"
It requires discipline and blood loss.
And then, maybe, in a couple of years you are ready to write your first application.
 
6:38 PM
I've been doing this programming thing for quite awhile. It's not like C++ is going to be this impossible thing to learn. But every language has some core things that everyone using it needs to know. You're not going to use every hammer in the tool shed at once.
 
If you say so.
 
[sigh]
 
@RobertHarvey C++ is not the language you think it is. Trust me, I found out with much blood loss. It's not an Object Oriented Language or Procedural Language, it's a Responsibility Oriented language. Which takes a lot of getting used to because it's VERY easy to use wrong.
 
It's funny how you came here for a recommendation. You got one you don't like and now you sigh.
Also if you need efficient code, then I don't really know what I would strip from C++.
 
@RobertHarvey it may seem like we're being hostile, or being rude. Far from it, rather we are the old men in the village warning you not to go to the big scary castle because Thar be monsters!
 
6:42 PM
Maybe exceptions?
 
@Jefffrey I'd keep exceptions, and give away implicit conversions
 
You can't get rid of templates or all the constant time goodness, if you need efficient execution.
 
How much of C is transferable?
 
I'd recommend nothing, except basic if statements.
Even variable declaration changes.
for loops are pretty much never needed.
 
foreach?
 
6:45 PM
Not even pointers
 
Smart pointers.
 
@RobertHarvey Everything in <algorithm>
@RobertHarvey Also std::optional
boost::optional, sorry
 
OK. I'll have a look.
Thanks.
 
This is just the tip of the iceberg.
 
@Jefffrey :(
well if you ever wanna move, Romania's a nice place...
and technically Romania's the HQ for the online libraries division
 
6:47 PM
I've heard Ketchup is acceptable over pizza there.
 
I'd rather not live near savages.
 
lol
I gotta go attend to my beautiful and ketchupful burger now :D
though I gotta admit the onions and cucumbers are the best part
 
Ketchup on burgers is fine.
 
Oh Jefffrey <3.
 
6:48 PM
Barbecue sauce is even better.
 
I love BBQ sauce
 
ikr, it's just awesome
 
bestness
 
lol
 
"Accelerated C++" is 14 years old. Is it still a good book?
 
6:49 PM
Nope
Anything that doesn't take C++11 or C++14 in consideration is not good, nowadays.
 
Might want to modify the Book List question, then. It features prominently there.
 
what about this one?
this is fairly new, and doesn't look very big
 
C++ Primer has been updated to C++11
 
...yes, let's add books because they "don't look big"
 
"Programming: Principles and Practice Using C++" as well
 
6:51 PM
@SamDeHaan he didn't want to read a 1000 pages
 
Then I'd recommend all the Scott Meyer's Effective series.
 
also I'm not talking about adding it to the book question list
 
My misunderstanding.
 
Something about templates exclusively.
Then maybe you are ready to begin exercising.
 
6:52 PM
Then you should watch some of the recent talks about C++.
 
ugh its old
 
Let's say ~20 hours minumum.
 
I thought it was new
 
Then you should get familiar with the standard.
 
@RobertHarvey we have ranged based for insofar as your compiler supports it
 
6:54 PM
Then you are at my level of knowledge.
Which is still fairly low.
 
@RobertHarvey I know you're not planning on using exceptions but I would highly recommend watching the videos on exception safe code
 
By this time you probably discover Haskell, and just forget about C++ entirely.
 
7:13 PM
aaaaaand ded again
WE ARE LOOSING IT
 
not if I can help it
guys, discourse is an amazing piece of software
4
I wish jeff made all the software in the world
 
I wish you were serious
I like vimeo
 
> THE DEPICTION OF ANY WEAPON OR VEHICLE IN THIS GAME DOES NOT INDICATE AFFILIATION, SPONSORSHIP OR ENDORSEMENT BY ANY WEAPON OR VEHICLE MANUFACTURER.
Seen at the end of a Battlefield blog article.
 
inb4 "The depiction of prostitution in this game does not reflect the developer's view of women and does not in any way try to promote the objectification of women."
in 20 years people will be so preoccupied by such minor issues that any blog post will be forced to have this shit at the end
and others like it
because let's be fair, we want everyone to be heard and respected
 
@AlexM. maybe in 20 years. The gun thing was because EA was sued by Glock I believe... might have been another gun manufacturer
 
7:21 PM
but at the same time anything can offend anyone
@Mgetz sued for what? doesn't the BF series use real life gun models since its inception?
or was that CoD?
 
@AlexM. don't remember, but basically they had been paying gun manufacturers to use the models... then they decided they weren't going to any more
 
@Xeo Too iffy exceptionally wise. I recommend that functions such as Make/Destroy are in charge of setting is_left, that makes it easier to track the invariant. Make sure you set is_left before destroying, and after constructing.
That would mean you relax is_left from bool to e.g. int to keep track of the unitialized state to avoid double-destruction, too.
Super hidden unusual gotcha protip: do ::new (/* storage */) remove_const_t<T>(/* init */), then you can support const-qualified types while avoiding UB (can’t destroy a const object then reuse its storage).
 
Xeo
huh, interesting. thanks.
 
user1804599
It's nice when you can estimate bug reports on 1m and it takes even shorter than that to fix them.
 
Xeo
7:36 PM
@LucDanton Setting is_left (or whatever counter) in Make is meh because I'd need to check which of the types I'm setting
 
Let me see how I handle that.
You’re right, I was probably thinking of optional (which is easier).
 
user1804599
> 124 of 900 MB – 1 min remaining
 
user1804599
now this is what I call a good torrent
 
Also it seems that I could use my own advice, I’m seeing a potential double-destruction :|
 
Xeo
lol
 
7:40 PM
@Xeo The order of setting is_left only really matters for non-constructors, i.e. chiefly assignment now that I think of it. Since a constructor exiting via an exception won’t trigger destruction at all.
 
Xeo
My only potential double-destruction is during assignment, if an exception is thrown from the move-constructed content.
 
hah :D
 
Xeo
I'd like to constrain the class to "only-noexcept-movable" types, but VS...
 
self.active_member = Index;
::new (self.storage.address()) Stored(std::forward<T>(value));
@Xeo I don’t mind a conditionally strong assignement.
That reminds me, the self.storage.address() is me being paranoid. Lovely.
 
Xeo
@LucDanton well, even that I can't do :)
 
7:42 PM
Point being that I don’t constrain operations on exception guarantees.
I don’t actually have a bug because I catch and rethrow on an exception, setting active_member appropriately. But that’s unnecessary/needlessly fiddly work, I’ll improve that.
@Xeo Can’t afford common_type_t either?
 
Xeo
hm?
 
Why same types?
 
Xeo
Oh, for FanIn... iunno, didn't think of common_type.
 
unsigned int sizes and alignments?
Alright that’s about it.
 
in practice, do you use noexcept for most of your functions or only occasionally?
 
user1804599
7:52 PM
> many system admins would disable the exec(), shell_exec(), popen() and similar functions due to security concerns
 
user1804599
top kek #php
 
@StackedCrooked I use it when a function should not throw: e.g. where throwing can't happen, or where if that code throws an exception the system is already FUBAR
@upvoter WHY!?!?! — Mgetz 18 secs ago
 
I also haven't seen any benchmarks for noexcept.
 
user1804599
> Genecoin samples your DNA, turns it into data, and stores it in the world's most powerful supercomputer: the Bitcoin network.
 
user1804599
8:07 PM
> Should This Exist?
 
user1804599
NO
 
8:23 PM
122
Q: When should I really use noexcept?

void-pointerThe noexcept keyword can be appropriately applied to many function signatures, but I am unsure as to when I should consider using it in practice. Based on what I have read so far, the last-minute addition of noexcept seems to address some important issues that arise when move constructors throw. ...

Bounty added.
 
user1804599
I offered so many bounties: stackoverflow.com/users/1804599/…
 
Ell
Evening
 
@rightføld What is your download speed?
@rightføld Why not?
 
They say noexcept allows for more efficient code generation (in general, so not considering things like vector's resize) but doesn't that kinda imply that the old "zero-cost exception model" was not really "zero cost"?
 
Aye Matey.
 
Ell
8:35 PM
@StackedCrooked was about to say, I don't think it does allow for more efficient code generation
 
Xeo
alright, fuck this, I'm getting a prepaid credit card.
Stupid Kickstarter, y u no paypal
 
@Ell I always read your name as Eli...
 
@Xeo Because Paypal is the devil.
 
@Nooble me too
 
Ell
@Nooble everyone seems to
not sure why
 
8:37 PM
Elliott always reminds me of the movie with the dragon.
 
@Ell I just switched to a 1440p monitor, I only noticed because of the higher resolution :P
 
Ell
1440p, nice
I forgot what the difference between p and h are
something about lines
 
p and h?
as in pH measurement?
 
Ell
oh wait it's i
1080p and 1080i
 
Ell
8:41 PM
oh cool.
 
user4655569
C++ would be a better language, if it didn't carry the ballast of C
 
So insightful :)
 
I want to learn C to program my Ti-89.
 
Ell
guys
what's the consensus of having conversations on twitter
do people do that?
 
As a side note, why does main return an integer anyways?
@Ell Only insane people do this.
 
user4655569
8:45 PM
@StackedCrooked Maybe not insightful, but true
 
Xeo
@LucDanton prototype!
I guess the biggest change I should make is changing is_left to a tri-state.
 
@nightcracker Why not?
 
user1804599
1080π
 
@Xeo Is this something you’re doing right now? I’m testing out my own recommendations and right now I’m deep inside the debugger.
 
Xeo
nah
I'll be back at it tomorrow
 
8:58 PM
Alright I’ll keep you informed.
 
Xeo
I was wrestling with SFINAE-safe result_of earlier, when a more important task came in
that ate the rest of my day
 
Ell
@LucDanton ooer ;)
 
user1804599
I should play Metal Gear Solid again.
 
user1804599
I have a week off starting Monday.
 
user1804599
Better finish MGS, MGS2, MGS3 and MGS4 in order.
 
9:08 PM
@Xeo Okay so if you carefully set active_member to -1 before destruction and reset it after construction you also have to take care not to go visits[active_member] to perform those very destructions and constructions >.>
 
Xeo
@LucDanton lol
 
Otherwise, seems fine.
 
Xeo
k
I wish we could use VS2013 :<
 
I actually don’t have tests for failed construction/assignment, let’s take care of that.
 
Xeo
hm, guess I'll have to change Destroy to take the is_left thingy by parameter, if I want to set it to "bad" before destroying
 
9:19 PM
Is it not a member?
Oh right, just like me you mean the value before resetting ;)
I have destroy itself do the dance and set the discriminator, if we want to call it that.
 
Xeo
ah, true
 
I don’t have a single place to do the construction (hence the bug-hunt), and I’m not sure I can remedy that :(
 
Xeo
alright, time for sleepz
g'night o/
 
Bye
 
9:39 PM
:DDD
 
user1804599
"Assimp" even sounds bad.
 
9:58 PM
I got myself sunk into JRPGs now :<
 
I don't think I like clojure particularly.
 
and with Valkyria Chronicles being released next week it doesn't seem I'll get out pretty quickly
 
user1804599
Clojure ist wunderbar.
 
You are wunderbar.
 
I'm a chocolatebar.
 
user1804599
10:06 PM
@Jefffrey I know.
 
Now, now. Don't get cocky.
 
user1804599
cock
 
user1804599
where i want one
 
user1804599
Here is proof that Clojure is great:
 
user1804599
user=> (def cock? (partial = :jefffrey))
#'user/cock?
user=> (into {} (map (fn [p] [p (if (cock? p) "a cock" "not a cock")]) #{:jefffrey :alex}))
{:jefffrey "a cock", :alex "not a cock"}
 
10:15 PM
why am I not a cock?
and is it a good thing
 
user1804599
becaus ei love you alex
 
-18
Q: How is "Satan hold your orgasm" offensive remark?

KugBuBuSomeone edited my answer here, and s/he removed part of the answer that said "Satan hold your orgasm", and the summary of the edit said that it is offensive remark. Why is that? Is it religious stuff? (I thought they hated satan)

 
@Rapptz because they're called flags everywhere else?
 
Satan hold your lol.
 
@rightføld I thought you loved cock.
the plot thickens.
 
user1804599
10:19 PM
Yes, but not cocks attached to cocks.
 
@nightcracker They are not.
(Where do you think I got the term 'verb' from?)
 
@MartinJames Top of Google search for 'satan hold your orgasm', well done OP.
 
I don't know, which is why I asked
 
Do you think C calls %f a flag?
 
that's a different thing
 
10:21 PM
A 'flag' in printf is +- #0
 
https://www.humblebundle.com/
err
wrong clipboard
thank god that isn't porn or something :D
std::ios_base::fmtflags is what I wanted to copy
 
in F#, 30 mins ago, by Reed Copsey
Vote here for F# support in ASP.Net vNext - https://aspnet.uservoice.com/forums/252111-asp-net-vnext/suggestions/6639207-f-s‌​upport
 
I called them verbs because they do an action to the stream.
 
@Rapptz things like std::dec, std::fixed, etc are all called flags in iostream
 
I got the name from Go.
 
10:23 PM
ah
 
They just so happened to be format flags at the moment.
But I initially wanted to have different ones that did different things.
(one that sticks out atm is thousand separator)
 
also I did some more rewriting
but while doing so I don't think your implementation is fully stateless
the only state I want to use is the locale of the stream
 
I don't use the locale per @LucDanton's suggestion.
 
widen is part of the locale?
 
evening rubberies and nobot
 
10:27 PM
@nightcracker That's different.
 
anyway, I think (haven't tested) is that your implementation doesn't properly reset the fill character when it was set before the format is called
 
There's no other way to widen a string and do equality comparisons on a string.
 
@Rapptz when I said "I use the locale" I meant I only use that part
I don't use it for any conversions
 
@Rapptz oo, soon it’ll be |args| args + upvalue to capture by-val and ref |args| args + upvalue for, well, by-ref.
 
:s
 
10:37 PM
@LucDanton what langauge is that?
 
Why is Rust so ugly?
Oh no *.
 
Hmm...
Enders game the film was not too bad. But it is like only half of the drama of the book.
 
Right, I wanted to illustrate how it goes if you want to mix captures. But I got it the wrong way around: you’d manually create references and capture those by-val.
 
@Rapptz ok I tested it and my conjecture was right, your implementation is not stateless for the fill character- gist.githubusercontent.com/orlp/a0aba247345baaf8c393/raw/…
 
So contrast |args| args + upvalue and let upvalue: &stuff = …; |args| args + *upvalue.
 
10:40 PM
I'm honestly not a fan of Rust's syntax. Feels superficial but that's life :v
 
I feel Rust has great ideas shipped in a suboptimal package :(
I don't trust Rust will take off
 
@nightcracker I shall fix.
@nightcracker It has a lot of hype around it.
 
but it will impact future langauges
the concept of lifetimes and the safe memory management it provides is very powerful
 
Ell
I want to take two std::vector<float>s and turn them into one with items adjacent to each other. so a = {0.1f, 0.2f, 0.3f}; b = {0.1f, 0.2f, 0.3f}; and combine(a, b) gives {0.1f, 0.1f, 0.2f, 0.2f, 0.3f, 0.3f}. Is this called zip? (with some combining function?)
 
could you consolidate your issues in the issue tracker btw?
 
10:42 PM
me?
 
yeah
that way I don't forget
 
if you want to
I was kinda hoping to show you my implementation once I'm done and compare
sure some implementation details differ ({}, automatic indexing) but those are minor
 
It may actually be obsolete syntax though. I’m trying to follow the RFCs but it’s dead links everywhere.
 
do what you must
 
@Ell Nope.
> Having to specify ref and the capture mode for each unboxed closure is inconvenient (see Rust PR rust-lang/rust#16610). It would be more convenient for the programmer if, the type of the closure and the modes of the upvars could be inferred. This also eliminates the "line-noise" syntaxes like |&:| , which are arguably unsightly.
 
10:44 PM
@Rapptz sneak peak, I use this - gist.github.com/orlp/e6df03fcbcc9976062bc
although I'm not certain if you could change your version of this struct to this as it seemingly had features that were used in other places
 
So that ref || stuff was short-lived since it was merged in August but is now absent, lol.
 
Ell
@LucDanton I forgot what the algorithm is called. In my mind zip combines two containers
like a physical zip turns two zip sides into one :P
What is the algorithm called?
 
@Ell There’s more than one way to combine though.
 
@Rapptz the idea is to store the old params, then generate a default_for_stream for every parameter we parse, set flags on that state, then apply it to the stream, and finally when done restore the original state
 
Ell
@LucDanton Right, that's why I thought you passed some function which combined two elements
 
10:46 PM
@Ell Append, chain, cat, concat (<- that one is used for other stuff as well, confusingly enough), +, ++, <>.
 
@ell in python that's a zip followed by a flatten
 
@Ell There’s more than one way to combine with a function or not, is my point.
 
Ell
yeah, to me the former two sound like they'd give {0.1f, 0.2f, 0.3f, 0.1f, 0.2f, 0.3f}
 
your algorithm does more than just combining
 
@Ell zip in Python creates tuples, so you'd get ((0.1, 0.1), (0.2, 0.2), (0.3, 0.3))
if you flatten that structure
you get what you want
 
10:47 PM
@Ell reverse RLE :p
 
Ell
what is the best way to do it in c++? I guess I should ask a question proper
 
@Rapptz is the fact that showpoint is missing intentional?
 
{2, 0.1f }, {2, 0.2f }, {2, 0.3f } -> { 0.1f, 0.1f, 0.2f, 0.2f, 0.3f, 0.3f } :p
@nightcracker yeah I didn't have a letter for it
s and p were taken
 
I was thinking actuall
change p to +
then showpoint as p
 
@Ell For varying values of best: use Boost.Range (which has a chain_iterator or similar), or reinvent your own ranges.
@Ell IIRC there is nothing more fundamental that you can express appending with. It’s the MonadPlus to flattening.
 
Ell
10:51 PM
 
@nightcracker decent idea
 
Ell
@LucDanton I'll look into that now
 
imma go back to playing Fantasy Life
it's fun
 
Zipping is combining side-by-side, appending is end-after-end, flattening is inside-outside.
 
10:53 PM
ewww python2
 
k
 
@Ell Right, the MonadPlus quip reminded me that I forgot <|> and mplus.
 
@Rapptz I'm also still not convinced of u -> uppercase, just making X and E would be enough to cover everything I think
 
user1804599
> 500 TW laser
 
Ell
@rightføld wut
what wavelength even is that
 
user1646075
10:59 PM
@Ell not wavelength. Terawatt
 
user1646075
and also WTF
 

« first day (1475 days earlier)      last day (3470 days later) »