« first day (791 days earlier)      last day (4165 days later) » 

user142019
1:00 AM
What's wrong with a tiling WM?
 
It hurts
 
gn8 guys
 
Somehow, I use my destkop in similar fashions, but I like to control the exact position of things. Tiling WM have always been too rigid for me.
 
... Oh dear. I think I've used virtual too much...
My vtable is enormous.
 
user142019
@sehe it works perfectly fine so far.
 
1:03 AM
Anyways, I think I've found the solution. We can just revert the font, and close chat.SO down instead. This will likely save more network traffic, while having the added benefit of doubling the effective answering capacity on SO — sehe 40 secs ago
Oh no doubt. Everything that is excruciatingly simple tends to work fine.
Except in windows
@ThePhD TMI. Also, who cares
 
@ThePhD I don't have anything under control, but I am not one to reminisce over what I can't do. I accept what I can do, do it, and move on. Or at least try.
 
@R.MartinhoFernandes You're not in danger of losing your job, are you? Sounds really ominous
 
=l Well cmon now, we didn't need to fill it with innuendo.
@R.MartinhoFernandes Is it a girl?
 
1:05 AM
But I forget you have a penchant for writing too. Dramatizing may come naturally in your current state of mind
 
@sehe Likely.
 
Well on that note, I bid you all farewell.
Happy snoring
 
Good night.
 
Good niiiight.
 
0
Q: Should the trailing return type syntax be the default syntax for all functions?

FredOverflowIn complicated function templates, you sometimes need the C++11 trailing return type syntax in order to use decltype on parameters, which otherwise would come into scope too late: template<typename T, typename U> auto add(const T& a, const U& b) -> decltype(a + b) { return a...

Let's see how fast this one gets closed :) I can think of several reasons off the top of my head :)
 
1:08 AM
@R.MartinhoFernandes You know you're on tvtropes.org when you read:
> For female breasts that are big, it's either Buxom Is Better or Gag Boobs.
 
Wait, something's wrong, I got an upvote.
 
do nodes based containers require default constructors, and are they allowed to create one more element than you put in the container?
 
@MooingDuck Pretty sure they don't required default constructors. Does any container require them?
 
@FredOverflow I remember Herb mentioning that he dreams of changing this in C++. To have the type at the right hand side. I don't remember why he considers it superior. Golang also does this btw.
 
@StackedCrooked Right, I remember an interview somewhere on Channel9 lately.
 
1:13 AM
@FredOverflow I'm trying to imagine how std::list would implement end() without making nodes that have buffers and using placement new in the buffer in the node.
@FredOverflow MSVC's list appears to create a new "null" node in the its default constructor which .... wait... they allocate space... but never construct the node?
 
@FredOverflow I like it.
 
Can someone vote to close my question as a dupe of 13742718?
 
@FredOverflow Yes and no. DefaultConstructible is required for some things like comparison operators. There are also individual constructors (e.g., for deque) that require a default constructor, but I don't think there's any container that requires the contained type to be default constructible.
 
wtf that's not legal is it?
using members of a struct that has never been constructed, but the members you're touching are all POD type?
 
@MooingDuck never construct the node or never construct your element inside the node?
 
1:17 AM
@MooingDuck Sentinel?
 
@FredOverflow either one
@R.MartinhoFernandes yeah that
		this->_Myhead = this->_Alnod.allocate(1);
		this->_Nextnode(this->_Myhead) = this->_Myhead;
		this->_Prevnode(this->_Myhead) = this->_Myhead;
 
@MooingDuck So what happens if you have an iterator to the last real element and increment that?
 
@FredOverflow it moves to the sentinel, which they set the next/prev on, but never constructed, so it never constructed the payload either
 
@MooingDuck What is the type of _Nextnode?
 
@MooingDuck What's the problem?
 
1:19 AM
@FredOverflow static _Nodeptr& _Nextnode(_Nodeptr _Pnode)
 
If _Nodeptr is just a raw pointer, I see no problem.
 
@R.MartinhoFernandes is it legal to read/write POD members of a class who's constructor was never called?
 
Sure, why not?
 
@MooingDuck Which class?
@FredOverflow Not always.
 
@R.MartinhoFernandes MSVC's list node class
 
1:20 AM
@R.MartinhoFernandes When not?
 
The lifetime of PODs starts whens storage is available.
@FredOverflow When it is a non-POD class.
@MooingDuck But in the code above, it only accesses members of this.
 
@R.MartinhoFernandes I don't see why that would matter. You never construct the bitch, you never destruct the bitch, you never call any member functions.
 
@R.MartinhoFernandes _Nextnode(_Myhead) is a reference to _Myhead._Next
 
@FredOverflow non_pod* t = (non_pod*)malloc(sizeof(*t)); t->some_pod_member = 3 /* UB, there is no non_pod object */;
@MooingDuck What is the type of _Myhead? Is it POD?
Also, remember that the standard library can cheat.
 
    //er, `_Myhead` is a `_Node*`, and the `_Node` is
		_Node* _Next;	// successor node, or first element if head
		_Node* _Prev;	// predecessor node, or last element if head
		value_type _Myval;	// the stored value, unused if head
 
1:24 AM
@R.MartinhoFernandes Because it knows the compiler?
 
@R.MartinhoFernandes ah right, I keep forgetting that one
 
@FredOverflow Yeah.
 
so the portable way to do this is probably to have a buffer instead of a value_type directly in the node.
which I have to remember how to align
 
I usually make the sentinels without payload.
With inheritance.
 
@R.MartinhoFernandes oh well that makes sense
 
1:27 AM
You can static_cast safely.
 
hmm, since I'm using unique_ptr everywhere, that makes it more complicated to have the sentinel inside the actual class though.
wait, I can't be using unique_ptr as I have, since I have an allocator. Oops.
is there an easy way to mash together allocators and unique_ptr?
 
seems like I'd have to give each unique_ptr a reference to teh allocator which seems like a lot of overhead
 
Oh you are linking the nodes with unique_ptrs?
 
@R.MartinhoFernandes I was, I don't think I will be
 
1:34 AM
I never really liked that idea.
The nodes are owned by the list, not by the previous ones.
 
if you don't have a sentinel, it works really well. The list doesn't even know about most of the nodes except indirectly.
 
Which is exactly why you end up having to do gymnastics to remove nodes and shit: the ownership is wrong.
 
@R.MartinhoFernandes gymnastics? Just swap and then release one?
 
@MooingDuck Right, gymnastics. As soon as you write release() you are handling the ownership manually; basically, overriding it.
 
@R.MartinhoFernandes wait, not release. reset.
 
1:37 AM
How so?
Really, tell when it is that you actually let a node destroy the nodes it owns?
When the list is destroyed. All the other times you are actively avoiding that.
 
@R.MartinhoFernandes sure, that's fine.
 
That's a hint the real owner is the list.
 
wait, I can't rule-of-zero this because unique_ptr isn't copiable. >.<
oh I'm late! gotta go
 
@R.MartinhoFernandes You still haven't convinced me that node ownership is a bad idea, but I'll think about it. Also during coding I may figure out why you're right.
 
1:46 AM
@MooingDuck FWIW, I am not entirely convinced of my own opinion myself. (I actually wrote this stackoverflow.com/a/12083868/46642 not long ago)
I need to try it too.
But the main motivation for not using unique_ptr here is that it actually makes things more tricky instead of simpler.
 
2:46 AM
73
A: Can you have a triple minus signs in C programming? What does it mean?

RobᵩIt is equivalent to: iHoursTemp = iHoursTemp + (iZoneNew--) - iZoneOld; This is in accordance with the maximal-munch principle

That 730 rep could have been mine :(
 
I don't really understand how this works. The operator-> returns a shared_ptr<T>. I would expect a second -> would be necessary to invoke shared_ptr<T>::operator->.
 
Jan 6 at 0:01, by R. Martinho Fernandes
a->b may be transformed into a.operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->()->b
 
Why does operator-> even exist? Couldn't it use operator* instead?
 
That's what I was suspecting.
Yeah, but it's less convenient to type: (*item).foo();
item->foo(); is more direct
And the hooking mechanism (see my link above) wouldn't work with operator*.
 
@Pubby If you want to feel better, get the question deleted. That way no one will have the rep ;)
With 730 rep I'd almost be at 3k :(
 
2:55 AM
@Pubby You mean 200?
 
Oh right ... the rep cap...
 
@R.MartinhoFernandes After taxes, yeah
 
12
Q: Why can operator-> be overloaded manually?

FredOverflowWouldn't it make sense if p->m was just syntactic sugar for (*p).m? Essentially, every operator-> that I have ever written could have been implemented as follows: Foo::Foo* operator->() { return &**this; } Is there any case where I would want p->m to mean something else tha...

 
@FredOverflow Thanks
 
Did they change the size of the numbers on the vote count?
Why do all the numbers look smaller..
 
3:09 AM
I think they changed the font
 
It's ugly.
 
19
Q: C++ auto keyword. Why is it magic?

ClairvoireFrom all the material I used to learn C++, auto has always been a weird storage duration specifier that didn't serve any purpose. But just recently, I encountered code that used it as a type name in and of itself. Out of curiosity I tried it, and it assumes the type of whatever I happen to assi...

lol @ title
 
It looks like they removed bold
Apparently Sony added Paypal as a payment option for PSN but... not in North America :(
 
3 hours ago, by FredOverflow
Has stackoverflow changed the font for vote points?
 
New font looks bad
 
3:22 AM
Okay, so it's like April Fools with extra Christmas, right? Right?Frédéric Hamidi 3 hours ago
 
3:58 AM
@R.MartinhoFernandes TIL something new about C++. Again.
 
So apparently, if a room gets abandoned, feeds will automatically assign a room owner to the most active user.
"Abandoned" meaning, no active room owners.
 
@StackedCrooked That is not what I expected when I clicked on that link
 
How so?
:P
 
I saw hookers and tits :(
 
4:31 AM
I guess I really don't have a sense of humor
 
@Mysticial I was going to suggest using the audio captcha but god damn I just heard it for the first time today. What the fuck is that?
Dude I'm human and I couldn't understand a single word
 
@Rapptz The audio captcha is pretty bad...
yeah
like
I can probably understand more Japanese than that stupid captcha
 
I worked a bit more on this answer:
0
A: WINMAIN and main() in C++ (Extended)

Cheers and hth. - AlfAbout the functions. The C and C++ standards require any program (for a “hosted” C or C++ implementation) to have a function called main, which serves as the program's startup function. The main function is called after zero-initialization of non-local static variables, and possibly ...

I think it's starting to shape up.
 
How do I deal with nested initializer lists? :(
like std::initializer_list<std::initializer_list<T>>
 
@Rapptz Example of what you're trying to do?
 
4:35 AM
constructor to assign a member that is a nested vector
 
eww....
 
hey hey.. I'm experimenting
 
dafuq
 
Why do I have more rep than you in anime.se
o.o
 
Apparently I don't watch enough Anime. :)
Or rather I don't watch any of the old popular shows.
 
4:45 AM
Huh no I mean I have that +100 bonus but you don't
 
Oh, anime is a beta now? I didn't realize.
 
@Rapptz I do too.
 
your rep shows up as 178 for me..
 
I have 100 + 78.
 
..oh.. ah.
 
4:45 AM
hi
 
Hardly any new shows are asked.
So I'm having more trouble on Anime than meta.
 
im trying to write a simple file system driver
PDRIVER_OBJECT g_fsFilterDriverObject = NULL
can you tell me what this code says
 
Makes sense.
 
can i ask explanations there
@Mysticial
 
4:47 AM
Yes you can. But you're much more likely to get an answer on SO.
 
Sometimes I wonder why people go like
@Mysticial @Mysticial
(Sorry)
 
1. Because we probably don't know the answer to your question.
2. Most of us don't really care.
 
@Rapptz
 
^
 
@Rapptz ahahahaha @Rapptz @Rapptz @Rapptz @Rapptz @Rapptz @Rapptz @Rapptz @Rapptz @Rapptz @Rapptz @Rapptz @Rapptz @Rapptz
 
4:49 AM
:P
 
So much green
 
@Alf @Alf @Alf
 
I don't think any of us do drivers.
 
^ Wrong in so many ways. Heh. :-)
 
@Cheersandhth.-Alf You must be pretty lonely to be pinging yourself. :)
 
4:49 AM
@Cheersandhth.-Alf You sound like a seal.
 
can you tell me what this code says
 
@techno Dude. Stop trying to sneak your code in.
 
not me
sorry people,the message repeated due to N/W error
 
excuses
 
4:52 AM
lies!
@techno I'm not being serious btw.
 
So nested initializer list = bad?
because I can't get it to work at all
 
asked the question
0
Q: Writing a simple File System Driver in C++

technoBasically what im trying to do is intercept File I/O Operations,so i try to write a basic File system Driver.I have been in C# for a while,don't know much C++ or System programming Can someone Help me with this //////////////////////////////////////////////////////// // Global data PDRIVER_O...

some one has already downvoted it
 
hey guys, i am trying to resolve this weird issue, I am trying to clear memory leaks from something which has some objects created in Globalobjects scope (dont ask me why not my code) , but crtDebugDump shows these as memory leaks, i thought global scope objects were taken care of because they were on the stack
 
5:12 AM
@R.MartinhoFernandes I almost immediately realized you must have been right since doing it with unique_ptr adds an absurd amount of memory overhead.
 
3
Q: Should I include <xxxx.h> or <cxxxx> in C++ programs?

Alok Save What should I include in C++ programs, stdio.h or cstdio? and Why? Why two header files which provide the same functionality? What does the standard say regarding this? How should I go about including other such headers, Is there a base rule that I should follow?

 
5:28 AM
user image
3
 
5:39 AM
I developed a useless technique again: namespace selection! Intrusively or non-intrusively.
 
Both have templates, so both are intrusive. :)
 
However, it's only 1 template function.
Actually, a colleague asked me today if he could use namespaces as template arguments.
It inspired me to do something silly :)
 
The 100k emails question got a historic lock.
Apparently, there was a delete/undelete war going on between normal users and mods.
 
6:04 AM
With macro's it's even better (or worse). It's convenient that a namespace can be closed and reopened again later.
 
Still has fugly templates. :)
 
Macros are worse, lol.
 
Ah much better. :)
Now I won't have to pee in my pants.
 
Glad we got that out of the way.
 
What's wrong with templates
 
6:10 AM
It's make him pee :P
 
At the wrong time and in the wrong places.
 
Are we talking about pee or templates
 
Templates make me pee at the wrong times and at the wrong places.
 
Bro it's 2012. Everyone wears adult diapers now.
(Relevant Fact, there are more adult diapers sold in Japan than baby diapers)
 
In any case you should not pee on motherboard and stuff.
 
6:13 AM
@StackedCrooked Yes, that's a bad idea.
 
Even though improves the conduction.
 
too lazy to find original on explosm
 
6:37 AM
That is interesting. Might consider using dropbox for coliru then.
For the archives.
Anyone been playing Eve tonight?
 
 
2 hours later…
8:13 AM
Well have you or not!?
Dammit.
 
haha
 
9:02 AM
did they change the font size of rep points in the main bar?
or basically all numbers seem strange
 
@bamboon yes
43
Q: What's up with the new CSS?

AsadI've just noticed the new rep/vote counts look different, and not in a good way (IMO, obviously people will disagree). What else has been changed, and is it permanent?

 
@Mysticial ah thanks, I somehow like the old style better
 
It'll take a some time to get used to.
But I believe one of the reasons why they did it was to de-emphasize vote counts and users.
And put more attention back to the content.
Since now the rep # next to every name isn't in-your-face bold.
 
@Mysticial yeah, that is always the same with design, in the beginning everybody cries and after a week nobody cares anymore.
 
@bamboon One thing that'll take me a very long time to get used to is no Aero in Win8.
Piece of shit... :)
 
9:08 AM
Everything is changing too fast.
 
@Mysticial you mean no aero in classical windows or the metro look?
 
@bamboon I don't think there's Aero at all in Win8.
 
@Mysticial yeah, I just meant if you disliked the metro stuff or how they redesigned the classical view
 
I was one of the few who actually liked Vista despite all the shitiness. Because it looked nice.
 
Appearance is most important part of OS after all
 
9:11 AM
@Mysticial anyways, you can start to get used to Mac OSX now ;)
 
My only windows machine runs vista, it wasn't terrible or anything. Never tried 7 or 8 though.
 
I think the only eye-candy that I was never a fan of was Dreamscene.
@bamboon sigh....
 
-2
Q: What is 'Dumb Submitter Bot' and Hw to Code It?

Jansen NjWhat is 'Dumb Submitter Bot' and Hw to Code It? Please tell me!!

 
lol
Well, I guess I learned what a Dumb Submitter Bot is...
 
@Mysticial Post that as an answer
 
9:19 AM
lol
 
Heh, OP is a dumb submitter bot himself
Well, at least a dumb submitter
 
9:49 AM
aarg, why doesn't SO ship to Europe. I want those stickers.
 
I got some from the Careers party. I don't see what's desirable about them.
I can sell you one for 50€, free shipping, btw.
:P
 
I just love stickers
@R.MartinhoFernandes ^^, classic ebay hoax.
 
10:19 AM
AAAA
what the fuck is with the upvote font
:<
(or is it just my PC ?)
Ohnoes whyyy. Any meta whine post?
Bring the sexy back
0
Q: Can we somehow bring the old score font back?

Bartek BanachewiczI woke up today, got a shower and headed to my daily morning stacktivities. I opened the page, and noticed, to my horror, that there's something terribly, infinitely wrong with the font used to score answers and questions. At first I thought it's only my local problem, but quick visit to Lounge c...

 
1 hour ago, by Mysticial
43
Q: What's up with the new CSS?

AsadI've just noticed the new rep/vote counts look different, and not in a good way (IMO, obviously people will disagree). What else has been changed, and is it permanent?

 
Oh, he's got talent for tagging. I weren't able to find it
 
10:35 AM
Anyways, I think I've found the solution. We can just revert the font, and close chat.SO down instead. This will likely save more network traffic, while having the added benefit of doubling the effective answering capacity on SO — sehe 10 hours ago
 
Oh noes, there is penguin all over my Twitter.
 
10:51 AM
@R.MartinhoFernandes is that a bad thing?
 
@jalf Nah, I am just mimicking a similar message I wrote yesterday.
yesterday, by R. Martinho Fernandes
OMG, there is ape all over my screen.
 
Ah
I think the current state is an improvement then :)
 
Twitter is terrible for that kind of discussion.
4
A: Can you have a triple minus signs in C programming? What does it mean?

Olaf DietscheAccording to Draft C++11 (PDF) 2.5 Preprocessing tokens, clause 3 and Draft C11 (PDF) 6.4 Lexical elements, clause 4, the compiler parses the longest possible sequence of characters as the next token. This means --- will be parsed into the two tokens -- and -, which gives iHoursTemp = iHoursTem...

Wow.
He fixed the answer and is now at +20/-16.
 
cool
reverting my downboat then
 
Yeah.
And meanwhile, yet another fly fell into the trap...
 
Ell
11:10 AM
It's cold in England :(
 
cpx
Did SO just change the font size of reputation and votes?
 
Yes... sigh.
44 mins ago, by R. Martinho Fernandes
1 hour ago, by Mysticial
43
Q: What's up with the new CSS?

AsadI've just noticed the new rep/vote counts look different, and not in a good way (IMO, obviously people will disagree). What else has been changed, and is it permanent?

 
Warmer than it has been here in the midlands, +4 and the sun is shining. How long should I wait before I submit my 'Why does a--+---+++b' give the wrong answer' question to get a load of extra rep?
 
Seems it's not snowing today.
 
@MartinJames just don't.
 
cpx
11:15 AM
It doesn't look pretty to the eyes.
 
It is just different.
You'll get used to it.
1
A: #define equivalent in c++

skpIt’s even better to use anonymous namespace for that (restricted to current file): namespace { int const ARR_SIZE = 64; /* ... */ }

Why is it a good idea to put constants into unnamed namespace?
 
they are only local to the current file then
 
They are anyway because const implies internal linkage.
 
oh, didn't know that
 
11:35 AM
Only in C++ btw, not in C.
 
Hm. Did the font for the up and downvotes counter on SO change?
 
30 secs ago, by cpx
24 mins ago, by R. Martinho Fernandes
44 mins ago, by R. Martinho Fernandes
1 hour ago, by Mysticial
43
Q: What's up with the new CSS?

AsadI've just noticed the new rep/vote counts look different, and not in a good way (IMO, obviously people will disagree). What else has been changed, and is it permanent?

 
cpx
1 min ago, by FredOverflow
30 secs ago, by cpx
24 mins ago, by R. Martinho Fernandes
44 mins ago, by R. Martinho Fernandes
1 hour ago, by Mysticial
43
Q: What's up with the new CSS?

AsadI've just noticed the new rep/vote counts look different, and not in a good way (IMO, obviously people will disagree). What else has been changed, and is it permanent?

 
I believe we should pin it ^
 
no, it’s awesome
inception
 
11:38 AM
(removed)
 
and a lot of typography nerds on here, apparently ^^
 
0
Q: C++ school assignment

user1906133I have to rewrite the following program without using repetitive structures. #include <iostream> using namespace std; int main() { z=0; while (x<=y) { if((y-x)%10==0) z=z+x; x=x+1; } cout<<z; }

 
A colleage of mine wants to learn idiomatic C++ design. He wanted to factor out a small piece of code. The piece of code was a function that existed (with the same name) in different namespaces. He naively tried to use the namespace name as a template parameter. I suggested he could implement it as a policy. But then he seemed upset with the idea of using inheritance. After all, he wanted to move away from inheritance-based thinking.
 
What do policies have to do with inheritane?
 
It is the top-down categorization of an object hierarchies (using inheritance) that he needs to move away from. Not inheritance itself.
@FredOverflow Policies are very often implemented using multiple inheritance.
 
11:47 AM
I see.
Aren't policies just "template strategies", like the deleter of a shared_ptr?
 
Stepanov said that bottom-up thinking works better than top-down. I think this applies here.
@FredOverflow Not really.
 
> An example from the standard library is std::allocator
Come on, if std::allocator counts, sure the deleter counts as well?
 
The deleter is not part of the shared_ptr's type.
The allocator in stl is.
I don't want to nitpick though.
Q. Why doesn't shared_ptr have template parameters supplying traits or policies to allow extensive user customization?
A. Parameterization discourages users. The shared_ptr template is carefully crafted to meet common needs without extensive parameterization. ...
 
Oh, right!
 
@StackedCrooked It really depends on topic being thinked about and on the thinker.
 
11:58 AM
@yetihehe thought about
 
-1
Q: what is the difference between getch() and getche() in C++?

Mr_NJ what is the difference between getch() and getche() in C++? And also i would like to know what os the difference between compilers of dev c and turbo c? thank you

 
Yes, sorry
 
closevotes.
 

« first day (791 days earlier)      last day (4165 days later) »