« first day (249 days earlier)      last day (4714 days later) » 

2:01 PM
room topic changed to Lounge<C++>: The Lounge of Extraordinary Ladies and Gentlemen.
 
right, I'll explain my problem
 
Yaaay, I passed the exam!
 
sbi
@Default They are indeed, but since no two vectors share their data, it has to be copied nonetheless.
(It's only on the heap so the size can be determined at runtime.)
 
@sbi ah. right. good explanation
 
sbi
@CatPlusPlus Cong-rats!
@Default: If you want to avoid copying, you need to use a std::shared_ptr.
Anyway, I gotta go and pick up one of my kids. See you!
 
2:06 PM
I want to find all files of a certain type in a directory. So I have a `class Directory` with two `vectors`, directories and files. I thought of a recursive function where I just return the files based on some filter, and my first thought would be to return a vector.. kind of like (`files` returns all files)

vector allFiles = files;
for all directories{
allFiles += directories.files;
}
return allFiles
why doesn't the code work..
but in that example, I would do alot of copies of filedata.. so pretty wasteful
 
If you don't want copies, use pointers.
Who owns the file data?
The directory?
 
yup
it has the vector of the files
 
By owns, I mean, who is responsible for destroying it.
 
well, it's the directory that allocates it
so the directory should clean it up
 
If the directory owns it, and it is destroyed, and you still have something else using the pointers returned from the filter, you'll get into trouble.
 
2:13 PM
oh, that's right..
 
Not sure if that matters to your scenario.
 
I don't think it will, but good to keep in mind :)
 
Ok, so, if the directory owns the data, you can return a vector of regular pointers.
Otherwise, you'd have to use std::shared_ptr<T>.
 
and shared deletes the object when all references to the shared ptr is removed, right?
 
2:16 PM
sweet :)
so is a shared ptr expensive to copy then? :)
 
No, it's internal state is just two pointers or something.
 
or will it be feasable to do it as I explained in pseudo code above
so a copy of that would be ok.. awesome. thanks @MartinhoFernandes
 
it's pretty feasible to copy shared_ptr, it would be quite pointless otherwise
but it's not just two pointers- you are also invoking an atomic operation for thread-safe reference count, so it's not that trivial
 
well, I don't know, I've never used them :)
 
well, shared_ptr is intended to be copied- how else could you share it?
 
2:23 PM
uhm..
you could make a pointer to it?
 
That loses the ownership semantics.
 
yeah, I was just kidding
 
That's what smileys are for. They're like extended punctuation :)
 
crap - can't edit it.. :P
 
Oh look, Google ported VB5 to the browser. http://goo.gl/78gcW
 
2:27 PM
NOOOOOOO!!
What monster are they going to resurrect next? Perl?
Oh, wait, Perl isn't dead yet :(
 
haha
 
@Default do you mean that they are dynamically allocated?
 
@TomalakGeretkal Actually don't know.. I just read in that comment that they were being created on the heap.
My objects that I store in my current vector is not dynamically located (yet). But since I will do a bunch of moving around it might be best to do it like @Martinho suggested and put them in shared_ptr<>s
 
@Default it will be dynamically allocated because that's how most vector implementations work. forget about "the heap"
 
ok
forgotten
 
2:38 PM
:)
 
@TomalakGeretkal you really don't like lies-to-children, right?
 
That doesn't actually apply here. It's similar, but not quite the same. "Stack vs heap" is _not_ a simplification of "automatic vs dynamic storage duration". It doesn't represent a strict subset of the information to impart. It's a very narrow, singular view of the implementation details of allocation in specific scenarios, rather than a generalisation of the process as a whole. It is more like a cousin than a younger brother, of the truth.

A lie-to-children for allocation rules would be "the only difference between `int x;` and `int* x = new int;` is that you don't have to `delete` the fi
2
 
shared_ptr is boost, right..? or does one also exist for std?
 
@Default C++0x has it in std.
@Default Otherwise, Boost it, or possibly look in your [std::]tr1.
 
ah. cool.
 
2:45 PM
@MartinhoFernandes Also, there's a difference between grossly simplifying an explanation when relating it to children, and picking less accurate terms for the sake of it, when neither is actually more or less child-friendly than the other.
 
lie-to-children is a lie
 
a cheat is only a cheat if it is noticed
 
if a child asks me "what is the speed of light" I say "I don't know, but somewhere around 300Mm per second"
 
@JohannesSchaublitb That's not a lie.
 
it's a lie to say "it's 300Mm per second"
 
2:53 PM
what if a kid asks you if santa exists?
 
lie-to-children
i will say i don't know
 
the diplomatic answer :) good. good.
 
You could really say "around 300Mm per second".
 
i need to look into scripture how it evolved
@MartinhoFernandes yeah I say that
 
I don't see how that needs simplification.
That is pure truth.
It's not exact, but it's true.
 
2:54 PM
becuse the wikipedia article says it's a lie-tochildren " acceleration due to gravity=10 m/s²"
 
or you could just say "google it"
 
but I don't see any point in doing that lie
@MartinhoFernandes it is exact
saying "around 300Mm per second" is exact
 
"around" doesn't sound very exact.
 
yes
it's exactly around
 
google has the answer to "speed of light"
 
2:55 PM
Ok, I'm done being trolled.
 
if you say "it is exactly 300Mm per second" then that answer is inexact
and wrong
if an exact answer exists, then you cannot give a correct inexact answer
 
You can give a truthful inaccurate answer.
 
@MartinhoFernandes you're like floating point numbers.
 
if truthful means "some truth in it, but still wrong" then I agree
to me, correct means "100% truth". i.e "true"
 
You can use approximate.
 
2:58 PM
Truthful means it's true. Saying "c ~= 300000000" is true.
It doesn't impart as much information as the exact value, but it's not false.
 
yeah if you say "300Mm +/- 500km per second" is an exact approximation
hm wait i say nonsense
 
You can't have an exact approx :P
 
You're using a different definition of exact.
 
"strictly accurate or correct", "precise, as opposed to approximate"
 
3:00 PM
the above is an exact approximation. there are clear bounds between which the exact value lies
 
You mean to say precise.
 
Hmm might be
 
I'm a moonlander.
 
Or accurate, I think.
Yeah, it's "accurate".
 
3:01 PM
precise would be "the speed of light is 0km per second"
but it would not be correct
but exact.
i think precise == exact ?
err. exact == the most precise
 
@ÓlafurWaage How's that working out for you?
 
Precise is about reproducibility.
 
"Pi = 20.0000000000000000000420008" is extremely precise and not at all accurate
 
precise, more precise, exact
@LucDanton correct
 
I think precision is more tuned to accuracy but exact tuned to narrowing the results
 
3:02 PM
Precision is how well you measure, accuracy is how close to the target
 
it is exact but inaccurate.
 
@Default good :)
 
but exact is when you are completely precise
 
My dictionary says "strictly accurate or correct", "precise, as opposed to approximate".
 
exact is the superlative of precise
 
3:03 PM
@MartinhoFernandes The exact value of c depends on the medium and the wavelength, iirc.
 
I don't know what to make of this.
 
i.e where the precision is infinite
 
@FredOverflow What? c is the speed of light in absolute vacuum. There is no medium.
 
@JohannesSchaublitb Are you allowing inaccuracy with this definition?
 
@MartinhoFernandes the speed of light?
 
3:04 PM
Exact would be used to shrinking the result set.
 
@FredOverflow that is correct
the speed of light usually referes to the speed of light in a vacuum.
 
inaccuracy just means the distance from the correct value.
 
But @Fred used the unambiguous c.
 
c / n is the notation for speed of light in a medium, not c
 
oh
 
3:05 PM
@Default Are there any natural vacuums? For example, there are still tiny amounts of mass in space, right?
 
You can be exactly inaccurate.
 
precision means the certainty of the assertion
the assertion is exact if the precision is infinite
 
I think this conversation is going exactly nowhere :P
 
@FredOverflow That doesn't make the exact value of c dependent of the medium.
 
that doesn't necessarily say that the assertion is accurate tho
 
3:06 PM
It doesn't have to be practical
@ÓlafurWaage You're being trolled.
 
@fred there must be parts of it that doesn't include mass. it's pretty big :)
 
@MartinhoFernandes I like that.
 
@ÓlafurWaage you now even used the term exactly as i use. by saying "exactly nowhere", you said "nowhere, and not only mostly nowhere".
 
@MartinhoFernandes So c is an abstract value. No real light travels exactly with the speed c.
 
@FredOverflow Well, in between "stuff", I guess.
 
3:07 PM
@JohannesSchaublitb because I know the precise location :P
 
the fact that you actually meant "nowhere" and not "not nowhere" is implied by the theorem of communication. i.e that you actually say what you mean
but actually, I'm just trolling. i have no idea about the meaning of these words
but it just makes sense
 
@Johannes: except when you do a freudian slip
 
@JohannesSchaublitb trolling is a strange art.
 
so. the question is. was freud exact?
 
@Default Technically, there are lots of little vacuums between the particles. But I mean vacuums of large proportions, like lightyears or someting.
Damnit, there's a fly in my room that wants to eat my pasta!
 
3:09 PM
@FredOverflow can vacuums have gamma rays in your definition? If so there are no vacuums
 
@FredOverflow no idea actually :) I do recall reading something about that, but I can't accurately say which it is
@FredOverflow sharing is caring
 
@ÓlafurWaage Can't you just get rid of the gamma rays with a vacuum cleaner?
 
@FredOverflow Current astronomy says that between planets we have "interplanetary medium", between stars we have "interstellar medium" and between galaxies "intergallactic medium". None of these is a pure vacuum, but they have very low densities.
 
@FredOverflow Still, air barely impedes light. I don't know what kind of measurement you need to measure the refractive index of the interstellar medium but you're making me curious
 
@ÓlafurWaage Why?
 
3:10 PM
@FredOverflow gamma cleaner.
@MartinhoFernandes isn't the entire universe filled with gamma radiation of some magnitude?
 
Gamma rays are just light.
Not matter.
And the background radiation currently falls on the microwave part of the spectrum, not gamma.
 
@MartinhoFernandes What? No, they're not.
 
Gamma radiation, also known as gamma rays (denoted as γ), is electromagnetic radiation of high frequency (very short wavelength). They are produced by high energy sub-atomic particle interactions in natural processes and man made mechanisms. These include electron-positron annihilation, neutral pion decay, fusion, fission, lightning strike, inverse Compton scattering and synchrotron radiation. Gamma ray production events range from production of a single gamma photon to explosive bursts that are the most powerful observed in the visible universe. Because gamma rays are a form of io...
 
@MartinhoFernandes The EM spectrum is broad. [Visible] light forms one [relatively small] part of the EM spectrum. Gamma rays form another.
That post backs me up.
 
Ok, I meant EM radiation.
 
3:13 PM
0
Q: Does "exact" determine the precision or the accuracy of something?

Johannes Schaub - litbI was wondering, when I say "the speed of light is exactly 300000000km/s", is that an incorrect or a correct statement? That is, does "exactly" refer to the precision of an estimate (then my statement would be correct, I think, because I wouldn't have asserted that my statement doesn't deviate ...

 
cool picture
 
@JohannesSchaublitb haha nice. Might actually create an account to upvote that :)
 
@Default you already have an account
 
3:14 PM
@Default oh, ELU. Sorry
 
not on english
 
@LucDanton Knowing the speed of light in that medium would be enough.
Not sure if that's something on our capabilities though.
 
@JohannesSchaublitb might want to change it to m/s to better represent the truth
 
@JohannesSchaublitb your accept rate is terrible, not going to answer that question.
3
 
where's the "star message as funny" button? I can't really claim that it's "useful"
2
 
3:17 PM
I was about to upvote this comment, before realising who it was that posted it.
 
...this silence must be the "nowhere" Johannes was talking about...
 
I love litb's SO profile. "I'm having fun at stackoverflow.com helping others and learning new ways of mastering programming." Because one way of utterly mastering programming just isn't enough!
 
Oh wait, there is no silence, my scrollbar just wasn't all the way down :)
 
It seems to stop at random times
100% accept rate. Nice.
Seems the English chat room is pretty active.
 
robusto seems to have a good point
 
3:22 PM
ya
 
But that doesn't make "exact approximations" possible.
It makes them antonyms.
 
then that would be oxymorons
 
if you always say "between N and M" where N and M are constant, then I think it's an exact approximation
like robusto says, it refers to precision
 
haha
 
@ÓlafurWaage Nitpick: An oxymoron is a figure of speech, not a property of words.
 
3:24 PM
@ÓlafurWaage How do you call someone who is too stupid to inhale? An oxymoron.
6
 
@JohannesSchaublitb Then everything I say is exact.
 
@MartinhoFernandes didn't know that. neato :) - Signed, the moonlander.
 
Just realized "opposites" is more common in English than "antonyms".
But "antonyms" has more of an expert sound to it.
:P
 
@JohannesSchaublitb accurate: (of ideas, images, representations, expressions) characterized by perfect conformity to fact or truth ; strictly correct; "a precise image"; "a precise measurement" wordnetweb.princeton.edu/perl/webwn
 
In Icelandic, exactly would refer to precision, not accuracy.
because the icelandic word for exactly is derived from the icelandic word for precision.
 
3:27 PM
Exactly is the lack of accuracy in English
That's why it isn't used outside of instances where exactly is easy to define. Exactly five people, etc.
 
i see now. "exactly" refers to "it's that, and not more and not less"
so it means it's very precise.
 
That's what I've always known it to be
Not very precise.... absolute precision, 0 precision.... the lack of error
 
Error is related to accuracy.
 
if i say "the speed of light is 1Mm/s" then I'm lying regardless. i took a bad example
 
nothing measured on scientific terms should use the word "exact" unless it can be factually stated.
 
3:29 PM
i should have asked it in form of a measurement, not in form of a statement like that
 
@Xaade Like the speed of light in a vacuum.
 
@MartinhoFernandes If it can be known exactly
 
@Xaade It is.
 
Then exactly can be used.
 
299,792,458 metres per second.
 
3:31 PM
In the fields of science, engineering, industry and statistics, the accuracy of a measurement system is the degree of closeness of measurements of a quantity to that quantity's actual (true) value. The precision Although the two words can be synonymous in colloquial use, they are deliberately contrasted in the context of the scientific method. A measurement system can be accurate but not precise, precise but not accurate, neither, or both. For example, if an experiment contains a systematic error, then increasing the sample size generally increases precision but does not improve accurac...
 
They defined a metre to be the distance traveled by light in 1/299,792,458 of a second.
 
Check your favourite languages
 
With that cheat, they made c exact forever.
 
What do you mean, exact? I thought C was full of undefined behavior?
 
@JohannesSchaublitb you have an answer from Jasper
 
3:32 PM
Lowercase, dummy :P
 
@MartinhoFernandes You got trolled, dummy
 
@Default should I know him?
is he some famous english guy?
 
no no.. I just thought it was an interesting answer
 
Gosh, someone just flagged BrainFuck.
 
3:38 PM
how does one define the c++faq tag?
 
What do you mean, define?
 
You can't. "c++faq" is not a valid identifier.
 
I mean, when should it be c++faq and not? who decides that?
if I think my question is good for many to know about, should I then tag it as c++faq`?
 
You only tag questions that get asked over and over again as FAQ. And mental masturbation, of course.
 
I think people are missing the point. Exactly isn't a technical term, and shouldn't be used for technical measurements. It is a term that when measuring something you determine it to be exactly X. There are exactly 5 people, I have exactly 5 apples, there are exactly 50 states in America. It's not correct to say that the speed of the car was exactly 50 MPH.... Speed can't be exactly measured.
 
3:41 PM
considering this for instance, never seen that question before on SO. Although I good question
 
@FredOverflow I heard of a woman that could bring herself to orgasm with only her thoughts. Is that what you're talking about?
 
Well, since you can have wet dreams, I believe the story. Still very envious, of course...
 
@MartinhoFernandes That isn't all that hard to do.
 
Did they make sure she didn't fake it? :)
 
lol
 
3:42 PM
@FredOverflow Yep, she was observed in a scientific manner.
They said.
 
I find it hard to consider orgasm to be scientific in any means.
 
And it was a fully conscious effort, not a dream.
 
@MartinhoFernandes Did they make a movie about that?
 
ups, freudian slip
 
Did she need any props?
 
3:44 PM
@Xaade No.
 
But she was freely given props afterwards?
 
I'm at work, so I can't pull out links, but I'll see what I can do when I get home.
 
I'm sooo full of noodles...
stomach.size() == stomach.capacity()
 
Does that mean you'll resize yourself if you eat one more noodle?
 
hahaha
 
3:46 PM
I don't dare try :)
 
@MartinhoFernandes physiologically speaking, he would.
 
Yeah, but the resize factor is very inefficient.
 
It's very efficient at getting you fat.
I can attest to this.
 
Well, if it was 1.5 or 2, it would be even more.
 
19 hours ago, by Cat Plus Plus
The oldest profession. COBOL programmer.
Really.... I was doing that just 2 years ago.
 
3:49 PM
I wouldn't want my container slowly destroying the elements in it..
 
@Xaade But that wasn't the first time someone did that.
 
@MartinhoFernandes It won't be the last either.
 
And saying you were doing the oldest profession two years ago sounds...
Weird.
 
@Default Unless it was a message queue.....
 
3:51 PM
:)
 
Isn't the human body basically a large collection of producer/consumer queues? :)
 
we don't know for sure that you can describe the brain in those terms
 
@Default I absolutely love when GUI actions are saved as messages in a queue forever, then after X time processing some query, that click is suddenly applied to the delete button who just moved to that mouse location.
 
@Xaade Like Windows?
 
@DeadMG Brain: consume oxygen, produce stupid thoughts.
 
3:53 PM
And then the space you pressed earlier confirms the Yes-No message box that popped up.
 
lol
 
Because someone stupid designed it to have "Yes" as default.
 
"Hm, I'll just move this here window a bit.. *click* move.. the window a bit.. *click* didn't I click it? *click click drag click drag* I must not have...
OMG what's happening?"
 
@MartinhoFernandes It makes no sense to have the default action on a user interaction clarification box, be "yes".
 
@MartinhoFernandes I sure do hate that. I have actually thought that, when I do popups that steal the focus from everything I'll actually check how fast the user pressed the OK button to see if they actually meant to press it
 
3:55 PM
So, what is the point of all this offensive tagging? Who gets the slap on the wrist?
 
What was flagged? I didn't see it.
 
@Default Harddrive scan complete, click applied, would you like to reformat, yes applied, warning do you really want to reformat, click applied..... reformatting, click applied.... stop button disabled feature turned on.
 
Did I miss one of the Android room wars?
 
@Xaade :|
 
@MartinhoFernandes no, people are flagging stuff constantly, I've had to verify about 5 flags today.
 
3:57 PM
Temptation.
 
flags on SO or in the chat?
 
One of them was on my usage of BrainFuck, the language.
 
@ÓlafurWaage That makes me want to flag that chat message.... out of irony.... flag weight prevents sin.
 
3:57 PM
I don't see what happens then.
 
Willpower depleting.
 
If you get 10 flags, you get banned or?
 
@Xaade Flag weight matters in chat?
 
It doesn't.....
ZOMG...... can't help it..... stop me.... I would at you but I can't type O with that accent.....
 
Someone broke Xaade.
 
3:59 PM
Ó ?
 
ä
 
Sorry.... had to refrain myself for a little bit.
 
@jalf how'd the interview go?
 
23.3.3.4/4 in n3242 says:
"An erase operation that erases the last element of a deque invalidates only the past-the-end iterator and all iterators and references to the erased elements. An erase operation that erases the first element of a deque but not the last element **invalidates only the erased elements**. An erase operation that erases neither the first element nor the last element of a deque invalidates the past-the-end iterator and all iterators and references to all the elements of the deque."
 
4:04 PM
Can anyone double check the FDIS?
 
@TomalakGeretkal It's not all that clear either way
 
> Effects: An erase operation that erases the last element of a deque invalidates only the past-the-end iterator and all iterators and references to the erased elements. An erase operation that erases the first element of a deque but not the last element invalidates only the erased elements. An erase operation that erases neither the first element nor the last element of a deque invalidates the past-the-end iterator and all iterators and references to all the elements of the deque.
@MartinhoFernandes That's from the FDIS.
right
 
Sorry, you meant your quote was from the FDIS. Duh.
 
4:20 PM
@MartinhoFernandes Yea, or at least, close enough. n3242 is the last free draft before the FDIS. I'm told there were no changes.
So, typo in C++0x.
I'm happy to report it, but I have no idea how. Can someone point me in the right direction?
Probably too late now, in fact?
 
from boost shared_ptr:
*For example, if main() holds a shared_ptr to A, which directly or indirectly holds a shared_ptr back to A*
not completely sure about that sentence..
 
@Tomalak: They will still accept typo changes
no semantic changes though
 
@Default It's about circular references
 
if B holds a reference to A, and A holds a reference to B, then neither will be collected
it's called a reference cycle
 
so it's only when I actually send the shared_ptr to the object that the shared_ptr holds. ok. I should be safe then :)
thanks guys
 
4:28 PM
the cycles can be hidden through many levels
 
@Default That would cover the directly part.
 
if A holds a reference to B, which holds a reference to C which holds a reference to D which holds a reference to A, then you still have a reference cycle
 
@DeadMG then how?
 
@Tomalak: What?
 
@DeadMG how do I submit a typo report?
 
4:32 PM
the hell should I know? All I know is that they're still accepting them
 
@DeadMG great, thanks for your help
anyone who does know the answer care to respond?
 
sorry that I don't have the answer to all of your questions
perhaps you should Google it or something
 
I'm concerned that it might feel like just enough of a semantic change, due to the nature of the typo, for the change to be accepted
 
You know, XML may be horrible, but there's worse. <data>9483924882347829478947289478924782478947238472348972389472839742384293487‌​2384723847238472384723984273482748273849</data>.
 
@Martinho: LOL
 
4:33 PM
oops
 
And technically, it's still XML.
Unfortunately, the XML API won't be of much help there.
 
@Martinho: Maybe the data is supposed to be one huge integer and won't be decoded further
 
Nah, it's a bunch of different data.
It has letters and all in it.
And I have an 81-page PDF describing what each position means.
Sigh.
Stupid governments.
They grabbed their old format, and converted it to XML: add a start tag at the beginning and an end tag in the end. Voilá. Instant XML.
Because XML is good for interchange of data.
 
lololol
 
SVG's path encoding also isn't really idiomatic: w3schools.com/svg/svg_path.asp
 
4:39 PM
Well, I think it would suck even more if it was XML-ish.
 
@MartinhoFernandes possibly
There's no limit to suckage.
 
At least they considered that and picked the best of both worlds: XML for what is XML-ish, and a simple compact notation for paths.
I bet raw pixel data has a special syntax too.
 
<?xml>
<row>
   <column>
       <redness>200</redness>
       <blueness>20</blueness>
       <greenness>5</greenness>
   </column>
   <column>
        ...
^ This is how images are supposed to be represented, guys.
 
dear god
anyway, it's been fun. ttyl.
 

« first day (249 days earlier)      last day (4714 days later) »