« first day (671 days earlier)      last day (4282 days later) » 

3:00 PM
@MohamedAhmedNabil You're welcome.
 
so with std::string i dont write cin.
 
@MohamedAhmedNabil read the documentation.
 
got frustrated with my job in one week
 
what if i want to make getline read a certain number of chars only
 
Then you aren't reading line and shouldn't be using getline.
 
3:01 PM
@NeelBasu What job is it?
 
They have got a QT Project and hired me for their job
 
eeew, GUI
 
@FredOverflow the the architect is so dumb ass, I donno from where she learnt all things she is constantly forcing me to store IP address in string instead of QHostAddress
 
@NeelBasu: Strings are safe. Strings do no harm. Strings are nice and warm. Why do you hate them ?
 
@MohamedAhmedNabil Um.. Don't use getline?
 
3:03 PM
@Drise then what should i use
 
@ereOn but wherever I need to pass the IP I need to convert it to HostAddress
 
@FredOverflow Oh you guys are talking to Plonk'd person.
@MohamedAhmedNabil erm. cin.get?
I think
 
@Drise Is there a feud between you guys?
 
@Drise ill see it
 
@NeelBasu: You don't need to convert it. Just assume it has a fixed content. Why would you deal with IP addresses anyway ? Are you some kind of hacker ?
 
3:04 PM
@FredOverflow Not really that I recall. He just kept saying something that I told him not to say again.
 
Nope Backup software
 
And what exactly does "plonked" mean? I know it has to do with fish, but I don't get it.
 
@ereOn hacker by what means ?
 
@FredOverflow Ignored.
 
@NeelBasu: By the way, I'm kidding. Obviously the software architect must be afraid of something. I share your pain.
 
Gah. Too slow.
 
@ereOn No she is not aware that there is a dedicated type to store that. But I told her so many times.
 
So like expired fish? Okay.
 
@FredOverflow But sbi has a competing 'theory':
2 days ago, by sbi
@sehe If I slap a dead fish over your head with enough force for it to make a "plonk" sound, what more explanation do you need to grasp my feelings about you?
 
@NeelBasu: Had to deal with a guy like that at my previous job. You can't change the way they think and even less improve their skills if they don't want to. I just changed the crappy code segments one by one until nothing was left.
 
3:06 PM
@Drise cin.get isnt working with std::string
 
Since the boss would only care that "It worked", there was no problem for me.
 
@MohamedAhmedNabil You're going to have to append each char if you do it that way. Code?
 
@Drise english please :)
 
@ereOn I said Person and Address is a different class and there is a has a relationship . but she is forcing me to store street name pin etc ... in the Person Class making so many properties in Person
 
@MooingDuck If you need a pair of Carcharias where the mic might work: tech.woot.com/offers/razer-carcharias-gaming-headset-23
 
3:09 PM
@MohamedAhmedNabil one sec
 
for (char ch = cin.get(); cin; ch = cin.get() )
     strvalue += ch;
There. <1 sec
 
@NeelBasu: Have you asked her why she wouldn't want to put those elements in another structure ?
 
@sehe Yep.
 
@MohamedAhmedNabil Don't forget about skipws (std::cin.unsetf(std::ios::skipws)) if you want to see whitespace
 
@R.MartinhoFernandes how baut utf8 for nix?
 
3:10 PM
@ereOn Yes and she replied "Why are you going in the Complex way ? this is Agile Model where we follow simple moves"
 
Sometimes people don't like to add classes/files because it is more painful in C++ (you have to write a header, a source file, to put include guards and so on)
 
@Cheersandhth.-Alf baut -> builds?
 
@sehe about
 
@NeelBasu Non-sequitur, orthogonal ...
 
3:11 PM
@sehe thats a good way to go, but isnt there a function to use isntead?
 
@Drise Ah, we're inventing shorthand english. Nice
 
@NeelBasu: that's not wrong sometimes. I guess it depends on the exact situation.
 
@sehe Now whats that ?
 
@MohamedAhmedNabil no.
 
@ereOn But this is C++ If you cannot do it in C++ way just quit the ground
 
3:11 PM
@sehe no. 'bout's been around for ages.
 
What's wrong with

std::string s;
std::cin >> s;
 
@NeelBasu: If the members you want to put in another struct are not reused anywhere else, It may be a waste of time to separate them.
 
what is c++next?
 
@Drise baut != 'bout
 
is that windows 8 thing
?
 
3:12 PM
@Cheersandhth.-Alf Blog syndicate by Dave Abrahams and others
 
@sehe read it phonetically. It is.
 
@sehe it stops at the first white space , and i want to select the amount of chars to be read
 
@MohamedAhmedNabil What are you trying to accomplish?
 
@ereOn But in future what if there comes a situation where I need them as a struct
 
oh, i thought it was a c++ dialect. i have link to them from my own blog. need new stm!
 
3:13 PM
@Drise I can't read phonetically. You should know because you have photographic whatsitcalled :)
 
@NeelBasu: Then you adapt the code.
@NeelBasu: Are you recently graduated ?
 
@sehe You've never said such a thing while I was paying attention listening.
 
@ereOn but then I need to change a lot of things
 
@Drise I want the program to stop reading input after reading a certain amount of charecters
 
3:13 PM
@ereOn Nope done Masters
@ereOn and used to work as freelancer
 
@MohamedAhmedNabil Is that amount know at compile time?
 
@sehe i cant set the max amount of chars with std::string
 
@MohamedAhmedNabil Do std::getline, or use basic_istream& get( char_type* s, std::streamsize count ); etc.
 
@sehe No, silly, he has eidetic whatsitcalled.
 
@MohamedAhmedNabil a.k.a. RTFM
 
3:14 PM
@Drise yes i want to do something like this char arr[200]; cin.getline(arr, 50);
 
@MohamedAhmedNabil then see @sehe's post
 
@Drise but with std::string not cstrings
 
@NeelBasu: Perhaps you are over-thinking this. The problem with this approach is that you can always go further in abstraction and complexity
 
@Drise Ow. Pro tip: when you read the C++ book, pay attention :)
 
basic_istream& get( char_type* s, std::streamsize count );
what should this do
 
3:16 PM
@MohamedAhmedNabil Doesn't matter. You can std::vector<char> v(200); cin.get(&v[0], 200);
 
@NeelBasu: Sometimes it is a good idea, sometimes it is a waste of time. Being agile indeed means that you write maintainable code that can evolve quickly.
 
@MohamedAhmedNabil Seriously:
 
@MohamedAhmedNabil Here.
 
1 min ago, by sehe
@MohamedAhmedNabil a.k.a. RTFM
I linked to the documentation !?
 
@NeelBasu: Ever heard of YAGNI ? I'm not saying that you are wrong in the described case, I'm lacking context to judge.
 
3:16 PM
@sehe the loop you gave me was the best option
@sehe just saw it
 
@MohamedAhmedNabil No, it wasn't. It will probably do the job, but it isn't the best option
@MohamedAhmedNabil Then, read it
 
char mychar[200];
cin.get(mychar, 199);
string mystring(mychar);
 
@ereOn May b. But its me who will need to change a lot of things if the architecture changes in future
 
@NeelBasu: Just don't be too sure. She probably does it that way for a reason. It may be a bad reason, or it may be a good reason you haven't thinked of yet.
 
@Drise good idea
 
3:17 PM
@MohamedAhmedNabil No! It will break if there is no null terminator
 
@MohamedAhmedNabil Remember to leave room for the null terminator
 
@ereOn LOL never heard reading. good link
 
@Drise cin.getline already calculates space for null
 
@sehe get doesn't append a \0?
 
@Drise At least add NUL: mychar[200] = 0 or, better yet string mystring(mychar, mychar+200);
@Drise Why would it? You ask it to read n chars, not a c string
 
3:18 PM
@MohamedAhmedNabil Listen to @sehe.
 
Remember, chars are basically octets, a.k.a. raw bytes
 
@sehe i will see the documentation
 
@NeelBasu: Long story short for YAGNI : You can always make things more complex. but keep in mind that every code tends to be thrown away in the end. Be it good or bad. So it's all about balance.
 
@ereOn So YAGNI approach means architect free coding ?
 
@MohamedAhmedNabil getline reads a std::string, which is not NUL-terminated
 
3:19 PM
@MohamedAhmedNabil Don't bother now. Read what @sehe said, and you'll be fine.
 
@sehe gtg now bye
 
08-17 15:19:23.158: E/AndroidRuntime(2740): java.lang.ExceptionInInitializerError
 
@MohamedAhmedNabil Good luck, cheers
 
@ereOn is there any opposite word of YAGNI ?
 
3:20 PM
@NeelBasu: Over-engineering.
 
STUPID
 
haha
 
@ereOn ha ha LOL
 
@NeelBasu DBS (Don't Be Stupid)
 
@Cheersandhth.-Alf The class stores utf8 internally on Linux and utf16 on Windows.
But sadly I can't construct only from u8"Hello" because there's no distinction between that and just "Hello" at the type level.
 
3:21 PM
@NeelBasu: Following your logic, we could also say that you need a separate class to represent a street number, because those could have some particular methods.
 
Woot, I'm already using the rule of zero in answers :)
0
A: C++ My matrix class

R. Martinho FernandesI would make several improvements. I really don't like the fact that the interface has no names on parameters. You can skip all the names you want on the definitions, but when I look at a declaration I want to know what the parameters are. Still, on the interface part, I'd rename get_row and ge...

 
I think XP is the opposite of YAGNI
 
@NeelBasu: Where does it stop ? Hard to say. Following YAGNI and DRY, you just write those when you realize there is a maintainance gain doing so.
 
There is little reason to not follow YAGNI. Develop for current requirements, not imagined future ones.
 
3:23 PM
 
@NeelBasu: On the other hand, if you see another reason why these members should be put aside, like : "it would make to store-to-database code easier to read and to modify while improving performance" then you already know how to convince her.
@NeelBasu: If it is just "I like to have objects for everything because otherwise it feels wrong", then I may suggest Java instead ;)
 
Ell
Hi guys
 
@Ell: What if I'm not a guy ?
 
@R.MartinhoFernandes Wut
 
@ereOn I selected the silent way. I'll just follow . and wait for the time when there will be a need to change a lot of codes
 
3:26 PM
^ Really?
> Unless you are using the Visual Studio compiler (which has this known issue), there is no need to move local variables in return statements like return std::move(tmp);
 
Ell
@ereOn then hi gal :L
 
@Ell: I'm a dude actually. I just highlighted the fact that we might not all be "guys". :D
 
@ereOn In that case it wasn't addressed to you.
 
Ell
I know we might not be, but I use "guys" for both guys and gals :)
 
@ereOn I think Ell is well aware of who is a guy or girl here
 
3:27 PM
Really ?
 
@Ell Say Hi People
 
Ever been in Thailand ?
 
Also, there are no girls on the internet
 
@CatPlusPlus what about really known future requirements (e.g. in an environment where you have to postpone some parts due to resource constraints)? Would you keep those in thought for your current design or ignore them completely until you have to add them (let's say in half a year)?
 
That skill actually helps there.
 
3:28 PM
@ereOn I've been in HighLand
 
@sehe Maybe. Pretty hard to be certain though. Do you know anybody who's met me in person, and can verify my gender?
 
@sehe It may be fixed in VS2012. That I don't know.
 
@ereOn That's my point. If anyone likes to act like someone else, on the internet, let them be :)
 
Ell
I have met all of you in person. I am god.
 
@KillianDS Known requirements are current. It doesn't really matter when you implement it.
 
3:28 PM
@Ell Liar
 
Ell
it was worth a shot ;)
 
Ahahahaha, my code works.
 
@R.MartinhoFernandes That confirms my gasp-worthy-ness trigger: VS2010 has that problem. Whoa
@CatPlusPlus inb4 valgrind
 
@CatPlusPlus Okay, that's how we do it (I have real feature requirements more than a year from now, go figure...), I was just curious to your opinion :).
 
YAGNI is about not designing for unknown requirements that will maaaaaaaaaaaaaaaybe come up in unspecified future.
 
3:30 PM
Aka, won't.
 
@sehe What about it? It's Java.
 
The only requirements that ever come up are the ones you didn't think of.
 
I agree, but I have had some discussions with "extreme" programmers that tend to say this about any future requirements.
 
@CatPlusPlus Oh. Then, there's actually a good chance that you're right :)
 
btw, @sehe I think you mentioned you were going to suggest some changes to that rule of zero post. Are you still considering that?
(Or did I miss some plink?)
 
3:36 PM
in C#, 20 mins ago, by Billdr
I want to go home in ten minutes to have sex with my wife. I think we're both going to be disappointed.
 
@R.MartinhoFernandes I'm considering that
@CatPlusPlus Indeed
 
@sehe He's probably finished by now.
 
:)
 
@R.MartinhoFernandes That's not a very nice thing to say.
 
3:38 PM
Well, this wasn't either:
in C#, 21 mins ago, by Lews Therin
@Billdr I can her make a lot less disappointed. With your consent of course :P
 
The C# room is talking sex? Maybe we should have a C++/C# meeting sometime...
 
@FredOverflow C++/C#? don't give MS any ideas..
3
 
Anyway, weekend. Which of my three recent books should I read: C#, JavaScript, SQL? I think I'm gonna go with C#.
 
++C#
 
3:42 PM
Don't read books about JS, that's for sure.
 
Why not?
 
It's only the good parts.
 
No, I got the rhino book.
 
You paid for the bad parts? :P
 
The rhino book is considered the JavaScript book, isn't it?
 
3:53 PM
@FredOverflow C#++
 
@FredOverflow I thought Crockford's book was considered pretty much the one to get, at least if you care about using JS to write code, not write something like a JS parser.
 
Ell
+#+C
Xx_c++#_xX
 
I just pushed something to bitbucket, and two seconds later...
I swear it's not my fault.
 
you broke it
 
Ah, it's back up.
 
Ell
4:06 PM
that was quick o.O
 
"Why will I run the tests before pushing if there's a build server that runs them for me?"
Luckily he was kidding, so he's still alive.
 
Xeo
@R.MartinhoFernandes That's how Clang SVN works :D
 
Graph API hates me.
 
If I have a vector of pointers and it falls out of scope, does it delete all the objects?
 
4:19 PM
I can't POST comments for some reason, all I get is 'unknown error'.
@Drise No.
 
fuck
 
Unless it's a vector of smart pointers, which it should be.
If you ever have owning raw pointers, you're doing it wrong.
 
@CatPlusPlus It's not. And I'm not doing it wrong. I'm just limited to 03
 
See above.
 
> If I have a vector of non-owning pointers does the vector own the pointees?
 
4:20 PM
@Drise Use boost::vector_ptr or vector of boost::shared_ptr.
Or ptr_vector. I don't remember.
 
Smart pointers are not a C++11 feature.
 
Jul 10 at 20:06, by Drise
@Fanael I can't stress enough how much I can't use boost.
 
Only unique_ptr is.
 
Then write your own. Or preferably quit, because your codebase is shit.
 
4:21 PM
@Drise We can't stress enough how much of boost you have to implement yourself if you can't use boost.
Really, there's no other decent solution.
Need resource ownership handlers => Don't have resource ownership handlers => Implement resource ownership handlers.
 
Jun 21 at 18:41, by Mooing Duck
@rubenvb I don't want to convince my company's lawyers that we can use boost, and then convince IT to put it on everyone's machines. Way too much work.
 
Your company has idiotic policies.
 
Anyone able to make any sense of the second sentence of this?
0
A: Why is one loop so much slower than two loops?

Guillaume KizThe first loop alternates writing in each var. the second and third ones only make small jumps of element size. Try writing 2 parallel lines of 20 crosses with a pen and paper separates by 20cm Try once finishing one then the other line And Try another time by writting a cross in each line al...

 
@Mysticial Sounds like trolling or garbage
 
That question's been attracting a lot of crappy answers over the past few months. Tempted to protect it. Though I'm not sure if that's appropriate since protection is keep out spam.
 
4:25 PM
@Drise Well, if it's more work than implementing your own copies of boost, then by all means implement your own copies of boost. There ain't no such thing as a free lunch.
 
@CatPlusPlus Thanks Cat. Glad you could provide such useful insight.
 
Well, what do you want me to say?
 
@Mysticial It looks like it has a really nice answer. I'd give my vote to protect it.
 
@Drise It's also got 4 deleted answers. Three deleted by mods... yeah I think I'll protect it.
 
Xeo
Do it
Btw, I like how you don't have a single downvote with 500 upvotes, that's rare :)
 
4:29 PM
@Mysticial I doubt even the original author really knows what he intended.
 
Xeo
3093 / -1
 
Let that question sit for a few more years and it'll get enough crappy answers to get wiki'ed.
 
Xeo
on the other one
Seriously, 3.1k upvotes
 
34
Q: What is a “protected” question?

waiwai933Questions can be protected. What does it mean for a question to be protected? Who can protect a question? Who can answer a protected question? Return to FAQ index

 
@Mysticial Am I still inline for a few hours with you at the helm of my account?
 
Xeo
4:31 PM
2nd place all-time by 500 votes
Though the hotel answer is at 4.4
 
@Xeo You mean regex?
 
Xeo
Oh, right
Yeah, the hotel one is at 2.3
> The system (via the Community user) will automatically protect a question that's had three answers from low-rep users deleted.
Doesn't seem to have happened there
 
Skeet's timezone one is 3rd and getting a crazy number of residuals.
 
Xeo
Though the question is, what is "low-rep"
 
probably less than 10?
 
4:34 PM
215 probably doesn't count as low-rep.
 
@Xeo Community is retarded.
 
My guess would be <100.
 
Nice rep @Mysticial - 55,555 right now.
 
I'm guessing 10 because protection only blocks users with less than 10 rep. Moderators can destroy accounts with "low" rep - the threshold for that is 500 I think.
@SamDeHaan oh lol... screenied.
 
@Mysticial Shit, I wasn't fast enough to fuck that one up. There.
 
4:37 PM
ahaha thx
 
@Drise I concur. Boost license is specifically designed to be unrestrictive. You don't even need to attribute, IIRC. In that way, I remember it to be less restrictive than BSD even
 
Why the flag?
 
There was a flag?
 
@sehe The biggest issue would be to convince the entirety of my development group to get boost, why we need it etc etc. A whole bunch of bullshit I don't want to deal with.
 
Someone is flagging petty language in the lounge....
 
4:39 PM
@Mysticial Somebody's been hanging out in the C# or JS room, methinks...
 
Ell
haha I just remembered I did something stupid I did last year at my work experience. Wrote some code for a screen shot thing in vb.net, found a better version on the internet, copy-pasted, commented mine saying "My Version" and uncommented the good version and wrote "Some better way I found on the internet"
that's a no-go, right?
I am blessed, I cannot see these flags :D
 
@Drise The crux of the matter is, you don't need to get boost. You can just pick what you want, paste it right into your own code base. The even make BCP to help you do it: boost.org/doc/libs/1_50_0/tools/bcp/doc/html/index.html
 
@Xeo You should see this guy:
 
@Ell I tried doing that, and then sending it off as a UDP packet.... The first packet came through just fine. The second would sometimes come through ok, or slightly not right.
 
3x 1000... geez...
 
4:41 PM
> I'm promoting this bug to feature.
2
 
@Mysticial How is that even...?
 
I have a feeling my coworkers have been drinking today.
 
@R.MartinhoFernandes Use your sense of smell
 
Who flagged what, btw?
 
e-satis puts even Jon Skeet to shame...
 
4:42 PM
@R.MartinhoFernandes if the developers at my company were honest, that would be automatically included in ~every commit.
 
@sehe Robot can smell?
@SamDeHaan ~every?
Yay for unintentionally not eating in 3 days. Woo diet!
 
@Drise Calling the development work here bad would be an insult to the word bad.
 
@SamDeHaan No. What does "~every" mean? every?
 
@Drise Roughly equivalent to every. Almost Every. Close to every. Take your pick.
 
everyish
 
4:44 PM
@SamDeHaan Oh, right. I haven't seen that in ages. "Approximately close to"
 
Ell
@Drise not eating in 3 days is bad:P
 
@Drise That's the idea.
 
Ell
and IIRC cutting down on calories just makes you fatter in the long run
 
@Ell Meh. Everytime I get near food, I feel like vomitting. This whole abrupt "you're not engaged anymore" crap is getting to me.
 
Ell
your body will turn more calories into fat next time you eat
oh wait I read it as "intentionally", sorry
@Drise You're not engages anymore? :/ Sorry to hear it :/
 
4:46 PM
2 days ago, by Drise
Oh fuck.
 
@Drise While I'm not going to pretend what you're going through is easy, you should probably try to eat something. Bland calories are fine, but your body can't manage no intake like that for very long.
 
One of the few times I've used the word "fuck" in lounge. Makes for easy searches.
 
Xeo
MAN I so want to kill my brother
 
@Drise Short and to the point :)
@Xeo You don't. Trust me. I haven't tried.
Goggles on.
0
Q: Delete pointer to multidimensional array in class through another pointer - how?

DeukalionI have a pointer to a class, that have a pointer to a multidimensional array but I can't seem to delete it from memory when I need to or set it to NULL. #define X 10 #define Y 10 struct TestClass { public: int *pArray[X][Y]; }; // different tries, none working: delete Pointer_To_...

 
@SamDeHaan Every time I even smell food, I get nauseous.
 
4:48 PM
@R.MartinhoFernandes Wouldn't you have many brothers? Off the same assembly line?
 
Xeo
@R.MartinhoFernandes Wat?
 
> delete[][]
Is that even valid?
 
@Drise In a comment, string literal, character literal, or preprocessor directive.
 
This person needs to be introduced to the rule of zero. I'm not in the mood though.
 
Xeo
4:50 PM
Dump your link, done
 
@RadekSlupik Clever!
 
@R.MartinhoFernandes link to blog post in comment, duh. Isn't that why you wrote it?
 
Is #!/usr/bin/env my-cxx-interpreter (i.e. non-standard preprocessor directives) allowed by the standard?
 
0
A: Delete pointer to multidimensional array in class through another pointer - how?

AnotherTestThe name of your array is "pArray". You should delete pArray rather than pArray[0][0]. So: delete[] my_pointer->pArray; my_pointer will not be deleted by this operation, but pArray will be. Also, a general tip: try using const instead of macros when possible.

 
Ell
@Drise Really sorry to hear about your situation man :/ Women are evil beings.
 
4:53 PM
What do we think about this? Bogus?
 
@SamDeHaan Oh, good point.
@Drise Looks wrong.
 
@Ell She wasn't evil. She just broke my heart. Something I thought I wasn't going to have to experience again. Even my mother was jealous. She thought I had found "the one" 12 years before she did.
@R.MartinhoFernandes I concur.
 
Ell
@Drise I know they aren't evil, it just seems that way most times to me
 
Now I have to figure out how to pick up the pieces, and start over. 2 years, 3 months, 20 days, and 16 hours shot. And a fair chunk of cash too.
 
Use a magnet.
Oh wait, you're made of meat.
 
Ell
4:55 PM
scotch tape and butterfly stiches
 
@R.MartinhoFernandes Sorry robot.
 
Ell
I have asked myself if being in a relationship is worth it
 
@Ell It is, until it ends.
 
Ell
exactly
when you can have sex & fun with a girl without being in a relationship
then it doesn't have to end
because it never started
 
@Ell good luck finding someone willing to do that. Women aren't programmed like men in the sense that one night stands are acceptable.
 
Ell
4:57 PM
I have found one actually
 
Xeo
@Drise I'm pretty sure there are many women out there who are like that
 
Ell
it just so happens to be my ex's best friend -.-
 
Xeo
Man and woman aren't that different
 
@Drise I'm pretty sure there are many men out there who are not like that.
 
They are programmed to find a father after mating to share the burden of raising the child.
 
4:58 PM
Women are not robots. Trust me, I would know :P
 
@R.MartinhoFernandes Of course, but men from a survival standpoint are programmed to mate as much as possible with as many as possible.
 
So why aren't you trying to do so?
 

« first day (671 days earlier)      last day (4282 days later) »