« first day (704 days earlier)      last day (4245 days later) » 

3:00 PM
No way you can google that so quickly
 
So?
@Borgleader Have you noticed that the UI for asking questions has a feature that allows posting an answer straight away (i.e. not even with a second of delay)?
 
@Borgleader He probably already knew the answer and then answered his own question to help people who have the same problem in the future.
 
If it were not desired, why would that be there?
 
@R.MartinhoFernandes It does?
 
@CatPlusPlus It's recent, but yes, it does.
 
sbi
3:01 PM
@Borgleader Look at the times this question and its answers were originally posted. (Hint: I had the answers all typed and planned by the time I started working on the question.)
 
@CatPlusPlus ^ the checkbox.
 
No, really?
 
@sbi mocking is not as fun when you point out holes in it
 
I've never actually posted a question on SO so no I didn't kknow about this feature.
 
sbi
@R.MartinhoFernandes That must indeed be recent.
@thecoshman It's fun to me.
 
3:02 PM
@sbi :S
@R.MartinhoFernandes shit... I opened it in another tab, and then read it... few, image didn't load... how bad was it?
 
@Borgleader It was fine from the start.
 
I've seen guys answer they own Q with a wrong answer too
 
TIL I learned that char[5][10] and char** are not like char[5] and char* in behavior
You cannot pass a char[][] to a char** function arg.
 
I like how in the particular case that @Borgleader mentioned, someone posted another answer and already garnered two upvotes vs zero on the OP's answer.
 
which I find rather confusing
 
3:06 PM
1
A: Nesting Boost.Assignment `map_list_of`

hmjdIt is possible to nest map_list_of in this manner (but there may be temporaries created underneath, I'm unsure of that): #include <map> #include <string> #include <boost/assign/list_of.hpp> using boost::assign::map_list_of; const std::map<int, std::map<int, std::string&g...

 
@TonyTheLion of course not. [][] is an array of arrays, ** is a pointer to a pointer.
 
And this is how VS2012 will compile Ambrosia
 
@daknøk yes, however you can access your double pointer as x[][] and get the value, which causes the confusion with the char[][]
 
Anyway, multidimensional C-arrays are confusing. Use std::vector<std::vector<T>> or std::array<std::array<T, M>, N>.
 
I know I should use vector, but I'm just trying to get my head around this
 
3:08 PM
the trick is
char** denotes two levels of indirection- when you do *ptr, you get another pointer.
 
I don't think multidimensional arrays are particularly useful.
 
therefore it can't be an array
because you're about to go de-reference that shit
I mean
 
@TonyTheLion It's easy to understand when you see how the two look like in memory.
T[N][M] looks like a single chunk, while T** reminds me of one of them deque thingies.
 
@DeadMG yes but when you have a char*, you can get it to point to your char[] first element
@R.MartinhoFernandes as in std::deque?
 
Fred's on arrays covers that (with ASCII pictures!).
 
3:10 PM
@TonyTheLion Right. But that can't work for a second dimension.
I'll show you
 
** is more similar to std::vector<std::unique_ptr<T>> when talking about arrays.
 
@DeadMG right, and I guess there's the clue
 
@daknøk Or std::vector<std::vector<T>>...
 
for one dimension, indexing an array and a pointer are identical.
 
3:11 PM
Oh god my eyes. :P
 
@R.MartinhoFernandes for some reason, T[N][M] made me think of Teenage Mutant Ninja Turtles
 
but for a second dimension, the multi-dimensional array index is not the same as the multi-level pointer
 
T turtle[M][N];?
 
@R.MartinhoFernandes I have no idea how it happened :P
 
I mean, you can see how for a multi-dimensional array, the second index requires knowledge of all but the last dimension.
 
3:12 PM
@DeadMG right, so if you want to pass a char[][] to a function, you can't use char**, but you need to use (char*)[n]?
 
yes.
well, no.
 
char(*)[n]
 
@R.MartinhoFernandes that.
 
that's what I meant
too lazy to type n lol
 
yep
 
3:13 PM
@daknøk barrier to abuse
 
> indexing a pointer
 
@R.MartinhoFernandes that's an array of pointers, right?
 
wow
 
@TonyTheLion so if you want to pass a char[][] to a function, you can't use your brain. FTFY
 
@TonyTheLion No. An array of pointers is what you wrote.
 
3:14 PM
@TonyTheLion A pointer to an array of characters.
here, the last dimension has decayed a pointer- but the other dimensions remain as fixed-size array.
 
@daknøk lol
@R.MartinhoFernandes huh, I didn't know that was different. Jeez
 
C declarator syntax is really nice.
2
@TonyTheLion When in doubt, typedef all the things.
 
@TonyTheLion The point is, only the first dimension can be treated as equivalent. All the others, they are quite distinct.
@R.MartinhoFernandes Or metafunction.
 
Or alias!
 
That's just a templated typedef!
 
3:16 PM
@DeadMG right, the first dimension decays, but the others don't.
@R.MartinhoFernandes confusing as fuck, you mean?!
 
@R.MartinhoFernandes And you thought I wouldn't have noticed!
 
Ell
boost::multi_array
 
@R.MartinhoFernandes Ahahahaa
 
another reason not to use C
 
Ell
3:16 PM
i get told off by you folks for using vector<vector<T>>
 
There is really almost no reason to use C.
 
except when using C.
 
@CatPlusPlus managers
 
My screensaver showed the definition of the word affliction while I was listening to the song Affliction.
 
3:17 PM
@Ell Do you need jagged arrays?
 
Ell
I don't need either personally
 
Xeo
@Ell I don't think anyone here would tell you off, at most we'd point out that vector<T> v(n*m); may be better if you don't need jagged arrays
 
Then why would you use them?
 
Ell
but i read something about multi dimensionalled arrays
 
3:17 PM
@daknøk meh, coincidence
 
@thecoshman I know.
 
@Ell almost always more hassle then they are worth
 
Ell
boost::multi_array provides view which look nice. I just don't know how to use them :L
 
@Xeo +1
 
char[size][] p; this is yet something else?
 
3:19 PM
Not valid.
 
Xeo
@TonyTheLion Aside from a syntax error?
 
@DeadMG has it in the example he posted earlier
 
Only the innermost bound may be omitted. (Disregarding declarator syntax etc.)
 
Xeo
@Ell Boost.MultiArray is complicated as fuck the first time
 
a lot of people seem to struggle with the concept of using a 1D array to store an ND array
 
3:19 PM
@TonyTheLion @DeadMG sucks. :P
11
 
@TonyTheLion Oh. That was just an illustration.
it's probably more correct to have T(*)[size].
 
@Xeo the first fuck, or once you know what the is going on?
 
@DeadMG ah, I see
@DeadMG right
 
Xeo
@thecoshman Err... the former? xD
 
@thecoshman it's kind of mind bending, the first few times you look at it
 
3:21 PM
@TonyTheLion really? is it really that hard to imagine sticking all the rows of a table into one big long row? I guess it is a bit more work to think about how access the element you want, especially when you want to use say N nested loops for your ND array
 
@thecoshman for some reason I misread “first”.
 
@daknøk :O
 
@thecoshman well, some can't picture things that easily I guess. What should I say?
 
on that note, I am going to head home
@TonyTheLion they suck? :P
 
3:22 PM
you suck
 
Xeo
@thecoshman I don't even think of it as one long row, I already think of it as a rectangle
 
may your timbers remain unshivered
 
I know it threw me off when I had to index an image in memory as a straight row of bytes.
 
@TonyTheLion All you have to do is understand exactly what indexing does.
then it will be obvious to you when two operations reduce to the same thing
 
@DeadMG maybe you should write a tutorial on that? :)
 
3:24 PM
lol
 
while you're writing tutorials
explain it really simply with lots of examples
cause I'm not the first to get confused about this
 
well
I'm going to wait a while, certainly
 
until you've got proof that others also get confused? :P
 
By the way, @DeadMG, I found a grammatical error in your hello world tutorial.
 
you're kidding
 
3:26 PM
I’m not.
> A breakpoint instructs an external tool, the debugger, to pause the program so that we can observe, and sometimes even modify, it's state whilst executing.
 
/me grabs popcorn
 
@daknøk Grammatical != spelling
 
pedants at work
 
Well, you misspelled “its”. :P
 
lol
 
Ell
3:27 PM
@DeadMG "it's" is "it is", "its" != "it is", looks like speilling to me :P
 
Well you're wrong. You could call it a typo though (and it could be one).
 
I installed VS2012 this morning.
 
is its even valid English?
 
First thing I did after starting it: close it and set that damn registry key to remove the ALLCAPS menus.
 
@EtiennedeMartel good on you. FUCK ALLCAPS!
 
3:29 PM
FUCK ALL THE CAPS?
 
Ell
@TonyTheLion "its" is possessive, I think
 
I've had it for months and I just realized the menus are in all caps -.-;
 
ah
@Borgleader ._.
@Borgleader you hadn't assimilated it?!
 
3:31 PM
The information was assimilated, just hadn't been processed until now ;)
 
lack of resources?
 
Too much information to process :P
 
@Ell Yes, "its" means "belonging to it", "it's" means "it is".
 
his, her, its..
 
Ell
@JerryCoffin I should know, I'm native, its embarrasing that I don't ;)
 
3:33 PM
@StackedCrooked ..., tits...
 
@R.MartinhoFernandes Yes, them too.
 
@R.MartinhoFernandes I thought the same. :P
I want to learn a new programming language.
 
Which ones do you know?
 
C, C++, Objective-C, Objective-C++, Ruby, JavaScript, CoffeeScript, Python, PHP, Perl and Haskell.
I might want to learn Erlang or Io.
 
@daknøk Objective-C++ is not really a different language.
 
3:38 PM
Why not Scala? Prolog? xD
 
meh
 
Ell
@daknøk coffee script? what's hello world?
@daknøk try a .net language? c#?
 
@Ell console.log "Hello, world!"
 
Ell
oooohhh Java :D
 
3:38 PM
I could learn C# or Java but it’s too much focussed on OOP, IMO.
 
C#?
It's not.
 
And Java isn’t any interesting.
 
Ever wrote it?
it seems awful different to me
 
@R.MartinhoFernandes Not? Hmm, it might be worth it then.
 
You get nifty functional stuffs all over.
 
Ell
3:39 PM
@daknøk yeah, linq n that
 
Try Rx. Rx is really neat. Also potentially mindbending. But neat.
 
Ell
also pure oop is the bomb :D
try APL, or gnu octave/matlab
 
Or sed.
 
@Ell Pity that "Pure OOP" includes pretty much everything under the sun.
 
I don’t know if Erlang would be any good outside of concurrent or parallel computing.
 
3:41 PM
when doing pointer arithmetic on pointers of someObj what would be the use of doing a reinterpret_cast<char*> before doing the arithmetic?
 
@TonyTheLion Casting to char* means you're doing arithmetic at the byte level.
 
You only do that when you need to place stuff at exact spots.
 
@R.MartinhoFernandes Seems hardly googleable.
 
i.e., ptr + 1 is one byte next.
 
@TonyTheLion + would increment one byte in that case.
 
3:42 PM
Which you probably don't need.
 
@sehe I mean compared to Objective-C.
 
whereas ptr + 1 is ptr + sizeof(*someObj) * 1
 
ah I see
 
@EtiennedeMartel Oh. Ok then
 
3:42 PM
Objective-C++ is terrible and has a lot of quirks.
 
@daknøk quirk++
2
 
@daknøk So, half of the languages you know are terrible. Hmm.
 
For example, using a C++ object from an Objective-C lambda will call the copy constructor. There is no way to use a reference. You would need a pointer and mark the object __block if you don’t want the copy.
 
Trip planning sucks.
 
And let’s not even talk about Objective-C’s exceptions and C++’ RAII.
 
3:44 PM
@DeadMG But isn't ptr + sizeof(*someObj) * 1 then ptr + sizeof(*someObj) * sizeof(*someObj)? Which itself... :p
 
@LucDanton What?
 
@daknøk Still better than communication through some sort of IDL and code generation.
 
only if *someObj is a pointer to char, and then, yes, ptr + 1 is 1 byte address.
 
@DeadMG pointerception
 
Oh wait 64-bit Objective-C runtime uses C++’ throw internally. So your code is only exception safe in 64-bit mode. xD
 
3:46 PM
@R.MartinhoFernandes So it isn't a neat, potentially mindbending programming language. That's a disappointing misunderstanding.
@DeadMG I was pointing out that you defined p + x in terms of p + f(x).
 
@LucDanton Not really. The second p is a pointer to char*.
could have been made clearer, I guess
or you could simply view the return value of f(x) to be a different type.
in any case, it's not recursive
 
My mathematics teachers took great care to instill rigueur in all of us. It has left its mark.
 
I was trying to communicate something to Tony. As long as he understood what I wanted to say, then by definition, I achieved my requirements.
 
I learnt something the other day: if you use delete on a managed reference in C++/CLI, it calls Dispose().
 
> If you are curious about C++ and want to just experience the basics, I'd wager the 1999 book would be adequate.
wut?
 
3:53 PM
@TonyTheLion That's one hell of a wager.
 
C++99!
 
Yeah, I have to disagree with this answer. I posted a full answer. I certainly wouldn't use a 1999 text in a classroom setting, but if someone is dabbling in C++ in his/her own time, it's probably new enough to learn the basics. — TheBuzzSaw 2 mins ago
see his answer on that question
 
I’m going to write a garbage collector. I’m bored.
 
Is there a better word than consultancy? (smart-ass jokes aside of course)
 
@daknøk sounds like a plan :P
will it collect my garbage too?
 
3:58 PM
It will collect yo momma.
 
@DeadMG C++11 is not mainstream yet. Plus, learning "C with a C++ guise" is hardly harmful. One can learn the language's basics and then move on to learning more advanced features. Again, I'm not advocating keeping the 1999 text as the only source. I'm merely pointing out that it is not useless as you claim. — TheBuzzSaw 23 secs ago
oh god why?
 
// Java’s garbage collector.

template<class T, class... Args>
T& gcnew(Args&&... args) {
    T* object = new T(std::forward<Args>(args)...);
    // LEAK :D
    return *object;
}
 
> "C with a C++ guise" is hardly harmful.
this is bad ^
 
C with C++ GUYS!!
 

« first day (704 days earlier)      last day (4245 days later) »