« first day (683 days earlier)      last day (4255 days later) » 

12:00 PM
(painted pink)
 
(continued)
 
(banned)
 
(epic)
 
(piratical)
 
Ell
(interracial)
 
12:05 PM
Combo Break !
 
(screw @ereOn)
 
Mouhahah
Yeah : I'm that evil.
 
@Ell (INTERCAL) FTFY
 
Today's TDWTF is awesome.
 
@daknøk thanks
 
12:14 PM
@R.MartinhoFernandes: I just read it. It is a lot of fun indeed.
 
Guys (high rep) - look at this one stackoverflow.com/questions/12177632/…. Hypothetically, 10 similar answers can show up, and all will be correct
I've seen many simple questions with answer duplications. Does SO have any mechanism to prevent this?
 
lol
 
> I told him the that the C++ guidelines are chalked such that so compiler sends error at compile time.
lol the C++ guidelines.
 
oh, the guy is obviously lame, but that's not the point
 
12:17 PM
HAve you looked at compilers? "Guidelines" isn't a bad description of the standard.
 
well, the pun clearly wasn't intended :P
 
@R.MartinhoFernandes CAPITALISE ALL THE LETTERS!
 
JAVA
 
By the way, 2 more answers just showed up
Anyone care to answer Does SO have any mechanism to prevent this?
 
@BartekBanachewicz funny, still no fucks given...
 
12:20 PM
-.- whatever.
 
sbi
@sehe To edit there, you have to register. I think the @Cat will review your request before it is granted. I'm not sure, though.
 
@BartekBanachewicz you were right. :)
4 answers already.
 
@BartekBanachewicz Downvote if it's a blatantly ripped off answer?
 
Ahh fuck this keyboard.
 
sbi
@ApprenticeHacker It already says so, here: "Please paste longer code snippets into some online service and post a link to it."
 
12:21 PM
Otherwise, just don't upvote.
0
Q: C++ Address of class member method by it's pointer

KolyunyaIn my program I need to know, if two PointersToClassMemeberMethod point to the same method of the same class. So I've tried to get the address of both methods by their pointers like this: void ( Type::*classMemberPointer ) ( void ); return ( size_t ) ( & ( * classMemberPointer ) ); But, I'...

 
Eeew (returning) owning raw pointers. Return an std::unique_ptr. — daknøk 1 min ago
Eeew (returning) owning raw pointers. Return an std::unique_ptr. — daknøk 18 secs ago
 
@daknøk This is going to end badly. That assembly thingy numbered dude doesn't like unique_ptr.
 
@daknøk I can, and I would do that in my code, but returning the pointer is the classic pattern seen in most of the literature. — juanchopanza 50 secs ago
Most of the literature is wrong and bad and must be burnt. — daknøk 30 secs ago
 
12:23 PM
@daknøk +1
 
> // parameters define which derived type to instantiate.
Isn't instantion the template thing?
 
@sbi All owners can edit freely, but you have to register there first and then ping me to grant you moderator access. cc @sehe
 
@daknøk well, class A { }; A Instance;
 
sbi
@CatPlusPlus That's what I thought.
 
...which is also on the main wiki page.
> If you're a chat room owner (see newbie hints for explanation), you'll be given moderation powers on the wiki, which are necessary for things like editing pages in owners: namespace, deleting and renaming stuff, etc. After entering password above, ping @CatPlusPlus in the room.
 
sbi
12:27 PM
What is it today with the flaggers? They are getting on my nerves. They shouldn't do this.
 
Lol. Lounge team taking over the answers ^^
@juanchopanza then you are not using C++ — thecoshman 47 secs ago
 
@daknøk yeah yeah, and if there is no std::unique_ptr? — juanchopanza 2 mins ago
lolz
 
it's your own fault for looking at the list of flags
 
then your implementation suckz
I am really in the mood to write Haskell.
 
using raw pointers for no valid reason? that's a down vote
 
12:39 PM
lol smart pointers in C
 
Wow, you guys are really pissy about this raw pointer thingy.
 
I for one like raw pointers
 
@R.MartinhoFernandes it's not raw pointers, it's just people doing things wrong
@LuchianGrigore stop trolling :P
 
@LuchianGrigore troll of the year
 
I'm not, and I do
 
12:40 PM
struct unique_ptr {
    void (*deleter)(void *);
    void *value;
};
unique_ptr move(unique_ptr);
void delete(unique_ptr);
 
Good luck getting that to work.
Maybe you'll end up with auto_ptr again.
 
@LuchianGrigore you sadistic fuck
 
@daknøk remember C has no implicit destructions.
 
What, you guys don't like raw pointers?... here's one for you - chat.stackoverflow.com/rooms/139/java
 
@BartekBanachewicz I know. :P
 
12:41 PM
@LuchianGrigore ¬_¬
 
u mad bro?
You have to love C++ the way it is, the good & the bad...
 
Mostly the bad
 
@LuchianGrigore Can I hate the java the same way?
 
But the bad is the best part...
 
@thecoshman Thing is, auto_ptr is not a good fit even for factory functions, and that's why people returned raw pointers from them.
 
12:43 PM
@R.MartinhoFernandes what's auto_ptr?
 
@thecoshman deprecated smart pointer from hell.
 
You don't need to know.
 
If you guys are so touchy about raw pointers, what's your take on void*? :)
 
@thecoshman The copy ctor moves, IIRC.
 
sbi
1 message moved to bin
 
12:44 PM
@LuchianGrigore stars in an endless void.
 
sbi
:5138501 Tempted to bin... Oh, dang.
 
shared_ptr should be implementable in C++03, not?
 
@daknøk was being sarcastic
 
@thecoshman All I'm saying is that there was no good tool in the standard library for a long time. And a shared_ptr is not particularly great for this.
 
@sbi there is no need for that :O
 
12:45 PM
@daknøk Yes, and highly suboptimal.
 
sbi
@thecoshman But, oh the temptation!
 
@sbi indeed :P
 
sbi
@R.MartinhoFernandes Who? What? Where? Why?
 
oh Fuck
(capitalized)
0
Q: How to Run the C++ application continously?

GuruI want to run my exe continously atleast for 24hours. How to accomplish this task, can someone guide me on this.. My sample code is like this.. This Run_Continously() function has to execute continously in loop. My previous attempts are like this: First Attempt: int Cmfc2Dlg::Run_Continously()...

 
@R.MartinhoFernandes I wonder who ¬_¬
 
@BartekBanachewicz -1'd
 
But hell... that guy... I am really shocked.
 
"Oh no God don't downvote him he is new oh no."
What if I told you, I don't ever look at reputation?
 
12:48 PM
no, i dont give a fkc
I mean, he did really try. But the result...
 
He didn't.
 
sbi
@R.MartinhoFernandes There seems to be some flag pheromone in the air today, at SO. I can't think of any other explanation for what I've seen today. I must have seen almost two dozen flags today.
 
Want your program to run forever?
for(;;);
 
Nice work causing UB.
 
@daknøk well, he had while(1). That wasn't the point
 
12:50 PM
@R.MartinhoFernandes Huh?
 
@sbi 'tis might fine weather for a flags
2
 
How is that UB?
a: goto a;
 
@BartekBanachewicz for(;;); is more efficient than while(1). It'll get you to infinity faster
 
Non-terminating execution with no side-effects.
 
Is that UB??
 
12:51 PM
Yes.
 
@Neil sir trolls a lot
 
k, another one to downvote
 
I don't remember if value computations are considered though.
 
Is there a good reason for that or are the Standard people just retarded?
 
0
A: How to Run the C++ application continously?

Mahbubur R AamanThe followings may helpful Utilize enum regarding memory issues. Release memory in perfect ways. Rather implement garbage collection.

 
12:52 PM
@daknøk Nobody knows how the text was accepted, it came up as a surprise to everyone. We might never know why this was submitted.
 
Hmm.
And the same for a: goto a; then?
 
@daknøk It doesn't do what all threads are supposed to do (terminate or do one of a number of special operations).
 
sbi
And, Wham!, another four flags.
@thecoshman Damn weather!
 
@sbi did I get the right weather?
 
@daknøk Yes.
 
12:53 PM
omg. someone actually upvoted that fucktard.
 
And for(;;)sleep(1);? Seems like a side-effect to me.
 
@BartekBanachewicz There are garbage collectors for C++.
@daknøk Depends on sleep.
 
oh yeah. lol :P
 
@R.MartinhoFernandes Why don't use that effing unique_ptr?
 
for(;;)asm("hlt"); :D <-- doesn't work outside kernel space, but whatever.
 
12:55 PM
Or even better, why use pointer at all
 
@BartekBanachewicz Dunno, haven't read the question.
 
You can use std::unique_ptr in tandem with a garbage collector, they're not mutually exclusive.
 
Also, a simple specialized garbage collector is not hard to write.
 
I wouldn't know how to make a windows daemon for instance
A program that hangs is one thing, but a daemon is another
 
@LucDanton Why would you even need GC if you have smart pointers?
 
12:56 PM
@BartekBanachewicz Deterministic destruction while the GC takes care of reclaiming the memory.
What's a GC to you?
 
GCs make many things easy.
 
GCs are great.
But I would not use them in C++.
 
@daknøk Depends on what you need
 
The current version of C++ is C++11 and as such, unless the OP specifically states otherwise, a question should be answered with C++11 in mind. This means this answer is currently teaching bad practice which must be corrected. — thecoshman 24 mins ago
3
^ gold
 
@LucDanton Something that calls delete for you.
 
1:02 PM
And if OP cannot use std::unique_ptr, he will just leave a comment and then start suggesting the use of raw pointers.
 
@R.MartinhoFernandes as simple anything is easy to write, if it wasn't easy it's not simple
 
@BartekBanachewicz That seems intractable for most types with non-trivial destructor. You'll run into order of destruction issues pretty quickly.
Did you mean operator delete?
 
@LucDanton Kinda like finalizers in Java and C#. There's a reason they are shunned.
 
@BartekBanachewicz delete getting called for you = GC by definition
 
@daknøk And I thought I was crusading for this. Seems I'm just advocating it, and you guys are crusading in the Roman Catholic Church sense of crusading.
 
1:04 PM
@R.MartinhoFernandes +1. That's surprisingly correct.
 
In C++03, can't you implement std::unique_ptr non-copyable with an explicit move function?
 
You shouldn't have to worry about releasing resources, and with smart pointers, you don't
 
@Neil Please do not mistake delete for operator delete.
 
@LucDanton I kind of don't know how to answer to that one. Well, GC should track the multi-level constructions, too.
 
@daknøk You can do it with transfer capsules. It's not a silver bullet, and far from pleasing.
 
1:05 PM
@LucDanton Okay.
 
@BartekBanachewicz Current state of the art and pratical advice on the matter of finalizers suggest that we're quite a way away from 'should'.
So, stick an std::unique_ptr in it and you can solve some more problems that GC alone can't.
 
Finalizers in Java can cause memory leaks (and I don't mean by not terminating or whatever, I mean just from existing).
 
@LucDanton Oh wait.
 
I like with in Python.
 
@BartekBanachewicz And then go write a lockfree algorithm and you will be: #1 pining for a garbage collector; or #2 writing what essentially boils down to a garbage collector.
 
1:08 PM
It is superior over finally.
 
anyone else doing the CTF challenge?
 
@IAmBatman Capture the F*ck! Oops.
 
:[
 
wow, finalize() looks like such a terribly broken 'feature'
 
do you know what /[^\w]WORD[^\w]*$/ means?
 
Ell
1:11 PM
would a webcam server be a kernel module in linux?
 
That zedshaw guy from Twitter who was quoted here yesterday is a complete ass-hat, is that possible?
 
I don't understand all the worry about memory management. There are more things going on to make a program correct than memory.
 
It is a Java feature, of course it is broken.
 
@thecoshman It's the "don't use unless you know what you're doing; you don't know what you're doing" kind of feature.
 
@thecoshman what the ... !classname() {}
 
1:11 PM
@Ell What?
 
@KonradRudolph Yes, he is.
 
I think [^\w] is non alphanumeric character yes
 
@LucDanton Yeah, but if you suck at memory and you leak, you are screwed.
 
@IAmBatman On dialects where that works. But \W is much simpler
 
@thecoshman They work better in .NET. Still problematic and not recommended unless you really need it.
 
Ell
1:11 PM
@daknøk a webcam server - e.g. a virtual webcam that can have effects applied and then used as an input for skype or whatever
 
@R.MartinhoFernandes is the proper way to use it, to not use it?
 
I am trying to solve an online challenge
 
@daknøk There are plenty of ways to screw up. Why focus on that one?
 
and I know it is looking for something that compares to /[^\w]WORD[^\w]*$/
 
@Ell ohh. Yeah then say that. I thought you wanted a web cam with a web interface or something.
@LucDanton As an example.
 
1:12 PM
I am not sure what *$ is
 
Ell
@daknøk Well that is what a webcam server is
 
@KonradRudolph Regexes should allow arbitrary Unicode properties.
 
@IAmBatman End of string
 
@IAmBatman * means 0 or more, IIRC
 
@R.MartinhoFernandes Modern implementations do
 
1:13 PM
@IAmBatman $ is end of input or end of line, depending on the modes set.
 
okay so it's basically just looking for (nonalphanumeric)WORD(nonalphanumeric)
 
@KonradRudolph Oh can haz example?
 
$ means end of string and something followed by * is 0 or more
 
so the last non-anumeric could be there, could not be there
 
Omg, that dude is famous?!
Zed A. Shaw is a software developer most commonly known for creating the Mongrel web server for Ruby web applications, as well as his articles on technology, business, and technical communities. His most famous and well-covered piece was his article called "Rails is a Ghetto", which has since been removed from his site. Software Shaw is the original writer of the Mongrel web server for Ruby web applications. Mongrel was the first web server used by Twitter, and inspired Node.js according to Ryan Dahl . Speaking * Zed spoke at CUSEC 2008. His talk, [http://vimeo.com/2723800 The ACL is Dead...
 
1:14 PM
@KonradRudolph Yes.
He's not a fool, he's only an asshole.
 
@R.MartinhoFernandes \p{UnicodeProperty}regular-expressions.info/refunicode.html
 
@IAmBatman It's WORD surrounded by two weird characters only
 
(or, in POSIX syntax, [[:UnicodeProperty:]])
 
Like .WORD.
 
@KonradRudolph Hmm, the list doesn't seem to include XID_Start and XID_Continue or even the old ID_Start ID_Continue ones :(
 
1:16 PM
well technically the * means there could be more than one weird character afterwards
so ?WORD?..//^^ would be valid
 
@Neil ?WORD would also be valid
 
@KonradRudolph Actually, upon closer inspection that's just Unicode categories, but they say "properties".
 
@BartekBanachewicz Yes, 0 or more characters
 
@KonradRudolph > You can find a complete list of all Unicode properties below. <*follows list of Unicode categories*> regular-expressions.info/unicode.html#prop
 
@R.MartinhoFernandes It should allow both
Hmpf
I’d assume (hope) that this dependes on the underlying locale used by the engine
i.e. that the Unicode aware part of a regex engine isn’t hard-coded but rather defers some locale/facet library (even though I’ve got no clue how such an API would even look like, let alone if it exists)
 
1:20 PM
Properties can be tailored for specific locales, yes. Such an API can be simply a bunch of predicates or getter functions (depends on the types of properties)
 
Talking from experience?
 
Oh! I remember what I wanted to talk about with you.
 
Don't forget it, because I'm going to have lunch soon (it's already 14:20!)
 
Have you considered introducing e.g. an adl::get that performs ADL of get on your behalf?
You know how inconvenient ADL is with decltype and the like.
I'm still fine with traits but I don't think every ADL-enabled operation needs a trait.
 
1:24 PM
Ah, yes, I've thought of that, but I haven't taken the time to do it yet.
 
I'm tempted because I suspect I have invalid code where I have a member function foo that uses the name foo in its return type, which is supposed to be found via ADL.
 
Boost.Range does that with boost::begin and boost::end.
 
And if I understand correctly then that's invalid because the name of the member shadows everything. But GCC accepts it currently (does two-phase, performs ADL).
@R.MartinhoFernandes I noticed that not long ago!
 
So anytime soon when I try Clang again or the snapshot is upgraded I'm afraid things are going to break deep in an instantiation stack.
 
1:26 PM
I have an interesting question for you: stackoverflow.com/questions/12138243/…
 
@SeçkinSavaşçı Hi.
 
Xeo
@R.MartinhoFernandes Does what exactly? using std::begin; begin(v); ?
 
@Xeo It's C++03 so I'd be surprised if it was designed to do that.
 
Xeo
Oh, righty
So what then? (note: I've not been following the conversation)
 
@Xeo I don't think it has the using part. AFAIK it replicates std::begin's behaviour (C++03) and does ADL on the argument's namespaces.
 
1:28 PM
@R.MartinhoFernandes Anyway I'm also running out of time but when I get around to doing that I may need some help, I'm still unsure how to use ADL with a decltype return type, even after your question regarding noexcept.
 
You never write using boost::begin; begin(v);, you just write boost::begin(v). ADL in a package.
 
Xeo
like boost::swap
 
...work needs to unblock SO chat. Anyone want to talk sense into whatever department maintains this idiotic block list?
 
@LucDanton Ok, feel free to ping me. But I won't be online at night much the next days.
 
@SamDeHaan Hack it and clear the block list.
 
1:32 PM
I love it when I add functionality to a class and it ends up with 30 less lines.
 
@dak that is one option...
 
Hmm, new C++ standard draft, now with even less typos!
 
Ell
I can't pinpoint what makes c++ a more difficult language than c#
is it the vastness and quality of the .net library?
 
@Ell main thing IMO is UB. in C# you can mess around until you get something that compiles, debug it until it observably does what you want, and voila, you have a working program
Try that in C++, and you're almost guaranteed to step into UB, and your program might blow up if you run it again
 
1:39 PM
Which means that in C++ you have to have much higher understanding of what you're doing
 
That's why I think bottom-up is a bad teaching approach for C++. It makes student experimentation worthless or even harmful.
 
@jalf +1. Does it quite mean that if one knows C++ well, learning C# will be really easy?
 
Also stuff like the GC. In C# you can trust that the language will clean up your memory for you. In C++, you have to either write tedious and error-prone C-like code, or make the mental leap to really understand stuff like RAII
most of the difficulty is really about how much understanding and prior knowledge is required
 
Ell
RAII is one of the most awesome features about c++ I think
 
Duh, I always mispell it as RAAI (at instead of is)
 
1:41 PM
@BartekBanachewicz I don't think it will help much. At least it won't help more than knowing any other run-of-the-mill OO-ish language.
 
@BartekBanachewicz not necessarily. You'll have to unlearn a lot of habits. And eh, the entire point is that C# is always kind of easy to learn
 
Ell
and i am confident with my c++ skills as much as my skills in other languages, yet I find it extremely difficult to "whip something up". I'm not sure if that is due to sparseness of libraries or the language being difficult to use or just massive overestimation of skill on my part
 
@Ell the 3rd one ^^
I'd say the easiest way to learn fast and accurate programming is writing a lot of stuff
I've noticed significant improvement and works-at-first-compile of my programs after writing similar code 10 times by hand.
 
Ell
to me it seems any (modern) language is easy to learn if it is in a familiar paradigm, apart from c++
 
@jalf Well, does it mean that there are actually no C# experts?
 
Ell
1:44 PM
e.g. java, c#, ruby etc.
 
Python FTFY
 
@thecoshman xD
 

« first day (683 days earlier)      last day (4255 days later) »