« first day (414 days earlier)      last day (4552 days later) » 

7:00 PM
-2
A: return a typedef type when using separate compilation

shog9I see that you are a new user to Stack Overflow, I suggest you to stay away and use forums and other traditional mediums instead of this decadent and vanity-driven “community”. Your questions and answers will only make the business of the lazy admins to grow and your work to contribute will not m...

 
32
A: Unfair and abusive suspension because of asking for help

Shog9This has dragged on for a couple months now... We try to keep these matters private to avoid public embarrassment for folks who've made an honest mistake... But since you've decided to put it before the public, let's put all the cards on the table: Sept. 12, 2011: A moderator contacts you abou...

 
?? who are you guys referring to?
 
@johnathon Uh, I think that last posted answer refers to the guy to posted the question :)
 
why does meta look so drab
 
7:15 PM
@robjb yea, lots of reading about people fighting on here.. what i think it all boils down to, but that sosb dude i believe it was is a real jerk
 
@SethCarnegie Because everyone there is drab :(
 
Well did the people there make it drab or did the drabness of the site make the people drab
It's a drabness-and-the-egg problem
 
I know what "drab" means.
 
Is this new syntax for templates or something
template<typename T, bool[std::is_base_of<T_base, T>::value] = nullptr>
the [] part
 
That's declaring an array.
 
7:19 PM
How do you name the digits after the dot? Like in 1337.45, there's two of them, namely 4 and 5.
 
SFINAE.
@FredOverflow Fractional.
 
you can declare arrays in template whatever-they're-called's
 
@FredOverflow Since the point is floating, let's call them "submarines".
 
wow never knew that
 
I've heard it called the number's decimal part.
 
7:20 PM
I suspect nobody except litb knows about that.
 
0
A: How to find ARM processor version on android device?

Android_useri am not a software developer ... Please tell my how to use this command ...

 
@RMartinhoFernandes Is there a special name for the non-fractional digits?
 
Digits.
 
@FredOverflow Boats.
No wait, submarines are boats too.
Ships?
-2
A: How can I draw Anaglyph effects like this image

relativI finally find real solution make 3D like that picture, I want to explain how I did it but some of people make me selfish with they are comments! I can make 3D now total 5 day later. You guys can find your solutions by yourself And I have not spend over millions dollar like as samsung, anyway...

What is this? Is total asshole day today?
 
Those images make my head hurt.
 
7:31 PM
and he didn't even spend over millions dollar
 
@FredOverflow "integral" and "fractional" part.
 
0
A: Ceil function: how can we implement it outselves

FredOverflowYou can take apart the ingredients of an IEEE754 floating point number and implement the logic yourself: #include <cstring> float my_ceil(float f) { unsigned input; memcpy(&input, &f, 4); int exponent = ((input >> 23) & 255) - 127; if (exponent < 0) ret...

@KerrekSB thanks, I already figured :)
 
Can't you use frexp or something?
Also, please use hex for bitmasks!
I can't read decimal. :P
 
Come on, everybody knows 255 ;) Also, it's one char shorter than 0xff.
 
LOL
 
7:37 PM
You can ++ floats?
 
@Seth did ya get your input loop going?
 
@RMartinhoFernandes yup :)
brainfart, everything's fine with the ++f approach as far as I can tell
 
@FredOverflow: Is a true bool guaranteed to convert to 1 as an integer?
 
7:39 PM
I just noticed that the title reads "outselves". I'm an introvert. I guess that explains why I didn't answer.
 
@sbi That's great!
 
sbi
@RMartinhoFernandes If you like that, you will like this, too: methodnamer.com
 
flipLoggerSingleton.
 
> So no, x - '0' does not depend on the ASCII table, it only depends on the C++ standard, which I think is acceptable.
@RMartinhoFernandes lol, is there anything else to depend on? :)
 
7:41 PM
:)
 
@johnathon input loop?
 
@Seth your questions you asked, i answered the last one you asked i belive
 
@LewsTherin Hi.
@FredOverflow Some people depend only on the C standard.
 
@RMartinhoFernandes Hello! Been a while :)
 
7:44 PM
@RMartinhoFernandes I see... so does the C standard not guarantee consecutive digits?
 
It does too.
 
@johnathon I don't see it, my last question was about move constructors
I have a short memory
 
do you have a link to the question
 
@Fred Oli made a good suggestion to improve your answer.
 
7:46 PM
isNonForNecessaryToNativeCallableShutdown
 
@RMartinhoFernandes Have you seen my rebuttal?
 
@Seth nvmnd Sean not seth :))
 
@johnathon haha
 
<needs more coffee
 
7:48 PM
coffee is a state of mind
 
Build systems are annoying me.
 
@FredOverflow Hmm. Truncation?
 
@RMartinhoFernandes please elaborate
 
"round the number down by masking out the fractional bits"
A cast to int does that, no?
 
@Seth yes, and i dident sleep well last night, so therefore i need more than usual to function properly
 
7:50 PM
Though it involves overflows and shit.
Oh nevermind.
Forget what I said.
 
Hm, my_ceil returns 0.0f for negative inputs, but ceil returns -0.0f. That is easily fixed, but somehow I have an aversion towards -0.0f :)
@RMartinhoFernandes No, casting the mantissa (as a float) to int would always result in a mantissa of 0. Not quite what we want :)
 
can we get a delete vote here
-5
A: Program crashes when freeing pointer to array, why?

nobodyI see that you are a new user to Stack Overflow, I suggest you to stay away and use forums and other traditional websites/media (thanks for the correction Tomalak) instead of this decadent and vanity-driven “community”. Your questions and answers will only make the business of the lazy admins to ...

 
@Mysticial Already done.
@FredOverflow Yeah, I came to that conclusion afterwards.
 
The ideology surrounding why 0 should be able to be negative i can only speculate at trying to represent some infintly small number that just happens to be on the negative side of zero .. but , honestly, can someone point out a real world case where this is used?
 
Political correctness.
 
7:55 PM
> I suggest you to stay away and use forums and other traditional websites/media (thanks for the correction Tomalak) instead of this decadent and vanity-driven “community”. Your questions and answers will only make the business of the lazy admins to grow and your work to contribute will not matter at all when one retarded mod or admin picks on you and starts censoring or suspending your account for no reason.
 
If 1 can be negative, 0 needs that right too.
 
@FredOverflow He's been posting that around for the past hour or so.
 
@johnathon It's just in the format I guess.
 
I asked mods to ban by IP, but maybe only employees can do that.
 
7:56 PM
Is -0.0 < +0.0? Doesn't seem so.
 
@R. Martinho wouldet do much good , theres always proxies
 
17 mins ago, by sbi
http://classnamer.com/
LOL
:P
 
@johnathon That needs more resolve.
Sure, this may be the kind of guy that would go to that trouble, but it could also be a guy that would give up at that point.
 
R. Martinho if dude's got enough resolve to say that in the first place, he's got enough resolve to stick a proxy in his browser
 
It's a game! "Find SOSB post and get free flag weight."
 
7:59 PM
ExecutableByteConcatenator :)
 
@R. Martinho But, theres always the off chance that hes not technologicaly adept enough to do that, but i somehow highly doubt thats the case
 
@CatPlusPlus Use the 10k tools, silly.
 
OptimizedLolcatIterator :)
 
That's cheating.
 
ErrorCorrectingMetadataIterator :)
 
7:59 PM
Besides, I'm too lazy anyway.
 
@johnathon In the early days there was a kid from Australia spamming the site in a similar manner. He gave up after an IP ban.
 
@R. Martinho you said a few keywords though that have great importance ... kid. .. austrialia ...
@R. Martinho and early days
 
I said kid because, well, you have to be a kid to do this.
Even if you're actually 40.
 
lol
i .. need.. a project :|
it is sunday afterall
 
Write me a non-annoying build system.
 
8:06 PM
Which build system are you currently using?
 
An annoying one!
 
They're all fucking annoying.
 
lol , that much is obvious
 
That doesn't narrow it down much.
@CatPlusPlus I thought you liked SCons.
 
It's the least annoying one by far, but still.
 
8:07 PM
Once upon a time there was a build system named "boobs".
It stood for "boo build system". But then the authors decided to change the name :(
It's abandoned now.
Hey, this is going to take forever to get that gold badge. I'm getting less than 1 kilo of flag weight per flag. :(
 
there. Took my enum and got rid of the leading underscore identifiers in it .. project done!
 
sbi
This needs three close votes.
 
@R. Martinho: It took me ~650 flags to get there. I had one declined at ~730 which set me back two days.
 
@Cat Plus Plus I honnestly have the slightest idea bout build systems, so i wouldent exactly be the best one to ask to impliment a non annoying one
 
@Mysticial Damn, I only have 100.
Also, people please don't use spaces or periods when @notifying. That doesn't work here.
 
8:18 PM
The one I had declined was stupid. I flagged it within the first 5 min. of being posted. And then it got edited into an actual answer - with no record. Hence declined.
 
Ah
 
ah, good to know
 
sbi
@RMartinhoFernandes I'm trying to think of a build system name that abbreviates to C.U.N.T. or something like that, but I fail.
@RMartinhoFernandes Which one would that be?
 
Concurrent Unified Native Translation Build system
 
@sbi Marshal.
 
8:19 PM
there's no runtime ratio type in c++11, is there?
 
Xeo
@sbi 1 left
 
sbi
@Xeo Thx.
 
man. seems kinda obvious, while they're at it. :-S
 
sbi
@RMartinhoFernandes Oh. is that new?
 
8:20 PM
@sbi Might be new to you, but it's been there for a few months now.
 
sbi
@RMartinhoFernandes Ah. Well, in general, I don't pay much attention to badges.
 
Around the time flag weight starting being shown in the profile.
 
anyone knows the reason why there's compile-time ratio and no runtime ratio?
 
@sbi I want all the badges!
 
sbi
@RMartinhoFernandes Why would you want such a thing?
 
8:22 PM
Shiny.
 
:)
 
Xeo
It looks nicer on the account plate
 
I'm a MAN you are MEN together we are MEAN
HAHA
 
and yeah...flag weight gains get really low the closer you get to 750
 
sbi
@RMartinhoFernandes Aren't there a few one would rather not have?
 
8:23 PM
But since Marshal will take forever, I'll probably turn to gold C++ for my tenth gold one.
 
i soon get gold C++11
 
@sbi Yes, and I don't want those.
 
i only need more answers :(
 
sbi
2 mins ago, by R. Martinho Fernandes
@sbi I want all the badges!
@JohannesSchaublitb You need answers? I thought you were handing them out?!
 
Ok, that was a bit of hyperbole.
I can't have them all anyway.
 
sbi
8:25 PM
@RMartinhoFernandes Yeah, I want to see you getting this one.
 
sbi
@RMartinhoFernandes :-/
 
the answers i create are for myself
because I need them
without the answers I would be a poor unknown guy. but with the answers i'm teh SO clown
 
Xeo
26 upvotes left, eh?
 
@JohannesSchaublitb No, that's Jon Skeet.
 
Xeo
8:28 PM
Oh, @Johannes, mind looking at this?
 
@RMartinhoFernandes no im teh clown
no way
the spec does not reuire the "undefined ref" diagnostics
those are NDR
so they are effectively UB
 
@JohannesSchaublitb Post a clown-ish picture of you and I'll agree.
 
R. Martinho lost in space?
 
8:34 PM
@sbi Ok, you have a point there.
 
Xeo
@JohannesSchaublitb Sure, but the int version of check_error should be brought into the enclosing scope with the instantiation of foo<int> and as such not cause a linking failure, no?
 
sbi
@RMartinhoFernandes Today is a robot day. You keep being faster than I am.
 
I even embiggened it for you :P
 
@Xeo your expected error linker messages are what I expect too
i.e "undef ref to check_error<int> and check_error<char>"
or i misunderstand your messages
what are you expecting?
 
sbi
8:37 PM
For some reason, TATB keep closing this. I have already posted a much upvoted comment explaining that it's dumb to do so, I had also flagged it to a mod who agreed that it should stay open, yet some idiots keep deleting it — and of course do not provide any rationale. It needs, I think, two more undelete votes. Anyone?
 
Xeo
@JohannesSchaublitb Uh, no, I expected only "undefined ref to check_error<char>" since I instantiated foo<int>, which should make the void check_error<int>(foo<int>*, int) version available and as such not cause an undefined reference
 
@Xeo but you call check_error<int>(void*, long)
 
sbi
And did I mention this one needs (one more) close vote(s)?
 
@Xeo so since it is not defined you get linker error
 
Xeo
@JohannesSchaublitb Why would I call that? The pointer conversion is equal for both, I understand that, but literal 0 is int and as such should match check_error<int>(foo<int>*, int). Atleast that's what I thought
 
8:40 PM
@Xeo the friend function template is not found by name lookup at all
so it cannot be called
 
Xeo
It's.. not? D: damn it. But why do two compilers find it?
 
because they suck
 
Xeo
:/
 
sbi
Thanks @Cat & @RMartinho!
 
what compilers find it?
 
Xeo
8:42 PM
g++ 4.5.1 (ideone version) and MSVC
I'm currently checking out the GCC source to look if the output is the same with 4.7
 
@Xeo I can have a build from 23/11 ready. I can try it if you link me to the code.
 
aww g++ and msvc suck hard
 
@Xeo Same as in ideone.
Only one error.
 
Xeo
hm
Damn, I want that to work. linktime error > runtime error
 
8:46 PM
lulz
 
@Johannes which compiler do you use?
 
Xeo
Better even a compile error, but I don't know how I'd get that to work
 
i'm using my head. THX
 
GCC 5.0.
 
Xeo
@Johannes, any idea on how to achieve what I'm after?
 
8:47 PM
> Most people come to StackOverflow to get answers, not to become better programmers. Sad, but true. – Oded 1 hour ago
 
Xeo
@RMartinhoFernandes Sadly, yes..
 
I came to SO for knowledge, I stayed for the points.
 
i stayed for all the gold
now im SO rich
3
 
SO is neat. I've learned more about C++ during that last year of increased SO activity than ever before.
 
Xeo
++
granted, I only learned C++ one year before I came to SO :D
 
8:50 PM
@Xeo not sure why you call it with 0, 0
if you call it with (foo<int>*)0, 0 it would work fine
 
Xeo
@JohannesSchaublitb What else should I call it with? Wouldn't static_cast<foo<int>*>(0) instantiate foo<int> and make the friend function available?
 
@Xeo I only learned C++ once I came to SO. More precisely, to this chat room.
 
@Xeo since you apparently already prevented to call it with SFINAE why would it hurt?
 
Xeo
hm
Woot, it works.
Shall I post it as a question and you answer? More upvotes for you :P
 
lol
you can ask and answer yourself
(TRICK OF LITB!)
 
Xeo
8:54 PM
lol
But now I'm kinda wondering why (foo<char>*)0 doesn't instantiate foo<char>
 
cpx
hm, i remember i named a .cpp file once 'litb_trick' lol
 
Oh, neat, glibc update in the queue.
That's what you get when you don't update server for 2 weeks.
 
Oh, there was a Smalltak fundamentalist here today. I'm glad I missed it.
 
Where, where?
 
9:07 PM
4 hours ago, by Kamil Tomšík
@FredOverflow overloading is usually code smell :-)
4 hours ago, by Kamil Tomšík
@FredOverflow but sometimes its just great, you should try smalltalk if you haven't already. btw: overloading does this because it favors static lookup over runtime lookup which is point of polymorphism. and no, point of visitor is really about only nodes knowing their type and invoking proper methods - in theory you could have super-node invoking all of them (which is not possible with overloading)
Oh wait, it's a PHP/Java programmer.
 
I tried to use Smalltalk few times, and to this day I have no idea how to start.
 
Does anyone know of a binary stream-style reader class? ifstream has let me down horribly. :c
 
Why?
Did you use the unformatted input facilities?
 
I am now. I rather wanted to read formatted binary though.
 
@LexiR, boost.serialization or other serialization framework
 
Xeo
9:16 PM
18
A: C++ ~ 1M look-ups in unordered_map with string key works much slower than .NET code

XeoVisual Studio 2010 uses a performant hash function for std::string, rather than an accurate one. Basically, if the key string is larger than 10 characters, the hash function stops using every character for the hash, and has a stride greater than 1. size_t operator()(const _Kty& _Keyval) cons...

18 upvotes.. wtf?!
 
@Xeo is it wrong answer? I voted for it
 
Xeo
No, but I wondered why it got so many upvotes, when it's basically just a copy+paste from MSVC's implementation
 
oh, it's yours
 
Xeo
9:18 PM
lol
 
lol
 
people like press +1 ...
 
@Xeo I can down vote if you want
 
Xeo
I love that. Sometimes I have days where I try hard to reach the cap, and sometimes I could reach the cap twice or more.. oh well
 
blah
 
9:39 PM
evening,
 
evening tony
 
This is getting weird:
 
Xeo
@JohannesSchaublitb I just noticed something interesting. After changing the code to template<class T> void check_error(...); and removing the int param from the friend version, both MSVC and g++ 4.5.1 compile successfully, while clang and also (!!) g++ 4.4.5 reject it
 
0
A: How to pass a shared_ptr to a mutable object as a parameter?

muntooAn example to what @Xeo said: void foo(const shared_ptr<bar> &p) { p.reset(); // ref_count == 0; memory is freed. } shared_ptr<bar> p(new bar); // ref_count == 1 foo(p); (@Xeo If you want, you can integrate this into your post and I will delete this answer.)

 
is there a way to get the stuff printed on the console redirected to a file?
 
Xeo
9:43 PM
@muntoo I thought you wanted to call reset outside of the function :)
But no, that in general is not what I meant, now that I think about it
 
@Xeo Doesn't that defeat the purpose of your answer?
 
Xeo
@TonyTheLion When you're in the console?
Just redirect: foo.exe > blah.txt
 
@TonyTheLion you can set new stdout in CRT
 
Xeo
or if you want to append: foo.exe >> blah.txt
 
@Xeo yea, some function call i make in my code writes to cout, and I want to redirect from cout to file
 
Xeo
9:45 PM
inside the program, just swap the streambuf of cout and a fstream
 
Oh, there's a C++ way of doing it.
 
@Xeo how do you do that?
 
std::cout.rdbuf(some_file.rdbuf());.
 
Xeo
std::fstream fout("blah.txt");
auto oldbuf = std::cout.rdbuf(fout.rdbuf());
std::cout << "this goes into blah.txt\n";
std::cout.rdbuf(oldbuf);
std::cout << "this goes back into the console\n";
The cool thing is, the streambufs actually do all the work in the iostream hierarchy
<ping />
hm
 
what's the type of oldbuf
not using VC2010
 
Xeo
9:48 PM
std::streambuf*
 
It's decltype(oldbuf), obviously.
decltype(oldbuf) oldbuf;
 
Xeo
lol
no, it's decltype(std::cout.rdbuf())
 
doesn't work
stuff is still written to my console
 
"Hey, I never ever release memory, and then my code throws std::bad_alloc. What's wrong?"
 
Xeo
oO
 
9:51 PM
0
Q: "std::bad_alloc": am I using too much memory?

bbarreThe message: terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc I looked at the gdb backtrace and this is the lowest level method in there that I implemented myself: /* * get an array of vec3s, which will be used for rendering the image */ vec3 *March...

 
@Xeo <ping target="??" />
 
Xeo
@muntoo Cool, that works?
<ping target="muntoo" />
not in chat. :(
 
@Xeo Yeah, you can kill anyone with it. :) Just adjust the target.
 
hmmm, thing is what's being written to my console isn't always from a cout call
it might be from a C printf
 
Xeo
then do freopen
 
9:52 PM
I knew it!
 
Xeo
lowest common denominator :P
 
Of course, all you need to do is use @username and hope the person has Desktop Notifications enabled.
 
Or in hearing range of the ping sounds.
 
so do I pass std::cout or stdout?
to freopen?
 
9:55 PM
stdin.
 
Xeo
Now think again and answer for yourself...
 
my program is a cpp program, but has C stuff in it too
 
Xeo
Seriously Tony, you should know better!
 
@Xeo I haven't a clue, this shit confuses me
:(
 
Xeo
And with that I mean both the C stuff and what to pass to freopen
 
9:56 PM
Wait, someone @ me. I thought I heard sounds coming from my headphones which are about two feet away, and on low volume.
 
Pass the C stuff into the C stuff.
 
Xeo
@muntoo
 
If you do that your apples won't turn into oranges.
 
@Xeo Ah, nevermind, I was just hearing things.
 
Xeo
But what if I want orapples?
 
9:57 PM
@Xeo Then you're hopeless anyway.
 
I think you misunderstood me
 
Xeo
:(
 
Grapple may refer to: Actions * Grappling, techniques, maneuvers, and counters applied to an opponent in order to gain a physical advantage * Grappling (martial art), hybrid combat style which consists of applying submission techniques in order to make the opponent abandon the fight * Grapple tackle, a controversial tackling technique used in rugby league * Submission wrestling (also submission grappling), a formula of competition Technology and Vehicles * Grapple (tool), a hook or claw used to catch or hold something * Grapple skidder, type of heavy vehicle used in a logging operati...
 
I have a console program, that writes to the console with std::cout OR printf, now I just want to dump the whole console text it spits out to a file
 
Then replace the buffer of std::cout and freopen stdout.
 
Xeo
9:58 PM
foo.exe > blah.txt!!
@RMartinhoFernandes Just freopening should do the job
 
12
Q: Redirecting std::cout

StackedCrookedI need a class that redirects one ostream to another ostream during the lifetime of its object. After some tinkering I came up with this: #include <iostream> #include <fstream> class ScopedRedirect { public: ScopedRedirect(std::ostream & inOriginal, std::ostream & inRed...

 
Xeo
since std::cout relies on that I think
 
^ This might help.
 
Xeo
@StackedCrooked We had that already, but that doesn't account for C stuff
 

« first day (414 days earlier)      last day (4552 days later) »