« first day (725 days earlier)      last day (4222 days later) » 

2:01 PM
room topic changed to Lounge<C++>: Celebrating random topic almost-Thursday [c++] [c++11] [c++-faq]
 
TURNIPS!
 
@aj8080 This has nothing to do with being a quick learner. But apparently Alf's explanation did not help you, at all, because it seems like you're just asking the same question you asked before he tried to explain, instead of asking about the part of his explanation that you did not understand
 
@Xeo Two guys got 5 rep from that question.
 
@MartinJames 50 -_-' Who the fuck votes for such an answer ?
 
Xeo
@MartinJames FGITW question, that is also horrendously basic.
Of course people jump at the chance to get free rep from that.
 
2:04 PM
Repwhores be repwhores.
 
Xeo
Well, we can always just nuke the damn thing.
 
Haha, I downvoted and 15 seconds later it's at -7.
 
@CatPlusPlus If it wasn't wearing such a convincing troll-mask, it would have reached -70 before it was closed.
 
Xeo
One nuke vote left.
 
Don't be so hard on the newbie guys -_-' — Anirudh Sudarshan 1 min ago
Burn it.
 
2:07 PM
I really don't get why this gets 7 upvotes. It's near the badge threshold. Seriously, who reads this and thinks "OH THIS IS A GREAT ANSWER, TAKE A BOAT"
 
Guys, the book list. Y U NO LINKS.
 
Haha we stole 100 rep.
I removed answer/comment links from my end, so I just vote.
 
Xeo
@kbok Yeah, that'S what I'm mostly surprised about.
 
is cache line related to block size? I am trying to implement matrix multiplication using that shit
NxN matrix needs to have k x k blocks, 64 bytes cache line size
its in C
 
2:11 PM
Wut.
GTFO.
 
What*
 
@BicB cache line is always 8
 
My caches go up to 11.
 
@CatPlusPlus you have one of them fancy new-age processors...
most of us mortals don't
 
process k x k blocks at a time. (Hint:
k should relate to the cache line size, which for PCs usually is 64 bytes)
 
2:12 PM
Also :frogout:
 
stuck on this shit for a day now
 
@BicB no, it's not 64
it's 8
I already told you
 
Eight what?
 
Our collective heart bleeds for you.
 
eight swallows
 
2:13 PM
What swallows?
 
@LuchianGrigore I got it at 64 when I checked
regardless, how would you calculate the k size?
 
@BicB you checked wrong.
 
I'd try a calculator.
 
@BicB I usually calculate it using 64/8
And it's usually 8
 
@CatPlusPlus you can't squeeze blood out of a stone
 
2:14 PM
Sometimes it's 9, though.
 
sometimes 7... for large enough values of 7
 
Aaand gone.
 
Protip: don't bite the hand that you expect to feed you.
Have you seen his profile bio?
 
have now :)
 
2:17 PM
Master of comedy.
 
wtf
 
0
Q: Convert a string array to a int array

Artem ChernovI'm trying to write a function that takes a string array as a parameter, converts it to a int array, and returns the new array. I thought it would be pretty simple with the use of "Atoi" but apperently you cant use it the way i tried to. here is my code so far. int GameHandler::convertToInt(str...

this isn't C++, is it?
 
Who cares. Posted here, downvote.
 
Great. I hate this. Got a rare CppUnit error/bug/whatever ...
Testing framework for first time -> discover rare bug. -.-
 
cppunit is horrible anyway
 
2:23 PM
It's like... the worstest framework.
 
oh, unit testing
 
If a test fails, the testrunner is not supposed to call terminate(), damn it!
 
I'm trying to use native MS Test (in VC2012) and it's such a crap =(
 
Your two problems are C++ and CppUnit.
 
Just use Catch...
 
2:25 PM
CppUnit violates #8 gist.io/3176551
 
#1 is violated by Poco Loggers, right?
 
Catch is good, but it lacks some useful features, like fixtures
 
@Abyx er, not really
 
@robert Dunno Poco Loggers.
 
they're just not called fixtures, because they're so trivial to make that it'd be silly to give them a name
 
2:26 PM
What's a type with bogus value?
Invalid state ones?
 
FWIW, that list is biased towards ICU, which, IIRC, features violations of all of them.
@CatPlusPlus Yes. ICU's UnicodeString even has a setBogus member to explicitly do this.
Yes, go ahead and laugh.
 
I'd shorten that entire thing to "Dear C++ library writer, I will hate you" really.
2
 
I have to use a piece of software that doesn't work
:(
how do I get anything done
 
2:28 PM
quick and dirty example, definitely won't compile, but hopefully it gets the point across :)
 
@CatPlusPlus +1!
 
Meh, some libraries are neat.
 
for an extremely limited definition of some
 
Also, I liked the slightly-less-bitter cat better.
 
he's doing Android.
there was a slight less bitter cat??
 
2:30 PM
@jalf I don't get it. Fixture is a class with variables and methods, and in Catch it will be local variables and lambdas?
 
I knew it.
 
Semester started, no no-bitter cats available.
 
Kitten - a little bitter cat.
 
har har
 
2:30 PM
@Abyx Just local variables, yeah. A fixture is setup stuff, and in Catch, you just do your setup
 
s/Clang/Catch/
 
fixture classes normally don't have (public) methods, afaik. They're supposed to just set up the environment for the test
and in Catch, you just... write your setup code. Do it outside the section, and it will be executed before each section is tested
 
dafuq is Catch?
 
each section gets a clean slate with just the code from the outer scope(s) executed
 
that's interesting... but I can't inherit fuxtures then
 
2:32 PM
@TonyTheLion the only test framework which doesn't suck
 
@Abyx why would you want to? Fixtures are supposed to be simple
 
ah I see
 
Fucktures.
 
but of course, you could just define your own fixture class, and create a local instance of it in the setup code
 
2:34 PM
Okay, I fixed the problem. Removed old Cygwin gcc packages (version 3.X, wtf). Then reinstalled cppunit. -.-
 
In "traditional" Java-esque test frameworks, your fixtures are just methods. A method that is called pre-test, to set stuff up, and another to clean up afterwards. They're not classes, and cannot be inherited from. Boost made it a class because "setup/teardown" corresponds nicely to constructor/destructor
 
@CatPlusPlus sounds elegant
 
usually I put a lot of methods in fixtures, like set_some_state, set_other_state, etc, so it's not only setup/teardown
 
@Abyx who calls those methods?
 
@jalf tests.
 
2:37 PM
@jalf don't go down that route again
 
a fixture is supposed to just be for setup/teardown. Put the world in a state where the test is ready to run, and then clean up after the test
 
@R.MartinhoFernandes That is really cool.
 
a fixture is supposed to make test code shorter.
 
@Abyx put those methods elsewhere. You're free to write helper classes, and instantiate those during setup, for example. :)
 
Length of the test code literally doesn't matter.
 
2:39 PM
point is, you're abusing a design decision Boost.Test (and a few others) have made. It's not just something Catch lacks, it's something that was never part of the concept of a fixture in the first place
 
@CatPlusPlus it does when you have to maintain it
 
Btw, @jalf do you know if and how you can make custom assertions with Catch?
 
If you have to modify test code, you're doing it wrong.
 
@CatPlusPlus bullshit
 
@Abyx if you really want to, you can do stuff like pastebin.com/gX8jY4nC. But I'd suggest that if your tests need to call out to your fixture class to modify state, then the test cases are too complex, and should be split into smaller, simpler one, each of which starts in the right state
 
2:41 PM
there are surprisingly few people with the talkative badge
 
@R.MartinhoFernandes dunno, sorry. :)
well, I'm pretty sure it's intended that you should be able to fairly easily
 
I mean, instead of REQUIRE(std::find(v.begin(), v.end(), 42) != v.end())), I'd like to do REQUIRE_CONTAINS(v, 42) or something and get neat failure reports with the vector contents and the item I'm looking for and all.
 
isn't that pretty trivial to do?
ah
 
@jalf With the diagnostics?
 
Maybe not. :)
 
2:43 PM
Yeah, the wrapping is easy, I just make new functions.
But "assertion failed: expected true; was false" isn't terribly useful :(
 
Well, I haven't looked. But one of his early design decisiosn was that the user should be free to rename the macros or create new ones easily
 
Ok, just checking if I could skip the looking up myself :P
 
so I'd assume it's possible without too much trouble
but I don't know
 
Guess I'll have to look it up after all.
 
@Abyx It means you introduced breaking changes and you're bad at this.
 
2:45 PM
Could always just ask him on twitter or something
 
Ever since I started using tests I started relying less and less on the debugger: good tests with good diagnostics are often enough for realizing the cause of the bug. And this really cripples my style because I have to fire up the debugger.
 
@CatPlusPlus and what's wrong with breaking changes?
 
@Abyx they.. break things? ;)
 
You're bad at this.
 
2:46 PM
But then, it seems that most of the time I spend time meta-debugging, and that's why I haven't put much effort into this yet.
 
meta-debugging?
 
Also, C++ ecosystem Y U NO META-DEBUGGER?
3
 
templates?
 
Yep.
@TonyTheLion Debugging those fuckers is painful because it must be done iteratively black-box style.
You can't even "inject" logging statements, you know, like when you drop printfs or cout <<s..
 
@R.MartinhoFernandes like in any FP (or declarative) language, isn't it?
 
2:49 PM
If you request a meta-debugger on the VS uservoice, I'll definitely upvote it :)
 
@Abyx Dunno. In Haskell there's a debugger and there's also a way to inject trace messages for diagnostics.
Dunno much about others.
Haskell is all about providing escape hatches anytime you need them.
 
but printf is an imperative thing. you can't put it inside a metafunction
 
But I could put something that generates warnings or notes or whatever the compiler wants to call them.
 
@R.MartinhoFernandes Ogre3D violates a bunch of them.
 
@R.MartinhoFernandes Doesn't that comprise purity?
 
Ell
2:53 PM
Wgafa purity?
 
@StackedCrooked That feature is for diagnostics. But yes, there are escape hatches that compromise purity for when you know what you're doing and really need it (unsafePerformIO is the most famous).
 
@EtiennedeMartel Ogre3D just needs to go away and die :)
 
// something like this would be great
template <char const* Message, typename T>
using print = __builtin_make_a_warning_on_instantiation(Message stringof<T>) T;
@Abyx This would be nice (or something similar; the specifics of the implementation are not very relevant).
 
Ogre3D is to C++ what AbstractSingletonProxyFactoryBean is to Java
 
@EtiennedeMartel Outside of boost, there aren't many libraries that do well in that scorecard.
 
2:56 PM
Ogre3D is terrible.
 
@jalf ah come on now, it's not that bad
 
@jalf It really boggles my mind how anyone would think it's a good design.
 
terrible terrible terrible.
 
@thecoshman Cue "Yes, it is".
 
btw, is there any C++ opensource engine better than ogre3d?
 
2:58 PM
@Abyx Irrlicht is all about hungarian notation.
So I'd say the two largest are both crap.
 
@EtiennedeMartel That's not even on my list!
 
@Abyx the Kyrostat engine could have been :P
 
@R.MartinhoFernandes To yesterday's "Is she hot?": I noticed today she is wearing Converse shoes. To a defense company job. Totally unattractive.
 
And it's not going there. I'm not delving into style territory, only concerns I can actually justify with technical arguments.
 
@Drise Who?
 
3:00 PM
@Drise ¬_¬ but is she hot?
 
@Drise Is she hot without the shoes?
 
@EtiennedeMartel My company's latest employee.
 
@R.MartinhoFernandes are her shoes hot?
 
@Drise Hmmmmmm.
 
@R.MartinhoFernandes Didn't see her face. Her voice is a turn off too.
 
3:01 PM
You are so superficial.
 
You're probably too picky. I bet she's hot.
 
@Drise oh, there is some one like that at work here. Real hot looking, but such an annoying voice
 
@thecoshman Converse? What, are we 15?
 
@Drise What? That's one of your criteria?
 
@Drise close enough
 
3:01 PM
@thecoshman suppresses joke I'm embarassed to have thought of
 
@R.MartinhoFernandes no! go for it!
 
@Drise You're definitely too picky.
 
Honestly, about the only thing I can't stand is cigarettes. Otherwise, GOOOO.
 
@thecoshman It's really obvious and ordinary.
 
@EtiennedeMartel Yea? Shit, I don't know how to dress myself, so my woman better know how to dress us both.
 
3:02 PM
@R.MartinhoFernandes I don't care! crap joke deploy!
@EtiennedeMartel surely not, what about gender? what about SPECIES even
 
@Drise See, too picky: I don't care how I dress, other than temperature and confort concerns.
 
@thecoshman I'm talking about human females. I tought that was obvious.
 
I would care more about ugly shoes than cigarettes.
 
@EtiennedeMartel it was, but I had to exploit your lack of specifics
 
@kbok Yeah, but you're French. You're trained since birth to think that voluntary lung cancer is cool.
 
3:04 PM
@EtiennedeMartel ain't you Candian?
 
@thecoshman So?
 
And btw, before anyone says that you have to dress nicely and shave and stuff for interviews... zero fucks given, got job :P
 
@R.MartinhoFernandes Depends on the place.
 
i think in the end our general sense of beauty derives from our instinctual evaluation of the female form as being good mother-material
or not
 
@R.MartinhoFernandes Show up in a dress next time, see how it goes.
 
3:05 PM
@Cheersandhth.-Alf And boobs too. Wait, that may be the same thing.
 
@EtiennedeMartel speak french => are french => are hooked on smoking
 
right. curves are good, in general
 
@R.MartinhoFernandes maybe you have a natural flair
 
@Cheersandhth.-Alf I think that too. Everything boils down to survival and reproductibility in the end.
 
@thecoshman I guess the ladies haven't noticed that yet, then.
@kbok Btw, next time, I'm totally making my cover letter "I'm awesome. Hire me."
 
3:07 PM
@R.MartinhoFernandes maybe you have gay vibes?
 
@thecoshman Not that I know of.
 
@R.MartinhoFernandes didn't this company pay for your flights?
 
@R.MartinhoFernandes then you good as had the job
 
I think there's something missing in that sentence.
 
3:09 PM
@Cheersandhth.-Alf I'd say "partly". It's changed enough over time, that it seems pretty clear to me that it's not all instinctual, but there's also enough commonality across time and culture that I'd say instinct is largely correct, but with a fairly healthy addition of cultural conditioning and such.
 
@R.MartinhoFernandes no... but i seems to be a phrase that confuses people
 
@thecoshman Not exactly.
 
@R.MartinhoFernandes translation: "then you practically had the job already"
@EtiennedeMartel I plead ignorance
 
@R.MartinhoFernandes Many employers want robots. Women, not so much.
 
@sbi ^
 
3:12 PM
Oh boy, you're in for a lot of trouble.
 
@R.MartinhoFernandes oh...
 
There's a bunch of really hot ladies where I work.
 
@thecoshman He doesn't like the M word.
 
Most of them are artists, but who cares!
 
I am not saying that IS @sbi, just that it would be of interest perhaps to him
 
3:13 PM
Wait. Daknok is back?
 
@Drise keep up :P
 
@EtiennedeMartel I'm an artist too! Good designs and coding are works of art, (no surrealist comments, by request).
 
@TonyTheLion Because I'm fucking busy until Friday.
@Xeo Someone rolled it back :( Anybody dare editing them back in again? :)
 
I'm watching NASA TV, they're filming inside the Dragon
 
3:19 PM
@kbok THIS is what is wrong with the world (╯°□°)╯︵ ┻━┻
 
@kbok Stomach footage? No, thanks.
 
@kbok That's like saying to a programmer "Stop writing such excellent code, you're making the other programmers look bad!"
 
@thecoshman Yeah, to hell with the good cooks.
 
@FredOverflow This is a bit what people do when they say "that's cool and all, but you have to keep the programming style consistent"
 
@FredOverflow you're fucking busy or busy fucking?
 
3:23 PM
@TonyTheLion I wish it was both, but I need my blood in the brains for now :(
 
meta as fuck
 
Dat pun.
 
oh gawd.
 
lol, I get it!
 
3:24 PM
@kbok Take all those municipal jobswoths outside an just shoot them. Typical local govt muppets - instead of bringing the standard of the other meals up, it's easier to shoot down someone doing a good job. Burn the bastards.
 
@FredOverflow oh ok
 
@MartinJames Wow, that's... opinionated :p
 
@MartinJames That's quite boolean.
 
@MartinJames Yeah, roast them and them give them to the lunch lady so she can make nice meals out of them.
Or better yet, let the lunch lady herself roast them, because she's the better cook.
 
@kbok Meh - we have the same brain-dead, zombified trolls in local govt here in the UK. If they cannot be burned, I suggest cryogenic suspension until their brains can be reprogrammed. That or rope suspension.
 
3:29 PM
@MartinJames I'd go for something more ecological. Dump them in a hole and let them turn into compost.
 
Good morning/afternoon/evening/night all.
 
Evening
 
@EtiennedeMartel Thinks.... OK, yeah, that'll do. Turn 'em into vegetable fertilizer, after all, they're pretty much vegetables anyway.
 
har har
Come and get it :)
 
Have you guys seen this presentation slideshare.net/SumantTambe/…? I was like "Oh cool, C++11 idioms", but by slide 25 I started raising an eyebrow and by slide 28 I was on full WTF mode // cc @Luc, @Xeo
 
3:34 PM
@R.MartinhoFernandes I couldn't tell the good from the bad in that
:(
 
@EtiennedeMartel Shame on you! Images showing penetration by unicorns are not safe for chat.
 
@sehe, Wow, nice "Lounge<C++> book".
 
Btw, _Build_index_tuple/_Index_tuple (or __make_tuple_indices/__tuple_indices in clang) are nice.
 
@MartinJames Yeah, and it's not like we have to waste any resources burning them or hanging them or whatever.
 
3:36 PM
@R.MartinhoFernandes Ahahaha. "Caveats": (slide 30)
> More critical eyes needed
> > Propose in Boost?
 
@sehe It's a unicorn that can only hold one corn.
 
@R.MartinhoFernandes That sounds like a good plan. Maybe you can send him feedback
@kbok What? Where? What are you talking about?
 
@sehe "Caveats": crazy as fuck to solve what problem again? (disclaimer: I need to read his blog posts more carefully)
 
@R.MartinhoFernandes It looks like a very misguided attempt at creating a "language in a language". One that reminds me of IDL, COBOL and other things.
 
@sehe You told me to come and get it, so I'm browsing your github
 
3:39 PM
Thing is: person believes DoTheRightThing is too hard in C++, so hide it behind Conventions.
 
Well, I always get very reluctant when I see a very inelegant solution to a problem that was not actually exposed.
 
@kbok Wut. That's is a fork of Radeks' cxx book.
 
@R.MartinhoFernandes ugh
 
@R.MartinhoFernandes To me, the logical response to the implied problem is always, Wide another programming language
 
What implied problem? I didn't get it.
 
3:41 PM
@R.MartinhoFernandes I explained what I got as the implied problem one/two messages before
 
@sehe I know.
 
Ugh, vector<T*>
ugh
 
Hmm, I guess I missed that. I don't see any message refering a problem with passing arguments.
 
I still make fun of it.
 
> In fact, if we think about it, C++11 already has a similar mechanism: perfect forwarding. Essentially, with perfect forwarding we have a parameter that can become an rvalue or lvalue reference depending on the argument type. And we can distinguish between the two in the function body. The only catch is that it works at compile time. So what seems to be missing is a similar mechanism that works at runtime.
Yep, sounds like total bullshit.
Why the fuck do you need to distinguish rvalues and lvalues at runtime? That doesn't even make sense now, does it?
 
3:51 PM
@StackedCrooked No, you turn it into a monadic computation that can work in either Identity (no logging, pure and optimisable) or IO (with logging, more or less imperative).
 
Okay: special request: I need enough downvotes to lose 6 points so my rep will be a palindrome. Anybody willing?
 
class MonadLog m where { log :: String -> m () } instance MonadLog Identity where { log s = return () } instance MonadLog IO where { log s = putStrLn s } or something like that. It's siiiimple.
 
@R.MartinhoFernandes You're right, it doesn't make sense, because lvalues and rvalues are expressions. There are no expressions at runtime, only objects.
 
@Drise So, not only you've noticed her shoes, you also know what company made them? Are you sure about your sexual orientation?
 
Yeah, what about her boobs instead?
 
3:55 PM
And then his example code creates dangling references...
 
@CatPlusPlus You can't miss Converse. Only one shoe looks like Converse and that's Converse.
 
I didn't even know what fucking Converse is until 10 minutes ago.
 
And makes a copy of something that was taken by rvalue reference...
Yep, this guy doesn't have the full chessboard.
 
Well, they are a very popular shoe in that states.
 
@R.MartinhoFernandes I meant 'do the right thing' for parameter passing (is it by value? is it by universal reference? boost call_traits::param_type? 'Want speed - pass by value'?) seems to be 'hard enough' for this particular person to want to bury it behind a (leaky) abstraction?
 
3:57 PM
Oh.
 
@R.MartinhoFernandes I commented on that page, making the case for C++11 and softly suggesting some question marks with the in<> convention
 
Can I get a downvote & delete votes on this please -> stackoverflow.com/a/12823484/673730
Already used up my deletes for the day... :(
 
@LuchianGrigore I don't get it. On your own answer? Can't you delete your own answer?!
 
@sehe you're limited to 5 deletes per day.
 
@sehe I'm reading his blog posts about that in<> thingy. The implementation of in<> tries to do the magic of not storing an object in the class as a member, without dynamically allocating it. Which of course, doesn't work and all he gets is a dangling reference.
 
3:59 PM
@R.MartinhoFernandes I am retracting my statement about buying his book.
 
It ends up storing pointers to a constructor argument.
 

« first day (725 days earlier)      last day (4222 days later) »