« first day (1487 days earlier)      last day (3444 days later) » 

2:00 PM
Construct the nodes inside.
addChild(TreeNode*) violates LSP, but addChild(payload) doesn't.
 
NodeJS Inside(TM)
 
Ell
ahhh merge conflicts are scary
I have no idea what these 3 panels represent i.imgur.com/4C9D4DI.png
okay I have some idea
 
ok
 
Ell
Idk why there are 3 though :P
 
2:02 PM
@Ell One is one conflicting part, another is another conflicting part, and the middle one the merge result?
 
BSTreeNode::left has as type std::unique_ptr<TreeNode>
 
Ell
@R.MartinhoFernandes Oh that's what the middle one means
 
Ell
wait.
then why can I change all 3 of them :L
 
Left is what was in the your last commit, right is what come from the remote, and middle is in your tree right now.
 
Ell
2:03 PM
so I really only want to modify the middle one. I think.
 
@orlp Ugh, unique_ptr.
Wrong ownership.
 
why?
 
The nodes belong to the tree, not their parents.
 
doesn't a node have ownership of it's children
 
@orlp right, yes, if BSTreeNode wants to perform some operations using its extra functionality on left and right it needs its own pointers or do casts (not necessarily dynamic though)
 
2:04 PM
Consider removal of a node.
Are the children gone?
 
@R.MartinhoFernandes no, you move the children in the right place first
 
You'll be essentially fighting the ownership you set up.
The only way you will let it actually work is when the tree goes down.
QED.
 
depends on needed semantics, in some appliactions removing a node means removing its children as well
 
@BartoszKP Call them subtrees then.
 
e.g. pruning decision trees
 
2:05 PM
well you have to deal with the children anyways
5
 
@orlp Yes, but only when the tree goes down.
 
@R.MartinhoFernandes yeah, s/its children/its subtrees/
 
Strong hint the tree is the true owner.
 
ok, let's say I'd use raw pointers
 
And consider an unbalanced tree of 1000 elements.
 
2:06 PM
how does this solve anything? root still has the wrong type in the base class, as do the left and right members
 
When you kill it, BAM 1000 call frames into the stack.
 
@orlp just put them to bed when they're naughty
@R.MartinhoFernandes I smell a pet peeve (for good reason!)
 
lol
 
@R.MartinhoFernandes fine I'll change ownership to the tree
 
@orlp Oh, it doesn't. I was just pointing out that unique_ptr is the wrong tool for ownership in trees/linked lists.
 
2:07 PM
but I'm still stuck
how to avoid dynamic_casts everywhere
 
Why do you need the dynamic cast?
What extra functionality do the derived classes provide?
 
16 mins ago, by orlp
I'm doing an university assignment
 
because BSTree stores BSTreeNode*'s
 
@orlp you can have BSTreeNode have its own pointers with the appropriate type
 
retarded uni requirements
 
2:08 PM
std::university_assignment(target, source);
 
@orlp Yes, but how is a BSTreeNode different from a TreeNode?
 
BS is a strong hint
Bull Shit is the difference
 
@BartoszKP no? then you have four pointers
@BartoszKP two in the base class, two in the derived
@R.MartinhoFernandes silly assignment functionality, in this case an overloaded comparison operator
 
@orlp yep, I also counted that much ;p and ?
 
@orlp Oh gawd, abandon all hope, then :|
 
2:10 PM
basically
the idea of them
 
@R.MartinhoFernandes boost.org/doc/libs/1_57_0/doc/html/intrusive/bst_hooks.html Boost intrusive uses different hooks for any of the *tree collections vs bstrees. That's a surprise (all of avl, btree, splay tree, rbtree, scapegoat and treap use the same hooks)
 
is that any BSTree must also be a Tree
 
Ell
I wonder why my stash is still there after I did git stash pop
 
you had more than one : )
 
@Ell no. maybe you saved it twice?
 
Ell
@sehe maybe
 
well
 
Ell
or maybe the conflict kept it there
 
BSTree HAS TO inherit from Tree
according to the assignment
 
@Ell Pop is not destructive if it doesn't apply cleanly.
 
2:12 PM
it seems like they want to promote OO and instead show exactly why it's thrash
 
@orlp does the assignment say that it can't have additional pointers with appropriate type? -.-
 
@BartoszKP but that's the wrong solution, then you have two unrelated trees
 
@orlp lol, no
 
@BartoszKP the idea is that you can inherit and reuse the functionality from Tree
 
two different pointers can actually point to the same object
because they are pointers
that point
:v
 
2:14 PM
@BartoszKP methods in Tree modify the TreeNode* pointers, methods in BSTree modify the BSTreeNode* pointers
 
@Ell of course
 
@orlp you said that the only difference is the comparison operator, not the way the tree is being rebuilt
 
Is that why the nodes have a comparison operator?
Ugh.
 
oh god
 
2:15 PM
They should be dumb holders with attach_left and attach_right and let the tree handle the rest.
 
Boost Intrusive is nice. If only to learn about factorization of container semantics/responsibilities
 
@sehe Can their hooks move now?
 
I've read something in the 1.57 release notes but it didn't consciously register.
Checking
 
@orlp remember my "What happened with vim.se was absurd" comment?
it got removed, haha
 
LOL
 
2:16 PM
@R.MartinhoFernandes Nope
 
Anyways, nodes are 2-3 pointers, typically.What's to move?
 
@BartoszKP ok, let's say I have a BSTreeNode*, what is the type of BSTreeNode::left?
 
Ell
^I'm so bad at git
 
@orlp I added it again
I like where this is going
 
2:17 PM
@orlp BSTreeNode*
 
@Ell Doesn't seem like that to me. It looks a bit as if you're not very good at coordinating your work :)
 
@BartoszKP how? the inherited left datamember has type TreeNode*
 
Ell
@sehe This is true for sure :P
 
@orlp you didn't ask about the inherited, to avoid confusion, call it bsLeft or something
 
@BartoszKP but then an operation inherited from Tree will not use the new bsLeft pointers
 
2:19 PM
@Ell in your defense, this was one of those Rasti Rostelli, Derek Ogilvie things to say (it's always true!)
Humans are bad at coordinating tasks
 
@BartoszKP hence the two unrelated trees - one for the base object, one for the derived object
 
@orlp true, if any child should be changed, you'll have to repin the pointers
 
Reap in tha pointaz
 
@orlp TreeNode*
 
@R.MartinhoFernandes and that is exactly the issue
 
2:20 PM
A BST node is just like any other node without bookkeeping.
 
and I can't fucking figure it out without casts everywhere
 
How would you require casts, if all you have is a single node type
 
and I can't imagine upcasting everywhere to be a proper solution
@sehe I have two node types
@sehe TreeNode and BSTreeNode
 
... again, what for
 
Then you're out of luck.
 
2:21 PM
assignment requirements >.<
 
Make it generic already
 
Xeo
using BSTreeNode = TreeNode;
 
the discussion is pointless until you'll show a use case where you need dynamic_cast
 
Xeo
\o/
 
@orlp To hell with them. If you show superior understanding, you might save the next batch of students the pain
 
2:22 PM
@BartoszKP He needs it when he uses the op< that comes in the nodes gasp.
 
@R.MartinhoFernandes ah, right, I forgot.
 
@Xeo oooh. I sense a reinterpret_cast<TreeNode*>(std::declval<BSTreeNode*>()) opportunity
 
basically
BSTreeNode's offer "extra functionality"
(they're "easy to compare because you defined overloads for them")
 
Also please don't remove my comment again, it's relevant to the matter at hand. Thank you. — Alex M. 30 secs ago
 
but since we inherit from Tree we're storing TreeNode's
 
2:23 PM
@R.MartinhoFernandes oh, eaaaaasy. Type erasure in the op< implementation! Just store a std::function(bool(TreeNode const&, TreeNode const&)>` in the nodes :)
 
@sehe I don't see how that helps. The base class lacks the functionality.
 
Wait. Is there even a base class for TreeNode now too?
I like this show. When is it usually on?
 
@orlp use the redundant pointers and repin them as needed (override TreeNode's functionality that modifies the pointers) if you really want to avoid any dynamic_cast calls...
 
@sehe No, TreeNode is the base class. It has no op<.
 
This makes /total/ sense. :| Screw the assignment
3 mins ago, by sehe
@orlp To hell with them. If you show superior understanding, you might save the next batch of students the pain
I'm going to be away. Hopefully order will have been restored when I return
 
2:26 PM
wait
if I link the assignment (in dutch) you can see the inheritance diagram
 
> Bomen zijn niet geïmplementeerd in de STL.
lol
 
Tree stores TreeNodes, BSTree (inherited from Tree) stores BSTreeNodes (inherited from TreeNodes)
 
Hehe. It's only 3.5 years ago :) But you're right. Deleting — sehe 8 secs ago
Janitors are afoot
> Bomen zijn niet ingevuld geworden in de standaard bibliotheek
@TonyTheLion Also, blatant lies. Every implementation uses them to implement {multi,}{set,map}
 
> polymorfisme
Dat zit tegenwoordig ook niet meer in het basis-pakket, toch?
 
2:31 PM
Het wordt niet uitgelegd
maar de oplossingen verwachten het wel
 
@sehe Bad teachers are bad
 
Ell
Hmm.
 
@orlp So. Peeps should really look at boost intrusive. Aside from intrusiveness they've done all these things. Right.
 
Ell
I've been reusing feature branches and I think I wasn't supposed to
 
but I don't see a solution =/
 
2:33 PM
Test.. am I me?
 
without casts everywhere
and that really defeats the purpose
 
Oh good, I am.
 
@orlp lol, I've given you the solution like ten times already. You won't have two different trees, if you'll make sure to repin the redundant pointers every time :v
 
@orlp That's why it's broken.
 
2:34 PM
I can only think of one thing that reduces the cruft to a minimum
a get_left method that does the cast and returns a reference to the appropriate type
 
lol, I really like to make fun of Vim but closure of this proposal was absurd :|
 
@orlp Looks to me you can find your way out of this fine mess, by using composition instead of inheritance. Then you can do pure Interface Inheritance (basically, marker interfaces) to honour the required hierarchy.
Your teachers have indeed highlight the way to abuse OOP. Implementation inheritences is rarely a good way to express typology/taxonomy. There's a reason why in "the STL" categories are usually associated with implementations using traits (char_traits, iterator_category etc.)
 
It's just as bad. The brokenness is in moving the comparison functionality out of the tree where it belongs.
 
@BartoszKP At least they have found closure
 
:D lol
 
2:36 PM
It would be fine without that.
 
@R.MartinhoFernandes Oi. I forgot about the other interface requirements that they add later. I was looking at the inheritance diagram, and thought "we can fake that"
 
I mean, FFS
 
@sehe but the assignment literally says "afgeleid", derived
 
@orlp I sense an opportunity for CRTP (TreeNode<BSTreeNode>) so you can make it static_casts :)
 
The comparison stuff is all of the tree's logic.
 
2:37 PM
anyway
fuck this, I'll ask questions next week
 
@orlp I know right. You can derive, without inheriting implementation
 
You add stuff to the tree and the tree figures out where to put it. Then you get stuff out of the tree. One never puts stuff in nodes or takes stuff out of nodes. The nodes are an implementation detail which should have been left unspecified.
 
lol
what a lame way to manage a community
 
@milleniumbug editor wars must be
@R.MartinhoFernandes /and/ the balancing (if selforganizing)
@TonyTheLion yeah, it should be in the mail soon (but I already read it in pdf)
Aiming for averageness. ("N.B. The class Treap need only be implemented by students, who want to achieve the good mark")
 
2:49 PM
@milleniumbug lol
Robert did it.
 
@TonyTheLion That's really exciting. Wish we were on a C++11 compiler.
 
...
 
@sehe I understood that.
 
> This question was voluntarily removed by its author.
 
@sehe ugh
 
2:51 PM
@R.MartinhoFernandes Of course you did. And you have appreciated the general clumsyness of the sentence structure too (not to mention, comma abuse)
 
at least we know it's the director guy being ultra-lame
I'm sure he was the one deleting my comments too
 
Every comma is abuse.
 
Dunno about the comma.
Dunno how it works in Dutch.
 
Well, the abuse is the same :)
 
Well, in German it would make have a comma there.
Roundabouts.
Feeding your translation into Google without the comma produces German with a comma in it.
 
Xeo
2:55 PM
lol
 
Ell
Hmm yes. I'm sure I've been misreusing branches
 
Even the original Dutch without the comma results in German with a comma in it.
 
@AlexM. It absolutely is not. Please do not rant in comments. Thanks. — Robert Cartaino ♦ 2 mins ago
 
@sehe So, I didn't notice the comma abuse because I was aware that I was not aware of how commas work in Dutch.
 
Ell
2:57 PM
I wonder if it's better to stop misreusing branches or to be consistent with misreuse
 
Xeo
> Stack Exchange sites can only be created via the community-driven process at Area 51.
 
@Xeo Wait, really?
 
@AlexM. meh
 
Xeo
they ended up actually removing the "democratic" part.
wow.
 
2:58 PM
impressive
 
Mess with vim, lose democracy.
 
What proposal got closed?
 
user1804599
@Xeo ahahahahahha
 

« first day (1487 days earlier)      last day (3444 days later) »