« first day (822 days earlier)      last day (4126 days later) » 

6:00 PM
Indeed, it's a crap answer.
It does give good advice with the "buy a book" thing, though.
 
That's what comments are for.
 
What, it is definite answer to that question.
 
user image
2
It's a Mr. Saturn made of snow.
 
@Griwes does it have picture of attractive woman?
 
6:10 PM
AWWWWWWWWWWW
That's adorable, @Etienne.
 
@Griwes It answers the question without addressing the underlying lack of understanding (and as good of advice as "read a book" is, it's not necessarily very helpful to a lot of people in understanding this particular situation).
 
Also.
BOING, ZOOM.
 
well to answer my own question there was no pretty picture but i upvoted it now just for the advice to get hold of a book. good advice.
 
@Cheersandhth.-Alf Yes and no -- given the percentage of books on C++ that range from mediocre to terrible, any such advice needs to either specify an exact book, or refer to something like the book list for advice on decent books to read. As is, it's not really very helpful (IMO).
 
hm i think any advice to get book is good. reference is of course even gooder. :-)
 
6:23 PM
The best would simply to link to the book list.
"Get one of these books".
 
ok fixed that
 
0
Q: unsigned data types in structures

user1632141I have seen one small c program recently.There in that program,the structure was declared in this manner which I could not understand. struct { mynode *node; unsigned vleft :1; unsigned vright :1; }save[100]; Here node is pointer to some other structure. Can some one please explain what uns...

^^ anyone have a dupe handy?
 
Alright, so, new feature on the tool I'm working on: when you start it, you get a list of pictures of cats ripped straight from /r/cats.
 
@Mysticial Yup. Voted to close...
 
8
Q: What does this C++ code mean?

derrdjiWhat does the following C++ code mean? unsigned char a : 1; unsigned char b : 7; I guess it creates two char a and b, and both of them should be one byte long, but I have no idea what the ": 1" and ": 7" part does.

 
6:31 PM
Is this really a way to measure how much programming you know? reddit.com/r/learnprogramming/comments/16li91/…
 
@Rapptz reddit is blocked here, but there is no easy way, so no.
 
Dude, those questions are really advanced.
I can't say I can answer even half of them.
 
Yeah see that's what I was thinking :|
 
@Rapptz The only "Gang of Four" I can find was a Chinese political thing
 
6:34 PM
@Rapptz Fairly mediocre at best. Many of them are fairly specialized -- crucial for a few particular types of development, but utterly irrelevant otherwise. Some are just mediocre questions in general.
 
That looks like a way to measure how much Java you know
 
ah
The book's authors are Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides with a foreword by Grady Booch. The authors are often referred to as the Gang of Four, GoF,[1] or Go4.
 
Fuck, I'm doing a phone interview with some wallstreet company in a few days. I hope they don't shoot those at me.
The Apple interview was special since they knew what I knew and what I didn't know ahead of time.
 
@Mysticial research them, write the answers down. After the interview, throw it away. They're jsut interview questions
 
I thought interview questions were easy considering how many people complain about working with people who don't know how to code.
 
6:35 PM
those questions look to me like some uni stuff with no relevance to real life
 
> What is the Repository pattern? The Factory Pattern? Why are patterns important?
Seriously? I've only heard of Factory Patterns... let alone know what they are...
> What is SQL injection?
I don't know shit about SQL.
> Describe, in as much detail as you think is relevant, as deeply as you can, what happens when I type "cnn.com" into a browser and press "Go".
This I happen to know because I just finished a course on it... but seriously...
 
@Mysticial actually that one I think is important, but it's pretty straightforward
 
@Mysticial See my comment above -- this is exactly the one I was talking about when I said "crucial for a few ..., but utterly irrelevant otherwise".
 
isnt't the SQL the easiest one?
 
@MooingDuck Important for web developers maybe..
 
6:38 PM
@Rapptz it affects any text-based API, including XML
 
The only SQL injection I know is for websites
 
@Rapptz I never put those ridiculous puzzles in front of people when I interviewed programmers
 
@Mysticial Repository is cool.
 
SQL Injection
 
@Rapptz the concept applies to any text-based API (and a few non-text based ones.
 
6:40 PM
@MooingDuck could you explain please?
 
anyway the key to those puzzles isnt implementing it, its the disambiguating questions you ask back. Ive actually refined the question so much they guy said, "ok, we can skip that" and went on to something else
 
@Mysticial It's essentially an interface over a data store, such as a database or a container. That way you can easily swap out a DB when doing unit tests.
 
@JerryCoffin Now that you've mentioned that, I think I have read an article about it a while back.
 
@bamboon if user input ever gets concatenated into a command that will be interpreted/executed, MAKE SURE THEY ENTERED VALID INPUT THAT WONT DELETE YOUR DATA
 
The average repository would support only the usual CRUD operations.
 
6:41 PM
@MooingDuck oh, I thought you were referring to the HTTP question and not the SQL injection.
 
@MooingDuck Well I guess I can see it now.
When I used to do SQL injections for fun it was similar to the comic Jerry linked.
except it'd be order by 5-- or something to that extent
 
Hello friends
it wasn't so fun after all
 
In a nutshell: never build queries by concatenating strings.
 
@Pubby well it was a learning experience.
 
@Pubby What.
 
6:43 PM
@Pubby you are joking right?
 
I thought he was joking around based on what I said
 
ya 5 years is about what you get for being a murderer nowadays :|
 
If it was C++ I would capture user input as a user<string> or something.
 
would std::make_unique be considered an implementation of the factory method pattern?
 
Yes, if you really care about ~patterns~
 
6:44 PM
@MooingDuck Not usually.
 
no
 
It's stateless but still
 
@MooingDuck I'd say it's about halfway there.
 
@MooingDuck Yes. (I'd leave the 'method' part out of the pattern name though.)
 
Today my informatics programming professor told me that struct in C++ does not have any member access control or can either have any methods. FML
 
6:45 PM
factory method pattern creates types that have something in common, like a base class with common virtual methods
 
@doug65536 That depends. If you murder a person, yes. If you (for example) murder a cat or dog, plan on at least ten times that.
 
unique_ptr<T> has unique_ptr in common for every T
 
lol
 
(Also it's a stupid definition)
 
@JerryCoffin really?
 
6:46 PM
Structs with private members are silly
 
@Pubby ORLY?
 
@doug65536 Erm. First degree murder generally means a life sentence.
 
Factory creates new objects
 
no, classes that have puiblic: as the first thing are silly
 
What's wrong with structs with private members?
 
6:46 PM
heh, I just realized I really want to see @CatPlusPlus and @DeadMG go over that programming list in detail
13 mins ago, by Rapptz
@MooingDuck http://pastie.org/5689611
 
@Pubby, yeah but exists. Even religions are silly, but hey, they exists...
 
Usually based on state, because stateless factories are usually silly
 
@MooingDuck Full list can be found here
 
Well, no, I wouldn't even go that far. It's just something that creates new things
End of definition
 
@Maxpm Struct usually implies no member functions
 
6:47 PM
Bullshit
 
that is not the definition. whats the point
 
Cowpiss.
 
@Pubby so you made up other meanings for struct
 
I use struct because public visibility/inheritance by default
 
@doug65536 it's a pretty common convention actually. struct -> POD.
 
6:48 PM
@Pubby nothing wrong with conventions
 
@doug65536 It's not just @Pubby's meaning. IIRC, Google adds that meaning as well.
 
struct T {
    interface
private:
    implementation
};
 
It's not a hard rule, it's just a "feel" for what structs usually are.
 
Hmm. Now I know who the Gang of Four are (some band from Leeds, apparently). I still don't think I should care.
 
No, you shouldn't
 
lose those intangible compulsions and you will be happier
 
Design Patterns: Elements of Reusable Object-Oriented Software is a software engineering book describing recurring solutions to common problems in software design. The book's authors are Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides with a foreword by Grady Booch. The authors are often referred to as the Gang of Four, GoF, or Go4. The book is divided into two parts, with the first two chapters exploring the capabilities and pitfalls of object-oriented programming, and the remaining chapters describing 23 classic software design patterns. The book includes examples in C++ an...
 
@doug65536 Like I said, it's not a hard rule.
 
If you ever link to Google style guide, don't expect to be treated seriously ever again
 
That's just an old school convention imported from C, and IMO it hurts modern C++, along other stuff.
 
6:50 PM
I know a guy that HATES the scope resolution operator. he can't stand it. make any sense to you?
 
@Maxpm It's not a feel or an implication, just a common convention.
 
@doug65536 he's old
 
@StackedCrooked I'm not sure I see the difference.
 
@doug65536 No. Kill him.
 
@AndreiTita how could it possibly hurt? Just add one line of code
 
6:50 PM
class T {
    implementation;
public:
  interface;
};
in reply to cat's code
 
struct is just prettier
 
hating :: is almost the the same as saying struct can't have a method.
 
@MooingDuck Because people get fussy about what a struct should and shouldn't do, while what it actually does is be a public (by default) class and only that.
2
 
@CatPlusPlus good reason to break all existing convention. one person thinks it's pretty
 
Also inheritance doesn't require visibility keyword
 
6:51 PM
@doug65536, no classes then, he seems like a good guy
 
@MooingDuck I've never seen the convention you're talking about
Well, except GSG, but that's shit
 
@MooingDuck ...I may have found that on my own, too ;)
 
@AndreiTita we get fussy about a what a lot of things should and shouldn't do, despote what they actually do, usually for good reasons.
 
I forget what we're arguing about.
 
@AndreiTita see: throwing exceptions from destructors.
 
6:52 PM
I will use structs forever
 
you are so cool
 
structured programming.
 
@MooingDuck Mhm fair enough ok. Then all I can say is IMO in this case, the reasons are not good.
 
@MooingDuck How is that related
Oh, nevermind I see it
But it's still a wildly unrelated different thing
Throwing from dtors is risking std::terminate
This ~convention~ you like so much is nothing but an irrelevant style issue
 
Well-said.
 
6:54 PM
I like the way cat thinks...
 
@CatPlusPlus I agree with that
 
So you lazy nerds
How about some workout?
:)
 
The real solution is to get rid of struct and make class do what struct does
 
6:57 PM
Aren't there differences between class A { private: int x; public: int y; } and struct A { private: int x; public: int y; } in the memory, right?
 
no
 
@Jeffrey Nope.
The only difference between class and struct is default access.
 
names will mangle differently though
may
 
The names have no real bearing on compiled code, though, don't they?
 
6:58 PM
You can't have class and a struct with the same name, it doesn't make sense to differentiate them on name mangling level
 
There's no name lookup past the linker level...
 
it can matter. mostly not important
 
No.
I don't even think you can use a class in a extern "C" block, anyway.
 
so I can go change all the private: to public: in my header files and it will all link?
 
6:59 PM
@doug65536 probably (it could result in ambiguous function errors if public and private member functions have the same names)
 
Yes, also not related to the thing we're talking about
 
try it, report back.
 
@EtiennedeMartel Lots of pointless arguing..
 
Then we can store that information for later use.
@MooingDuck Why on earth would you have two functions in the same scope with the same name, with one being private and the other being public?
 
@MooingDuck No, it would only be ambiguous if you they were in the same class, and that's resolved during compilation
 
7:00 PM
@ShotgunNinja why not?
 
Linker doesn't care
It also doesn't care about visibility modifiers
 
@doug65536 Possible compilation errors?
 
@ShotgunNinja Overloads
 
@ShotgunNinja if the public several validates input, then all call the private one. I do it all the time.
 
@MooingDuck Hmm. Was not aware.
 
7:01 PM
@CatPlusPlus yeah, I meant compiler error, not linker.
 
struct T { void x(); private: void x(); } is redefinition error, struct T { void x(); private: void x(int); } is valid two overloads
@MooingDuck It won't be affected by visibility modifiers though
 
loldroid
 
@CatPlusPlus could be that the private version is a better match for inputs being passed, or an equal match.
 
making a conversion constructor public when it wasn't could cause a bucnh of bad implicit conversions
 
What's up?
 
7:03 PM
I'm procrastinating.
:3
 
We're considering a silly thing, because changing public/private will make the compilation fail for variety of reasons anyway
 
@doug65536 Or you could make it explicit.
 
@CatPlusPlus that's what I was saying
 
The original issue is whether it would cause linker errors, and that's a no
 
@Maxpm yeah the chat is great
 
7:04 PM
I know it's mostly moot, but since we're here: does the standard require implementations to use the same symbol names whether public or private? forget overloads for the moment, just mangling concern
 
@doug65536 Not relevant to linking
 
I decided to hit the gym instead of coding
 
Standard doesn't say anything about symbol names
 
Unfortunately my gym does not have that many hot bitches as youtube :(
 
@CatPlusPlus I doublechecked, OP did indeed say "link"
@doug65536 no
 
7:05 PM
@CatPlusPlus yes it is if there are static data members
 
What?
 
I thought you asserted that symantic analysis would do scope searches and thats where public private is enforced, therefore linker has nothing to do with it. Im saying you're right, but static data in a class is handled by the linker
 
Everything is handler by the linker eventually, but access modifiers don't exist at that point
Accessing static data members is no different than accessing non-static data members
So I have no idea where you get that idea from
 
name mangling? nice try
 
7:08 PM
What?
 
"Tangerine Dream's earliest concerts were visually simple by modern standards, with three men sitting motionless for hours alongside massive electronic boxes festooned with patch cords and a few flashing lights."
 
@doug65536 What you're saying makes no sense at all, I'm with the cat on this one.
 
11 hours since last time sex was mentioned
 
@kbok (fixed)
 
:)
 
7:10 PM
Penis
does that count?
 
Probably.
 
so I am off, have fun masturbating!
:P
 
I just read that as "I'm off having fun masturbating"
 
@Nils What.
 
i once stumbled on a nose fetish page on the net
 
7:12 PM
If that's the worst thing you've seen then you should be happy
 
^ this
 
@Cheersandhth.-Alf There's also that whole foot fetish thing.
 
There are sites on the internets where you can see cocks
 
Disgusting.
 
I am surprised to not see the robot's giant cock this time.
 
7:14 PM
@Nils Warning: NSFE (Not safe for Eyes).
 
@kbok ah, the roosters, yes
 
I'm at the Berlin C++ User Group meeting at the #cbase. This promises to become interesting. http://twitpic.com/bvins6
 
cpx
I guess It will take some time to update flair.
 
dat photo quality
 
Ell
Aww gawd I messed up again
I ought to move :o
 
7:31 PM
@ScottW Eh.
 
@ScottW err...
 
lol
Stack Overflow in a nutshell.
Look at that amazing edit.
 
@Rapptz That's one hell of an edit.
 
Nope
Apparently you only get rep if you suggest an edit.
 
I fucking did it. I struggled for a bit after that trying to implement this in Lua (switch logical -> imperative again, sigh), but now these two give the same results. I've implemented memoization in Lua, though, and I'd like to do similar thing in my Prolog version. Hints? SO doesn't really have anything for SWI-prolog which I have to use.
 
7:37 PM
herb sutter is now already editing posts. he seems to start liking SO stackoverflow.com/a/14342778/893693
 
@bamboon We're still not sure it's really him.
There's another account with the same name and avatar.
 
@EtiennedeMartel we had that discussion yes.
 
I feel like the votes on the answers on this question don't correspond to the usefulness of the answers. Can I request a few people go read the answers and up/down/no vote as they feel appropriate?
 
@EtiennedeMartel Isn't it him? I remember this answer being linked.
Which is coincidentally, the same account that did that edit.
Or maybe he has two accounts.. that'd be weird..
 
@EtiennedeMartel he said that he's going to use the other account but yeah, no verification like on twitter exists here.
 
7:45 PM
@MooingDuck i upvoted kevin's answer for proposing std::vector
why do i sometimes envy people who are famous and extremely respected with high income and good health
need to work on that
 
@Cheersandhth.-Alf evolution->biological imperatives->social values
 
Ell
social selection
 
Well, one of my colleagues just sent me a beautiful ASCII penis.
That's what I call bromance.
 
lol
 
@EtiennedeMartel like with lens flare and everything?
 
7:56 PM
did he use an image->ascii gnerator thing?
 
Well, I say "beautiful", but I'm mostly joking.
It's pretty ordinary.
But it's the intention that counts.
 
@EtiennedeMartel ascii art
 

« first day (822 days earlier)      last day (4126 days later) »