« first day (304 days earlier)      last day (4658 days later) » 

2:02 PM
the problem with clock is not resolution, and the resolution is never as low as 1 sec. the problem is that it has different behavior on *nix and Windows. in Windows it measures real time.
 
Can someone review my clock benchmarker? ideone.com/p8w9v
It says precision is 0.01s.
 
Isn't there a standard way to query this?
 
@RMartinhoFernandes What do you want to query?
 
The precision of the clock.
 
@StackedCrooked what's wrong with just inspecting CLOCKS_PER_SEC
 
2:10 PM
@AlfPSteinbach CLOCKS_PER_SEC is 1000000 on my machine
However, my program outputs 0.01s.
So you can't really trust CLOCKS_PER_SEC.
 
have you thought about this, that it might be opposite, that you can't really trust your program?
 
No. You can't trust your loop.
 
after all, your program relies on CLOCKS_PER_SEC to calculate its result
 
@AlfPSteinbach I asked for review, so I have thought about it.
 
What happens if your process gets preempted before you test the loop condition?
It could yield 10 minutes.
 
2:14 PM
@RMartinhoFernandes with a conforming implementation of clock it measures process time
 
Oh.
Ok, what about the time it takes to (possibly) call the functions, perform an assignment, and do a comparison? That will skew the results.
 
That's all true, but I don't understand why it keeps outputting 0.01 which is a very low resolution.
 
Well, clock() sucks?
 
yeah, you really need a platform-specific wrapper on that
 
2:30 PM
Apparently clock() calls increment per 10000 ticks. So inspecting CLOCKS_PER_SEC isn't the way to find out the accuracy of clock.
 
3:07 PM
@jalf you are probably confusing with time(0)
 
@StackedCrooked Wait, you mean that you always get multiples of 10000 as the result of clock()?
 
There are only two things wrong with C++: The initial concept and the implementation. -- Bertrand Meyer
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. -- Bjarne Stroustrup
 
We all know C++ sucks, what's your point?
 
You mean, spam?
 
@RMartinhoFernandes I consider it more productive.
 
3:17 PM
And this is not the first time you do it here, isn't it?
Or is my memory failing me?
 
He is one of those JS kids probably
or worse, he does PHP and JS
 
That's what it says on his profile.
 
WITH TABLES.
 
And yes, he's been here on July 4 with this same ideas.
 
@hexa Don't get PHP into that. @ChristianSciberras What problem do you have with C++? If you don't get pointer, just don't use C++, okay? Don't blame the language on your own faults.
 
3:19 PM
And this will not derail again into a language war today.
 
@NikiC I like PHP actually
 
UGH PHP :(
 
@NikiC Pointer? I eat pointers for breakfast. Except C++ ones.
 
You should try some cereals
 
Hmm, gotta tell @sbi that "explicit read access" thing doesn't really take write access away.
 
3:22 PM
Pointers are quite rare in C++ anyway.
 
And right now, I'm not in the mood to go ask on meta what the hell is that for.
 
@kbok ???
 
Even a blunt instrument is deadly if you wield it properly; C++ is the same. If you learn how to use it properly, you wouldn't hate it as much.
 
@ChristianSciberras C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it.
 
@kbok Rare as in every 6 lines of code, compared to C's 2 lines?
 
3:22 PM
@ChristianSciberras What did you not understand ?
 
@hexa You really like that quote, huh? ;)
 
@RMartinhoFernandes YES! :D
I find that whole email so amusing
 
@ChristianSciberras A C++ code with pointers every 6 lines of code is cruft
 
@hexa Good quote. It's the same with PHP too, actually. Lot's of script kiddies trying to use it are the main reason for it's bad reputation ;)
 
@kbok Just because you make more use of libraries, frameworks and the like doesn't mean it's not there.
 
3:24 PM
@RMartinhoFernandes yes
 
And personally, I don't like a language which requires extensive frameworks in order to do anything productive.
 
@ChristianSciberras I don't see the connection between the use of pointers and libraries
 
Als
hmm
 
@ChristianSciberras Like Javascript?
 
Also, I thought you were doing PHP ?
 
3:25 PM
I don't like it when the framework isn't consistent with his naming convention
 
@hexa Or pretty much about any language where you can do anything productive.
 
Anyway, I've got work to do. This is basically trolling.
 
I flagged for the mods.
 
@kbok file_get_contents(); // see, no extensive framework, nor libraries nor pointers nor exotic string types
 
I hope others follow suit.
 
3:25 PM
@kbok Are you afraid to use the heap? :P
 
Als
@RMartinhoFernandes: About what?
 
@RMartinhoFernandes What line exactly?
 
I think anyone will do.
 
Als
Goddamn I leave you guys for some time and you break everything
 
Flagging for mods is not to remove messages.
 
3:26 PM
@ChadLaGuardia Remember the "blowing your foot with C++" saying?
 
@ChadLaGuardia I don't see your point
 
Though if a message gets enough flags to be removed, its author gets suspended for 30 minutes.
I think that would work too.
 
Als
Oh I got the spam flag, duly marked as accepted too
 
@RMartinhoFernandes If it hurts your eyes so much, I'll start censoring stuff for your convenience >> C++ is so <bleep>
 
[Insert Never Argue With An Idiot Quote Here] -> I'm out.
 
3:28 PM
@ChristianSciberras Don't hate something just because you couldn't learn how to use it.
 
Als
@hexa: Who is the new kid spoiling the party?
 
Whatever, hate it. Stop trolling.
 
@Als JavaScriptKiddo
 
@RMartinhoFernandes Which message have you flagged ? I can't see them.
 
@Als He's not new. He's been here before.
@kbok You need 10k+ imaginary points.
 
Als
3:29 PM
@kbok: You need 10k rep to see that
@RMartinhoFernandes: Ah i see, We need to unleash our @TonyTheTiger, on him
talking of rep, I am a little closer to 20k now, what do I get on 20k?
 
Ability to edit all tag wikis, and other stuff.
Not very exciting.
 
Als
@RMartinhoFernandes: Thats BS, thats for grandpas
I was thinking some hotties and stuff like that
 
nothing exciting for 20k at all
 
Like, wine and women ?
 
Als
@kbok: Yup the the two W's
 
3:32 PM
Oh, I've seen this yesterday.
 
Als
what?
 
@Als That's the third W of this room ;)
 
@Als unleash on who
 
> This user has been automatically suspended for posting inappropriate content and cannot chat for 24 minutes.
He's gone for now.
 
oh we had a troll... hmmm
 
3:35 PM
It feels good to have the system work well for once.
 
Als
@TonyTheTiger: Oh you scared him! a lost kid
 
I never troll, I just talk about ***
 
What's so special about three splats?
 
it's a word we never mention... :P
 
Als
Its S*E*X
 
3:36 PM
ohhh that
yea I've heard of it
 
Als
@TonyTheTiger; Now that I said it, you can just blame it on me :P
 
indeed
blame @als
 
The craziest thing is that he used file_get_contents() to praise PHP.
 
Als
@TonyTheTiger: Still You were, are and will be Hugh Hefner of this room
 
Rob
@kbok I literally lol'd at that.
 
3:38 PM
@Als oh damn :(
 
I once had to work with legacy php code. Quite a mess. A meatball if you will.
 
Meat is good.
 
it was not a delicious meatball :(
 
Als
@TonyTheTiger: Now pretend you don't feel happy about it while inside you are beaming with pride
 
3:38 PM
a rotten one?
 
@Rob I started to write something about it, then though "No... He's already a lost soul"
 
@Als meh lulz
 
Rob
Ha. I missed what he managed to say to get people up in a flagging riot. Just obscenity / trolling?
 
I guess this is not a room for lost souls, but what are us lot then?
 
Als
hmm
 
3:40 PM
we're just a sad bunch of C++ geeks
and we have no social existence besides SO Chat
lol
 
@Rob Something in the lines of "I will repeat that until you stop using C++"
 
Als
Whats with people celebrating virtual friendship day on facebook, idiots they filled my inbox with absurd spam
 
assholes
 
@Rob He didn't say anything specially offensive in itself. He just come in trolling/spamming and admitted it.
 
Als
@TonyTheTiger: Yes and they start some weird chains
 
3:41 PM
The flagged message was the admission.
 
Rob
@kbok, @RMartinhoFernandes: lol, I missed his admission of guilt.
 
Als
@RMartinhoFernandes: Who are we exactly talking about, I can't make out who the troll is
 
how stupid to admit that you are trolling when you're doing it
 
Als
Stupid Troll
 
that's one way to get banned
 
3:43 PM
Maybe he was trolling about trolling ?
 
Als
who was it?
 
@Rob Are you this cute robot from Nintendo ?
R.O.B. (Robotic Operating Buddy), released in Japan as the , is an accessory for the Nintendo Entertainment System. It was released in July 1985 in Japan and later that year in North America. It had a short product lifespan, with support for only two games which comprised the "Robot Series"; Gyromite and Stack-Up. R.O.B. was released with the intention of portraying the Nintendo Entertainment System as something novel in order to alleviate retail fears following the video game crash of 1983. R.O.B. was available in the Deluxe Set, a configuration for the console that included, among ...
 
Rob
Wouldn't that be awesome?
I remember those despite them being released a year or two before I was born
Alas, no I am not
 
time to get banned, ah
 
3:46 PM
They cost a huge pile of money now
 
i'll repost the full Lenna pic
:-)
 
I heard around 500$ no less
 
It's not like you can't easily find it on Google.
 
well it's accessible from Wikipedia!
heh
 
3:46 PM
Or that.
 
user image
6
i'm now waiting to be bunned...
i need moar tee
 
@kbok R.O.B is worth less than 100 USD
 
@RMartinhoFernandes Oh hello there.
 
Als
@AlfPSteinbach: Oh la la ...psst psst @TonyTheTiger, just pick it up I need that
 
oh, sorry, it got very quiet here
 
3:59 PM
templates suck :(
 
@LucDanton Hi.
Templates are awesome.
 
not being able to decltype() member variables is an incredible pain
 
you can't?
 
and perfect forwarding is another incredible pain once you start trying to make objects with it
nope
class x { int y; auto func() -> decltype(y + y) { return y + y; } }; compiler error
I thought it was a bug in MSVC but I saw Standard wording saying that's how it's supposed to be
 
@RMartinhoFernandes I have written a nice utility recently and I'm not too sure about the interface. I've asked the chat already but I'd like your opinion on it.
 
4:02 PM
Yeah, that's sucky. You can't use this on decltype.
 
and then I've got another problem, which is namely that I need to perfect forward and keep that chain going through many objects
 
@LucDanton Show me the money, er, interface.
 
but, of course, it's very difficult to actually know what the types are at any given point
 
If f is an overloaded name (either overloaded functions or templates), you can create an overloaded functor from it. The problem is that there is repetition when using it.
 
ah, lenna was flagged
 
Als
4:03 PM
@AlfPSteinbach: Yes that pic got flagged
 
probably someone who doesn't know it's the standard test pic for image processing
 
e.g. make_overload<int(int), int(long)>(f, f); assuming f is overloaded and conform to those function types.
 
...
 
@DeadMG Doesn't std::declval<This_Type>().y help?
 
i like these silly things
 
Als
4:04 PM
@AlfPSteinbach: Don't get banned over that dude
 
not really
I did something similar, except msvc doesn't have declval so I emulated it
but apparently, that's using an incomplete type and is also an error
 
actually it is very important to change this American morals thing
 
I've use this yesterday on GCC.
Except for the member variable part.
 
for example, recently Facebook banned some pictures that Andrew Koenig posted
just to relate it to C++
:-)
 
Just something like decltype(std::declval<This_Type>() / param)
 
4:06 PM
I wish that MSVC would accept that, but it doesn't
 
@LucDanton And you want to DRY up the fs?
 
by the way
what the hell is the deal with iterator tags? My iterator type offers all the ++ and stuff that for_each should need
 
@RMartinhoFernandes Yes, but the only way to do that is with a macro.
 
we should be able to post standard test pics (as I did here), or pics of body-painted women (as Andrew did), without getting banned by silly US morals, like tits are dangerous
in norway woman breast-feed in parliament, it should be so also for US Congress
 
@AlfPSteinbach To be fair, the standard test pic is just Lenna's face.
 
4:07 PM
oh
well, anyway
 
only cause they only had 640x480 resolution
 
@LucDanton That will look so inelegant.
 
@RMartinhoFernandes I've gone through iterations and I believe I can make it look like make_overload</* list function types here */>(BETTER_FIND_A_CLEVER_NAME(overloaded_name));
Which, I think, doesn't look that bad provided I find a clever name for the macro.
 
@DeadMG 512x512, AAMOF.
 
Hmm, how does the macro know how many params there are?
 
4:10 PM
Previous designs were of the kind MAKE_OVERLOAD( (int(int))(int(long)), overloaded_name ) which is sort of eye watering.
 
@JerryCoffin point's the same
 
@RMartinhoFernandes It doesn't, I cheat. The macro pastes a predefined number of times and dummy defaulted parameters pick up the rest.
 
Ah, I suspected that :)
 
ok
0
A: c/c++ Assign values to void variables

DeadMGFirstly, you must cast a to the appropriate pointer type and then de-reference it. Secondly, use a template- that's what they're for. Thirdly, malloc and free is baaaad, OK? Don't. If you think that this is good code, you need serious remedial C++.

this is why I hate "C/C++" so goddamn badly
you visit a question, you see the C++ tag, you give a C++ answer, and it turns out the OP wants C.
 
When I discovered the default parameters trick I moved to with_signatures</* function types go here */>::MAKE_OVERLOAD(overloaded_name);. But a 'scoped' variable seems so awful.
 
4:13 PM
@Luc: what's "default parameters trick"?
 
@Als: Why did you re-tag that question? The OP only tagged C++.
 
Als
@DeadMG: Because there was nothing C++ about it?
 
@LucDanton It does help with naming, but is damn ugly.
 
heh, nice, latex sources for the C++0x draft are online
 
so what? if he's compiling it in a C++ compiler, then he's talking about C++, even if his code is C style
 
4:14 PM
@jalf Linky!
 
@AlfPSteinbach template<typename First, typename... Rest> unspecified make_overload(First&& first, Rest&&... rest, /* repeat First* = 0 here a preset number of times */);
 
and unless you're psychic, then you don't know that he's actually in C
 
Als
@DeadMG: I am not really sure OP was using a C++ compiler the title said c/c++ and nothing more
 
he only tagged C++
 
4:15 PM
now for flooding the internet with near-but-not-quite-accurate copies of the draft :D
 
SFINAE to make sure that First is a function type and hence that First&&/First* doesn't do something stupid.
 
and then he says
 
Als
@DeadMG: He tagged C++. The title said C and the code was C
 
I'm doing a class in c++
how many C classes do you see out there?
 
Als
4:16 PM
@DeadMG: Was it a class?
 
he explicitly states "class in C++", he only tags it "C++", I think it's quite clear he's in "C++"
 
@AlfPSteinbach The macro repeats the name the same number of times as the repetition in the prototype so the call is always matched.
 
Als
Did you see any in OP's code?
 
it's in the question text
you know, that thing that you read when you view the question?
 
Rob
@Collecter, "R.O.B is worth less than 100 USD" -- I'm offended
 
Als
4:16 PM
@DeadMG: And the code does not display any class
 
it's the first six words of the question
"I'm doing a class in C++"
 
Als
@DeadMG: I can read, really
 
@Rob Notice the periods. It was an acronym.
 
Als
@DeadMG: But you cant see there is no class in the code?
 
who cares?
he probably just wrote a short, self-contained example
 
Rob
4:17 PM
@Collecter, I know, it was a joke ;)
 
like we always ask people to do
 
Als
@DeadMG: No you don;t write a c code example to question about a class, not really
 
you do if you don't know the difference
 
@Rob I know, but I decided to counter your joke by being serious.
 
that doesn't make it C
 
Rob
4:18 PM
Haha, well then I guess the joke's on me
 
Als
@DeadMG: You do not know it's C++ because it does not have any C++
 
nor does it have any C-specific features
 
Als
and you might say that all C is C++ but then we wouldn't have any classes eh
 
that specific snippet would probably compile as both
 
Als
it has a system call
 
4:19 PM
oh yeah
by the way, the question is made of the whole question, not just the code sample
if I said, "I'm writing a compiler in C++ to compile C code, here is my C code snippet but my compiler compiles it wrong", do you think that's a C question?
 
"the question is made of the whole question"? That sounds like a tautology
 
no, of course not
 
Als
@DeadMG: First you would argue that the code is C and C++ both now that the code is almost prved C, ou would argue the Q is not just the code
 
the code is not specific
 
Als
@DeadMG: Yeah sigh just it has no C++
 
4:21 PM
How often does return {}; work?
 
He clearly states he's going to put it in a class. That's C++ specific. Then, he states he's going to put it in a class in C++, which is even more specific. And then he only tags C++. I think that he's pretty damn clear about what language he's in
 
Als
@DeadMG: he states he's going to put it in a class was never said in the Q
neither he's going to put it in a class.
 
I'm doing a class in c++
the first six words of the question
I'd say they're pretty damn explicit about what language he's using
 
Als
@DeadMG: But there is no class, so
 
"I'm doing a class in c++" is how it reads now
 
4:23 PM
check the edit history- it always read that
 
Als
@DeadMG: Well that code is still C for me
 
@Als So what? So he posted a snippet in a main? Or maybe he's just testing his concepts before physically putting them in a class?
just because there's no literal class keyword does not mean that there are no classes involved
 
@DeadMG: just did, ur right
 
Als
@DeadMG: system("pause"); malloc free
For me thats C
 
it's also valid C++
so much as I would personally love to destroy such code, it does exist and it will compile on a C++ compiler given appropriate #include and using
and constitutes no evidence whatsoever that he is not in C++
 
Als
4:25 PM
@DeadMG: I would bear that in mind, next time you criticize someone for not using raw pointers or new
 
I never said that such people were using C
 
Als
or the suddenly turned up so called C++ way of doing it
 
despite the fact that they explicitly stated otherwise
merely that they were utterly and hideously wrog
 
Als
@DeadMG: I am afraid this conversation is going no where
 
which is exactly what I said to this guy
that's because you're being utterly irrational
 
Als
4:27 PM
@DeadMG: And I could say the same about you, So why don't you hold to your point and i will hold mine and we shut the fcuk up.
 
You made a typo there.
 
I'm not being irrational and I'm perfectly prepared to hold a rational debate about it
 
Als
I am at the fag end of my day, and I do not want to sweat over some silly stupid pedantry
 
@RMartinhoFernandes lol
 
Als
4:28 PM
@RMartinhoFernandes: I didn't If i said fuck, the @TonyTheTiger, would come along
 
4:44 PM
@Luc I can't really think of a nice name for that macro that isn't just a preposition or something like that. And that's definitely not a good name for a macro.
 
I'm having the same problem.
Well, that and that GCC bug with variadic packs.
 
Hmm, what bug?
 
If there's a variadic pack in the arguments
then that pack ends up with everything in the pack plus what's after it.
 
what's up with the starring of NSFW pics?
 
We're not at work.
 
4:46 PM
Here I have (First&&, Rest&&..., First* = 0, First* = 0); (more First* = 0 but you get the point) as arguments.
There's no deduction going on (it wouldn't be allowed because the pack is not in the final position)
But with a call of make_overload<T, U, V>(t, u, v), Rest... ends up as U, V, First*, First* (modulo perfect forwarding, we don't care here).
 
Cool gpgpu project ideas. Anyone? :)
 
Well, not $500 surely. The guy who told me that must have overpaid :)
 
@bobjink Heating up the flat in winter.
 
@kbok Even that one is over, It is coming from japan first of all.

http://completed.shop.ebay.com/i.html?rt=nc&LH_Complete=1&_nkw=nintendo%20rob&_fln=1&_trksid=p3286.c0.m283
One sold for 50, and in working shape recently
 
4:53 PM
OOOH I NEED IT
 
@kbok You collect games too or something?
 
@Collecter Yeah, I collect NES games
 
@kbok I collect them in general. ;) You get PAL games though dont you?
 
@Collecter Yup. I think I'll buy a famicom when I'll have more money.
 
I collect NES games too, under \emulators\nes.
 
4:55 PM
@hexa Not the same.
@kbok I have no idea if ROB somehow has region lockout built in, you may want to check before you buy one from the us.
(Or disable the lockout chip on your NES, really easy to do).
 
@Collecter I'll see that. I think US and EU versions are the same, but I'm not sure.
 
Ugh, this thing throws, catches and swallows 12 exceptions (of the NullReference and InvalidOperation persuasions) before it gets to the splash screen.
 
Also, I think I have a SECAM version.
 
it works! I am a genius™
 
@kbok SECAM? Wiki says it is some type of old color TV?
 
4:58 PM
@Collecter It was the standard then in france.
 
@kbok Wait so are you saying there are PAL and SECAM versions of the NES, or are you talking about your tv?
 
@DeadMG Lowercase? Have you been demoted or something?
 
@Collecter I think this may be a SECAM version. I'm not too sure
 
lol
 

« first day (304 days earlier)      last day (4658 days later) »