« first day (492 days earlier)      last day (4439 days later) » 

12:00 AM
@ScottW I was talking about the "engine does not derive from car" part.
 
@sehe Essentially, yes, a macro button with the macro pointing to the next sheet (so there would be buttons saying "Next Sheet" and they'd all have different macros assigned
 
@KianMayne When I said that, I was assuming that this was supposed to be the 'bad code'. See my surprise later:
1 min ago, by sehe
@KianMayne You don't say they wanted gotoNext and gotoPrevious defined for each worksheet?!
 
@Leoheart You avoid locking stuff like a twat?
 
i said, i use various sync. mechanisms
 
@Leoheart: You avoid sharing data as much as possible
 
12:00 AM
yup.
 
yeah, that's not right
 
and...
 
@KianMayne There is no good rationale for that. Especially for maintainability. Imagine what would happen when the sheets are reordered
 
deadlocks are a result of using too many sync mechanisms
 
@DeadMG In undisciplined ways
 
12:01 AM
@DeadMG hmm... you are right
 
generally speaking, you should favour lockless operations and containers
they execute faster and cannot deadlock
 
@Leoheart @DeadMG pat on the back :)
 
Although be careful with lockless/lockfree code
 
yaa i do... apart from efficient they are simple, I follows KISS approach as much as possible
 
They are not trivial to write
 
12:01 AM
@Insilico +1
 
It's very, very easy to write lockfree code that works 99.99% of the time
 
@Insilico They are trivial write. In all cases where you should contemplate writing them: never :)
 
@Insilico But the absence of a parent/child relationship screws the example up
 
and fails miserably the other 0.01% time
 
hmm.. so there is only 1 answer.
 
12:02 AM
the only thing that can protect you from threading-related errors is a solid design
 
try to use Locking mechanisms when there is no other way around
 
@Leoheart the easiest way to achieve lockfree code is by not sharing information, instead of using lockfree containers.
 
what points would you add more to your answer?
 
there is no implementation that can save you
 
For me I use some kind of well-tested message queue for interthread communication
 
12:03 AM
a bad implementation can kill you, but a good one can't save you
 
(concurrent message queue)
 
@Leoheart instead 'shard'/'partition' the workloads and if necessary use agents to 'reconcile' the partitions using synchronized section. But make it very easy to reason about and prevent any deadlock potential
 
It's not a panacea but it alleviates a lot of the pain from threading
 
Ok guys, off to bed. Cya
 
nn
 
12:04 AM
Okay...
 
@ScottW Jij ook. Steeds meer nederlanders?
 
@sehe Good night
 
@sehe: nite
 
@sehe Exactly! But a bit later, it turned out like this and this
 
@sehe, you might be somewhere from Western Europe if you are sleeping right now
 
12:05 AM
@sehe Night! (:
 
@ScottW Your Dutch is quite well developed, shall we say (or your google translate skills)
 
man
my chair is broken :(
 
@DeadMG: Like catastrophically broken?
 
yeah
 
Or did it gradually break to the point of unusability?
Ouch
 
12:06 AM
Did it throw an exception?
 
no
 
My condolences
 
@ScottW Nice. Cheers - We'll talk some other time :)
 
now it's functionality is a stool, at best
and I like to lean back on my chair
 
Poor chair.
 
12:07 AM
buy a new one.
 
lol
 
guys, do you know how to go to a particular line on emacs
 
Get a bicycle chair connected to a generator to power your computer
Double points if you have dual monitors
 
i tried M-x then typed line number and pressed enter, it doesntw ork
class Chair : public Funiture {
Chair();
~Chair();
Chair& Chair(const Chair&);
chair& operator=(const Chair&);
}
 
@ScottW: What's wrong with just Chair deadMG_char; ? :-)
@Leoheart: Did you try ESC x <line number> ?
 
12:11 AM
i did, doesnt work
M-x 34
i pressend enter, doesnt work
@Insilico i used same webpage to learn it but it doesnt work on my emacs atleast
 
Emacs makes my hands hurt.
 
@Leoheart: Is there a way to view the current keybindings in your emacs installation?
 
don''t really know.. forget it. i thought i was doing some trivial mistake. dont wanna spend more.
thanks though for trying
i have one question guys.
i have been unable to understand the answer even though i knew it since many months
 
that's what you said last question you asked :P
 
hehe...
pardon my repeatitive questions
suppose a Linked list has a loop, how do you figure out at what node it has loop
if i am disturbing you guys, please straightforwardly tell me. you guys have already helped me enough.
 
12:17 AM
@Leoheart: Are we talking about a circular linked list?
 
no..
a linearl linked.list but has circle some where
 
you iterate through it and add each node to a set
 
something like this
nodeA->nodeB->nodeC->nodeD->nodeE->nodeC
 
then when you find a node which is already in the set, you know you've already visited it
the only way that can happen is if there is a circle in the list
@Leoheart It's ok, if we don't want to answer, we will just ignore you. Happens All The Timeâ„¢
 
i think i am missing some part of this puzzle question.
Ohh Okay :) thanks for headsup.
no no, the answer you said is correct
 
12:21 AM
he said he was missing a part of the question, not the answer
 
but i think the question i asked here is not where i was stuck.
i am missing the actual question.
 
man
I have way too many classes named "Context"
 
sorryyyy :(
 
@Leoheart it's ok
 
make your class names more descriptive :)
 
12:22 AM
heh
 
@DeadMG: Presumably they're all in different namespaces?
 
I would do, except those names also need to double as namespace names
@Insilico Yes
you're talking about things like "I need a class, and the best description is Render, and it also needs to have a namespace called Render... fuck"
 
Naming classes is surprisingly difficult at times
 
are you allowed to use "f***" here. i didnt know that
 
@Leoheart The Meta police tried to stop us and failed, as far as I'm aware.
 
Xeo
12:23 AM
@Leoheart We don't give a fuck if you use it in here. :P
 
Sure. You can use any one of Carlin's 7 dirty words here
 
we use it all the fucking time
 
As long as it's not like 50% of your vocabulary
 
hahahahhaa
 
@Insilico Actually, you generally get props for that
even with a word as flexible as fuck, it's hard to work it in to be every other word
 
12:24 AM
i am not gonna use it.. trying to be gentleman for as much time as possible :)
 
Xeo
@Insilico Sometimes, the puppy exceeds those 50%, atleast in a single sentence
 
you'd have to have some serious creative balls to make it work
 
My namespaces aren't that detailed
It's usually like Boost's where there's one boost namespace
 
@Insilico I usually have a couple of levels.
 
and one other namespace level if appropriate
 
12:25 AM
only members with a 100 weeks of humble service in chatting badge could use those words. @Leoheart
 
right now, I generally have a top-level namespace, and then a sub-level
 
hahah.. okay
 
Wide::Render::Font, Wide::Direct3D9::Font, Wide::Lexer::Context
 
I think there was a Stack Overflow question about your situation
but for C#
 
@Leoheart :) :P
 
12:26 AM
Lemme see if I can find it
 
well, the general principle is the same across all languages with namespaces and classes
 
Xeo
Hm, that reminds me, for my current two projects I don't even have namespaces (yet)
 
you can't realistically do namespace N { class N { }; }
 
@Xeo lookofdisapproval.gif
 
3
Q: Identical class names in different namespaces

Ricardo NoldeI have two different namespaces, with lots of classes with the same name. I believe some code will make it easier to understand: namespace Print.Pdl.PostScript.Operators { public abstract class BaseOperator : IOperator { // ... } } namespace Print.Pdl.Pcl6.Operators { p...

 
12:27 AM
@LucDanton +1 for that, how hard is it to write namespace X { } around everything
 
2
Q: Namespace with same name as a class name

StijnI thought the following makes sense to do, but it's not possible and an error will be thrown: The namespace 'foo' already contains a definition for 'bar'. namespace foo { public class bar { ... } } namespace foo.bar { public class baz : EventArgs { ... } } What would be the appropriat...

 
Xeo
@LucDanton That should be "soniamdisappoint.jpg", tztztz
 
tomorrow i have an interview..
 
Not sure if they help or not
@Leoheart: Good luck!
 
@Xeo nope.mov.exe.gif.tiff
 
12:28 AM
thanks.
so tired of doing what i hate to do at my current job
 
Xeo
@LucDanton And hey, both aren't library projects, so I can't be bothered. And for one project, it's like 3 files big (though that could increase in near time)
 
Anyway, the global namespace is unsexy.
 
@Leoheart: What do you do at your current job?
 
Xeo
If my second project actually develops more, I'll just wrap everything in a toplevel namespace
Since it might actually be used as a library
 
i am software quality engineer at eBay
 
Xeo
12:29 AM
Even though that's not my intent
 
@Xeo I stick to writing namespace foo { anytime I'm writing a project 'foo', no matter if it ends as an executable or not.
 
i want to be a software development engineer at high income.
 
i got good offers but mot competent enough :)
 
@Leoheart: What company are you trying to get a job at for your interview?
 
Xeo
12:30 AM
@DeadMG GEMA hates us here.
 
Amazon
 
Except I have the habit of writing stuff right before main in the global namespace when trying out things. Then I refactor them into a TU into the proper namespace.
(If it's a library i.e. no main then I don't do that.)
 
i have never failed so many times than in last 8 months :(
 
Xeo
@LucDanton Heh, it always starts out as a simple "main.cpp"
 
For some weird reason I don't think Amazon would be that much better overall as a company. :-P
 
12:31 AM
i dont care how good is the company. i love ebay, i love people in my team
 
But if they have a good position go for it
 
@Xeo Yep. But once I find that the interface of whatever I'm writing is satisfying then it becomes featurex.hpp + featurex.cpp.
 
its just i wanna be a devloper at my job not a guy testing web pages and listening to developers who are not even so good
 
Oh, no don't get me wrong. Go for it if you feel they can make better use of your skills
 
Xeo
12:32 AM
Hacking away at library implementations is fun.
 
position is SDE, Amazin kindle
 
Similarly when writing a library I usually start with the unit tests if I'm not too sure what the interface should look like. Usually end up in an anonymous namespace rather than global though.
 
i would love to develop stuff fro my company even if it takes 12 hours of my day
 
@Leoheart: Sounds like fun. Again, good luck with your interview!
 
@Xeo Write your own function wrapper to support move-only types.
 
Xeo
12:33 AM
Oh btw, @Luc, I found the difference between boost::adaptors::sliced and boost::adaptors::copied.
 
I'm trying to build clang and I get the error "The path 'C:\Users\sethcarnegie\Desktop\llvm' appears to be part of a Subversion 1.7 or greater working copy. Please upgrade your Subversion client to use this working copy."
 
Thank you. i would let you guys know tomorrow how it goes (or day after)
coz its whole day interview tomorrow
 
Someone voted to close my constructive question as "not constructive" :(
 
Xeo
Even though the documentation really doesn't make it obvious, copied does indeed copy the subrange and returns the copy, while sliced will return a view.
@Pubby They all say that their question is "constructive".
 
@Xeo your link is taking me to http://stackoverflow.com/questions/9339829/using-stdfunctionvoid-to-call-non-void-function#comment11810871_9343400

is that your intent or a wrong link.
thanks though
 
12:34 AM
@Xeo Mmmh what does copying a copied subrange ends up doing?
 
Xeo
@LucDanton Huh?
 
Is it shared amongst copies? Wouldn't surprise from a pre-C++11 perspective.
 
Xeo
@Leoheart That was my intent.
 
@Xeo "What is a retainstack" isn't constructive?
 
@Xeo Algorithms take ranges by value, don't they?
 
Xeo
12:35 AM
@LucDanton copies returns by-value, so nope, no sharing
@LucDanton no, reference
    template< class CopyableRandomAccessRng >
    inline CopyableRandomAccessRng
    operator|( const CopyableRandomAccessRng& r, const copied& f )
    {
        iterator_range<
            BOOST_DEDUCED_TYPENAME range_iterator<const
                                           CopyableRandomAccessRng>::type >
        temp( adaptors::slice( r, f.t, f.u ) );
        return CopyableRandomAccessRng( temp.begin(), temp.end() );
    }
 
Oh I see. It does remind of Boost.GIL.
 
see ya guys.
 
Xeo
And it actually uses slice.
 
good luck with all what you do. I will go to my books and read more.
 
(Where the const-ness of a view object doesn't affect whether it's a mutable or immutable view IIRC.)
 
Xeo
12:37 AM
Boost.Range views are const-propagating IIRC
 
thats a lot everyone, speacially @DeadMG and @Insilico
 
no probs
 
@Xeo This is going to be confusing what with temporaries binding to const&, no?
range | copied(0, 15) is such a temporary...
 
Xeo
@LucDanton Why?
 
@Leoheart: No problem. Good luck!
 
12:38 AM
Thank you. Later
 
Xeo
Well, it's certainly a shame that Boost.Range isn't move-aware, but oh well..
 
Oh I see, for_each is classified as non-mutating.
That certainly looks manageable then.
 
Xeo
@LucDanton Yeah, because for_each itself doesn't mutate. It is overloaded on const, though.
And as such does provide mutability for the non-const overload
 
@Xeo My example was going to be for_each(range | copied(0, 10), ++arg1);, no matter how non-sensical that is.
 
Xeo
Ah, yeah, that won't work
 
12:42 AM
@Xeo It's prohibited to mutate the element according to the docs.
 
Xeo
range | copied(0, 10) | transformed(arg1+1) should, though
 
Nope, for_each returns the functor (just like std::for_each).
Well, you can pass one I guess, but what's the point?
What's the for_each for right here?
 
Xeo
I'm wondering myself.
 
With that call, range | copied(0, 10) can only bind to const&. How does tranformed deal with that?
(I know it's lazy at this point but suppose the range is used.)
 
Xeo
@LucDanton Returns a copy of the result of the functor
 
12:45 AM
what's the difference between?

reinterpret_cast<void*>(i) && (void*)i

?
 
Xeo
Actually, it's all up to the functor
 
Oh hey, Xeo's back!
 
Xeo
Btw, I came to love counting_range/counting_iterator to create views of ranges.
 
Yeah, transform is mutating.
@user1131997 Depends on what i is.
 
Xeo
@LucDanton transform, but not transformed
 
12:46 AM
So yeah, this const-propagating business is limiting.
 
@LucDanton for example int
 
Xeo
@LucDanton I'm having a hard time imagining how else it would work for temporaries. And const-correctness in general.
 
@user1131997 Then it's the same.
 
Xeo
@user1131997 No difference then, (void*)i will select reinterpret_cast
@Mysticial Internet outage. :(
 
@Xeo In GIL if you do view(image) then the range-like resulting view does not propagate const. But you can do const_view too, including to a (mutable) view.
 
12:48 AM
@Xeo Oh? How'd that happen?
 
Xeo
@LucDanton I wonder how it does that, if image is const?
 
Simply put const& is coopted as the default mechanism to pass views and the caller enforces mutability/immutability.
 
allright, then if some class or struct

struct/class A, B {} .... B *obj = new B();

reinterpret_cast<A*>(obj);
(A*)obj;
 
@Xeo You'd get a compile error :)
 
Xeo
@LucDanton Heh, okay. So you need to be explicit.
The solution to mutable temporaries is rvalue refs anyways. I want those in Boost.
I was shocked at the fact that boost::filesystem::path doesn't have move-semantics. :(
 
12:50 AM
No, the solution to everything is perfect-forwarding.
 
Xeo
@LucDanton rvalue refs are a subset. :P
 
@user1131997 Second could end up doing a static_cast if A and B are related.
 
Xeo
And that boost:filesystem::path isn't even allocator aware...
 
more problematically, it could also be a const_cast
not in that specific scenario, but more generally
 
Can i send message here?
 
12:51 AM
Also adaptors::transformed has no requirement on mutability, but I imagine it would fail to compile in this case or others.
 
@LucDanton I mean, if exactly using (A*)obj , and what's the diff between using this or reinterpret_cast<>
 
With a move-aware Boost.Range I'd like some container-ish range similar to copied. How about a range that is insertable?
 
Xeo
    template< class InputRng, class UnaryFunction >
    inline transformed_range<UnaryFunction, const InputRng>
    operator|( const InputRng& r,
               const transform_holder<UnaryFunction>& f )
    {
       return transformed_range<UnaryFunction, const InputRng>( f.val, r );
    }
 
@user1131997 I just told you: sometimes the second one is a static_cast, not a reinterpret_cast. That's a difference right here.
What (T)expr ends up doing depends on the nature of the types involved.
 
Xeo
@LucDanton How would that look like?
 
12:54 AM
@LucDanton Do you mean, that just (A*)obj is equal to static_cast<A*>(obj) ?
 
Xeo
@user1131997 It can be
That's the problem with C-style casts. You never know what they actually do.
Also, they never even consider dynamic_cast
 
@Xeo transform(transform(left, right, out_range<std::vector<int>>(), op::multiplies {}), op::plus {}) aka inner_product!
@user1131997 I mean exactly what I just said:
2 mins ago, by Luc Danton
What (T)expr ends up doing depends on the nature of the types involved.
 
Xeo
215
Q: Regular cast vs. static_cast vs. dynamic_cast

Graeme PerrowI've been writing C and C++ code for almost twenty years, but there's one aspect of these languages that I've never really understood. I've obviously used regular casts (i.e. MyClass *m = (MyClass *)ptr; all over the place, but there seem to be two other types of casts, and I don't know the di...

 
how do you often use friend, mutable at work?
 
I use mutable a lot more than I actually am comfortable with. But I'm a hobbyist, so that's not work.
I'm fine with my uses of friend. They are there, and they are necessary: they document that such and such freestanding function/template is part of the public interface of the type.
 
Xeo
12:57 AM
@LucDanton I just recently used mutable for my indirect_key struct. :>
Which is a funny thing.
 
Most recent friend is visit, for my variant.
 
Hey guys. I am learning c++ and I would like to some good gui librarys.
 
@AidanMueller I don't know of any.
 
@AidanMueller: Do you have a specific platform in mind?
 
Xeo
@AidanMueller There are no good GUI libraries.
 
12:58 AM
Preferably cross-platform
 
@AidanMueller try to work natively with video driver in ring0, so cool ;)
 
Your "best bet" would be something like wxWidgets or Qt
Note that I use the scare quotes for "best bet"
 
$ grep mutable -Ri include/ | wc -l
11
Not too great :(
 
@Insilico Both of those suck donkey balls
 
Xeo
Jan 30 at 15:04, by Cat Plus Plus
Doesn't matter which UI library you'll pick. You'll hate it after a week anyway.
 
12:59 AM
@Xeo WinRARâ„¢
 
@DeadMG: Yes, they do suck.
Again, note my use of "scare quotes"
 
Qt seems common
 

« first day (492 days earlier)      last day (4439 days later) »