« first day (331 days earlier)      last day (4607 days later) » 

12:35 AM
no one here?
 
 
2 hours later…
2:22 AM
'/
 
 
2 hours later…
3:55 AM
Hello james
 
 
2 hours later…
6:18 AM
Hello room
I am c++ developer with 2 years experience in 3d graphics domain . I would like to contribute to open source projects in my spare time. I have searched , but couldn't find anything worthy . Please suggest me some projects. it should be on c++ or qt, preferably related to 3d domain
 
7:13 AM
Thank you for your input on my answer @LucDanton
 
7:30 AM
@Drahakar My pleasure.
 
@TonyTheLion You got a new hair style I see?
 
Als
7:49 AM
Ohla
There seems to be a problem, I cannot see who answered
it shows like it would for anonymous
Anyone else sees the same?
 
Answered to what or where?
 
Als
any answers
I can just see a blank square instead of an users gravitar image and name
@LucDanton: Just open any answered q and check
 
Same.
Worked only minutes ago, too.
 
sbi
@Als Same here. Have you looked at meta? No doubt there's already a complaint about this.
 
Als
uh hehe they broke it
 
sbi
7:58 AM
Two questions on meta.
 
Als
I thought its just me so thought of asking in here first
lemme check meta
 
sbi
@Als No need. This is the one the other is closed as a dupe of.
 
Als
@sbi: Ah thanks, It doesn't work for me just by refreshing the page as one of the comment says there
 
sbi
@Als That's not what the comment said when I looked at it.
 
Als
@sbi: Just think if they can't fix it anymore? :P
haha
@sbi: Woops that meta page got deleted? It says so when i hit referesh
 
sbi
8:03 AM
They seem to delete those questions. Well, if that's an attempt to cover up, we might need to keep asking it.
Well, it's fixed.
 
Als
Yeah its fixed now, someone tripped a lil it seems
@sbi: talking of managing it well, here you might want to read comments on this
4
A: sizeof() applied to structure and variable

AlsBoth will and should indeed return the same value. From MSDN: The sizeof Operator The sizeof operator gives the amount of storage, in bytes, required to store an object of the type of the operand. This operator allows you to avoid specifying machine-dependent data sizes in your programs. siz...

 
sbi
0
Q: Please stop deleting questions, even if what they have been asking is obsolete

sbiA few mins ago a bug on SO made all answerers appear as anonymous. There were a bunch of questions about it quickly springing up here on meta. Some got closed as dupes (fine), but one stayed open for a while. While we were still contemplating what happens in the chat, I checked other sites and fo...

Anyway, gotta go. I expect this question to be closed, too, when I come back in an hour. <sigh/>
 
Als
@sbi: Oh it was closed by Jeff already
took 2mins 11 secs to be precise
@sbi: And deleted
 
sbi
8:19 AM
That makes me really angry. I might have to write a blog posting again. Good I saved the question's code.
 
Als
This place seems the community led to believe that it runs the site, No A dictator runs it and not the community
2
 
sbi
LOL! I can't ask this question again, because it's a dupe of the (closed) question meta.stackoverflow.com/questions/105897/…, which doesn't exist.
That is so wrong.
Wow. I just lost 84rep on meta. With no apparent explanation. Creepy.
 
Als
@sbi: Ansd you should ask the reason, Why
 
sbi
It's worse. meta.stackoverflow.com/reputation: ** rep today: -102
 
Als
@sbi: Where did you get the explanation of why you cant ask that q? meta chat?
 
sbi
8:24 AM
@Als Yeah, I should. But I really, really do have to go now. :( Later.
@Als When trying to commit a new version of it.
 
Als
@sbi: Ah okay, do ask on meta and post a link here later
 
sbi
It's probably a bot seeing that the titles are exactly the same.
Ah well, I'm way to late anyway...
 
Als
@sbi: Okay have a good day
 
sbi
...so I quickly wrote the question:
0
Q: Where did my rep go?

sbiAccording to http://meta.stackoverflow.com/reputation, I lost a lot of rep in the 10hrs this day is old in Greenwich: ** rep today: -102 Of course, http://meta.stackoverflow.com/users/133368/sbi?tab=reputation makes no mention of this. So where did it go.

So. Now I really need to go.
 
8:51 AM
When is a constexpr function to prefer over a single constexpr value?
Don't really see the point
 
When you need to do a function's job, like computing something.
 
Is it for accessing constant values in classes?
What do you mean?
 
factorial(4); factorial(5); how do you do that with a value?
 
In that function you compute differently for 4 and 5, so it's not a constant value?
 
Yeah, functions are not values.
Also, C++ functions of all kinds are constants in a sense already.
On the other hand, you've discovered how constexpr has at least two roles: as a function specifier, and as a kind of storage specifier.
i.e. constexpr int i = 42; isn't the same kind of constexpr as in constexpr long long factorial(long long) { ...
(It's quite unlike a storage specifier come to think of it, I should have picked something else.)
 
9:04 AM
I don't understand the second constexpr.. If I pass some variable and then compute an answer, then what's the benefit of defining it constexpr?
 
The resulting function call is a constant expression (some of the time).
 
Hence int array[factorial(3)]; is valid, whereas if the function was not constexpr qualified it would be invalid.
 
but returning a const value is also a constant expression
right?
 
No.
Also you can't return const int
It's the same as returning int.
 
9:05 AM
true
 
@RMartinhoFernandes Hello, I've noticed a small bug in your concept stuff.
 
ah.. so you mean that when you type array[factorial(3)], the compiler pre-computes the value and checks that is inside the range of the array?
 
@ManofOneWay My example was a variable definition (notice the leading int before array).
 
ah okey, but let's say you instead tried to access
 
9:09 AM
@RMartinhoFernandes Your unused_variables helper uses pass by value so when you use it in some concept requirements it implicitly requires some of the types you test to be CopyConstructible.
 
@LucDanton Oh, that's likely. I haven't tested it yet :)
Oh, you're right.
 
@ManofOneWay Indexing doesn't require a constant expression so that makes no difference. However in some cases a smart and helpful compiler might warn you (but it in actuality it could then warn you with a non constexpr but otherwise identical function just as well).
@RMartinhoFernandes Of course this then requires that the type be convertible to its own reference type. You can't win all the time :p
 
I still have a hard time understanding the actual usage of a constexpr function
 
It's useful when you want to compute something from either constant expression or non-constant expressions, and retain constant expression-ness when available.
Constexpr functions are bizarrely placed in-between compile-time metafuctions and plain old runtime functions.
However I expect constexpr literal operators to be quite useful; so at least there's that.
 
@LucDanton Hmm, when wouldn't an lvalue of the type be convertible to its own reference type?
 
9:17 AM
operator pathological_type&() = delete;, but I haven't double-checked.
 
It's Machiavelli/Murphy really.
 
I think can live with that.
 
You can add a template<typename T> is_not_machievellic: std::true_type {}; traits and cite it as a requirement for all your traits/code, specifying that 'only truly evil types wouldn't satisfy this trait' :)
Uh how do I reset an std::stringstream?
stream.clear(); stream.str({}); not enough?
 
I hope so.
Of course, that doesn't reset formatting flags.
 
9:23 AM
Speaking of, I'm probably doing the inserting wrong. Hence the extraction errors later on.
 
@LucDanton literal operators? Is that something new in C++11?
 
@ManofOneWay Yes.
stream << 1 << 2; stream >> i >> j; won't work, correct?
Yep, whitespace separators fix my problem.
 
@LucDanton What are you coding?
 
Wrote an extract<T>(some_stream); helper
I realised that with delegating constructors one can use T(std::istream& is): T(extract<T>(is)) {} to have a streamable type that is not default constructible.
Well no, you can do that just as well with one assignment.
So I guess I just made a helper.
 
:)
pigslookfunny wrote:
Surely she would have run out of fuel before then.


Right, because obviously there's never been a way to put more fuel into an airplane.

(someone should come up with that... they could re-use the planes, probably save a lot of money that way)
 
9:33 AM
On the other hand that's not the most economical way to go to space!
 
Yeah, apparently someone forgot that reuse requires maintenance, and that incurs costs.
 
> /usr/local/include/boost/exception/info.hpp:100: virtual boost::shared_ptr<boost::exception_detail::error_info_base> boost::exception_detail::error_info_container_impl::get(const boost::exception_detail::type_info_&) const: Assertion `::boost::exception_detail::type_info_(typeid(*p)).type_==ti.type_' failed.
Compiler playing tricks on me :(
 
morning y'all
 
sbi
9:51 AM
> Meta is a madhouse, and my nose is rubbed in it every time I poke it in here. - meta.stackoverflow.com/questions/105899/where-did-my-rep-go/…
 
@sbi In fact, I bet it wouldn't have been an issue if you had written "f-ed up".
Which is silly.
 
sbi
@RMartinhoFernandes Actually, I didn't write "f-ed up", I wrote "fucked up". And, yes, that is so silly, it is not even funny anymore.
 
'f-ed up' is 'effed up'. Or at least you can claim it is.
No onebox :(
 
Wikipedia oneboxing sucks anyway.
 
sbi
I wonder where I should now paste my deleted plead to not to delete questions.
 
9:56 AM
Even sillier, if you make a typo when writing that word, it's probably acceptable, even if you actually meant to write it without self-censorhip.
 
Uh is there an alternative to ptype for gdb to print types?
Well, more specifically, ptype prints the defintion of the type of the expression. I only want the type.
 
Google says whatis.
 
I would have expected help ptype to be informative but no dice.
@CatPlusPlus Thank you. Now I get a typedef to a map instead of knowing what kind of map it is >.> To the source!
 
Use the Source, Luc.
 
Can't make Boost.Exception work with -fvisibility=hidden :(
 
10:12 AM
hiya fellas
Seriously, does no one reply "hi" back whenever someone says "hi" ...like 100th time this has happened..just 2bytes dudes lol
 
Nope.
 
Rude :'(
What does 97 & 0xff do? :S
I know it ANDS 97 & 255...but
But what's the point of &ing bytes?
 
97 is an int literal, someone needs a byte.
 
?
returns an integer value
but to use it you have to AND it by 0xFF
 
It will cut off any bits that wouldn't fit in a byte.
 
10:24 AM
so it like scales it ?
 
If you have 32 bits, and you'll AND with 8 bits all set to 1, you'll never have more than 8 bits as a result.
Lol, yesterday someone downvoted my singleton-related answers in .
 
All of them?
 
Ok..but how is that it doesn't return like the 255 as the result
 
0x61 & 0xFF = 0x61.
 
@RMartinhoFernandes There were only two.
 
10:29 AM
so it is like doing a modulus then?
 
Why would it return 255?
 
In this particular case, yes, it's equivalent to doing % 256. But in general no, bitwise AND is not like modulus.
 
When do you know to use & then ? :S
This stuff is confusing..i learned it was to clear a bit...now it is to cut of bits
sigh
 
No, &= to clear a bit.
 
Er, you use it when it is what you need. Yeah, I know that is a silly answer.
@LewsTherin clearing a bit is a special case of cutting off bits.
 
10:36 AM
I will never get used to this stuff
(KEY_X << 8 that is shifting to the left 8 bits?
How do you know by how many amount to shift :S
 
Because you know what you want to achieve...
That's like saying A * 8 multiplies by 8, but asking how one knows by how much to multiply by.
because you need to compute A * 8.
 
yeah
how do you get italics working ?
 
Use splats. *like this*
 
nice
ah bloody ashes...this binary stuff making me feel dizzy
 
7
Q: There is a bug where you can get free reputation

IzzyThis really is minor, and inconsequential, but it's a bug nonetheless. Anyway, here it is. Find a new user with 1 rep that has asked a question. Downvote question. Remove downvote. Voilà, 3 rep. See this example, daniel [sic] Or this example, Jim

 
10:43 AM
@LucDanton &= with ~.
 
Set, reset, unset what's the difference !?
 
Fuckin' bits, how do they work.
 
From now on I'm awarding 12 rep to any new user that I find with a decently crafted question.
 
@CatPlusPlus wish I bloody knew
 
@CatPlusPlus It's easy. Either they work, or they don't.
 
10:47 AM
If it doesn't work, then it ain't easy
Wtf...you can have a list of references
but can't have array of references? bullshit
 
References are not objects.
You can only have arrays of objects.
 
so you can have a list of anything then
If references are not objects..what on earth are they
I mean you can have an arrays of pointers, and pointers are not objects
 
But pointers are objects.
 
you just lost me...pointers are values..they are ints
well hex
numbers ..whatever but are they are values...
 
But ints are objects too!
yesterday, by FredOverflow
Hint: If you come to C++ from a different language, forget everything you know about the terms "object", "reference" and "initialization".
And pointers are not necessarily ints. They're pointers, just pointers.
In C++, an object is a region of storage.
 
10:58 AM
ok so a pointer is an object because it stores an address
 
'Object' in C++ terminology is inherited from C terminology and is unrelated to the OOP meaning of the term.
 
@RMartinhoFernandes but if a reference references a variable which has storage location...it should be valid then
 
@LewsTherin The property is not transitive.
 
11:04 AM
> It is unspecified whether or not a reference requires storage.
 
Bloody ashes..so how come we can have a list of references
 
@LewsTherin What kind of list?
 
list<int &>variable
 
std::list I presume.
I'm checking the requirements.
 
yeah
 
11:07 AM
Well it uses an allocator and IIRC this alone excludes references.
 
?
Don't understand sorry
 
You cannot have pointers to references so yeah, should not be allowed.
 
@LewsTherin Some of the allocator requirements are incompatible with references.
 
Right..so if I use list<int&> I should expect undefined behavior
 
The compiler will likely complain when you use some functionality.
Obtaining the value from an iterator would not compile, I guess.
 
11:12 AM
Excellent...need to wrap my head around this
 
Right, see how g++ freaks out: ideone.com/AeRxJ
> error: forming pointer to reference type 'int&'
 
is switch (mystr[0]) case '+': .... case '-' : .... better than if (mystr[0]) == '+') {} else if (mystr[0]) == '-') {} ? In terms of efficiency and readability?
I am writing my own parser.
And since I would need like a million of these.
So it's an important decision
 
@Lewis: You can put references in a container they are not objects.
A reference is an alias.
 
@IntermediateHacker If your compiler produces code with large differences for those two, throw it away.
 
That is another name for an existing object.
 
11:15 AM
Do you mean can or can't?
 
Can't
 
@RMartinhoFernandes And what about readability?
 
It is a compilation errror.
 
Fair enough..
Will have to make a CC then
 
@IntermediateHacker I don't mind either of them.
@LewsTherin What's a CC?
 
11:17 AM
You can always use a boost::ref they are real objects that pretend to be references.
 
Copy Constructor...
It should more efficient I hope
Ah crap, I can't even use it if I wanted...bloody polymorphism
 
Store pointers.
Smart pointers preferably.
 
I haven't found a good tutorial on that unfortunately
 
Only use smart pointers if there is an ownership question.
How is Rand?
 
i.e. if you wanted references in the first place then raw pointers work for the same purposes.
 
11:20 AM
@TuxD I fear Rand might be like me :( Let the Light help us ha ha :) Finally
 
The problem with pointers is. They are pointers. They have no ownership symantics.
So it introduces a whole bunch of other problems'
 
What do you mean by ownership
 
The owner of a pointer is responsable for deleting it.
 
Who is responsible for cleaning it up?
 
Shared pointers share ownership etc
Boost::ref is good in this context.
 
11:22 AM
Oh yeah right
 
It is an object but acts like a reference.
 
Boost isn't C++ standard is it?
 
You can also put them in containers.
As good as.
 
@LewsTherin It's as close as it gets. In fact, lots of the new stuff in C++11 comes straight from Boost.
 
Anything in boost is basically being considered for the next version of the standard.
 
11:23 AM
C++11 great...is it completely different?
 
@LewsTherin It has a ton of new stuff.
But most old code is still valid, except for a few corner cases.
 
Lets dance with Jack of the Shadow.
 
Damn, so I'll have to relearn...bloody brilliant
Jak O' Shadows :O
 
Not relearn. Learn some more.
Your current knowledge is not obsolete.
 
I speak the Queens tounge. Not contractions.
 
11:25 AM
9 mins ago, by Tux-D
Can't
:P
 
Learn some more..lol I'm having trouble learning the current one
 
@RMartinhoFernandes Yep.
 
@TuxD what do you think of ToM?
Is it bad if I do *it it being an iterator if I don't want to use shared_ptr
 
Are we taking WOT
 
What does shared_ptr have to do with *it?
 
11:27 AM
@TuxD yeah..you started it xD
Sorry I meant delete *it
 
It may not look bad but sometime down the line it will blow up.
 
You use *it = NULL;
If it was a shared_ptr (iterator)
 
You shouldn't need to use delete unless your program is doing special stuff.
 
It requires a bitmap which is a pointer to some struct
Since I store the objects as pointers in a vector..I need to delete the objects
when I erase the pointer
 
Use smart pointers for ownership.
 
11:31 AM
Bloody hell I guess I have to read it anyways
it is weird...you can't remove an object using the index?
 
What container would that be?
std::list again?
 
Vector
std::vector
 
some_vector.erase(some_vector.begin() + index);
 
You can use an iterator. But mind you vectors are not designed for removal at random indices.
 
I would have to move it to the end then
begin doesn't return an int...
 
11:34 AM
@LucDanton Use a boost::ptr_vector it takes ownership of pointers but allows you to access them like normal objects.
 
Why should it?
 
ok it returns a pointer+offSet
 
@LewsTherin begin() returns an iterator.
 
which is kinda like a pointer yeah ?
 
By adding an int to it, it advances the iterator by that number.
 
11:35 AM
@LewsTherin No, a pointer is a kind of iterator :)
 
NO a pointer is like an iterator. But an iterator is not nesacerilly like a pointer.
 
Oh man, lol...
so indices is a kind of iterator as well
 
Iterators an d pointers have the same interface though.
 
@LewsTherin No, because you cannot obtain an element from the index alone. You also need the container.
It's true however that you could build an iterator from a (reference to container, numerical index) pair.
 
Right...
 
11:37 AM
3
Q: Do all STL containers returns by reference?

Mr.AnubisI am learning STL these days and I was wondering if STL containers return by reference? for e.g: vector.first(); map[key]; *vector.begin(); or any possible return that ends with element (or value type) of container another e.g: std::vector<int> elements; elements.push_back(20); elemen...

i am still not satisfied by answers , and started the bounty of 50
 
@MrAnubis glad to see you are alive and kicking
 
my life is back on track for some days i think :)
 
xD, nice one :P
Btw, is it better to use #pragma once or include guards
 
#pragma once is not standard, include guards are.
I believe #pragma once is supported on pretty much every decent compiler out there, though.
I use include guards.
 
OK then I used that but removed it..will put it back
Why is using namespace std bad? compared to using std::cout and so on?
I find it rather easy and quick
 
11:48 AM
@LewsTherin it's only unconditionally bad at global scope in a header file (context does matter)
 
Because code is read at least as much as it is written (and in practice it's read a whole lot, but hardly written more than once). Explicitly qualified names are easy to read, and it takes barely longer to type. Also what Alf said.
 
Doing that like @Alf says is basically going against the whole point of namespaces.
 
Oh because there could be a conflict
 
@MrAnubis: maybe try some good food, like, chicken in red curry?
 
11:50 AM
That looks good....just remove the leaves
 
Carnivore?
 
Yeah
Dislike vegetables or anything green
 
i suspect it's not veggies, but rather a herb, good old "basil" (not from fawlty towers),
Basil, or Sweet Basil, is a common name for the culinary herb Ocimum basilicum (pronounced or, in the US, ), of the family Lamiaceae (mints), sometimes known as Saint Joseph's Wort in some English-speaking countries. Basil, originally from India, is best known as a culinary herb prominently featured in Italian cuisine, and also plays a major role in the Northeast Asian cuisine of Taiwan and the Southeast Asian cuisines of Thailand, Vietnam, Cambodia, and Laos. Depending on the species and cultivar, the leaves may taste somewhat like anise, with a strong, pungent, often sweet smell. T...
 
Oh yeah..that's grand then
 
Here's something from Portuguese cuisine:
 
11:56 AM
Looks awesome what are those yellows? Pineapples?
 
That's good...is that broccoli I see there?
 
No, it's cabbage.
Potatoes, carrots, cabbage, beef, pork, and chicken (though I can't find all these kinds of meat in the picture)
A mish-mash of stuff.
 
Yeah, remove that too... I don't understand..how do people eat cooked carrots?
That must be dear..5/6
 
You'd rather eat them raw?
 
11:59 AM
Of course...
Wash it and eat them that way..
Cooking removes the juice
 

« first day (331 days earlier)      last day (4607 days later) »