« first day (588 days earlier)      last day (4363 days later) » 

Ell
12:00 PM
oh dear :L
 
Numbers entertain me on slow days. :$
 
Ell
I have a rectangle class, this has a Transpose function. What should I call the function that copies the rectangle and returns a transposed version?
 
user784668
Is swap(*this, rhs) a reasonable implementation for move-assignment?
 
Is it really necessary to copy it?
 
if you have copy and move constructors, you don't need to write move assignment
@Ell Uh, why not just Transpose?
 
user784668
12:02 PM
@DeadMG I have no copy constructor.
 
@Fanael OK. I'm pretty sure that move-and-swap functions identically to copy-and-swap, though.
 
0
A: How to check when a pointer is deleted?

Cheers and hth. - AlfSet a conditional breakpoint on the destructor of the type in question. Let the condition be that this points to the object you're interested in. E.g., in Visual C++ Express 2010: For the above figure I first executed to after the three new expressions, then noted the address of the b object, ...

^ Just to say that hey, that's not impossible, it is instead just ordinary debugging.
 
@CheersandhthAlf shiny
 
@CheersandhthAlf But it is kinda useless, because the only reason you have the problem in the first place is because you have a logical error in your code which must be fixed by using RAII, which is not a run-time logic.
 
Programmers often have to clean up other's mess (as well as one's own). How To Use A Debugger is one of the things one should master for that. I think.
 
12:09 PM
oh, I agree
I'm all in favour of debuggers and using them
all I'm saying is that this case can be proved and prevented by using entirely compile-time logic
and thus not really applicable to being solved by a debugger
 
@CheersandhthAlf can't you override operator delete?
 
man
I can't believe that I got -3 on my answer
 
@CheersandhthAlf Hi man, mind linking me to the latest version fo your book to read over?
 
@CheersandhthAlf i disagree
 
@thecoshman He's an author of a book o_O ?
 
12:18 PM
@ScarletAmaranth he's writing one, and I've been (attempting) to help with it where I can
 
@CheersandhthAlf Good luck with dat book then :)
@thecoshman shiny
 
@DeadMG It's actually a correct answer, refactoring is preferable. And you can't make such a check and the question is based on a wrong idea to start with.
 
user784668
@DomagojPandža Four people disagree. They prefer shitty code to clean code.
 
user784668
@DeadMG I'm confused. So that implementation is reasonable or not?
 
@Fanael Yes, it's perfectly reasonable
 
12:38 PM
@thecoshman just minute, i will generate new pdf
 
I don't understand how people can code and work with pointers and ask such questions. What does it mean to delete a pointer in such a context, why doesn't anybody think? It's a simple little variable which holds an address of the first byte to the data at hand and the system can use the type data to infer how big the data is without going over the boundaries (and why void pointer and promises to the compiler that you know what you're doing are dangerous).
You can basically infer why would you want/need it, passing a value around the size of a simple pointer is much easier than shuffling big chunks of data. But people get confused with "pass by value", "pass by reference" ideas. Realistically, everything is pass by value, just a little abstracted away, you give the value stored in the pointer.
 
@DomagojPandža And you're explaining it here because ?
 
Frustration mostly.
 
uploading...
 
12:40 PM
Some people don\t understand pointers. Period. Does it make them worse programmers ? I personally think so. Does it make them unusable in the industry ? I don't think so.
 
@CheersandhthAlf Is it going to be released under a free license ?
 
it's not much more than previous version, just some small editoral changes. i'm working on a figure
 
@CheersandhthAlf reading :D
 
@ScarletAmaranth i guess so?
 
12:50 PM
@CheersandhthAlf Nice one! I've always wanted to write a book (ebook, at that) on advanced realtime rendering that actually explains the mathematics, physics and ideas behind it instead of just spewing algorithms like someone pulled it out of their behind. But since there's not really an audience that would appreciate it, not much point to it.
 
@DomagojPandža And honestly, you're better off just studying a lot of linear algebra and analytical geometry for that :P
 
Ahoy flag capital
 
@CheersandhthAlf Sizes and number ranges of integral types -> Melikes dis part.
 
@CheersandhthAlf I know you are still early in the work of this book, but so far I can't help but feel it's a spot random. You don't seem to have an objective for what you are trying to give to the reader
 
@thecoshman well i'm starting at bottom, with the fundamental types. one needs to master that. then the plan is to proceed to higher level types. so it's an easy plan.
 
12:58 PM
@CheersandhthAlf Are you considering std::vector<T> more fundamental than T*?
 
@DeadMG T* is a "fundamental type" in the sense of the C++11 standard's §3.9.1 "Fundamental types", while std::vector<T> is not
 
@CheersandhthAlf Who gives a monkey's shit about the Standard? It says a bunch of things you don't need to know if you're a beginner
 
oh that silly cat! he is building springbok on top of qt
@DeadMG this book is not for the beginner
 
oh ok
ignore me then
 
I think I'll stick to glskel
 
1:02 PM
it's a reflex reaction
 
@DeadMG well in some case i would agree with you, that the standard's terminology is at odds with common usage. then i would choose common usage. :-)
 
std::deque saved the day ^_^
 
user784668
@CheersandhthAlf: what are you writing this book in?
 
@Fanael Word 2010, provided gratis by Microsoft
 
But beginners need to be introduced to the hard path very early on. That's the part of the deal for every programmer. Otherwise, you have people who think pointers are magical entities.
 
1:03 PM
I just wanted to learn modern Word, so it wasn't really meant to go much further
 
And sometimes, the Universe sets the label expert on such people
 
@DomagojPandža The deal is that you have to know pointers to be an expert. At what stage you learn them, however, is immaterial.
 
@DomagojPandža pointers are magical entities that should never be let loose naked
 
beginners should be introduced to best practices first, and if at all necessary, the worst practices after you've fully mastered the best ones
 
user784668
@DomagojPandža me casts a pointer. There, pointers are magical entities.
 
1:04 PM
pointers are baadf00d
 
@DeadMG it's good to show bad practice, in the sense of "this a signleton, it shit, don't use it"
 
@Fanael And you're out of mana. And magicka for that matter. Here's an elder scroll for you. :P
 
@thecoshman Only after you mastered good ones
 
That's the easy path, the hard path makes you really understand. Not just quote what somebody told you in a book, on a forum or somewhere else.
 
@DeadMG you can't learn all the good things. We learn about history to (try to) avoid making the same mistakes.
 
1:06 PM
@DomagojPandža No, it makes you write shit for the first ten years. The two are not the same.
@thecoshman It's more important to know what's now than what used to be
 
Understanding is the only thing that matters. And if you write shit for 10 years, then you should give up and take up gardening.
Sprinkle grass and shit.
 
@DeadMG for the most part I would agree with that. But you can't use that as a blanket statment
 
what makes you think that learning C-strings before std::string promotes any more understanding whatsoever than learning std::string and then C-string?
for one, there's absolutely no point understanding a practice you're never going to use. I don't understand how my CPU works, but since I'm never, ever going to re-implement it's functions in my own electrical circuits, then I have no problem with that
 
i think it's great that there's so much interesting in teaching & learning, bestest approaches for. :-)
 
It's not the practice that matters. It's the very core of what it represents, an array of characters, the idea that memory is continuous, that such notions aren't truly physically possible, then you grasp that there exists virtual memory that allows us to enforce such things. It's not just a C-string. It's what it represents.
 
1:10 PM
@DomagojPandža What it represents is an endless sea of bugs, and nothing more.
std::string also represents a contiguous array of characters.
 
Yes, but you don't see that on the lowest levels. For a beginner, it appears atomical, magical at best.
 
which is an absolutely fine attitude to have up until the point where you need to know better, at which point you can, say, read the Standard or ask the question, at which point you will promptly learn it
 
@DomagojPandža essentially it's an array of characters and that's how is usually introduced. I think that what you mean is that you can't know strings (in whatever form) without understanding arrays first.
 
if I am crating a std::vector like std::vector<foo> myFooVee { 1 , 2, 3}; and I want to pass it into a function that takes a std::vector<foo>, I could just pass it a temp right? by doing takesaVector({ 1, 2, 3}) right?
 
user784668
@thecoshman Right, IIRC.
 
1:15 PM
Today I learned that std::vector is like a priest in a kindergarden ^_^
 
Depth is what is important. How you reach those depth is entirely our choice. Can't really say one's wrong as long as you get to the same point without drowning. And everyone has something that works for them.
"The fastest path", if you will.
 
@DomagojPandža Except your method is like teaching people to swim by attempting to drown them repeatedly
 
user784668
@damian what?
 
@CheersandhthAlf sorry man, can't concentrate enough to read it trough properly, will get it at some stage though. maybe tonight once it has cooled down
 
@Fanael yes it "molest" it's members
^_^
 
user784668
1:17 PM
lol
 
@damian Nah, today you learned, "Always consider copy/move semantics".
 
@DeadMG What doesn't kill you, makes you stronger. :Đ
 
@DomagojPandža Nah, it's just a waste of time, because people also have to learn to fight whilst swimming as well as just swimming. Also, it takes much longer, there's no gradual process to reward people for doing well, etc.
 
@DeadMG true true ^_^
 
Knowledge is its own reward =)
 
1:19 PM
yes, it is
but it's not when you could simply have obtained that knowledge simply and easily
instead of shitting around for like, six months, learning a bunch of irrelevant practices and not being able to code anything that works
 
I couldn't disagree more. There's no simple and easy way. If you think you've got it, you're deluded. By "understanding" a simplification, you're not getting the full set. And that's how you get 90% of programmers nowadays. Those who have been taught automatization and everything that requires creative thinking is out of their comfort zone. Discussing this is most certainly a dead end, it's just a difference of opinion.
 
template teypename T
struct foo{
  foo(std::vecotr<T> data);
}
struct dataType{
  float a ,b;
}
foo<dataType> newFoo({{1,2},{3,4}});
that should work shouldn't it?
 
And mine is confirmed by all the people I have met, and the false notions they have in their head because of taking the "easy way out"
 
You can graduate most of the colleges without actually understanding pointers ... so hurr my durr, there is an easy way out. Yet i consider it stupid.
 
If you take the easy way out, you're damaging yourself and the company stupid enough to work with you.
I have had applicants who graduated from a "respectable university".
They're not applicants. They're drones.
No fascination, no ambition. Understanding or that burning desire for it.
 
1:23 PM
There's a bazillion companies that don't mind hiring people who have no idea how pointers work. And honestly, if you don't care about your career as a thing but onyl about money, you will probably get paid the same if you do or do not understand pointers. on average that is.
I know people who work in the industry and have no idea what int x; int *p; p = &x; does ...
And they have Masters in computer science ...
 
My country is full of such people.
Cheat their way through school, through life, expect a job and then bitch when they don't get it.
 
They do get it.
They don't go plumbing.
 
Or that it's too hard when they do get it.
 
@DomagojPandža You don't need the "full set".
I don't know how multiplication is implemented on my CPU, nor modulo, nor many other operations, but I don't need to
 
1:27 PM
The only thing that you need in life is to die.
Everything else is a preference.
 
it's called "abstraction", we use it every day, and it applies just as well to std::vector asto that
 
I prefer to know everything I can about this Universe. That's just who I am. I can't know everything, but I will die trying.
And be better for it.
 
Good for you, but don't force that on other people.
 
I don't force it. But you can't say you understand something if you really don't.
 
And don't consider them inferior just because their priorities are different.
 
1:29 PM
I don't consider my fellow humans inferior.
Just lazy. :P
I think there's potential in everyone.
 
I couldn't care less how transistors work.
 
I couldn't care more. :P
how can you be so easy going, doesn't it fascinate you?
 
And i use them every day. Hurr durr.
 
@DomagojPandža Of course not. But there's a limit to what you need to understand to do a job.
 
I agree with @DeadMG
You don't need every programmer to be a systems programmer or to understand pointer arithmetic.
I understand it yet i've used it like twice so far simply because I have a layer of abstraction available to me.
That is not likely to be error prone while my implementation might and often will fail in corner cases unless debugged extensively.
 
1:31 PM
"By using the technology of the mass relays, your society develops along the paths we desire" - Sovereign, Mass Effect
By using abstraction not written by you, you're submitting to someone else.
Depending on it.
 
I prefer x[4] instead of *(&x + sizeof(T) * 4), don't you @DomagojPandža ?
 
Perhaps it's just me, but I can't allow that. Not if I can help it.
 
user784668
@ScarletAmaranth u fail
 
@Fanael Good for me then.
Point being, I like abstraction and I want to use it because I don't have the brainpower to be thingking about little stuff while I'm trying to solve a higher level problem.
Thinking about how resistors handle logical operations while trying to do computer vision is impossible.
@DomagojPandža I assume you write either in assembly of some sort or verilog then.
 
You don't have to think about it, you just have to understand it to really get the most out of it. Abstraction is nice, but if you don't understand what happens beneath it, if someone takes it away. You're dead in the water.
 
sbi
1:38 PM
What's with the 32 flags for three messages in this room?
 
@DomagojPandža Do you understand how tranzistors work ?
@DomagojPandža Or how your PSU transforms voltage from 230volt to 16volt ?
@sbi Do I need some rep to see the flags ?
 
getting stupid undefined reference errors, I can't see why
 
sbi
@ScarletAmaranth >10k
 
@sbi I am not THAT bored! :)
 
Oh, yes. I am actually quite interested in electrical engineering, design of electronic devices, computer hardware architecture, how every freaking thing works and even thinking about how I could do it. But you don't have to really be fascinated by computer architecture to contemplate transistors, just be fascinated by physics.
I am fascinated how instruction sets map into hardware architecture of the CPU, how it all interconnects
but I don't think about it while I write high level code, implementing a realtime few-bounce raytracer
 
1:41 PM
@DomagojPandža Good for you. And now i can claim that I don't give a green jolly, I use it as an abstraction every day and voila, i can programme just fine.
 
sbi
Ah, it's only 26 flags for two messages in this room. It seems @sehe and @DeadMG were involved in the discussion with @LearningSlowly. Anyone care to explain?
 
@sbi I didn't contribute to the flagging. Basically he came in here, asked a few pointless inane questions, and then generally started trolling everybody
 
If I take them away, could you really program? You're depending on it.
The more dependencies you have, the more liable your position as a programmer is. When you don't understand the abstraction you're using, you're trusting someone else.
That goes away, boom, so does your career.
 
sbi
Mhmm. What got flagged doesn't look like he was trolling.
 
@DomagojPandža Write software in a team of more than 1 and you depend on them. My software depends on CPUs, RAM, HDDs, Windows, the works.
 
1:43 PM
I'm just saying its beautiful to understand.
 
@DomagojPandža You don't understand way more than you think you do and your claims are groundless to the point where I think you might be just trolling me.
 
@sbi I think only the very last few were flagged. But he spent about half an hour trolling. That's my recollection, but I wasn't paying attention
@DomagojPandža It is. That doesn't mean you need to know; or indeed; should teach a beginner that before other things.
 
@ScarletAmaranth The more you know, the more you understand how much more there is to learn.
 
@DomagojPandža You're trying to claim that programmer needs to understand electrical engineering.
 
He doesn't.
 
1:44 PM
@DomagojPandža You don't say.
 
But if he's not curious, then he's not much of a programmer.
 
I am not curious about how my car works and look, I use it every day.
 
Understanding all that makes a better programmer.
 
Yeah but my ambition is not to be the world's best programmer. I have different priorities.
That doesn't make me a bad programmer.
 
@DomagojPandža Only if you have cause to use it in a program.
 
1:47 PM
Yes, but you're then a driver. Not an automotive engineer / physicist
 
@DomagojPandža Yeah, I'm also not a hardware architecture designer, I'm a programmer.
 
wut?
 
Racecar drivers don't need to know exactly how their car works. They don't care about partial derivatives governing the explosions in combustion engine.
 
sbi
Well, I took the time and looked at the transcript, and it seems everybody was annoyed by him. So I'll agree to the flags.
 
@sbi How come you're so interested in moderating this community anyway :) ?
 
1:49 PM
This is sbi's crib.
 
sbi
@ScarletAmaranth Do you get this little number over your avatar in the lower right, when someone replies to you? What does it do to you? Does it nag you to read who's written a message for you? Does it prompt you to reply? See, once you're >10k, you get another such number popping up for every flag that's thrown anywhere in the chat. And it's nagging me just the same. Like a phone ringing, I have the urge to react to it.
 
Ahahah, I love the grumpy old ape <3
 
@sbi Ok I was just wondering :) I sometimes "admire (not exactly admire but find it admirable)" people who voluntarily do things just to in a small way "make the world a better place" if that makes any sense :)
 
sbi
@DomagojPandža Bah. My crib was a laundry basket. It's now atop my wardrobe, keeping assorted junk I don't dare to throw away. When i was lying in there, for most of you your parents were still in kindergarten.
 
@ScarletAmaranth He's just messing with you. :P
 
sbi
1:54 PM
@ScarletAmaranth Well, I can't deny feeling a certain responsibility for this room. For most flags I usually decide on a whim whether to click "agree", "disagree", or "don't know". When it's in this room, I'd like to make a well-informed decision.
@DomagojPandža Are you trying to annoy me?
 
@sbi Don't tase me, bro. :Đ
Anyways, I have to mow the lawn! It's going to be an interesting afternoon.
 
@sbi Yarr, I'm not saying it's a bad thing. This whole stack-exchange "nonsense" works because there are people who actually care and that's what I find admirable. Hell even i sometimes fancy flagging and down-voting answers just so others don't need to read 20 lines of text just to realize that question-asker needs his homework done.
 
sbi
@ScarletAmaranth I used to care a lot more about this place here, but Jeff and the meta crowd surely soured that.
 
@sbi I enjoyed that particular blog post, lots of good, hard hitting points regarding SO and Stackexchange in general. But do remember why we do this, to help others, to learn more ourselves and simply join in on the festivities. You're respected by the community, as is everyone else who tries to assist others in need.
 
sbi
2:10 PM
@DomagojPandža Didn't you want to mow the lawn? Procrastinating, eh?
 
@sbi Just got to the part with the google cache link, i can no longer access it :( Google says it's not found :(
 
@sbi You know me too well. :P I'll get to it. Be good everyone. And sbi, smile a bit. It'll do you good. =)
 
sbi
@ScarletAmaranth Yeah, of course. That's more than a year ago.
@DomagojPandža I'll now pack our stuff, then take the kids and head for the garden, where hopefully we'll spend the rest of Whitsun.
 
@sbi Interesting, I had no idea such thing happened here and wouldn't actually guess for i was under an illusion that this site works as well as it does precisely because of the fact that users have say in how the things work. Oh well :)
@sbi But afterall, I don't really care all that much. I sometimes ask something here, sometimes answer and I leech smart people's knowledge from the chat from time to time :) I actually consider developers here on SO excellent, but I'm not all that interested in "politics". I'm still pretty glad that there are people who do care though, I second that :)
 
2:33 PM
G'day.
 
hello folks
 
2:45 PM
hi
 
not much talking happening I see :)
@Radek, wassup?
 
Nothing. I'm writing.
 
Oh nice, university student?
 
I see
 
2:49 PM
I'm writing code. :P
I call that writing.
 
hahaha
Indeed :P
@Radek , Im a c++ noob would you mind helping out a bit?
 
@KodeSeeker what's the problem?
 
@RadekdaknokSlupik here's the link to the problem stackoverflow.com/questions/10766942/…. Im editing the question at the moment.
 
What's the client program?
 
@RadekdaknokSlupik edited and added the details now
 
3:02 PM
None of the functions you call are declared in the header, so you cannot use them.
 
3:25 PM
Well, this was an intense lawn mowing experience.
 
Ell
hi again guys
finally back from the garden
 
how was it?
 
Ell
hot
and tiring
but worth it :)
 
:D
 
Ell
Now I still have that naming issue. i have a function called transpose that modified a rectangle, what do I call an equivalent method that copies it first?
myr.Transpose(1, 1); // modified myr
myr.TransposeClone(1, 1); // returns transposed copy of myr, leaving myr untouched
but I don't like TransposeClone.
 
3:33 PM
transpose, transpose_in_place.
Immutability by default is good.
 
Ell
Right kk thanks
to make a copy of myself I can just dereference this cant I? Is there anything wrong with that?
 
Sure you can.
 
Ah, Cat++
 
Two cats in front of my house screaming at each other since 3:00am. Now it's 5:40pm. You?
 
3:40 PM
use shovel
 
I'm being annoyed by Qt's keyboard events.
 
@RadekdaknokSlupik: you around?
 
I wonder what would happen if you threw some meat between the fighting cats. Would they be distracted and start eating it, or keep fighting?
 
Hey mate, thanks for the tip earlier, I had the wrong header files in place earlier.Edited the question, mind having a look now?
 
3:42 PM
Screw named virtual keys, let's just use scan codes directly.
 
youtube.com/watch?v=siksIuMestg It seems they're discussing singletons.
Dear lord, so disturbing.
 
man
all the BBC can ever bang on about is the Olympics
 
anyone here got an idea about Stanford courses?
 
they exist
 
3:55 PM
that's the best idea you could come up with?
 
hello
 
indeed, but I was looking for something more tangible :P
 
@StackedCrooked it's true
 
it's a true idea alright
 
@KodeSeeker Virtually none of us are Americans, and even if we were, don't you think it's a tad specific?
 
3:56 PM
@Dea
oops
 
and also a tad vague
 
both too specific and too vague- an impressive question
 
@DeadMG and @StackedCrooked : Indeed so care to know the details? :D
 
let me briefly ask my RNG
 
I never thought it could happen, but there it is, a question that is both too vague and too specific. Kudos to you good sir
 

« first day (588 days earlier)      last day (4363 days later) »