« first day (752 days earlier)      last day (4182 days later) » 

10:00 PM
@sbi side-problem, C++03, solve ASAP -> use pointers. You can't afford to build skyscrapers to make it more elegant. My $0.02
 
@sbi what about boost::stable_vector?
 
sbi
@MooingDuck How do I avoid copying a 1k std::vector when I push_back() it onto a ``std::deque`?
 
@Abyx It copies?
 
sbi
@Abyx What's that?
 
@Borgleader The guy I binned definitely didn't protest.
 
10:01 PM
@sbi You push_back an empty one, and swap the new back with yours.
 
@Mysticial Yeah, that's what I said.
 
sbi
@R.MartinhoFernandes Oh.
 
my_deque.push_back(vector<T>());
my_deque.back().swap(my_vector);
Assuming a non-braindead swap, that should be cheap.
 
Hmm.. are the total number of buffers fixed, ie. are they pooled?
 
Fixed? No.
Not from what he has been telling me this past week.
 
10:02 PM
@sbi You could actually try writing a thin wrapper on top which always uses swap operations.
 
assuming that your faux_unique_ptr is default-constructible.
 
@sbi There is Boost Intrusive (which has lists and all manner of other containers). To be honest, I'm not so sure it is something you'd whip up in a hurry, though. It does look as though it will be the most performant mix of C++03 and clean allocation strategies. I mean, it would make C programmers proud :)
 
and you guarantee the nothrow of swap and default-construct.
 
10:03 PM
@MooingDuck The return is missing. You can't do this move-return thing, so it has to use out parameters.
 
If we really wanna troll people, we could fill the bin up with NSFW images.
And then start binning the drive-by-linkers.
 
@R.MartinhoFernandes I assumed some elision would apply, but the concept stands
 
@Mysticial That's assuming they will even care.
 
Since you get "invited" to the target room if one of your messages is moved.
 
sbi
@sehe It's done. The code works fine, doesn't leak, and doesn't double-delete. Only I cringe when I see all the explicit deletes. Also, I fiddled with the allocation method today, and certainly failed to hunt down one of the places doing delete — which requires a hard-reset on the embedded device. And, of course!, I failed to hunt down one of them when I changed it back again... What happens if someone fiddles with this code who is not as familiar as I am now? I want to fix this.
@DeadMG I have a locking_queue adapter already wrapped around an STL container. Yeah, that's a thought.
 
10:04 PM
@Mysticial Hahaha, that sounds like it could lead to some pretty funny situations.
 
@sbi I can relate to that. I'm just offering the opinion that you should not fix this in a hurry
 
haha, look at the last 5 messages in the bin... lol
 
@Mysticial How does on access 'The Bin'?
 
@MooingDuck Oh, for some reason I was still thinking it was not copyable at all. But to push_back the empty one, it has to be. Nevermind.
 
It sounds like that cool-people's Cafe or something.
 
10:05 PM
@Mysticial I'm at school not sure I can.... or even should
 
@ThePhD everyone has read access
 
@ThePhD its a room liek any other
 
@Borgleader It's SFW.
 

 bin

It's a bin, for binning things.
 
Just received a text from my girlfriend: "I've put some sad music on and my roommate just started to cry"
 
10:05 PM
@Mysticial Except when someone bins NSFW stuff.
 
lol
 
sbi
@MooingDuck Yeah, thanks. I could put this into my wrapping queue.
 
@Mysticial well, at least he still has a good mood :)
 
Hahahaha his english is awful which for some reason makes it funnier.
 
The bin... is a scary place.
I don't think I want to ever be associated with it.
 
10:07 PM
@sbi Consider something like this.
it's not pretty, but it should work.
 
sbi
The only problem I have with this is that, a year or two from now, someone fiddles with this and won't catch on the importance of the swapping, and performance goes down the drain again... I'd rather just have a buffer type that one could hand around, that copies cheaply, and that cleans up after itself.
 
@sbi You could have a non-thread-safe non-heap-allocating shared ownership pointer.
 
Intrusive ref counts?
 
but barring that, the swapping faux_vector is your best choice- you'll just have to leave a comment.
@R.MartinhoFernandes I was thinking linked-list design.
 
sbi
@DeadMG Yep, that was my first thought, too. I was just wondering if I could create one that moves under the hood when copied.
 
10:10 PM
@sbi Yeah, I'd wrap a std::deque with the correct interface as it's own type so nobody screws it up later. Also prevents insertion in the middle and other things
 
@sbi :If you want that, you need something on the spirit of holders and trules (which is close to move semantics emulation).
 
@sbi Not if you want it to actually work.
 
Haha, it looks like Thiefmaster suspended his ass.
 
Oh the drama xD
 
@R.MartinhoFernandes ideone.com/w1yjSo compiles and tested slightly :P
 
sbi
10:12 PM
@MooingDuck The thing is, those buffers are handed to functions. And I have seen functions taking strings per copy here. Ideally, I have a cheap to copy buffer, rather than a expensive one that I carefully never copy.
 
cheep
 
sheep
@sbi Can't have your cake and eat it too. At least not without C++11.
 
You decide.
 
sbi
@kbok Thx.
 
@sbi Alright, in that case I'd probably just use a shared_ptr, and forget the overhead. Easiest way to "have" move semantics.
 
sbi
10:14 PM
@R.MartinhoFernandes Well, the cake, you know, is not for me, actually.
I think after two days at your new job, you should have gotten used to the fact that cow-workers are sheep.
 
Just got back from voting.
 
cheap
 
@sbi You've been lying to us all this time! Are they cows or sheep?
 
sbi
@R.MartinhoFernandes They combine the worst of the two.
@MooingDuck Ah, but it's the performance I did all this for!
 
@Rapptz faithInMerkins++;
 
10:16 PM
btw
I'm not mad, am I, in saying that std::runtime_error copies it's constructor argument?
 
Yes. Lifetime issues would arise otherwise.
 
@DeadMG The std::string? Yes it does
 
goody
 
@R.MartinhoFernandes could have moved the string
 
dealing with some guy on the isocpp forums who doesn't want a Unicode exception because it might involve heap allocation
 
10:18 PM
@sbi Mmm. I may be gauging this wrong, but, isn't it quite obvious that since you're on this special device with strictly required 20-out-of-100ms cooperative timeslicing, anyone touching the code will inevitably be aware of the performance constraints? Perhaps they might miss the significance of a std::swap, but that won't be anything a profiler/test run wouldn't tell them right after they make the mistake. And then they'll think about it.
 
@DeadMG nothing wrong with an exception constructor throwing an exception
 
If you don't think this is a plausible view, it looks to me you're basically lending support to the Linus-camp that C++ is too complicated to be transparent even for experts? Or to put it the other way: one of the most important lessons I learned regarding larger C++ projects has been: don't be afraid. Judicial use of a comment will go much farther than frosting it in abstraction just to hide the ... essentials ("performance is important here").
 
@DeadMG Meh, don't use it?
 
@R.MartinhoFernandes Been considering that. After all, exceptions are already hardly cheap.
 
@Borgleader You haven't seen the voting process/machines :( <troll/>
 
10:19 PM
and I think that the cost of a heap allocation to move a Unicode string into it is hardly a large addition.
 
@sehe Actually I have (if you mean the video about the defective machine choosing Romney when Obama was pressed).
 
@Borgleader That too
 
0
Q: Why won't all of my char array get passed (in C)?

user1804523I'm new to C, and am a little confused by the type system. I'm trying to write some code to print the number of lower case characters in a string, but only an int-sized piece of my array gets passed to the cntlower function. Why is this? #include "lecture2.h" int main(void){ int lowerAns; ...

^^ sigh... anyone know of a good dupe?
 
sbi
@sehe They are aware of the constraints, but not necessarily C++-savvy enough to grasp on the significance of certain idioms. Also, a performance decrease might not show up immediately, or only under certain circumstances. And I don't think there is a profiler for that platform. ICBW about this, but the fact that I haven't heard about it shows that it isn't used.
 
... Blargha. I have to redo a PNG Loader.
 
10:21 PM
@DeadMG Really, I'd simply argue with his outlining: either you really need an exception with Unicode stuff in it, or you don't. If you do, you have to pay for it; TANSTAAFL. If you don't... why do you care?
 
sbi
@sehe Yeah, maybe.
 
@Mysticial Just got closed :P
 
GAH FREAKING NUANCE ERROR LOGS
 
@Griwes That was fast. I clicked on the close link when it has 1 close vote. And by the time I submitted, it was closed already.
 
Ok, time to sleep.
 
10:23 PM
@MooingDuck is that some kind of code language?
@R.MartinhoFernandes n0p n0p n0p
 
@Mysticial I managed to cast my vote on time :D
But I don't know how ;D
 
@Griwes mine was on budget though
 
Haha Huffman Trees and shit? Nope I'll stick with my DDSLoader kthx.
 
@sehe wop wop wop
 
@bamboon gangnam style?
 
10:26 PM
@sehe apparently I have an error in my XML. Here's the error my coworker got: liveworkspace.org/code/e47d36abf5e3c2dd78759105b0234bd8 one line.
This is how all of the nuance errors look. Missed a ">"? Good luck finding where!
 
@MooingDuck Instead of fnkCompileGrammar I read fknCompileGrammar I found that pretty funny.
 
allocators!
that's another proposal I was to write... allocators.
 
@Borgleader Otherwise it's just funky.
 
user142019
Allocators gonna allocate.
 
@sehe Meh, just because it's time for it, it doesn't mean I will do it. :S
 
10:28 PM
@DeadMG provide an interface where using realloc under the covers is plausable?
@sehe no wait, it's doing that for a code-generated-xml document. So whatever it is isn't my fault at least :/
 
@MooingDuck Well, I could surely propose a couple of additions to the Standard allocator interface. But more importantly, I wanted to propose object pool, and memory arena allocators.
 
@DeadMG oh. Those are good too
 
@DeadMG what happened on the job front?
 
sbi
@sehe I bet it shifted, and he lost sight of it.
 
@sehe Still going to Linz with Oracle if nothing else turns up, but I've got a couple leads in the UK. Network programmer in Bristol.
 
10:31 PM
@sbi Dog joke? =.=;
 
@DeadMG oh sounds good. When's the ultimatum/verdict?
 
sbi
@Borgleader What's that?
 
A load of interpunction
 
@sbi Nvm, I thought you made a dog related joke that I didn't understand.
 
sbi
@sehe No, I meant the text before that.
 
10:33 PM
@sehe Well, their earliest start date is like, next March, so.
 
@DeadMG and google?
 
@bamboon I actually didn't get back to them after I got back from Linz.
 
Btw, @DeadMG do you know that Nicol guy is a game developer?
 
they only wanted to offer me a sysadmin job anyway, and the Google Style Guide? ugh
 
Quite a smart frood, for a game dev.
 
10:35 PM
@R.MartinhoFernandes No, but it does surprise me. He doesn't seem like a gibbering idiot.
 
@DeadMG Sysadmins don't need the style guide.
 
@R.MartinhoFernandes No, I mean, even if I was to gravitate from sysadmin to real developer
 
lol "real developer".
 
@R.MartinhoFernandes Exactly my thoughts
 
Weird. Why can't I emplace_back a std::unique_ptr<T> && into a std::vector<std::unique_ptr<T>>?
 
10:36 PM
@DeadMG I like how he is a staunch defender of RAII.
@EtiennedeMartel You're doing something wrong?
 
emplace_back(bla), not emplace_back(make_unique(bla))
(disengage crystal ball)
 
@EtiennedeMartel Because a named rvalue reference is an lvalue?
 
m_childs.emplace_back(ptr);
 
booyah, I'm the winner.
 
Oh shat.
 
10:37 PM
std::move
 
So I have to move it again?
 
@EtiennedeMartel Yep.
that's why you don't usually deal in named rvalue references
 
you have to tell the compiler it is ok to move. The repeats will likely be optimized away
 
It kinda makes sense.
 
@sehe that's a compile time feature, they better be "optimized away"
 
10:39 PM
@MooingDuck i was talking about the move, not the cast (std::move is a cast)
 
@sehe ah
 
aarg, this intellisense is crazy
 
Yes, it is.
Just tell it to shut the fuck up.
 
@MooingDuck It doesn't have any assembly representation, when you get right down to it. It's just a pointer cast- the underlying bits are identical and need no alteration.
 
10:40 PM
@sehe That again?
 
@R.MartinhoFernandes And get the mythical "twice as efficient" VS as a bonus!
@R.MartinhoFernandes first time i saw it. I must say, I had some hairs raising in the back of my neck when Sutter repeated that theme a little to much. I mean, I know how C++ will still be easily ~10x faster on the stuff I care about (I benchmarked that once). But hey, it's just to easy to create blind 'hype' by throwing around terms like that.
 
TL;DR: three particular lines of code produce similar assembly in C++ and C#. You can't compare C# with C++, but I can compare C++ to C#.
@sehe It is a well-known fact that Sutter trolls a lot.
 
tbqfh, I thought that ~2x was the commonly accepted difference
 
That's a succinct summary. And the hand gestures. Oh boy :)
@DeadMG Oh well, it was parsing stuff. I used Coco/R C# vs. Coco/R C++ (yup, that was before my Spirit infatuation started). Sadly lost the code. I doubt whether I ever profiled to spot the main culprit
 
@DeadMG shootout.alioth.debian.org/u64/… verifies 1.25-2x for the tasks measured
 
10:46 PM
I'll accept 2x on average. But I don't care much for averages :) I'll let business care about that
 
@sehe for the most heavily optimized stuffs (on the chart), it's only about 25% slower.
 
Did benchmark anything that was fully vectorized in C++?
 
sbi
@R.MartinhoFernandes Whom are you guys talking about?
 
heh, C++ was 1.0-1.8s. Ruby was 4.65-256.68s
 
@sbi Some frood that goes by the moniker "Nicol Bolas".
@MooingDuck MRI is known for it's snail-likeness.
 
10:48 PM
@Mysticial Cmon, it's your run-off-the-mill blogorrhea. Who cares?
 
I believe you have met him before, and did not get a good impression of him.
 
@LucDanton I do. :) And that's good enough for me. :P
 
7 mins ago, by R. Martinho Fernandes
TL;DR: three particular lines of code produce similar assembly in C++ and C#. You can't compare C# with C++, but I can compare C++ to C#.
No.
 
lol
 
sbi
@R.MartinhoFernandes You talking to me?
 
10:49 PM
Mar 18 at 12:12, by sehe
@DavidRodrĂ­guezdribeas @Mysticial http://docs.go-mono.com/index.aspx?link=N:Mono.Simd Mono.SIMD
 
clearly, I didn't read all the messages.
 
@sbi Yes.
You probably don't remember.
 
btw
op>>(istream&, int&), is virtual right?
 
@Mysticial You should write about it on your blog, not talk about it here, so that the 'discussion' stays where it belongs in the blagosphere.
 
or that protected/private virtual thing
 
10:50 PM
I did get a bad impression as well back then, but I have since changed my opinion drastically.
 
sbi
@R.MartinhoFernandes I am not infallible, no.
 
@DeadMG It's an NVI.
It calls virtual stuff somewhere.
 
@LucDanton I wouldn't be able to make it impartial though. I've never used C#.
But I can write about Java.
 
Ask for comments (by linking to your blog). Then others will write blog posts to answer you!
 
@R.MartinhoFernandes But the point is that any std::istream-derived class can choose to read that int by any arbitrary method, of course.
 
wait, I can't open two instances of netbeans? bah
 
sbi
@R.MartinhoFernandes Yeah, I'm already looking at it.
 
writing a paragraph dealing with how my proposed std::io::binary_file_stream deals with legacy I/O
 
I don't know if he's hoopy.
 
sure you're not just looking at some windows desktop feature? Try launching netbeans.exe (or whatever it is) from the commandline. Try /? for shits-n-giggles too
 
10:53 PM
lol
 
and right now, I just said "Calls operator>>(std::istream&, T&) if nothing else can be done, and implementation-magic makes reading from the argument read from here."
you reckon that's workable?
 
lolwut
What does "nothing else can be done" mean?
 
launching netbeans.exe says "The launcher has determined that the parent process has a console and will reuse it for its own console output. Closing the console will result in termination of the running program.
Use '--console suppress' to suppress console output.
Use '--console new' to create a separate console window."
 
@R.MartinhoFernandes Paraphrased. It means "If the new I/O stuff couldn't be found", i.e., a type with only a legacy operator>>.
 
@sehe and /? additionally says "5 does not exist, or is not a plain file." and closes.
 
10:56 PM
Ah.
@MooingDuck lolwut.
 
ah -help is the magic option
 
@MooingDuck You found an easter egg
 
@sehe Also known as a bug, right?
 
Less appealing
 
you know
I haven't really defined any stream-related mechanics.
like, what exactly it means to write to the stream or read from it.
 
10:59 PM
@sehe just noticed the /? also causes the already open gui to pop up a dialog with the same "5 does not exist" text.
 
yesterday, by R. Martinho Fernandes
@MooingDuck @Xeo did say he was premature.
 
hey
 
@MooingDuck WTF.
 
I haven't even posted this proposal on isocpp yet
 

« first day (752 days earlier)      last day (4182 days later) »