« first day (626 days earlier)      last day (4323 days later) » 

12:00 AM
@MooingDuck Why ambiguous?
 
iterator& operator++() {if(!dereferenced) operator*(); ++internal; return *this;}  //remember?  My opinion is void
 
I can't find anything useful. What is final?
 
@RMartinhoFernandes which order do I pass the bytes?
 
What I don't like about the second is implicit conversions galore and shit.
 
@Drise Java, like a const pointer.
 
12:01 AM
@Drise it means this function is virtual to base classes, but cannot be overriden by derived classes.
 
I saw it in the spec
 
@CaptainGiraffe wait what?
 
template <typename OutputIterator>
void output(OutputIterator&, uint16_t);
template <typename OutputIterator, typename DontConvert>
void output(OutputIterator&, DontConvert) = delete; // <3
 
@MooingDuck uh?
 
12:02 AM
Mooingduck, explain please?
 
@RMartinhoFernandes and if I pass a uint16_t&?
 
@MooingDuck He's saying that in Java, it's like a const pointer.
 
@RMartinhoFernandes I'm going to have to look up Java const pointers aren't I?
 
@MooingDuck The second overload will deduce DontConvert as uint16_t and the first one is preferred because it isn't a template.
@MooingDuck No.
 
In Java the final modifier sets a member to be initialized only once. Much like a const pointer in c++. You can't replace the pointer/object but you can change the stuff it is referring to.
 
12:05 AM
@RMartinhoFernandes oh, first isn't a template. Overlooked that
 
It also works to prevent overriding of methods, just like in C++.
@MooingDuck Wait, it is (the iterator). Hmm.
 
@RMartinhoFernandes now I just feel stupid. I shouldn't thnk about what you're doing whiel I attemp to work. Looks what it did to my spelling.
 
@RMartinhoFernandes Yes, but that is for the advanced class, consting vtables =)
 
stupid fingers.
 
Why would you not want a derived class to override a function? Isn't that the point of virtual?
 
12:06 AM
@Drise That's why A was virtual. What if B wants the function to not be virtual anymore?
 
@Drise Because you don't want to/can't design for inheritance.
 
@Drise It is certainly against OO
 
@MooingDuck Ah, it seems it's still ok because it's more specialized.
 
Also Drise Sometimes OO and especially OO proponents present themselves a being a cure for cancer. Don't buy into that. There are good and bad solutions to pretty much every problem. The bad solutions outweigh the good ones at about 29/3 though.
 
Holy balls. The cop presence I swear has tripled for the past few months.
 
12:15 AM
@Drise stop speeding
 
Xeo
Man, I'm so lucky at mahjong atm. Fuuun. Nobody careing to join yet? :)
 
Ell
don't understand mahjong
I know you have to choose two pairs
sorry a pair
is that is?
choose a pair of top layer tiles to destroy?
is that is?
 
how would i go about getting a random number between 0-100?
in c++*
 
@ell exactly it. It takes strategy though. You can really mess up if you go wild and don't think ahead.
@mooingduck I'm not, but they're frickin everywhere.
 
Ell
I remember making it impossible for myself most times :L
 
@ITNinja Either Boost, TR1, or C++11.
 
Has anybody noticed any zealous moderators since after the last election?
 
@LokiAstari nope. Something happened?
 
http://stackoverflow.com/questions/94227/smart-pointers-or-who-owns-you-baby
was just closed after being open for 3 years with no complaints.
 
wow...
bring it up on meta
George isn't active in C++. So he probably doesn't know the content well enough to tell it's a real question.
Give these new guys some time to adjust and learn that our tag is not a push-over.
 
12:41 AM
@Mysticial I'm trying to tell if it is a real question. Seems like it might fit perfectly into one of the close reasons.
 
It does fit in the C++ FAQ.
 
@EtiennedeMartel Yes, that's what I was thinking.
I can see how the 3 bullets would make it seem too broad. Perhaps we can fix it up a little?
 
It also needs some modernization to fit with C++11.
Also, I wonder if there is already something in the C++ FAQ about "which pointer type to use and when"?
 
@sbi made one.
45
Q: Which kind of pointer do I use when?

sbiOk, so the last time I wrote C++ for a living, std::auto_ptr was all the std lib had available, and boost::shared_ptr was all the rage. I never really looked into the other smart pointer types boost provided. I understand that C++11 now provides some of the types boost came up with, but not all o...

 
Ah. So a "exact duplicate" might have been more appropriate.
 
12:50 AM
Hmm.... I seem to crash whenever i run: ideone.com/zGApx but i have no idea why o.o
 
@ITNinja Trolling?
 
@CaptainGiraffe nope, just being a noob at c++ >.>
 
@ITNinja Your pointers are 0,, any 0 pointer is an invalid pointer. Deleting 0 pointer has adverse effects.
 
ooh ok
TYVM ^.^
 
12:55 AM
I thought delete NULL does nothing. Or is that only for free(NULL)?
 
It's true.
But the pointers are not initialized.
 
oh
haha
clearly, I didn't look at the code.
 
delete 0 is considered harmful in Bjarnes Programming C++
 
@CaptainGiraffe why?
(for future reference)
 
=) Bjarne and Edsger in on quote =)
@ITNinja 0 Is always considered to be owned by the system, not a valid adress.
 
12:59 AM
@CaptainGiraffe kk ty :)
 
@CaptainGiraffe oh, no. 0 is a valid pointer value. and deleting a nullpointer has no effect, by definition (in particular, no adverse effect).
@CaptainGiraffe No no no.
@CaptainGiraffe oh, you're trolling. ha ha. i'm dumb. i'm going to bed.
 
@CheersandhthAlf I guess this "0 Is always considered to be owned by the system, not a valid adress."
 
@CaptainGiraffe the address 0 is considered to be owned by the system on most systems. that's because on most/many system you have the boot vector there, telling the CPU where to go on power-up. but address 0 is not necessarily the same as a C++ nullpointer, the integral value 0 converted to pointer type. and you can safely delete a nullpointer. it is guaranteed to have no effect.
 
@CheersandhthAlf If virtual address 0 is actually mapped to physical address 0. Which often isn't.
 
@RMartinhoFernandes i wouldn't say it "often" isn't.
 
1:06 AM
:)
 
It probably isn't mapped at all. The processor probably just traps 0 immediately and throws an exception.
 
@Mysticial for which segment?
 
For a nulll pointer.
 
@Mysticial on a PC, for 32-bit code a null datapointer is an offset in the DS segment (the data segment). the x86 can trap on offset range errors, IIRC. or it can trap one level down, that the linear address isn't mapped to a page. i think nullpointer detection must be one those two, and not a general trapping of offset 0.
 
@CheersandhthAlf I'm not familiar with those hard-core details of segmenting.
I hear everything changed on x64.
 
1:13 AM
Don't all kernels just use a flat memory model (i.e. segments cover the entire address space)?
I think the operations for entering and exit kernel mode require it anyway.
 
@Mysticial oh, it's not complex. when (on PC, 32-bit) you use a data pointer value like P, it's first treated as an offset in the data segment, so you get highLevelAddress = startOf( dataSegment ) + offset. Then that highLevelAddress is within a 4 KB page somewhere. If that page is mapped to physical memory, ok, you have your physicalAddress. If not, much action takes place (possibly involving disk access, ouch)
@RMartinhoFernandes in 32-bit Windows the data segment is mapped to the complete 32-bit address range. but one level down you have paging. 4 KB pages.
 
Right, not mapping it to a page and trapping a page fault is quite simple.
 
I'm someone familiar with the virtual address translation process. (as in which bits map directly, and which bits go into the TLB for translation) But all the DS segment stuff has me lost. (I never cared enough to read up on it.)
 
whoah. my comprehension => _ this subject => -- xD
 
i don't know much about 64-bit. i made first 64-bit program yesterday (or was it day before?)
 
1:16 AM
And that's partially where all the false aliasing bullshit stalls come from.
 
@Mysticial Nowadays segments only matter pretty much when the kernel is setting up segments to not matter.
 
@RMartinhoFernandes wat?
 
@Mysticial When booting, the kernel sets up all the segments to just cover the entire address space. Once that is done, it doesn't really matter much for address translation purposes.
 
ah
 
hello all.......
 
1:20 AM
And certain x86 instructions require it to be that way.
 
@RMartinhoFernandes i don't think it does in Windows. as I recall you have to use FS segment to address something about exceptions or thread local storage or what it was.
 
@ShivShambo hello :)
 
need some professional advice nothing related to c++.. can i proceed
?
 
go for it i guess.
 
@ShivShambo Try the PHP room.
 
1:20 AM
lol
 
is it a joke..
 
lol
 
Ask away. If someone is willing to help, they will.
 
it was SEH exception setup. I found uninformed.org/index.cgi?v=5&a=2&p=4
mov     eax,fs:[00000000]
 
which means that the processor on PC doesn't trap on nullpointers in general.
 
@CheersandhthAlf Oh, cool.
@CheersandhthAlf Yeah, it doesn't. The kernel needs to set that up itself.
possible tl;dr: PHP is interpreted fast enough that branch prediction doesn't make a noticeable difference. — Jon 7 hours ago
 
I am thinking of quitting before the notice period ends becos of burnout...how unprofessional is it?
 
Enough PHP bashing anyways, what were we talking about?
@RMartinhoFernandes I have no idea where he's pulling that out of it. (assuming I reading it right...)
 
@ShivShambo on the contrary, that's perfect behavior. if u don't fit, don't stay.
 
1:25 AM
@Mysticial Sarcasm.
Really, I'm the robot?
 
@RMartinhoFernandes I fail for not getting that...
 
By the definition of "sorted" it would have to be faster. If an array were not sorted then by definition it would be slower.

The reason I just say that is because there are already answers explaining the actual workings of why it is faster. But from a lingual standpoint it would have to be faster. :)
Wow, this deleted answer on the branch prediction question stackoverflow.com/a/11256395/46642
WTF.
Also, enough Unicode for today. Time to sleep.
Good night.
 
@RMartinhoFernandes Obviously he's talking about linguinis.
 
night
 
@Mysticial night :)
oh soz
 
1:30 AM
@ITNinja I was talking to the robot.
 
How many people actually have DirectX 11 compatible cards these days?
I'm debating which version of DirectX I should use for a new project
 
@Mysticial I realise that now :3
 
@RMartinhoFernandes Yeah, I WTF'ed my ass off reading that.
 
the way classes work in c++ are making my brain melt >.>
 
Texture2D(SafeHeapPointer<BitmapData> bitmap, SafeComPtr<ID3D11Device> device, SafeComPtr<ID3D11DeviceContext> context) {
	D3D11_TEXTURE2D_DESC textureBufferDescription;
			ZeroMemory(&textureBufferDescription,sizeof(textureBufferDescription));
			textureBufferDescription.ArraySize = 1;
			textureBufferDescription.MipLevels = 1;
			textureBufferDescription.BindFlags = D3D11_BIND_SHADER_RESOURCE;
			textureBufferDescription.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
			textureBufferDescription.Usage = D3D11_USAGE_DEFAULT;
Just realized it's using way too many smart pointers
Beginning to wonder if that could slow the program down...
 
1:36 AM
Not if you need the semantics.
Because the alternative is to do the same thing by hand.
If you don't need the semantics, take them off.
 
Yikes! I could imagine trying to do it by hand....
By the way; for a smart pointer, is there any way to override &?
Like let's say I want to take
SmartPointer<SomeClass>
And say
SomeClass** inst = &SmartPointer
 
@IDWMaster There is but it's very often considered a bad idea.
 
How would I go about doing that?
 
It interacts badly with many things.
@IDWMaster Overload operator&.
 
@RMartinhoFernandes Like what?
 
1:45 AM
@IDWMaster Why not just get a reference to it?
 
I've heard that there was some safe way to do it, but I was wondering how there can be a safe way to do it?
 
Why do you need pointers in the first place?
 
@EtiennedeMartel Probably COM shenanigans.
 
@RMartinhoFernandes Yep
You guessed it
COM and DirectX
I want to be able to do:
 
You could just write a member method for your smart pointer class.
 
1:46 AM
device->CreatePixelShader(blob->GetBufferPointer(),blob->GetBufferSize(),NULL,&shader);
But right now I'm doing
device->CreatePixelShader(blob->GetBufferPointer(),blob->GetBufferSize(),NULL,&shader.internalPtr);
 
I suggest ugly_get_for_crappy_twenty_years_old_APIs.
 
And that just seems like a messy way of doing it
 
So what's unsafe about overloading &, and how can I work around any issues it causes?
What's unsafe about this?
X** operator&() {
return &internalPtr;
}
 
What if you want to take the address of the smart pointer itself?
 
1:49 AM
@IDWMaster It's just wrong, don't.
 
Yeah, that also.
 
Address-of is too fundamental a property to mess with. Lots of code make assumptions about it (can't really blame them).
 
lol, this is awesome
bye
 
It also makes it too easy to violate the smart pointer invariants.
 
1:52 AM
I'm still trying to figure out why I'd ever want to get the address of a smart COM pointer.....
 
anyone here familiar with dependency injection
 
@cheez Erm, it's the "D" in "SOLID". It's not exactly a mysterious concept.
What's the problem?
 
@EtiennedeMartel I'm trying to figure out how to automagically add authentication information as dependencies
 
@cheez First, nothing's automagical. Second, you're awfully vague.
 
bitbucket.org/cheez/dicpp/wiki/Home (my library) is almost automagic
so the way it works is like this: you have a type A that takes types B and C in its constructor
 
1:55 AM
@IDWMaster To point to it.
 
Personally, I'd just do T* ptr = smart_ptr.get(); f(&ptr); smart_ptr.reset(ptr);, and even that looks shady to me, depending on what the smart pointer is.
 
you ask the "framework" to give you an instance of type A
 
@cheez Oh, right, like Ninject.
 
and the framework automagically creates instances of B and C and passes them into A, respecting rules that you .. yeah
so one of these types is "username" and another is "password"
for example
obviously, these are restricted to (say) a server connection
 
How does that work with templated ctors?
 
1:56 AM
I'm trying to figure out whether I'd use a scope or a provider (a la google guice) to implement this
it doesn't work with templated ctors
 
I think, I dunno. haven't needed them
so how would you accomplish that in ninject, say?
or even google guice
 
No idea. Never really messed with it.
 
doh
 
I just name dropped that because I once read some of the documentation, back when I was quite the hipster.
 
1:57 AM
lol
 
Now I'm more of the "OOP isn't just sticking buzzwords together" school of thought.
But still, for your problem, in a strictly OO point of view, I would simply inject some sort of auth controller or something. And then ask that shit for authentification. So you can inject a real one or a mock.
 
Argh. Partial function template specializations strike again.
Also, I said it was enough Unicode for today. Why am I still here.
 
@RMartinhoFernandes Because you don't have to do Unicode to be here?
 
@EtiennedeMartel I'm still writing code for it.
 
Hmm. Apparently Microsoft actually overrides the & operator
 
2:01 AM
Still fucking around with ICU?
 
@EtiennedeMartel What's wrong with ICU? I use it all the time.
 
It's foogly.
 
@IDWMaster Have you tried wrapping it in a clean, modern C++ interface?
 
@EtiennedeMartel that could work
 
@EtiennedeMartel Yes, that's what I've did.
 
2:01 AM
but the problem is that I would have more than one connection and there would have to be some way to say "this is the active connection"
 
And made a nice new string class out of it
 
@IDWMaster Alright, then, see @RMartinhoFernandes, because I think he might shoot himself in the head.
 
Really? Seems a bit extreme.
 
@cheez Yeah, you might need to make it a singleton (and by that I mean an object that can only exist once, not a global variable in disguise).
 
I don't like that
I want it to behave like dynamic variables in lisp
 
2:03 AM
Erm, LISP isn't OO.
 
like (with-active-connection (server user password) ....)
godamn
I hate C++
 
We all do.
 
@IDWMaster That's all?
 
@RMartinhoFernandes Served most of my needs nicely
 
No iterators? That won't do for our needs.
 
2:04 AM
Shit's going down.
@cheez Oh, that's just a global variable in disguise.
 
You can get a UChar* from that
 
Urgh, pointers.
 
@EtiennedeMartel it's a better global variable
 
@IDWMaster No, that's not the kind of iterators we need.
 
@cheez Right. It still pees itself whenever there's more than one thread involved.
 
2:05 AM
That's an iterator on codepoints.
 
no it doesn't, you don't know dynamic variables
 
We want iterators on grapheme clusters.
 
@cheez The only LISP I did was Scheme, and it did not go very far.
 
It's painful.
 
WE WANT CHOCOLATE.
 
2:06 AM
yeah I'm talking about common lisp, the only one that's practical
 
Oh, it's on.
 
I'm eating homemade mint chocolate ice cream
 
@cheez Can i haz some?!
 
mint chocolate chip**
sure
 
@cheez But, wait, so they're thread local variables?
 
2:07 AM
they're better than thread-local
they're context-local
 
It's just a thread local stack in disguise.
 
yes
I wrote an implementation in c++ somewhere
 
Well, eat my ass on a plate then.
 
O.O Iwantitsobadly Q_Q
 
2:09 AM
it's delicious
(I made it, so of course)
 
Anyway, Lisp sucks.
The only non sucky functional language is Haskell. Or so I heard. Because hell, if Cat likes something, then it has to be good.
 
I think I code more in lisp than c++
friggin emacs
 
@EtiennedeMartel It is, the cat is not insane.
 
@RMartinhoFernandes Well, he is insane. But not for that reason.
 
Fuck, it's 3AM already. Ok, I'm going now. Good night. For real.
 
2:15 AM
Alright. G'night, sleepy bot.
 
night ^.^
 
2:33 AM
so i have: ideone.com/yrAIk however i am running into the probelm of random_int being the same number every time. How would i go about making it so that it does not have the same value every time?
 
@ITNinja You never call srand().
rand() requires that srand() be called at least once in the current process.
 
@EtiennedeMartel ty xD i totally just face-palmed >.>
 
But, honestly, if you want better random numbers, look at Boost's, TR1's or C++11's <random> library.
 
im just using it for very basic random stuff. Im just getting familiar with c++ :)
i will probly use that later on though :)
 
2:50 AM
I thought you were going to sleep
 
@cheez The Robot was.
 
3:13 AM
lol... somebody just cast a whole bunch of 100th votes.
 
@Mysticial How'd you know they were all by the same person?
 
Because ponies.
 
I came back with 2 votes, one on the branch-predictor one, and one on my stupid 99-point answer.
I thought it was just a generous person going into my profile to give me a badge after upvoting the branch predictor answer.
Then I saw the recent badges list - nope...
I also often will seek out and cast final votes for badges. But not that many at once. lol
 
3:30 AM
0
Q: quiero hacer una prueba a la siguiente clase que e creado para usarla como un componente de mi aplicacion pero no se como debo de crear la prueba

user1497577 package poker.app; import android.content.Context; import android.view.LayoutInflater; import android.widget.ImageView; public class Carta_Comp extends ImageView{ private Context context; private String palo; private String valor; public Carta_Comp(Context context) { super(context); this.context...

um...
 
xD
o.o i thought i did a pretty decent job on this answer... I hate when people downvote with no explination >.> stackoverflow.com/questions/11303200/…
nvm on the no comment...
 
3:51 AM
That guy has some valid points.
 
4:03 AM
im working with it. :) I had tried to answer the OP as clearly as i could based on his code.
gah so...tired...must...stay...awake xD
 
Try some speed.
 
yeah... NTY >.>
im logging. later yall.
 
4:35 AM
I'm looking for a new cable modem/router. Anyone have tips, or know features that are must haves? (WPA vs WPS or whatever)
 
4:48 AM
morning
 
evening
 
5:03 AM
morning
I just got up reluctantly.
Man I just used an adverb, I'm like a book writer.
4
 
lol
 
0
Q: Can't able to enter in chat rooms even I have more than 20 reputation

NinjaTurtleAs per the faq You must have 20 reputation on Meta Stack Overflow to talk in chat room. I am not able to chat in chatrooms.Yesterday I'd asked one question yesterday and I earned 23 reputation. For more information have a look on attached images below:

 
5:25 AM
I've totally seen him in chat before. That's strange
 
@MooingDuck He has 23 rep for meta.
 
Is the leap second also added to epoch time?
 
morning
 
5:47 AM
Unix time, or POSIX time, is a system for describing instances in time, defined as the number of seconds that have elapsed since midnight Coordinated Universal Time (UTC), January 1, 1970, not counting leap seconds. It is used widely in Unix-like and many other operating systems and file formats. It is neither a linear representation of time nor a true representation of UTC. Unix time may be checked on some Unix systems by typing date +%s on the command line. {| class="wikitable selfreference" style="text-align: center; margin:auto;" |- | Example: (Z) (Above, the Unix time when this pag...
^ Apparently not.
^ Not too shabby.
 
6:14 AM
flumpledingle
2
Q: Speeding up parallel std::vector calculations using iterator in c++

ibellI have a small function that calculates a parameter based on doing element-wise math on a list of parameters that are calculated based on the std::vector instances l,t,d,n where l,t,d,n are all std::vector<double>. This is the pinchpoint in the speed of my program - I have profiled, and I ...

worst microbenchmark ever
 
6:29 AM
@RMartinhoFernandes Yes the modules proposal is from 2006 IIRC. I wonder if there is any hope to still get it in the next few years..
 
On Linux, can a single process have multiple terminal windows?
 
What do you mean with terminal windows?
 
never mind
 
I don't think an equivalent for the Windows console exists.
 
6:55 AM
hmmm
asynchronously reading Unicode is a bit of a problematic
 
7:26 AM
hello all
 
Helloooo ~
 
hi
 
can anyone think of a better way of handleing many TCP/IP connections other then select?
 
IOCP
 
input from clientsd
 
7:28 AM
epoll
 
for windows also
 
IOCP then
 
will that work in a console application?
 
Of course, why wouldn't it?
 
...and it's free?
 
7:29 AM
Yeah
It's a Windows technique
 
great I will look into it tyvm
 
Yw
FYI IOCP is currently the best available concurrent IO model on Windows
It's more complicated than the select one because it's just massively asynchronous
But the performance gain can be huge (I hear some people reached 60k connections simultaneously)
 
asio ftw
 
problem is I'm running openssl /tls and it only seems to like winsock
so I'm limited to select huh
If I can get that to work even
 
It's unrelated
 
7:36 AM
ssl is another layer
 
@Cicada massivley asynchronous?
 
What.
 
@Cicada how can you be "massively" something that you either are or are not?
 
Depends on the scale?
 
massively green
 
7:49 AM
@thecoshman Operations can be partially asynchronous
 
massively diabetic
massively turbulent
 
massively boring
 
massively <404 missing adjective>
 
but if I wasn't to use IOCP select would be my best bet?
 
@Neil ¬_¬ 'massively' is an adjective
 
7:52 AM
@thecoshman massively missing the point
 
@thecoshman massively massively
@thecoshman Actually I think that accounts for an adverb, not an adjective
The adjective would be massive
 
@DeadMG really? huh... that doesn't make sense to me, but it does explain the point
 
@user1220811 Well, you don't necessarily have to use raw Win32 IOCP. boost::asio provides nice abstractions over it
 
@Neil indeed
 
@Neil well, adverbs are both adjectives and verbs
 
7:55 AM
the best example if a word fitting more than one category is "fuck".
 
any way, time to saddle up and head to the parents!
 
@Cicada thanks for the help
 
@DeadMG That word relies heavily on type inference.
 

« first day (626 days earlier)      last day (4323 days later) »