« first day (377 days earlier)      last day (4556 days later) » 

5:00 PM
@RMartinhoFernandes You can if you do it manually. I mean theoretical concept.
 
@SSight3 No you can't. I challenge you to do it.
 
@RMartinhoFernandes well, whatever angles are legal to turn it in tetris
 
Represent 15 with two's complement on 4-bits.
Go on.
 
I am only familiar with my own subtraction method. Can I use that instead?
 
that's not two's complement
and subtraction method != representation
 
5:01 PM
@TonyTheLion Well, only those two are legal. You don't need complicated methods to rotate the stuff. Unless you want smooth rotation on the screen.
 
@DeadMG I only vaguely recall manually doing 2's complement at university. It'd take time to revise.
 
@RMartinhoFernandes right, well I obviously have no idea what I'm doing, it seems
suggestions?
 
15 - 1:
 
@SSight3 So what you're saying is that you've been blathering on about it all this time and you actually have no idea what you're talking about?
 
not 1111 : 0000
add 0000 + 0001 : 0001
not 0001 : 1110
Answer: 14
No, like I said, I am only familiar with my own binary subtraction method.
 
5:04 PM
subtraction != representation
so wtf have you been talking about then?
 
@TonyTheLion Er, make a precomputed table?
 
also, your above method uses 8 bits, not 4
 
@DeadMG I manually represented it right there. That is a nibble.
 
I think I'm repeating myself too much today.
 
@DeadMG Actually, those are four bits. Two values. In nibbles.
 
5:05 PM
I cooked a tasty meal today. :P
 
15 - 1. aka 1111 and 0001
 
1110 is not 14 in any form of 2's complement
it's - something, probably -2
 
@TonyTheLion I mean, if you really want bragging rights for computing the rotations at runtime, I can help, but if that's not a goal, just make a table.
 
@RMartinhoFernandes I don't know what you mean by that? You mean a table with the tetromino's drawn in their correct position?
 
@TonyTheLion Right!
 
5:06 PM
@DeadMG Not 2's complement. I'd need to expand by one bit for signage.
 
@RMartinhoFernandes I would love bragging rights, at least I might have learned something :P
 
that's exactly the point, you blind moron
he said "You can't represent 15 in 4 bits with 2's complement."
 
You've just blathered on about something completely irrelevant
 
@DeadMG But you can. Keyword: without signage.
 
5:07 PM
2's complement is a signed representation
 
@SSight3 But that's not two's complement.
You can't change the definition of two's complement for this challenge.
 
you obviously don't even know what 2's complement even is
so I suggest that you just don't bother
 
@DeadMG And yet I'm capable of binary subtraction?
I feel so scolded already(!).
 
@TonyTheLion So what will it be, precomputed table, or runtime rotations (which I'll say again, is a bit pointless)?
 
5:09 PM
you don't even know the limits or how to represent specific values in 2s complement
so I'd suggest that you're not at all capable of binary subtraction
 
Binary subtraction works just like subtraction in any other positional radix numeral system.
 
So what was this I just wrote earlier?

not 1111 : 0000
add 0000 + 0001 : 0001
not 0001 : 1110
Answer: 14
 
@RMartinhoFernandes Well, I can easily do the precomputed tables, but if you don't mind helping me understand the runtime rotations, I'd prefer to try that, see what I can learn
 
not 2's complement at all
utterly unrelated to 2's complement
 
@DeadMG You said binary subtraction not 2's complement.
 
5:10 PM
See, I'm trying to learn doing this tetris game
 
no
 
It's in binary. It's subtraction.
 
you're the only one who's mentioned anything, at all, about binary subtraction
 
@TonyTheLion Ok, let's start by making a tetromino a 4x4 matrix of bools or something.
 
I've been trying to get you to shut up about it
because it had absolutely nothing to do with the question at hand
 
5:10 PM
You need that because the sticks can be up-down or left-right, so it requires size 4 on both directions.
 
everyone else has been talking about 2's complement
 
@RMartinhoFernandes ok, so you want me to write a matrix class that contains bools?
 
@TonyTheLion Well, something like that. What are you using right now to represent a tetromino?
 
@TonyTheLion Rotating 2D co-ordinates at run-time is relatively trivial.
 
@DeadMG It clearly isn't working then. As I said earlier, I do not recall 2's complement and hence why I asked about the 15 - 1 (or 1 - 15) overflow issue. I do not recall the precise system. I might retort 8 bits is not needed as you'd only need 5 on paper.
If you include the sign.
 
5:12 PM
It's a simple application of trigonometrical identities and polar co-ordinates
but more importantly, whatever API you're using should include the functionality out of the box
 
(Also, I'll start saying "piece" instead of "tetromino", because I always make typos on the latter.)
 
@SSight3 Then what the fuck are you even talking about? Certainly nothing related to what anyone else has been saying.
 
@SSight3 Well, in five bits, you get an overflow with 15+1, and an underflow with -16-1.
 
@RMartinhoFernandes So it'd be 15 - 1 using 2's complement that'd break it? Thank you.
 
It's easy. You grab the maximum representable value and add 1. Or you grab the smallest representable value and you subtract 1. Works for any representation.
@SSight3 No!
15-1 is 14.
 
5:14 PM
@RMartinhoFernandes a class that contains four QRects that I draw on the screen in their correct positions
 
Has anyone seen the Chaser? imdb.com/title/tt1190539
 
@RMartinhoFernandes There's no binary subtraction operator. It uses addition first of 15 + 1 in the process of computing 15 - 1.
 
@RMartinho so something like this
 
@TonyTheLion Ok, I think you can keep that for that drawing.
 
@RMartinhoFernandes right
 
5:15 PM
@TonyTheLion You can make it a std::array or a C array. The size is fixed.
 
@RMartinhoFernandes right, let me change it
 
@SSight3 You're right, there is no "binary subtraction operator". But there is a subtraction operator that works on numbers, regardless of representation.
 
changed, so what's next, a function rotate ?
 
@RMartinhoFernandes And what command is that in assembly?
 
Well, yeah.
You can do this with a simple mapping, no weird calculations.
@SSight3 Who said anything about assembly?
 
5:17 PM
@TonyTheLion Don't rotate yourself, it's a waste of time. Just provide the rotated versions in an array.
 
If you want to advertise your underlying_type emulation.
 
@RMartinhoFernandes I did. It's where the binary subtraction step walks in. It's also what is used for computing the - operator.
 
@LucDanton Thanks!
I'll be off for a while, collecting rep.
 
I think I'm gonna ask an SO Question, cause this is confusing
 
tony
it's not hard to implement 2D rotation
you can get the matrix formula from Wikipedia and then do a simple matrix multiplication
 
5:21 PM
K, I'm back.
 
@TonyTheLion So you have no "domain model" for the tetrominos, just a representation model?
 
@DeadMG There's no need for that to do discrete rotations in a 4x4 matrix.
 
it's a series of 2D vertices, you can just rotate each vertex individually
 
@FredOverflow Yeah, and it's also more error prone.
 
@StackedCrooked What is more error prone?
 
5:24 PM
Implementing the logic for rotating the block versus providing the rotated versions hard-coded.
 
@SSight3 Well, then, all assembly flavours I know of have a subtraction operation.
And that's what might be used for the - operator.
 
@StackedCrooked Which one of the two do you think is more error prone? :)
 
The former is more error prone imo.
 
It's also less flexible, because it always gives you four rotations per shape. But some shapes only have two rotations. Or even one.
 
@FredOverflow Well, in the table you want to keep those dupes so you have no special cases to handle.
 
5:26 PM
If you are really hard-core then you define a general polyomino type with Tetromino being the instantiation of N = 4.
 
@RMartinhoFernandes Yes, but the point is that you can have the exact dupes in the table and not some slightly differently placed dupes.
 
Then you can play Heptis!
23 hours ago, by R. Martinho Fernandes
user image
@FredOverflow Why would that happen?
 
@RMartinhoFernandes That looks fun.
 
@StackedCrooked I like the one with the hole in the middle :)
 
@RMartinhoFernandes lol
 
5:28 PM
@RMartinhoFernandes If you rotate the I piece twice, it should occupy the exact same positions. If you just rotate by a fixed formula, it will end up one position to the left or to the right.
 
@FredOverflow Oh, I get it!
The Ns would look weird.
 
@FredOverflow I think this will happen if you require each block to be defined in a 4x4 grid. If you only require the smallest possible grid then it will ... nah, never mind.
 
@StackedCrooked Right, let's make it simpler. Oh wait.
 
alright, smart rep whores
0
Q: Rotate tetris blocks at runtime

Tony The LionI have a class tetronimo (a tetris block) that has four QRect' types (namedfirst,second,third,fourthrespectively). I draw each [tetronimo][1] using abuild_tetronimo_L` type functions. These build the tetronimo in a certain direction, but as in tetris you're supposed to be able to rotate the tet...

 
5:32 PM
@TonyTheLion cos and sin
wtf
Ok, there is more than one way to do it. But you have chosen a path that is not the easiest.
 
You need sin/cos only when you want to have freely rotating pieces.
 
rect_coords first_coords = coords["first"]; -- Why are you using string literals?
 
@StackedCrooked well, I wanted to have some math fun, lol
 
But then you're entering the domain of NotTetris.
 
I used cos and sin when I implemented a Breakout game. I needed it to calculate the bounce corners.
 
5:35 PM
@StackedCrooked just an easy way to identify which coordinates belong to what square
 
@TonyTheLion Er, numbers?
 
@RMartinhoFernandes lol, yea I guess, you have a point
 
You know you shouldn't be programming while drunk, right? ;)
 
If you persevere and become a super programmer in a few years then you have no fucking idea hard you'll be facepalming when looking back at this piece of code.
At least, that's how I feel when looking back at my old code.
 
s/If/When/ :)
 
5:39 PM
 
@StackedCrooked I know. well, you're welcome to add an answer with suggestions to improve the code
 
Boo, failchat cannot https.
 
I'm not a super programmer yet, and I'm still learning
 
@CatPlusPlus Yeah, sucks.
 
@TonyTheLion No worries. Persevere!
 
5:41 PM
wasn't trying to write perfect code, just code that worked, then I can make it better
 
You're only a handful of aha-erlebnissen away from enlightenment.
 
Pe-what?
 
Whatever that means.
 
I thought it was a common term.
 
@CatPlusPlus you have a point, perfect doesn't exist
 
5:42 PM
No, persevere.
 
That's not a word!
 
@StackedCrooked There's no "erlebnis" on that page!
 
Even if you are a perfect programmer the language problems keep you from writing perfect code.
 
@StackedCrooked If you're a perfect programmer you write your own perfect language.
 
5:43 PM
Like @DeadMG.
 
@RMartinhoFernandes It's a German term that is sometimes used as an expression here. It thought it would also be used in English.
 
erlebnis = experience?
 
This is a list of German expressions used in English; some are relatively common (e.g. hamburger), but most comparatively rare. In many cases, the German borrowing in English has assumed a meaning substantially different from its German forebear. English and German both descended from the West Germanic languages, though their relationship has been obscured by the great influx of Norman French words to English as a consequence of the Norman conquest of England in 1066, and the High German consonant shift. In recent years, however, many English words have been borrowed directly from German....
 
5:44 PM
We call 'em facepalms.
 
lol
@FredOverflow We have that crap here on TV :(
 
@MrAnubis Cool, the students are seeing Kanji!
I'm studying kanji.
 
What does it read?
 
@StackedCrooked you're smart student then :)
 
@RMartinhoFernandes You live in Japan?
 
5:47 PM
@FredOverflow No :(
 
It's basically memorization. It doesn't require intelligence. It requires a little imagination to find meaning in these meaningless strokes so that you can remember them easier.
@FredOverflow What makes you think that?
 
@StackedCrooked That show I posted was from Japan.
 
sbi
@StackedCrooked I had never heard the words Eigengrau and Merkwelt. The former I could put down as an almost medical term, which I do not need to know, but "Merkwelt" is very puzzling. That is not a German word I have ever heard, nor do the two words it is made of make any sense to me in that combination.
 
Well, they copied it over here in Portugal.
The quest for crap TV never stops.
(Why do I keep saying "crap TV"? It's redundant.)
 
@RMartinhoFernandes those look like septominoes. i remember being introduced to pentominoes in Arthur C Clarke's book "Earth" (I think it was called). and the challenge was to arrange the pentominoes in a 5*12 or 3*20 rectangle, I'm not sure I remember the numbers correctly
of course you had to first figure out the set of pentominoes :-)
 
5:51 PM
@AlfPSteinbach And you started a brute force which continues to this day? ;)
 
he he
no but the boy in the book did, only it terminated successfully -- and unexpectedly
 
@AlfPSteinbach Both are possible.
And I call the seven ones heptominoes, hence "Heptis".
 
offhand factoid: danish poet piet hein was deeply into this
 
That's not the same guy as Piet, the painter, is it?
 
not sure
 
5:55 PM
Ah, looks like it isn't.
The painter is Piet Mondrian.
Guess what, there's more than one person named Piet.
 
Impossible.
 
sbi
@CatPlusPlus Do you feel caught?
 
He's not Piet.
 
sbi
@RMartinhoFernandes He is.
 
No, he's Piotr.
And AFAIK he's the only one named Piotr. :)
 
sbi
5:58 PM
@RMartinhoFernandes And what name do you think this when translated into Danish?
 
No idea, I don't know Polish nor Danish.
But I'm not a fan of translating names.
 
sbi
@RMartinhoFernandes Wrong. I knew another Piotr >20 years ago.
@RMartinhoFernandes Both are variants of Peter.
 
Piotr would be Pieter in Dutch maybe (Peter in English).
Or maybe not.
 
@sbi But have you ever seen that Piotr and this one at the same time in the same place?
 
sbi
@RMartinhoFernandes Why do you think I mentioned when I had seen the other one?
 
6:03 PM
The truth is out there.
@sbi How can you be sure he's not the same? We may never know.
 
A: Last week an Iranian woman who was suspected of having committed adultery was stoned to death.
B: Wtf, just how much did she smoke?
 
slti $t8, $zero, -1 -> what would it mean?
 
That MIPS?
 
sbi
@RMartinhoFernandes Because our @Cat doesn't come across mature enough to have been the mid-50s guy I met 25 years ago (who spoke nothing but Russian).
 
He could be faking it!
 
6:05 PM
slti is instructions?
 
sbi
> I think I figured out what the “S” stands for in the iPhone 4S. - Erick Schonfeld
 
@MrAnubis slti sounds a bit slutty...
 
lol
@MrAnubis Well, if that is MIPS assembly, then yes, slti is an instruction.
Set on Less Than Immediate.
 
Oh, a conditional move instruction? Nice!
 
learning assembly is really pain i am thinking to have
 
6:07 PM
@MrAnubis slutty dollar tight dollarz ero minus 1
 
lol
 
@FredOverflow It only sets one or zero.
 
@MrAnubis SPARC is quite nice, if you can pick your language.
 
If $zero is less than -1, it sets $t8 to one. Otherwise it sets it to zero.
Guess what happens in this case.
(Tip: $zero is a constant zero)
 
MIPS instuctions can work on CISC ?
@FredOverflow SPARC another architecture?
 
6:10 PM
Don't think so.
 
SPARC (from Scalable Processor Architecture) is a RISC instruction set architecture (ISA) developed by Sun Microsystems and introduced in mid-1987. SPARC is a registered trademark of SPARC International, Inc., an organization established in 1989 to promote the SPARC architecture, manage SPARC trademarks, and provide conformance testing. Implementations of the original 32-bit SPARC architecture were initially designed and used in Sun's Sun-4 workstation and server systems, replacing their earlier Sun-3 systems based on the Motorola 68000 family of processors. Later, SPARC processors we...
 
MIPS is RISC.
 
It's from SUN, but it's better than Java, trust me ;)
 
typedef std::vector<Item> ItemList; Would you consider this wrong because a vector is not a linked list? Or do you think the term "List" can be interpreted more generally so that it can both mean array or linked list.
 
In general list is a "bit" overloaded.
 
6:11 PM
How about Items?
 
Overloaded? By type?
@FredOverflow I usually go for that.
 
@FredOverflow Thanks , i'll go with SPARC then :)
 
@StackedCrooked No, overloaded in meaning. As in, it has many meanings.
 
@MrAnubis Why do you want to learn assembly language?
 
6:11 PM
@RMartinhoFernandes So you think it can be used in the more general sense?
 
@StackedCrooked Yes. But if it was me, I'd name that Items, like Fred suggested.
 
I think ItemVector is really ugly. ItemArray less ugly, but still not very elegant.
 
@FredOverflow Security purposes , understanding exploits
 
@StackedCrooked That's a variant of Hungarian notation!
 
6:13 PM
@MrAnubis I learnt that before, not fully. I suggest at&t easier
 
@MrAnubis If you actually intend to write code and run it, you're probably better off with x86.
Unless you have a SPARC at home, of course :)
 
We had to learn MIPS without ever seeing a single MIPS machine.
 
@RMartinhoFernandes Hungarian notation prefixes object names, not type names AFAIK.
 
@Lews: Are you that guy that broke the world?
 
@BenjaminLindley Yes I am. :) and I will break it again
 
6:14 PM
@StackedCrooked I said a variant because you're suffixing, and that's a variable declaration right?
 
@LewsTherin Jerk
 
@FredOverflow Understanding assembly and writing complex is really hard? ( i am pre-scared :( )
 
I heard that now the teachers no longer use MIPS for that class and use Y86 instead.
 
explain terms please
 
@RMartinhoFernandes It's a typedef.
 
6:15 PM
@BenjaminLindley If you had told that to me before, it'd have been met with balefire.
 
@StackedCrooked Oh, I missed that!
 
@BenjaminLindley I so can't wait for the new book!
 
Apparently Y86 is a simplified version of x86. They built a simulator for students to practice.
But I had to do MIPS on paper.
 
@MrAnubis Assembly languages are the simplest there are. It's just that each instruction does very little, so it's sometimes hard for beginners to see the forest for the trees.
 
I do use prefixes: cItem for (static) const, gItem for global, inItem for input argument, outItem for output argument, ioItem for input/output argument, mItem for member variable, fItem for function-local static. But this is also not hungarian because the prefixes are used to indicate scope, not type.
 
6:16 PM
@StackedCrooked There's more than one form of Hungarian.
 
@LewsTherin I've only read halfway through 9. Are Jordan's final books as bad as so many reviews say?
 
@RMartinhoFernandes Is y86 a variant of x86?
 
Hungarian notation is an identifier naming convention in computer programming, in which the name of a variable or function indicates its type or intended use. There are two types of Hungarian notation: Systems Hungarian notation and Apps Hungarian notation. Hungarian notation was designed to be language-independent, and found its first major use with the BCPL programming language. Because BCPL has no data types other than the machine word, nothing in the language itself helps a programmer remember variables' types. Hungarian notation aims to remedy this by providing the programmer with e...
 
@FredOverflow can you suggest some good assemblers which supports x86 architecture?
 
1 min ago, by R. Martinho Fernandes
Apparently Y86 is a simplified version of x86. They built a simulator for students to practice.
 
6:17 PM
lol
 
@RMartinhoFernandes You are redefining it now.
 
@MrAnubis gcc can compile C to assembly and assembly to object code. So I suggest gcc.
 
uh
assembly to object codce?
 
@BenjaminLindley Well not as bad, if you are a long time fan you can ignore it. It was annoying with too much bickering, there was less storyline on Rand and Lews Therin and less on the main characters and that really annoyed me, but Brandon is doing a good job. Really picked up the pace
 
@DeadMG Or whatever it's called. The binary that's spat out by compilers.
 
6:18 PM
@FredOverflow never knew that , C to assembly , how?
 
So I think it is still worth reading
 
@MrAnubis gcc -S foo.c creates a foo.s file with assembly code
 
@StackedCrooked No, seriously, not all Hungarian is about the types.
That's the bad Hungarian.
 
@LewsTherin what?
 
@RMartinhoFernandes oh thanks
 
6:19 PM
@FredOverflow Thanks again)
 
@LewsTherin I am excited to get to Brandon's books. I've read the Mistborn trilogy and it was great. I've considered just reading synopsis for 9, 10 and 11.
 
@BenjaminLindley I intend to get Brandon's Mistborn trilogy, I've never heard of him before WoT but I have to say I must. I just have no time. Bloody college.
@BenjaminLindley WHAT! No you can't. Oh man, you are missing a lot if you do that. Mat, Perrin and Rand get some seriously awesome storylines.
And Egwene gets badass.
 
tbh
I'm glad someone else has WoT now
Robert Jordan just wrote like five books in which virtually nothing happened
 
Did he also write books in which templated nothing happens?
 
Brandon Whatsisface could have sold a million copies just by putting "SHIT ACTUALLY HAPPENS" on the front
 
6:23 PM
lol
 
@DeadMG Wow you've read the series? Respect. Yes Brandon could have, he is doing a fantastic job. Robert came up with a good idea, but he went way off track.
 
How can I reply to a pinned message?
 
Er, same way as to any other?
 
today i learned that lying is necessary in complementary ways for g++ and visual c++
with g++, in order to produce windows ANSI encoded output you use ANSI-encoded source and tell the compiler it's UTF-8
with Visual C++, in order to produce UTF-8 encoded output you use UTF-8-encoded source and tell the compiler it's Windows ANSI
 
@RMartinhoFernandes Like this.
 
6:32 PM
ub?
 
Btw, who took my Careers invites? I don't mind, otherwise I wouldn't have posted the link. But only three people asked for them, and all five are gone now :) I'm curious.
 
What's a career invite?
 
@AlfPSteinbach Does it make you feel better if you can encapsulate the lie?
 
@StackedCrooked it would yes, how?
 
6:35 PM
Ah, it's not in the code that you need to lie but when running the compiler.
 
We have batch files, don't we? :)
 
I don't know of a very clean method. One option is to put a gcc executable in your local bin folder that forwards the command line arguments to the original gcc. You can use this indirection to cheat a little. (This is also how ccache works (that or it starts the original gcc as a subprocess).)
 
well, both lies are sort of lies by omission -- relying on the default
 
Are you using a build tool? It should be possible to encapsulate the lies there.
Btw, which one is right? Or are they both wrong here?
Awesome, Xeo is here!
@Xeo how are things going?
 
Xeo
not so good? money's short atm and I can't seem to find a job. :|
 
6:44 PM
Aren't you still in college? Or do you mean a part-time job?
Being a student sucks. I was always short on money too.
Never mind, you didn't come here to talk about that I guess.
 
sbi
#stackoverflow and the rest of #stackexchange are experiencing login problems due to a Google OpenID error. Workaround: http://bit.ly/vAJKIS
 
sbi
7:40 PM
Ha, I caught four downvotes on meta yesterday and today (which is relevant, because I have only <50 questions and answers there), ironically including my question and answer about serial downvoting. :) I don't really care about my rep on meta, but it would be nice to be back above 3k, as this would give me the privilege of casting close votes.
Interestingly, on SO proper I seem to have a serial upvoter stalking me at the same time. I have had nothing but upvotes for many of my old questions, almost twenty for the last three days.
Hullo, anyone here? Considers echo. Hm. Doesn't really sound very lived-in here. Anyone home?
 
@sbi Somethings gotta be done about those guys.
 
sbi
@BenjaminLindley Yeah, been saying this for years, but nobody would listen to me.
 
@sbi He/She must be going through all the questions in your profile
 
Are there any C masterminds in here?
.___.
 
Hi, @sbi.
 
7:46 PM
@TrevorArjeski Go ahead. Maybe we can help you anyway.
 
sbi
@vivek Well, it's not so clear-cut. The operator overloading FAQ question got upvoted twice (but that's been reddited and whatnot, and has upvotes trickling in all the time anyway, so it doesn't really count), and for the rest, too, it's not all that much above the usual dribble of upvotes. But the pattern differs: Usually, I get two or three upvotes on one question that was linked to somewhere. Now it's one upvote for many questions.
Hi @John.
 
Just wanted you to know someone was here.
 
I'm here too!
 
sbi
@TrevorArjeski I doubt you'd find them in the C++ lounge, but we all know a bit of C.
@JohnDibling Yeah, but you only just got in.
 
@sbi Ok. Someone's stalking you
 
7:48 PM
true dat
 
It's a weird question...I'm trying to gather the right way to explain it
It basically has to do with data corruption when I change directories in the shell that I wrote
 
@sbi : what happens when a vector (or any other container) is returned ? Is a copy made ?
 
Only happens when I implement the "cd" function in it
 
sbi
@vivek In C++98/03 it's copied, in C++11 it's moved. I wouldn't worry about that, though, until profiling shows a problem.
NOW WHO DOES THAT??
 
@sbi You mean returning a vector ?
 
7:52 PM
Isn't there RVO in 03, too?
 
what's this RVO/NRVO ?
 
I don't know if it's in the standard, but it's at least in MSVC: msdn.microsoft.com/en-us/library/ms364057(v=vs.80).aspx
 
(Named) Return Value Optimisation.
 
Copy elision for returned things.
 
7:54 PM
@codemaker hi
 
@sbi Hmmmm. It's a mystery.
 
@LewsTherin yo
 
most people don't rage about gaining rep like that :P
 
sbi
@CatPlusPlus Of course there is, but it's an optimization, and you can't rely on it. You can rely on move semantics, though.
 
@sbi wow... a few more and it'll cover the whole lounge screen
 
7:55 PM
@codemaker Ah, I thought you were away there.. Doing some wireshark... it is indecipherable
 
sbi
@vivek Did you do that?
 
@LewsTherin heh, you have to know what you are looking for
 
@sbi You can also "swaptimize" it. Like std::vector<T> ret; f().swap(ret);
 
It's almost like someone on here saw you talking about it and just upvoted 5 random answers to freak you out.
 
@sbi Right.
 
7:56 PM
@sbi what? me? no !
 
@codemaker There is too many stuff. I see a lot of ip addresses and I know they are the ones sending and receiving data in turn.
But I don't understand what frames 5 mean or all that crap
 
sbi
@DeadMG Of course. You can also pass in a reference. But all that obfuscates the code with optimizations.
That's the beauty about move semantics: you write the code in the simplest possible manner, and you get almost optimal speed.
 
swaptimization isn't that obfuscating
better than passing in a reference, I'd say
but of course, proper move semantics are teh betters
 
@LewsTherin well start by filtering it to just show stuff from your app
@LewsTherin put tcp.port == <port> in the filter box and then click apply
 
sbi
@DeadMG Obviously, you have never been teaching C++. Show a bunch of newbies std::vector<T> ret = f(); and show them std::vector<T> ret; f().swap(ret);. Which one do you think they will gloss over and which one will they have to ask you about?
 
7:59 PM
@codemaker i will start with localhost.
 
heh
 

« first day (377 days earlier)      last day (4556 days later) »