« first day (354 days earlier)      last day (4577 days later) » 

12:01 AM
PackagedTask does look interesting, and it might be possible to implement a .join on it. On the other hand, it may also be possible to implement parameter passing to a std::thread as well.
Both are supported by g++/gcc and MSVCC
Cool! A <threadpool>!
Not supported by MSVCC though....
 
A bunch of semi-drunk animals around a campfire? What campfire?
 
@IDWMaster That's probably a GCC extension.
 
The fire is dying
 
That didn't make it into the final standard.
 
12:05 AM
Well; it is in gcc....
So I guess MS is finally going by the book.
 
@IDWMaster What version?
I'm running 4.6.1 and it's gone.
 
The one included in Eclipse
Perhaps its some kinda eclipse extension to it as well.
 
Eclipse really?
 
Not even a GCC extension
Yes, I'm using Eclipse
 
Well, whichever version it is, it's better to not use <threadpool>. It was there once but no longer is.
 
12:09 AM
Yeah.
 
but the gcc version? from a default eclipse install is impressive
 
Is there any good reason to use :: without prepending it with a namespace, i.e. to refer to the local namespace?
 
@CaptainGiraffe What's impressive?
@Maxpm It refers to the global namespace, not local.
 
@RMartinhoFernandes not much
 
@RMartinhoFernandes Even better.
 
12:12 AM
@CaptainGiraffe It wasn't a default Eclipse install. I got the C++ version of eclipse from their website.
 
@Maxpm A reason to use it is to disambiguate colliding names. namespace foo { void* malloc(size_t); void f() { void* = ::malloc(10); /* use global malloc */ }. Though that should be a rare situation.
 
Not the "standard" eclipse
It was specialized for C++ development
 
@RMartinhoFernandes I said a good reason. ;P
 
@IDWMaster The g++ website?
 
@Maxpm That's a good reason. If you don't use it in that situation, you will call the wrong function.
 
hey
12:13 AM
hey
does anyone use ubuntu or linux?
I need help
 
@hey Ubuntu here.
 
hey
I NEED TO INSTALL GLIB
 
No we all use Windows xp here
 
@RMartinhoFernandes Trying to overload malloc is neither a good solution nor a good reason.
 
12:14 AM
I have an Ubuntu install
Did you try searching for G-lib in aptitude?
 
@Maxpm Replace malloc with some other name. The point still stands.
 
I mean Synaptic
 
hey
I need to install GLIB, because I get an error: configure: error: Cannot find GLIB: Is gtk-config in path?

I tried to install it, did ./configure, make and so on. Everything what was in INSTALL file. So, what should I try next? Because I still getting that error when I want to install one program. Thanks (maybe someone has skype and could try it through teamviewer?).
 
@RMartinhoFernandes Putting something in the global namespace is generally a bad idea, as well.
 
hey
or maybe i need restart computer? but i really doubt it
 
12:15 AM
I doubt it
 
@Maxpm So? That's a bad idea. But you may have to use the unqualified :: because of it. It doesn't make :: bad.
 
I would see if gtk-config is in PATH.
 
hey
how to see that?
 
@hey sound like a version conflict
 
hey
@cap
 
12:16 AM
@hey echo $PATH
 
If anything it makes it good because it lets you work around someone else's bad code.
 
hey
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 
I'm not really sure what gtk-config is referring to. Likely a directory somewhere.
 
hey
@CaptainGiraffe, so what should I do then if it's version conflict?
 
Try this
 
12:17 AM
Another reason is when using placement new.
 
sudo apt-get install libglib2.0.0
 
@RMartinhoFernandes Placement new?
 
hey
ok, installing
installed
 
::new guarantees you won't call an overloaded operator.
 
@hey download , install the proper versions
try the gui tools @hey
 
12:18 AM
@Maxpm Placement new is basically a fancy way of calling constructors directly on already allocated memory.
 
Neato.
> Handling exceptions is like Pokemon - gotta catch 'em all!
3
 
It's "please construct an object at this address".
 
hey
damn it...
still got an error:
checking for GLIB - version >= 1.2.0... no
*** The glib-config script installed by GLIB could not be found
*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GLIB_CONFIG environment variable to the
*** full path to glib-config.
configure: error: Cannot find GLIB: Is gtk-config in path?
 
Did you try apt-getting gtk-config?
 
hey
12:20 AM
I need to install this thing: cs.manchester.ac.uk/resources/software/komodo
apt-getting gtk-config
 
I THINK that's a package
 
hey
apt-getting: command not found
 
I meant apt0get
apt-get
 
Er, $ apt-get gtk-config.
May need sudoing.
 
kk are you doing this in a virtual machine or a chroot environment?
 
12:21 AM
Did you run make install
After you ran make?
 
hey
virtual
 
I'm assuming it uses a makefile
 
kk go for it
 
hey
no IDW i think
should i?
 
a snapshot and go for it
 
12:22 AM
Yes, usually libraries will require you to run make install
after running regular make
 
hey
Still the same error :/
could somebody try through teamviewer, please?
i really need that program fast
 
I'll try
 
hey
'if somebody have a few free minutes
ok
941 513 534
 
ID?
 
 
hey
12:23 AM
4837
 
@Maxpm Sry not funny
 
@CaptainGiraffe Thanks for sharing.
 
@Maxpm Did you find it funny?
 
@CaptainGiraffe Indeed, I did.
 
@Maxpm I did not get it.
 
12:28 AM
@CaptainGiraffe I'm sorry to hear that.
 
 
1 hour later…
1:34 AM
Introducing packaged_tasks as an abstraction for my new threading model!
 
 
1 hour later…
2:43 AM
dis_kd = (float)sqrt(Tree.d_min) ;
'sqrt' : ambiguous call to overloaded function
can anyone explain me why I have this error here
 
2:54 AM
are you using an ide?
a google search brought up this
sqrt() does not have an overloaded version that takes an integer as its argument. I believe there are 3 overloaded versions, which take float, double or long double arguments
so since you dont cast Tree.d_min, it doesn't know which one to convert it to
 
yes i solved it
:)
it is sytax problem
 
thank you stephen I just changed it to sprt((float) tree.d_min)
and it works fine
and correct
 
dont thank me, thank google haha ;)
 
yaa it is awesome !
google is an adict ..huh tough to get ack to books :D
back*
 
3:19 AM
How does one actually go about using the new wchar_16?
Is there an std::string extension for it or something
Found a solution! site.icu-project.org
If the license is good....
 
C11, C.XI, C-11 or C.11 may refer to: In transport, vehicles, ships or public transport routes: * C-11 Fleetster, a 1920s American light transport aircraft for use of the United States Assistant Secretary of War * Fokker C.XI, a 1935 Dutch reconnaissance seaplane * LET C-11, a license-build variant of the Soviet Yakovlev Yak-11 trainer aircraft * C-11 Gulfstream II, the military designation of the Gulfstream II business jet * Barroso (C11), a light cruiser of the Brazilian Navy * HMS C11, a 1907 British Royal Navy C class submarine * HMS Liverpool (C11), a 1937 British Royal Navy Town cla...
 
hellllllllllllllllllo
 
3:42 AM
argh. i'm listening to the australian edition of sensucht. it's like they removed all rough edges. or possibly it's identical to european edition but my ears hear it differently in the morning. but anyway rammstein used to have some punch, as i remember, and now, nothing there, just easy listening pop/muzak. hm.
yep much better on youtube. that's silly.
 
Is there a version of the std::string class for char16_t
Or at least a way to convert?
Between char* and char16_t
or wchar_t and char16_t?
 
no. in windows you can use wstring. otherwise you can instantiate it yourself but as i recall you need to also add some traits specialization. in general. don't know if that's necessary for char16_t.
 
Probably easiest to just use ICU
Kind of a bulky library though
 
it's two different things. the c++ standard library does not have Unicode support.
 
Most have been some pretty Euro-centric/racist developers at the time.
 
3:49 AM
he he
 
Then I see you're from Norway - irony
 
it's like a tragedy in Windows, e.g. ofstream does not have a constructor or open method that takes a wstring or wchar_t const*. so to be standard-conforming one would have to use the "short" (DOS 8.3) filenames in Windows. in practice, instead one uses Microsoft extensions that are not formally permitted.
 
The question is how to use something that will work on both Linux AND Windows
I guess the question is; how did Mono do it?
 
Whatever is different is just abstracted in a layer somewhere. It's the same as with anything platform-specific. It gets tricky if you also want efficiency.
 
How would you convert a 32-bit wchar_t to a 16-bit wchar_t though; or vice-versa?
 
3:54 AM
check out wikipedia on "surrogate pair"
going down to utf-8 is a little more tricky, involving algorithm.
 
ICU is probably the best way to go to support everybody, considering that not only strings may be different, but also DateTime formats, currency formats, etc.
 
Hello
 
World!
 
Today I had no school.
I had almost no homework.
I spent time writing a paper for fun.
I ruined it by adding a header so that I could fill up more space.
Meh. It looks like homework now.
Anyone have any thoughts on patents and tech before I lump my views out there?
 
Hello World
 
4:43 AM
hey all
 
I did choose a question to make it c++faq
7
A: Template specialization of particular members?

Johannes Schaub - litbYou can only specialize it explicitly by providing all template arguments. No partial specialization for member functions of class templates is allowed. template <typename T,bool B> struct X { void Specialized(); }; // works template <> void X<int,true>::Specialized() { ...

I find it sad that after a few milliard years, there will be no life anymore, for all time. because the universe will never collapse again :(
 
 
2 hours later…
6:53 AM
...
this room is inactive for once? mmn
 
@LewsTherin yeah. surprising...
 
yeah....
 
8:17 AM
morning
 
8:35 AM
Good morning :)
 
if I'm infinitely lucky
 
I may yet escape having to spend a whole year proving rotation matrix formulae
 
@DeadMG grins
@DeadMG you're professor?
 
well
I submitted some coursework for which I got a zero
and I don't quite grok how this happened, but the most likely is that the lecturer misplaced it or something
and I guess it's technically possible that I could submit again
 
8:59 AM
@JerryCoffin Reinstalling libc6 solved my stringstream problem, thanks for the suggestion. The version where the problem was exhibited was different from my other machine (where it worked fine).
 
9:39 AM
@JohannesSchaublitb you can view the alleged expansion as if the size of the universe is constant, and everything within is shrinking. remember einstein-man said, all is relative. so, what's allegedly happening is that everything's shrinking at an ever accelerating rate. and of course in a way so that it is indetectable locally here in the solar system even after a 3rd of the universe's alleged total age. so don't be sad. rejoice in the shrinking.
 
9:53 AM
Blah.
 
@JohannesSchaublitb also, just a note on terminology, i think the english expression for "milliard" is "billion"
 
Johannes is on a righteous quest to end the short scale.
 
1000 million
we used to have an English billion, which was 1,000,000 million, but now we tend to use the American billion, which is 1,000 million
 
Well, at least the Continental Old World is still on the correct scale, aka long scale :P
 
I think the short scale makes more sense
 
10:03 AM
It's not about making sense. It's about being right.
 
nah
there's nothing more correct about long than short
SI units use a short scale
 
@DeadMG Well it's not like the long scale hasn't got a word for 1000 * one million. What do you base your argument on?
 
I think that SI units being short is a perfectly fine argument for suggesting that the short is more generally applicable
 
But... there's no room for argument!
 
@DeadMG No no, what is your argument when you claim that the SI units use a short scale.
 
10:08 AM
uh, wtf are you talking about? basic knowledge...
The International System of Units (SI) specifies a set of unit prefixes known as SI prefixes or metric prefixes. An SI prefix is a name that precedes a basic unit of measure to indicate a decadic multiple or fraction of the unit. Each prefix has a unique symbol that is prepended to the unit symbol. The SI prefixes are standardized by the International Bureau of Weights and Measures in resolutions dating from 1960 to 1991. Their usage is not limited to SI units and many of these date back to the introduction of the metric system in the 1790s. SI prefixes are used to reduce the number of ze...
 
So what?
Look at the two columns for long and short scales.
 
so the SI scale quite clearly uses a totally separate prefix for all values of 10^3
 
And the long scale has a totally separate word for all powers of 1000 (above one million).
 
The long scale has words for all of them too. And those words are the right ones.
 
words != totally separate words
the difference between "million" and "milliard" is not very separate, is it?
 
10:11 AM
Because 'billion' is totally separate from 'million' right?
 
mullion
 
more than "million" and "milliard"
and how are you going to shorten them?
at least 10billion can become 10b unambiguously
if you used million and milliard, you could never write 10m, because nobody would know what m you meant
 
million vs billion => one prefix, million vs milliard => one suffix. Same difference?
@DeadMG That's unrelated to your claim that the SI uses a short scale, isn't it?
 
We don't need yet another set of prefixes. Just use 10G.
 
10:12 AM
I don't want to take part in the short vs long scale, I just want to rebuke your silly claim on the SI units.
 
well, the SI units have clearly distinct words for each prefix, and the long scale doesn't
 
Distinct is in the eye of the beholder isn't it?
 
'billion' isn't clearly distinct from 'million' either.
As I said, they differ in prefixes, million and milliard differ in suffixes.
 
and as I previously pointed out, prefix differential is much more practical
 
10t is what btw?
 
10:15 AM
That may be an argument long scale vs large scale, but since the SI prefixes are M and G I don't think that helps here.
'a Gillion'
 
10 thousand?
Oh, what about 10q?
 
i.e., the SI units use different prefixes, just like the short scale does
 
10 trillion?
 
10t is obviously 10trillion
 
10q is 10 quadrillion or 10 quintillion?
 
10:16 AM
apart from the fact that you'd probably just write it out if you said 10,000, people use 10k for thousand
 
10s is 10 sextillion or 10 septillion?
 
which is a bit odd, if you ask me, but that's how it is
 
I've never thought of long and short scales in terms of prefixes.
 
true, but those are hardly requiring common use right now
million and billion are
 
@LucDanton Because it's about words.
 
10:17 AM
@RMartinhoFernandes Exactly yes.
 
Anyway, I also have a silly argument in favor of the long scale.
You can work out what power of ten they refer to easier.
Just multiply the number by 6.
A duodecillion? 10^(12*6) = 10^72.
 
6*prefix+3 for -illiard?
 
That works.
 
I think it would be much easier if we would just use the SI prefixes for everything
 
10:21 AM
8 mins ago, by R. Martinho Fernandes
We don't need yet another set of prefixes. Just use 10G.
 
Million, Gillion, Tillion, Pillion, Ellion, Zillion, Yillion? Just not units, also the words.
 
@LucDanton The words are: Mega, Giga, Tera, Peta, Exa, Zetta, Yotta.
 
Works for units, not for things.
 
"Ten Mega" sounds fine to me.
 
what's a gillion? lol
 
10:23 AM
And "Yillion"...
 
@RMartinhoFernandes What?
 
at least "zillion" is well known already
 
Also, "Zillion" is already taken for "some indiscriminate large amount that is way too big for me to specify or measure".
 
Consider it's '80 Mega Germans' vs '80 Gillion Germans' for population.
 
shouldn't it be indeterminate?
indiscriminate would imply any value, but in fact you did discriminate- because it has to be too large
 
10:24 AM
Or something.
 
personally, I prefer "bajillion" for that use
 
I'm with "gazillion" now.
 
@RMartinhoFernandes By that same token 'Mega' and 'Giga' are already taken in some languages to express large quantities.
 
personally, i prefer "lot". fewer letters. :)
 
lol
 
10:25 AM
Less... poetic.
For some very liberal definition of poetic.
 
the problem with fewer letters is that it feels less expressive
 
well, for the really really big amounts, there's the standard metric fuckload
 
5
A: The use of declaring function inside a function?

DeadMGThere is little value to declaring a function inside a function, unless you intend on defining it later and only having it available to that function- i.e., the function declaration is encapsulated. int main() { void foo(); foo(); } void some_other_func() { foo(); // ERROR } void foo...

look at the comments on ilia choly's answer
 
@DeadMG Short scale doesn't have unique prefixes above 'billion' anyway.
 
owch
 
10:29 AM
quite the discussion:
1
A: C++ vector size types

Alf P. SteinbachThe book you’re reading states that if you want to extract the size of a vector of type double (for example), you should do something like: vector<double>::size_type vector_size; vector_size = myVector.size(); Whereas in Java you might do int vector_size; vector_si...

^ about sizes
 
@DeadMG Heh, micro-moderating :)
@AlfPSteinbach Mine is bigger!
 
it is not micro-moderating to suggest that an answer which has nothing to do with the question at hand should be deleted
 
I just liked the term.
I still don't know what it means.
 
me neither
actually
:P
but as far as I can tell, he's just offended that I said his answer was irrelevant
it's a fact that on a Q&A site, you post answers which answer the question.
 
i'd say the answer is worth a downvote. or several. it's not really a moderatable thing though
 
10:32 AM
well, the guy got confused about what the question was asking
that's fine by me, I don't normally downvote for that
it wasn't the clearest question evar, although I think that most people with more than a modicum of C++ experience would know wtf he was talking about
but I think that leaving it up there is definitely wrong and downvotable, which I just did
 
It's dupe. I'm voting to close it.
 
@AlfPSteinbach And at the end of that I have no idea what range of value std::ptrdiff_t is supposed to hold.
 
the "kindly delete or edit it" was a bit...i dunno. bossy.
 
the answer isn't wrong, it's just not relevant
what else do you suggest he does?
it's not like he could actually choose to ... do something else to make it more relevant
 
someone comes to me like that, i'll happily tell them to fuck off
 
10:34 AM
There voted the dupe in.
Now go upvote my question. Er, vote to close that question.
 
@DeadMG There's an edit button.
 
@LucDanton I said "delete or edit"
and hey, I was pretty nice to the guy in that comment
 
editing the answer to fit would completely change its meaning
 
so what? he could also just delete it instead
 
Right, it would be rude to edit it yourself. I don't see a problem with the poster doing it.
 
10:36 AM
the answer as it is is totally irrelevant and does not belong, and he should perform some action to remedy the problem
 
hint: adding "kindly" does not automatically make something kind.
 
you know, it really doesn't matter
there is a problem with his answer, and he needs to go solve it
 
i agree there's a problem with it. but i'd just downvote, least til it's fixed. :)
 
Hint: Adding "fuck off" does not automatically make something rude.
 
I'd rather simply ask him to fix it than downvote
 
10:38 AM
I reserve downvotes for stuff that is beyond salvaging.
 
@RMartinhoFernandes Do you salvage yourself if the author has no inclination to do it themselves or downvote?
 
@LucDanton Sometimes I do salvage them.
Though I wouldn't do it here. I would just comment like @Dead did.
 
eh. i reserve downvotes for an answer that has obvious flaws that the author doesn't care to correct after they're spelled out
i won't edit code except to correct obvious typos. conceptual errors and such as that...too big a change for some stranger to make, imo
 
Are all IEEE 754 binary32 numbers representable in binary64?
(Same for binary16->binary32 and binary64->binary128)
 
as in, floats in doubles?
 
10:45 AM
Typically.
 
I believe so for 32 and 64.
You have all the same bits for the same information, and then some.
 
should be. more space for the mantissa and exponent...if a double has less precision than a float, something's wrong :)
 
@LucDanton Yeah, that was my first thought, but since FP is full of weirdness I remained in doubt.
Maybe I should make this a question on the site.
 
iirc, floats and doubles are both represented quite similarly... 0.625 is represented kinda like 1.01b x 2^-1. the components of a float are the significand and the exponent. with 64 bits, you just get more bits for the significand (meaning more precision) and for the exponent (meaning more range)
 
@LucDanton James is fixing that. but it is IMHO good to know that there is no hard fact, when there isn't. as opposed to thinking there is.
 
10:59 AM
@AlfPSteinbach Fixing the wording in the Standard :) ?
 
@LucDanton well, filing a DR, which hopefully means it will be fixed.
 
Damn, I lost again.
 

« first day (354 days earlier)      last day (4577 days later) »