not actually to establish a blogging point where individuals can enrich their learns on facilitating and leveraging .NET-related activities most effectively
365 followers 0 articles/week
Tree-walking algorithms: Incrementally performing a postorder walk of an N-ary tree

We continue our exploration of algorithms for walking incrementally through an N-ary tree by perform a postorder walk through the tree. Recall that our goal is to follow the red arrows through the tree, as if we are walking along the outside of the tree with our left hand touching it.       ︎ A ︎         ︎ ╱ │ ╲ ︎     ︎ B ↷ C...

Wed Jan 8, 2020 17:42
Tree-walking algorithms: Incrementally performing a preorder walk of an N-ary tree

We continue our exploration of algorithms for walking incrementally through an N-ary tree by perform a preorder walk through the tree. Recall that our goal is to follow the red arrows through the tree, as if we are walking along the outside of the tree with our left hand touching it.       ︎ A ︎         ︎ ╱ │ ╲ ︎     ︎ B ↷ C ↷...

Tue Jan 7, 2020 18:18
Tree-walking algorithms: Incrementally enumerating leaf nodes of an N-ary tree

Suppose you have an N-ary tree, in which the node operations are Get first child. Get next sibling. Get parent. For example, this type of tree structure may represent a window hierarchy. You also see it in a TreeView control. Enumerating the nodes of this tree with a recursive algorithm is relatively straightforward. Doing it incrementally is trickier....

Mon Jan 6, 2020 19:14
Anybody who writes #pragma pack(1) may as well just wear a sign on their forehead that says “I hate RISC”

When you use #pragma pack(1), this changes the default structure packing to byte packing, removing all padding bytes normally inserted to preserve alignment. Consider these two structures: // no #pragma pack in effect. struct S { int32_t total; int32_t a, b; }; #pragma pack(1) struct P { int32_t total; int32_t...

Fri Jan 3, 2020 17:23
Why doesn’t RegSetKeySecurity propagate inheritable ACEs, but SetSecurityInfo does?

A customer was updating some code that manipulated registry key security. The old code used the Set­Security­Info function to update the security, and they observed that the function propagates inheritable ACEs to child keys. Their revised version used Reg­Set­Key­Security, and they observed that that function does not propagate inheritable ACEs to...

Thu Jan 2, 2020 17:32
Nasty gotcha: Positioning your window beneath a topmost window makes it topmost

There’s a nasty gotcha with the Defer­Window­Pos function, and therefore any functions built on top of it, such as Set­Window­Pos: If you specify a hwndInsertAfter, and the insert-after window is topmost, then the window being positioned will be placed immediately after that window. So far so good. The hidden gotcha is that the window will be placed...

Wed Jan 1, 2020 18:08

Build your own newsfeed

Ready to give it a go?
Start a 14-day trial, no credit card required.

Create account