WP_Query: how to search tags in addition to a custom post type?

Below is what I have so far for a custom rest endpoint (‘placesdb/v1/search?term=’) for a custom post type (place). This successfully returns all the places that have the search term in the title or content. However, I also want to return all the tags (tag archive pages) that match the search term (the same result as calling the non-custom ‘/wp/v2/tags?search=’). Is it possible to somehow add the tag results to the place results? I already successfully did the front-end approach of calling the places and tags endpoints separately via ajax, but I would rather get all the data in one swoop. Hence my attempt at making this custom endpoint.

function placesSearch() {   register_rest_route('placesdb/v1', 'search', array(     'methods' => WP_REST_SERVER::READABLE,     'callback' => 'placesSearchResults'   )); } function placesSearchResults($  data) {   $  places = new WP_Query(array(     'post_type' => array('place'),     's' => sanitize_text_field($  data['term'])   ));    $  placesResults = array();    while($  places->have_posts()) {     $  places->the_post();     array_push($  placesResults, array(       'title' => get_the_title(),       'permalink' => get_the_permalink()     ));   }    return $  placesResults; } add_action('rest_api_init', 'placesSearch'); 

Question about the addition of hydrogen to a molecule undergoing MoleculeModify

I would like to identify the atom that used to participate in a bond before the molecule was modified by MoleculeModify[mol, {"DeleteBond", {idx1, idx2}}].

According to the official documentation of MoleculeModify:

When removing or replacing an atom, the number of explicit hydrogen atoms may be adjusted to maintain proper valence. Disconnected hydrogen atoms will be removed.

This suggests to me that I should be able to find the formerly participating atom in the connected component by finding the current bond that features the highest atomic index (mol // AtomList // Length).

My questions are:

  1. Is the new hydrogen atom, added to balance out the valences, always guaranteed to have the highest index in the list of atoms of the connected component? (In other words, is such an approach robust?)

  2. Is there a better way to do this?

If the Feywild Shard magic item’s Wild Magic Surge results in a spell, does that replace the initial triggering spell, or occur in addition to it?

Tasha’s Cauldron of Everything (p. 127) includes a magic item called the Feywild shard. The relevant part of its description states:

When you use a Metamagic option on a spell while you are holding or wearing the shard, you can roll on the Wild Magic Surge table in the Player’s Handbook. If the result is a spell, it is too wild to be affected by your Metamagic, and if it normally requires concentration, it doesn’t require concentration in this case; the spell lasts for its full duration.

This part is the one that some in my group don’t agree on:

  • My reading: You cast a spell that is being affected by Metamagic. You then choose to roll on the table. If the resulting effect listed on the table is then also a spell, it is separate from the original spell and has the two listed added conditions (Metamagic can’t be used on it, and it doesn’t require concentration).
  • The others think that if the result of the roll on the Wild Magic Surge table is a spell, it replaces the original spell, and the original Metamagic option you chose doesn’t affect it.

Which interpretation is correct?

IEEE 754 addition wrong result floating point numbers

I want to add two IEEE 754 numbers. I followed the steps to add two 754 numbers. However the result it not correct. Number 1: S:0 E:01111111 M:11111111111111111111111

Number 2: S:0 E:01111111 M:00000000000000000000000

Here is my calculation:

enter image description here

The site http://weitz.de/ieee/ gives this result: S: 0 E: 10000000 M: 10000000000000000000000

in my calculation the mantissa is 01111… Why?

Is there a good reason (and what can it be) to require DAC restriction on IPC in addition to SELinux rules?

Our company is developing an AOSP-based platform for our customer. Some of our vendor services are using HWBinder for IPC which is using SELinux to restrict service discovery and access. The problem is that our customer insists that SELinux restriction is not enough and we need to provide a DAC-based restriction as well.

Our customer is basing this requirement on a security audit that was conducted on an earlier version of the platform. This security audit, however, didn’t evaluate HWBinder IPC, but a socket-based IPC that was used in older services. The issue that was highlighted during this audit is that Unix sockets had 0666 access and a recommendation was to change it to 0660 and use Unix groups to allow only specific services to access the socket.

For some reason our customer is now requiring to apply the same (or similar) approach to HWBinder IPC which, however, doesn’t have anything to attach these permissions to.

Unfortunately so far I couldn’t get a straight answer regarding their threat model, so my question is: Does it even make sense to require DAC + SELinux and if so, what threat model should I be considering to properly implement this restriction?

Also, any ideas regarding how I can get our customer an additional layer of security without changing the IPC method would be greatly appreciated.

Is there a way to map the concatenation operation over strings to the addition operation over $\mathbb{N}$

Given an alphabet, say $ \Sigma = \{0,1\}$ , I can make a one-to-one mapping from all possible strings $ x \in \Sigma^*$ to $ \mathbb{N}$ . This could be done by ordering $ \Sigma^*$ lexicographically and assigning the $ i$ th string $ x_i$ to number $ i \in \mathbb{N}$ .

But given strings $ x_i,x_j \in \Sigma^*$ , is there any special mapping such that the concatenation operation $ f:\Sigma^* \rightarrow \Sigma^* | (x_i,x_j) \rightarrow x_ix_j$ is also related to the usual addition performed over the corresponding indices $ i,j \in \mathbb{N}$ to which $ x_i$ and $ x_j$ are mapped ?

For instance, if I assign the character $ \{1\}$ to the number $ 1$ , and string $ x$ is assigned the number $ 10$ , is there a mapping such that the string $ x1$ is assigned the number $ 11$ ? (i.e. $ 10 + 1$ )

Is this addition to the spell Negative Energy Flood balanced?

In this question I outlined an inconsistency in the RAW interpretation of the spell Negative Energy Flood (XGtE, pg. 163): a size Large or larger creature killed by it rises as a size Medium zombie. To remedy this, I have added to the spell description to make it scale with the size of creature killed. Bold in the spell description indicates my addition to the spell.

Negative Energy Flood

5th-level Necromancy
Casting Time: 1 Action
Range: 60 feet
Components: V, M (a broken bone and a square of black silk)
Duration: Instantaneous

You send ribbons of negative energy at one creature you can see within range. Unless the target is undead, it must make a Constitution saving throw, taking 5d12 necrotic damage on a failed save, or half as much damage on a successful one. A target killed by this damage rises up as a zombie at the start of your next turn, having the same size and shape as the target. If the zombie is of size large or larger, it deals extra dice of damage on a hit. Double the weapon dice if the zombie is Large, triple the weapon dice if it’s Huge, and quadruple the weapon dice if it’s Gargantuan. Statistics for the zombie are in the Monster Manual. The zombie pursues whatever creature it can see that is closest to it.

If you target an undead with this spell, the target doesn’t make a saving throw. Instead, roll 5d12. The target gains half the total as temporary hit points.

This solves the obvious problem of Gargantuan creatures becoming Medium zombies, and I anticipate a size change alone has little implications for balance – correct me if I am wrong.

Potential balancing issues arise in increasing the damage output for Large and larger zombies. I borrowed the language directly from DMG pg. 278 in the section on creating your own monster stat blocks, taking into account the size of the monster. Step 11 of Creating a Monster Stat Block reads:

Big monsters typically wield oversized weapons that deal extra dice of damage on a hit. Double the weapon dice if the creature is Large, triple the weapon dice if it’s Huge, and quadruple the weapon dice if it’s Gargantuan.

A zombie has a Slam attack that deals 1d6+1 damage on a hit (Monster Manual, pg. 316). So for a large zombie, the damage on a hit would be 2d6+1, Huge 3d6+1, and Gargantuan 4d6+1.

I don’t think only scaling the damage dice by size would make the spell too much more powerful than it already is, the zombie still has an AC of 8 and 22 hitpoints. What would start to tip the scales out of balance, I think, would be scaling the hit dice according to Step 8 in the same section of the DMG (pg. 276), especially for Gargantuan creatures. Scaling hitpoints in this way gives: Large – 25 (3d10+9), Huge – 28 (3d12+9), and Gargantuan – 40 (3d20+9).

Allowing the spell to scale hitpoints in this way for Gargantuan creatures gives the zombie nearly twice the staying power as the original version of the spell did. I also couldn’t think of a clear way to word it into the spell description. For this reason, I propose only scaling the damage dice for the zombie with the zombie’s size.

Is this buff to Negative Energy Flood still appropriately balanced as a 5th-level spell?

Does “Claw at the Moon” require the character to make a normal attack roll in addition to the Jump check?

Claw at the Moon’s description states the following:

ToB p.86

As part of this maneuver, you attempt a Jump check to leap into the air and make a melee attack that targets your foe’s upper body, face, and neck. The Jump check’s DC is equal to your target’s AC. If this check succeeds, your attack deals an extra 2d6 points of damage. If this attack threatens a critical hit, you gain a +4 bonus on your roll to confirm the critical hit.

If your check fails, you can still attack, but you do not deal extra damage or gain a bonus on a roll to confirm a critical hit. The maneuver is still considered expended.

I have two interpretations of this maneuver’s effect:

  1. You get to make a Jump check and a normal attack roll, if the check fails, you only take into account the normal attack roll and don’t have any additional bonuses.
  2. You only make the Jump check to determine the attack roll (since the DC of the roll is the enemy’s AC, it would make sense), and only if you fail, you can make a normal attack roll and attack normally.

Logic dictates that the first interpretation is the correct one and that the second one is a tad overpowered, but I’ve been wrong before. Which interpretation is the correct one?

Procedure for finding if Overflow occurs on addition

I have two 4-bit 2’s complement numbers a,b, and their sum in s (Also a 4-bit 2’s complement number). Using only the basic logical operations, I need to write a procedure to find if an overflow occurs. If there is an overflow, the output needs to be 1000 otherwise it is 0000.

The inputs in this procedure are a, b, s, and output is 1000 or 0000 depending on the inputs. I am allowed to use AND, OR and NOT operators

I know that there is an overflow if a and b have the same most significant bit and c has a different most significant bit but can’t seem to figure out what the expression should be except that whatever the result is, needs to be ANDed with 1000 for the final result. How do I solve this?