« first day (353 days earlier)      last day (4599 days later) » 

8:00 PM
lol
 
Now I want a new chat feature — attaching audio clips to messages.
 
Sry DeadMG not in my experience
 
alright, let the fights commence!!!
 
I mean, I don't copy myself to be in more than one place
 
I would if I could.
 
8:00 PM
cloning
 
Takes too long (about 24 years, to be exact).
 
class money : boost::noncopyable /* :( */ {
 
I'm confused when input from the command line arguments
for example myprog run code
 
Fine, I'm unique, but only to the point of Full Metal Jacket, this is my Gun, there are many like my Gun but this is Mine. Well you know.
 
8:01 PM
that creates a 2d array?
 
3D. It travels through time.
 
a char* [] ?
 
argv is an array of strings
 
like this
    char str[3][10] = {
                    {"myprog"},
                    {"run"},{"code"}
                  } ;
 
but since a string is itself an array of chars, you need 2D array
 
8:02 PM
The first thing you do with argv is std::vector<std::string>(argv, argv + argc);.
 
Yep, but heck char* is a string, the [] tells you there are a few of those strings.
 
And then it's actually usable.
 
Not bad Cat
 
Ah guys does it declare a 2d array in that format?
 
how about an argument parsing library?
 
8:03 PM
boost has one, afaik
 
no not a 2d array, its an array of strings.
 
donno what the name is
 
Boost.ProgramOptions.
 
Well, then you don't use argv directly, so it's good, too.
 
Tomorrow is a holiday.
 
8:04 PM
C strings suck.
 
oh nice
 
Wait, what?
 
Oh ok I think I see
 
@RMartinhoFernandes Here too
 
@CaptainGiraffe Oh really? Where are you?
Portugal?
 
8:05 PM
@RMartinhoFernandes At Overworked professor land in Sweden =) No lectures tomorrow =)
 
That's so not fair. I want a holiday, too.
 
Oh. What special day is it?
 
Go to work, you lazy bastards!
 
@CaptainGiraffe it is a 2d array how can it not be a 2d array?
 
Here it's the anniversary of the First Republic.
 
8:06 PM
@RMartinhoFernandes Trying to know everything about Androind I suppose in all humbleness
 
(Yes, we had more than one, and we celebrate them all, just to have less work days :)
 
an array of strings is a 2d array
 
oh haicakes
 
Yes, it is, but since it sucks, you shouldn't use it.
 
Yeah but I'm trying to understand how it is represented in the command line because I can't recreate it
 
8:07 PM
@LewsTherin Do you consider "Hello!" to be an array?
 
argv is an array of pointers to arrays of characters.
 
it wants to know the size of the 2d array
 
@CaptainGiraffe It is.
 
@CaptainGiraffe it is
 
@RMartinhoFernandes well yes of course
 
8:07 PM
@RMartinhoFernandes oh
 
int main(int argc, char** argv)
 
@LewsTherin Hey I'm the teacher here =)
 
And that's not really how it's represented in "the command line".
 
char const* str[3] = {
                "myprog",
                "run","code"
              } ;
 
Command line is a single string.
 
8:08 PM
I guess.
 
Sry that last comment was meant for @R
 
Chat has editing capabilities.
2 days ago, by R. Martinho Fernandes
If you are new here, please read the newbie hints. Thank you.
 
@RMartinhoFernandes that creates 3 pointers and each point to the char in memory
m r and c
 
@LewsTherin Right. It has the same structure as argv.
(I believe I forgot some const in there.)
 
No, it's not const.
 
8:09 PM
@LewsTherin forget about c-string when you have string objects :P
 
Hi MrAnubis lol yeah but it is good to understand :)
 
@CatPlusPlus My example is.
 
String literals C++ basically fucks up.
 
@CatPlusPlus just factoid: many persons are not aware that in Windows the process gets a "command line" instead of arguments. it does not work well with C/C++ main. the standard suggests using utf-8 for the arguments, but ISO standard does not beat strongly entrenched convention, it's a mess
 
Nope. Chuck Testa!
 
so **argv is equivalent to str
 
This meme wasn't funny.
 
just posting random things
 
you're not funny
 
Not funny.
 
8:11 PM
No, you!
 
damn you all
 
I'M BATMAN.
 
i'm listening to first böc album. they could make music at that time
 
@CatPlusPlus No, you're not. Batman is a human being.
 
what?
 
8:12 PM
@LewsTherin it is now a single char
 
@RMartinhoFernandes No, I'm Batman.
 
@Lews A command like "dir mydirectory\ *.com"
 
You're a cat.
 
No, I'm Batman!
 
You're hard to parse, but you're not Batman.
 
8:12 PM
@MrAnubis I don't think so... str is the same thing as &str[0]?
 
Will give you an array "dir" "mydirectory\" "*.com" in argv[0], argv[1], argv[2] respectively
 
@LewsTherin We already had this discussion once. It's not.
 
@CaptainGiraffe Not on Windows.
 
@CaptainGiraffe an array of pointers to those strings to the char
@DeadMG sigh true but to pass it as a char** it is equivalent
 
@RMartinhoFernandes What happens under windows?
 
8:14 PM
3 mins ago, by Alf P. Steinbach
@CatPlusPlus just factoid: many persons are not aware that in Windows the process gets a "command line" instead of arguments. it does not work well with C/C++ main. the standard suggests using utf-8 for the arguments, but ISO standard does not beat strongly entrenched convention, it's a mess
 
@LewsTherin check this : ideone.com/otUSp
 
That last portion is key: it's a mess.
 
I have a sourdough to attend to, it's a mess.
 
yeah it points to the char but you had to dereference twice :)
*mm holds the address that points to the char
that's why I can do char **a = mm or char **a = &mm[0]
 
@LewsTherin yes :P
 
8:17 PM
@RMartinhoFernandes Does the "command line" include the app name? or is the app name argv[0] and the rest argv[1] ?
 
@LewsTherin Avada kedavra!
 
@CaptainGiraffe yeah it does
 
@CaptainGiraffe Not entirely sure.
I know it's messy, that's all.
 
@MrAnubis Expelliarmus!
except this is confusing
char **a = &mm[0]
 
Oh, noes, not the Harry Potter things again.
 
8:18 PM
@LewsTherin told you to get away from c-string , and use abstraction :)
 
Loremus ipsumus!
 
@Harry Fenestratis confucionatis
 
@RMartinhoFernandes sectumsempra!
 
@LewsTherin Crucio!!
 
@MrAnubis Imperio!
 
8:19 PM
@LewsTherin I have no clue what that means.
 
@RMartinhoFernandes xD
 
@LewsTherin ouch!
 
Tip: it doesn't mean anything.
 
(I have never read or watched any Harry Potter.)
 
that sucks on a phone
 
8:19 PM
That's a neat wallpaper.
 
@RMartinhoFernandes lol
 
@MrAnubis lol
@CatPlusPlus nice spell :0
 
Anything mentioning VxD is an obvious troll.
 
@LewsTherin Confringo!
 
@Tony sry you had the Indigomortis spell cast at you
 
8:20 PM
Protego!
 
@CatPlusPlus Duro!
 
@RMartinhoFernandes you need to
read the books at least
 
@RMartinhoFernandes You can skip the films, and not miss anything great.
Books are rather good.
 
@LewsTherin Well, I just ordered a new pile of books last week, and it didn't include any Harry Potter, so I won't do that any time soon.
 
very good
 
8:22 PM
@Lews They are cute at the very best.
 
:( when you are finished with those books then...
 
I still have classics to catch up with.
 
Later films are basically CGI show offs.
 
only read the first Harry Potter book
 
It got darker
 
8:22 PM
@LewsTherin that is bad , Legilimens!! (haha i can see your bad mind , full of pr0n lol )
 
Full of weird plot/time skips, sometimes kinda-forced dialogue.
 
Farenheit 451, it got darker =)
 
@MrAnubis lol ... Impedimenta!
 
The lead cast grew up, but their acting skills aren't all that better than 8 years ago.
 
Please, there is a very good reason, we have classics, Harry Potter is not one of them.
 
8:23 PM
yeah I believe that was done on purpose
I hate the movies
 
The main actor tries to show emotion, and you can't help but laugh.
 
Lord of the rings, disputable. Aniara, for sure. If you are in to fantasy.
 
That was his undoing lol the only decent actor was probably the guy who played Draco
@CaptainGiraffe how could you forget the Wheel of Time?
 
@CaptainGiraffe Lord of the Rings is a classic, and that's not disputable.
Classic != good (i.e. you like it)
 
@RMartinhoFernandes I would not object if you have an example.
 
8:25 PM
I don't think I ever managed to read through the Ent discussion thing.
I mean, skipped it.
 
Plan 9 From Outer Space is a classic, and it's universally agreed that it sucks tremendously.
 
@RMartinhoFernandes For sure.
 
if you want to see some classic , see If only (2004)
 
@RMartinhoFernandes I'm very much a LoTR fan though =)
 
Speaking of supposed classics, I didn't really like 2001.
 
8:27 PM
The movie is a tad (read: a lot) boring.
I loved the book.
 
@CaptainGiraffe LOTR? -> when i was watching 2nd or 3rd part , i was wondering it did have end (so long)
 
@Cat good example of something not necessarily being a fav but still a classic.
 
The movie was boring? What the hell?
What movie?
 
Ah, kids these days. ;)
2001.
Yes, it's a movie.
 
@LewsTherin 2001 A Space Odyssey.
 
8:28 PM
@MrAnubis Not watching, reading.
 
The lotr book was damn hard to read
The lotr book was damn hard to read
 
Yeah, LotR Director's Cut is a bit of a stretch. 4 hours of one film is a bit too much.
 
@CaptainGiraffe i thought you were saying about movie :)
 
The lotr book was damn hard to read
 
@LewsTherin And FWIW, I'd agree that it was a mediocre movie at best.
 
8:29 PM
Last February, me and my friends, we had a LoTR marathon.
 
@JerryCoffin ah I thought he meant LOTR movies, never watched that
 
We watched all the special editions in sequence.
 
@Lews english is not your native language?
 
@CaptainGiraffe it is but I missed the earlier comments, and couldn't be arsed to read it
 
8:30 PM
Turns out it wasn't as fun as we expected.
 
I have a LoTR marathon every several months. I'm always completely exhausted at the end of the second part.
 
@TonyTheLion so true
 
@LewsTherin Okay, you have three more to go. As written, it's really six books (that were intended to be published as one volume). Breaking it into three volumes was done by the publisher, apparently contrary to Tolkein's wishes.
 
Just your loss
 
8:30 PM
@CaptainGiraffe you got the wrong guy , it's me (not english guy) lol
 
Also, if you think LoTR was hard to read, you never tried to read Silmarillion.
 
Then we considered running a Star Wars marathon.
 
@MrAnubis =)
 
Silmarillion is a bitch
couldn't even be arsed to read it
 
We decided against it because we would have to either: 1) start in pain with the crappy prequels, or 2) end in pain with the crappy prequels.
Then someone suggested a Matrix marathon. Which I didn't understand because there are no The Matrix sequels.
 
8:32 PM
To be honest that was the first time I preferred to see the movie than read the books
 
There's a Silmarillion film?
 
no the lotr movies
and hopefully the hobbit but it is unlikely
 
@CatPlusPlus Keep in mind that it wasn't really intended to be published as it was. It's a collection of notes, long with a few really polished bits and pieces, that his son mashed together into something the publishers would accept. Under normal circumstances, I doubt any publisher would have accepted such a mess at all. Being Tolkein, however, they were happy to.
 
`char *str[3] ={"Hello","World", "Mr Doe"} ;`
Before I go, where is the first pointer?
 
@LewsTherin str[0];
 
8:34 PM
char *str[3] ={"Hello","World", "Mr Doe"} ;
      ^
Here.
 
no I mean the * pointer before the str[0]
 
Now, My favorite book of all times I read in English, it was Umberto Eco's "I'l pendolo di Focault" or something similar. "Focault's pendulum" was the English title. I crap on you native English readers for deciding a novel is too dense.
 
@LewsTherin lotr -> should be lol -> three parts ( all were dying for just ring) , i'd have given that ring to bad guyz in first part lol
 
str is an array of three pointers, which are initialized to point to statically allocated memory containing "Hello", "World' and "Mr Doe".
 
And it's missing a const.
 
8:35 PM
Would people recommend using ClickOnce?
Because it annoys me and I just want one small package not something that get's all stupid and annoying
 
When it works, it's actually pretty neat.
When it goes sour, it's hell.
 
but where is the first pointer
@MrAnubis no I'dnt xD
 
@LewsTherin What do you mean by "where"? "Where will it be stored in memory?", or "what part of the syntax indicates a pointer?" or something else?
 
@LewsTherin str is const pointer to element of first char* element which is str[0]
 
8:37 PM
Where it will be stored
@MrAnubis are you sure?
If that is so then it makes sense lol
told you I was the bigger eejit :P
 
@RMartinhoFernandes I've never really had a good experience
 
@LewsTherin no , pointer are big pain in a$$, very confusing ( i told you many times , don't think of my precious position lol)
 
@LewsTherin If you define it inside a function, it'll be stored like any other auto-class variable (e.g., on the stack or possibly in a register). If you define it outside a function, it'll be stored like any other static-class variable (typically in an initialized data segment).
 
@MrAnubis It issss minnnnnnnnnnne, minnne!!! (Smeagol) xD
@JerryCoffin right true but str is a const pointer like MrAnubis said?
 
All those pointers are const*.
str is not a pointer, it's an array.
 
8:41 PM
@R just a simple const_cast away
 
Is writing my own autoupdater over-ambitious?
 
@Kian No but quite silly
 
@LewsTherin @RMartinhoFernandes is right , str will turn in to const pointer when used in expression
 
@CaptainGiraffe Why?
 
8:43 PM
@LewsTherin The pointer isn't const itself, so you could do an assignment like str[0] = "Goodbye";, and that would work fine. You haven't defined it as a pointer to const either, but it's pointing at const data, so if you tried to do something like str[0][0] = 'g'; the compiler wouldn't stop you, but you'd get undefined behavior -- it might do what you expect, or it might blow up the computer, or just about anything else.
 
@KianMayne Why cant you use existing ones? what is your use case?
 
@RMartinhoFernandes was i right ( my last line) , @LewsTherin confusing me lol
 
@CaptainGiraffe Never cast constness away on pointers to literals.
 
@CatPlusPlus Why not!?
 
Because you might get tempted to write to it. And you can't.
 
8:45 PM
You can't safely modify this memory.
 
const_cast doesn't let you cheat.
 
well ok we satisfied that=)
 
It might work by chance, but it's a sure AV if compiler does string pooling.
 
Access Violation.
Also known as segfault.
 
8:47 PM
ah =)
 
Access violation, segfault, boo-boo.
 
Also known as Segmentation Fault.
 
General protection fault.
 
Of course the GPF
 
@CatPlusPlus Unfortunately, still only "likely", not "sure". For example, MS C used to do string pooling on MS-DOS -- but MS-DOS didn't do any memory protection, so modifying a pooled string would just modify all the strings in the pool. OTOH, you're not likely to see that on any reasonably modern system.
 
8:48 PM
Neat.
 
They'll be in read-only sections in PEs and ELFs.
 
@Cat yes that is what we are betting for =)
 
Overwriting your own strings wasn't the worst thing you could do in DOS.
 
@RMartinhoFernandes It was a good way to pull some tricks. Nobody expects "printf("whatever");` to suddenly produce something entirely different than "whatever".
 
@JerryCoffin Don't tell anyone, but something similar works in .NET :)
 
8:50 PM
@CatPlusPlus Quite true -- you could overwrite absolutely anything (e.g., the core of the OS itself...)
 
strcpy((char*)"whatever", "SPANISH INQUISITION");
Or was it the other way around? I can never remember.
 
@RMartinhoFernandes When will they ever learn? Oh wait, they obviously won't!
 
typeof(string).GetField("Empty").SetValue(null, "bar");
 
Really?
 
8:51 PM
Where is the null-pointer-exception when you really need one
 
It works (and by works I mean, it will crash very soon).
9
A: Can C# cast const?

R. Martinho FernandesIt's not possible in C#, just like it's not possible in C++. In C++, if the object is really const, you cannot const_cast the constness away and write to it without invoking undefined behaviour: struct foo { const int x; }; foo a; int& b = const_cast<int&>(a.x); b = 17; // invokes...

 
Monkey-patching is the best kind of patching.
 
@RMartinhoFernandes Well, it does at least make it slightly difficult. The best was a few ancient FORTRAN compilers that would let you modify values of integers. Pass an integer literal to a function, modify it in the function, and that literal took the new value everywhere. Fortunately, even the FORTRAN people figured out that was a problem pretty quickly.
 
Java (Sun's JVM) has a small cache for the boxed Integer type.
 
scheme ftw!
 
8:53 PM
It caches the values -128 to 127 I believe.
 
@R to nobodys fortune =)
 
I'm not sure, but I believe you can hack around and change that cache too.
 
So guys, I've been looking for a way to iterate over all members of a given class once every 1/60th of a second in order to update their position, rotation, and velocity angles. Is there a way to do that with C++?
 
new Integer(127) == new Integer(127)
new Integer(128) != new Integer(128)
 
8:55 PM
Sweet too.
 
@CaptainLightning Portable C++, no. Any particular C++ implementation, probably.
 
So guys, I've been looking for a way to iterate over all members of a given class once every 1/60th of a second in order to update their position, rotation, and velocity. Is there a way to do that with C++?
What
Why did that post again when I rejoined?
 
(At least presuming you really mean "instances", not "members". Would be possible with members too I guess, but instances seems to make more sense.
 
@JerryCoffin std::this_thread::sleep_for(std::ratio<1,60>()); or something :P (may not be quite what is desired, but...)
 
@CaptainLightning Oh, you didn't intend to post that? Probably sitting in some buffer somewhere, and got re-transmitted because something though the first attempt failed.
 
8:57 PM
Teehee, StackOverflow chat has such cool features.
 
Yeah, like edits.
 
@CaptainLightning c++ does not do reflection very well.
 
@RMartinhoFernandes C++11 != "portable" (yet).
 
@JerryCoffin Fair enough.
 
But yes, I really should have said instances. Would anyone here know if C# is capable of doing this?
 
8:58 PM
@CaptainLightning Undoubtedly. If you're willing to live with the platforms supported by C#, C++ will do it quite nicely as well.
 
C# is a very nice key, many of my favourite Chopin pieces are in C#
C# has reflection, c++ does not
 
@CaptainGiraffe You mean, C♯?
 

« first day (353 days earlier)      last day (4599 days later) »