What range is used to determine targets for the victim of a Spectator’s Confusion Ray

The Spectator has an Eye Ray option, Confusion Ray, that says:

[The target] uses its action to make a melee or ranged attack against a randomly determined creature within range.

Unlike the spell Confusion which limits the attack to melee attacks, the Spectator’s victim can be compelled to make a ranged attack.

When determining the random target are creatures that are outside of the weapon’s normal range but within the weapon’s long range included?

For a specific example a Rogue with a light crossbow is hit by the ray and fails their save. On their turn there are three allies within 80 ft, and the Spectator is 90 ft away. Is there a chance that the Rogue randomly targets the Spectator?

Can I use my own implementation of a widely used, supposedly secure cryptographic algorithm for securing data at rest?

I know you shouldn’t roll your own crypto and generally its not a good idea to implement (and then deploy) any extensively tested and recommended algorithms by yourself either.

I have already seen this question, and as far as I understand, the main problem with implementing things yourself is that you will probably remain vulnerable to a host of side-channel attacks.

But suppose I have already implemented AES (just for fun and as a learning experience). What if I now use that implementation for simply encrypting files locally (and then perhaps back them up on the cloud or on removable media)? Since nobody other than me would be using the implementation, most of the side channel attacks would not apply. For instance, since no attacker can request an encryption/decryption (the way it works with a server), no timing attack can be carried out. Would this scenario be sufficiently secure?

In other words would using my own implementation of AES provide security for data at rest or will using it still be a stupid idea?

Getting strange output on commands that used to work

I have used the following code before and it worked then but now it seems to default to the word Function, and some of the other commands are giving results like All when they used to work.

Would you help clarify what’s going on?

 usaStateCases[s_] :=       Select[data, MatchQ[Interpreter["USState"][s], First[#]] &][         All, #ConfirmedCases["LastValue"] &] // Normal // First          usaStateDeaths[s_] :=       Select[data, MatchQ[Interpreter["USState"][s], First[#]] &][         All, #Deaths["LastValue"] &] // Normal // First          usaStateCases["California"]  

This used to work but now, the output of the last line is Function

TIA

Can choice function in SHA algorithm be used in a simplied way?

While going through the official documentation SHA algorithms from NIST here.

There is a choice and Majority function used. Maj(π‘₯,𝑦,𝑧)=(π‘₯βˆ§π‘¦)βŠ•(π‘₯βˆ§π‘§)βŠ•(π‘¦βˆ§π‘§)
Ch(π‘₯,𝑦,𝑧)=(π‘₯βˆ§π‘¦)βŠ•(Β¬π‘₯βˆ§π‘§)

Can I use Ch (or Maj) function in a simplified version?

eg:

(x^y)βŠ•(Β¬π‘₯βˆ§π‘§)
=(x^y)^ Β¬(Β¬π‘₯βˆ§π‘§) + Β¬(x^y)^ (Β¬π‘₯βˆ§π‘§)
=(x^y)^(x + Β¬z) + (Β¬x + Β¬y)^ (Β¬π‘₯βˆ§π‘§) can be further simplified as

(x^y) + (Β¬x ^z)

can above simplified version be used ??

How to explode single string IF it’s used in shortcode

I have a shortcode that works to display posts from specific categories, or a single post based on the post slug. I’m having trouble figuring out how to get it to display multiple posts based on their slugs though. I know I need to use explode, but I can’t seem to get it right.

Here’s the current working code:

add_shortcode( 'latest_post', 'latest_post_query_shortcode' ); function latest_post_query_shortcode(  $  atts ) {     ob_start();     $  atts = shortcode_atts( array(             'posts_per_page' => '',             'category' => '',             'offset' => '',             'post' => '',     ), $  atts );      $  args = array(             'post_type'     => 'post',             'post_status'   => 'publish',             'posts_per_page'=> $  atts['posts_per_page'],             'offset'             => $  atts['offset'],         );              // Add category if not empty     if ( ! empty ( $  atts['category'] ) ) {         $  args['tax_query']  = array(                  array(                     'taxonomy'  => 'category',                     'field'     => 'slug',                     'terms' => $  atts['category'],                 ),              );           }          // Add post if not empty     if ( ! empty ( $  atts['post'] ) ) {         $  args['name']  = $  atts['post'];     }         $  string = '';              // The Query     $  query = new WP_Query( $  args );       // The Loop     if ( $  query->have_posts() ) { ?>         <section class="recent-posts clear">         <?php while ( $  query->have_posts() ) : $  query->the_post() ; ?>             <article id="post-<?php the_ID(); ?>" <?php post_class( 'left' ); ?>>                  <?  echo '<a href="' . get_permalink( $  _post->ID ) . '" title="' . esc_attr( $  _post->post_title ) . '">';                     echo get_the_post_thumbnail( $  _post->ID, 'large' );                     echo '</a>';                     echo '<h2><a href="' . get_permalink( $  _post->ID ) . '" title="' . esc_attr( $  _post->post_title ) . '">';                     echo get_the_title( $  _post->ID);                     echo '</a></h2>';                  ?>             </article>         <?php endwhile;          wp_reset_postdata();?>           </section>                   <?php          $  clean = ob_get_clean();         return $  clean;           } } 

I tried adding:

'name' => explode( ', ', $  post), 

inside

$  args = array( 

but that didn’t return anything when I tried specifying two slugs, for example: [latest_post post="almond-cake, coconut-pie"] (If I use either one of those, it works, but not both.)

Additionally once I added the explode, it game me this warning everywhere else the shortcode was used:

Warning: trim() expects parameter 1 to be string, array given…

Can Armor of Hexes be used to cancel a ranged spell attack?

Can Armor of Hexes be used to cancel a ranged spell attack like Scorching Ray? Does one ray count as an attack roll because you roll to hit?

Armor of Hexes

"At 10th level, your hex grows more powerful. If the target cursed by your Hexblade’s Curse hits you with an attack roll, you can use your reaction to roll a d6. On a 4 or higher, the attack instead misses you, regardless of its roll."

Scorching Ray

"You create three rays of fire and hurl them at targets within range. You can hurl them at one target or several. Make a ranged spell attack for each ray. On a hit, the target takes 2d6 fire damage."

When are Ability Scores (not modifiers) used in D&D 5e?

In D&D, the main ability is a score from 1-30, while the modifiers range from -5 to +10 (score -10/2 round down)

In the Player’s Handbook, it states:

Because ability modifiers affect almost every Attack roll, ability check, and saving throw, ability modifiers come up in play more often than their associated scores.

So when do the scores come up?

How can a Hobgoblin Captain be used as a player character?

On my last session as DM, a party of five level 3 players managed to make a Hobgoblin Captain become friendly with them and ultimately join them.

There’s a new player who’d love to take the character of the Hobgoblin (so it would be six players).

I find it really interesting to make him able to do so, but I can’t see how to make it a PC, able to level up and so on, while keeping him as similar as possible to the original monster, and obviously not making everything unbalanced.

How could a Hobgoblin Captain become a playable character, which can level up as players do? (It doesn’t to be exactly the same as it is in the monster manual)

Can musical instruments under the effect of Animate Objects be used to make music?

Can Animate Objects be used to make musical instruments produce that instrument’s music?

The spell’s description is a bit vague as to how much control you have over animated objects for non-combat purposes.

Wind instruments probably wouldn’t work but I’d assume mechanical instruments could work, such as accordions or drums.