Confusion with “every path from a given node to any of the leaves goes through the same number of black nodes” property of RB trees

One of the properties of Red Black trees is: “every path from a given node/vertex to any of the leaves goes through the same number of black nodes”

Two related questions about this property:

1) is the vertex we start at counted in this black vertex count?

2) is the leaf we end at counted in the black vertex count?

I have a secret theory about both of these questions, but am hoping for confirmation and so shalt not yet reveal it.

twentysixteen child theme – responsive menu – ham icon button not working – Cannot read property ‘classList’ of null

I am trying to convert this site into twentysixteen child theme. It appears that /js/menu.js in my child theme is not working as nothing happens when the ham icon button is clicked (pls.see my site link above to check correct behavior). On inspecting via Google Chrome Inspect I am getting the following errors:

Uncaught TypeError: Cannot read property ‘classList’ of null at mediaqueryresponse (menu.js?ver=5.3.2:19) at menu.js?ver=5.3.2:10 at menu.js?ver=5.3.2:31 mediaqueryresponse @ menu.js?ver=5.3.2:19 (anonymous) @ menu.js?ver=5.3.2:10 (anonymous) @ menu.js?ver=5.3.2:31

Any advice is appreciated

header.php in child theme

<header class="header" id='myTopnav'>  <?php  wp_nav_menu(              array(                   'theme_location'=> 'topnav',                   'container' => 'nav',                   'menu_class' => 'topnav',                   'menu_id'    => 'myTopnav',                   )  );?>  <button class="ham-icon"><span class="fa fa-bars fa-2x"></span></button>  </header> 

/js/menu.js in child theme

(function () {   var mql = window.matchMedia("screen and (max-width: 960px)");   //detect media query    var navTop = document.querySelector(".header");   //return first element within the document that matches .header    var toggle = document.querySelector(".ham-icon");    mediaqueryresponse(mql);   //ensures that addListener function is executed when the page loads, by default addListener only fires when state of the window changes   mql.addListener(mediaqueryresponse);    function mediaqueryresponse(mql) {     if (mql.matches) {       toggle.addEventListener("click", clickMenu);       //if media query matches, execute click or clickMenu event     } else {       navTop.classList.remove("responsive");       //otherwise remove .responsive       toggle.removeEventListener("click", clickMenu);       //and remove EventListener     }    }    function clickMenu() {     navTop.classList.toggle("responsive");   }  })(); 

Google Search Console: Separate Subdomain Property from Top Level Property

I’m working with a website and there’s a subdomain which I don’t have access to.

In Google Search Console, the “Property” consists of the entire domain, including this subdomain. (It’s all part of 1 Property).

The subdomain is handled by a different part of the company — and it has a bazillion issues which show up in Google Search Console for the domain as a whole.

I’d like to separate these two domains into two different Search Console properties so that the top level site doesn’t “see” the errors from the subdomain. And I’d like the subdomain to be its own property in Search Console.

(Also I’m a little afraid that the poor quality subdomain may be impacting the search performance of the top level domain? I’m not sure about this).

What I’ve done so far:

I used “Add Property” to add the subdomain to Search Console. That part was easy enough.

Now I have a listing for the top level domain and the subdomain.

What I want to do next

Is there a way to tell Search Console to then ‘ignore’ the subdomain from the main, top-level Search Console property?

Effectively this would give me two totally different Search Console properties. One for the top-level (minus the subdomain) and one for the subdomain.

Is this possible?

Use the Rice’s theorem to prove that the following property of a Recursive Enumerable language L is undecidable

This exercise was taken from the book “Languages and Machines: An Introduction to the Theory of Computation” by Thomas Sudkamp. It refers to exercise 12 (b) chapter 12. Given a language L which is recursive enumerable, I have to prove that the following property is undecidable:

  • L is finite

The text says that it is sufficient to prove that it is a non trivial property.

I tried to solve the exercise as follow:

Consider the empty language $ \emptyset$ , which contains only the empty string λ, in other words $ \emptyset$ = {$ \lambda$ }. Then $ \emptyset^-$ which is the negation of the empty set, will contains some string which is not $ \lambda$ . By doing this, I’ve found a language which is finite and does satisfy the property, but I’ve also found another language which doesn’t satisfy the property because $ \emptyset^-$ it is not finite. In conclusion the property it is not trivial, and by the Rice’s theorem it is impossible to decide that property.

I’m not sure if I’m doing the right thing here and I haven’t found any solution to this exercise… Can anyone help or at least tell me if I’m doing it right?

Thank you very much.

What is the property of a PL that extracting a subroutine should not change the meaning?

What is the name of the property of a Programming Language that says that extracting a subprogram into a subroutine and using that subroutine instead of the subprogram should not change the meaning of the program?

I could swear that this exists and that it has a well-known name, but I can’t for the life of me remember it. My efforts to search for the name have been thwarted by being swamped with results for the Liskov Substitution Principle or Referential Transparency.

What I am looking for is the property that I should be able to replace



void hello() {     printf("Hello"); }  hello();  

without changing the meaning of the program.

I think it is named after the person who coined it, but I am not sure. Something like XYZ Equivalence or XYZ Principle where XYZ is the name of a well-known Computer Scientist. I want to say Strachey, but I couldn’t find a mention of anything similar in Fundamental Concepts in Programming Languages.

How to add apply_filter for a class property in plugin

I am trying to add an apply_filters function to a property of a class so that the form fields could be added to from another plugin or functions.php but I just can’t get the $ filter_fields to set. Can anyone tell me what I’m doing wrong? When I echo out $ form_fields I get the h4 and the submit button but no fields.


class RegForm {            // Properties         private $  fields;          private $  filter_fields;           // Constructor         function __construct(){              $  this->fields = array(                 'name'      => '<label>Name.</label><br>                                 <input type="text" name="name"><br>',                 'business name' => '<label>Business Name.</label><br>                                 <input type="text" name="business_name"><br>',                 'email'     => '<label>Email.</label><br>                                 <input type="email" required="required" name="email"><br>',                 'password'  => '<label>Password.</label><br>                                 <input type="password" required="required" name="password"><br>'                 );              add_shortcode('registerform', array($  this, 'create_reg_form'));          }            // Methods              public function init (){                 $  filter_fields = apply_filters('tbg_reg_fields', $  this->fields);             }              public function create_reg_form ($  filter_fields){                  $  form_fields = implode($  this->filter_fields);                   ?>                     <h4>Register as a New Store Owner</h4>                         <form method="post" class="tbg_reg_form" action="' . admin_url( 'admin-ajax.php' ) . '">                             <?php echo $  form_fields; ?>                             <input type="hidden" name="action" value="tbg_form_submit">                             <input type="submit" value="Start Selling Now">                         </form>                     <?php                     }                 }          $  newForm = new RegForm;         add_action ('plugins_loaded', [$  newForm, 'init']); 

and in the themes functions.php file I have

    // Registration Fields   function add_age_field($  new_fields) {     $  new_fields[] = '<label>Website.</label><br><input type="text" name="website"><br>';     return $  new_fields; }  add_filter('tbg_reg_fields', 'add_age_field'); 

Pathfinder 1-e, if a paladin uses their divine bond to give their weapon a special property, what means would players have of identifying it?

A paladin’s 5th level Spell like ability Divine bond allows them to give their divine bonded weapon a level based enhancement bonus or an equivalent special property picked from axiomatic, brilliant energy, defending, disruption, flaming, flaming burst, holy, keen, merciful, and speed. I’d like to know how a player character might identify the property picked when facing a paladin.

Normally, per this stackexchange, when identifying the properties of a magic item that isn’t a potion or a scroll, you esentially have to use a magic spell. Either detect magic, identify, or analyze-dweomer.

But divine bond is a spell like ability and a “spell-like ability works just like the spell of that name”. Spell effects in place can be identified with a DC20+spell level Knowledge arcana check. If a character class grants a spell-like ability that is not based on an actual spell, the ability’s effective spell level is equal to the highest-level class spell the character can cast, and is cast at the class level the ability is gained, which makes, I believe, this a DC between 21 and 24.

On top of that, a knowledge religion check of 10+ class level when the feature is granted can identify a class feature from a class that grants divine spells, which for a paladin would be a DC 15 knowledge religion check. Would this identify the choices the paladin has made, or just the options they have available to them?

Would a knowledge arcana check identify the bonus granted (and the level the spell was cast at) by the spell Magic Weapon, Greater, or just that it was cast? Would that sort of granularity apply to a clas feature/spell like ability?

Does the “reappearing” property of the “Shadowneedle” Unbreakable Arrow function?

In Adventurers League play, it is possible to find a “Shadowneedle” (Unbreakable arrow), which has this special text :

One of twenty unbreakable arrows crafted with Shadowsong [A flavored Oathbow that could be found in Adventurers League play in the past, and is still tradeable today], when this arrow is nocked onto the Oathbow and leveled at an opponent, a gentle hum fills the wielder’s mind, steadying their hand and steeling their focus (this feature has no mechanical effect). When [the Shadowneedle is] fired from Shadowsong, the wielder may say the words “Needles, return to your thread” to make this arrow (and any other in its set loosed from the wielder’s hand) reappear in the wielder’s quiver.

However, ammunition are apparently considered as Consumables in general, and the Dungeon Master’s Guide has a section on such items :

Some items are used up when they are activated. A potion or an elixir must be swallowed, or an oil applied to the body. The writing vanishes from a scroll when it is read. Once used, a consumable item loses its magic.

Does that mean that a Shadowneedle, even when shot from Shadowsong, loses its magical properties and thus won’t fly back when the words are spoken ? Or am I (hopefully) missing something, making the “reappearing” property of the Shadowneedle function properly ?

Proving that Rice’s theorem does not apply to a property

This is related to an assignment, but I would still appreciate help in formalising proof either through private message or on this topic.

The question is about if Rice theorem applies to certain property. For example for a structural property such as number of states. I would argue that:

  • The property is decidable through its definition in encoded form.
  • The property is irrelevant to the language, because given the same language we can easily find another TM that does not have this property, ie one with empty states, so the property is not a language property, and hence Rice Theorem does not apply, since by definition, Rice theory only applies if it is a non trivial language property.

To me, this seems to be a good argument, but the question is assign a substantial mark of 10, and I feel like this is not enough for 10 marks, am I missing out some rigorous argument that I need to include to make my explanation crystal clear?