dnd 5e – If you are falling, can you Misty Step to the ground to avoid damage?

If you fall in 1 round and within the next round you successfully cast Misty Step before hitting the ground, you will be able to avoid taking fall damage according to the main answers of related questions that V2Blast has linked.

Potential problem.
You won't be able to instantly launch Misty Step because the furthest you can teleport is 30 feet and you would still be in the middle of the last 500 foot drop. From bonus actions can't prepare, but they only launch on your turn, you cannot cast Misty Step in reaction.

According to the next tweet, a bonus action cannot be prepared to be taken on a different turn. However, if you are the only one to fall and your turn lasts the round, you can reasonably wait until the end of the round to cast Misty Step to avoid damage from the fall (emphasis on my tweet).

Only one bonus action can be taken on your turn. Therefore, you cannot use Done with a bonus action. #DnD

Rules for a DM.
Your DM might have you do an intelligence or wisdom check to see if you correctly judge how far away the ground is when you cast the spell, but that's just a suggestion.

oop – Plugin architecture question: how to avoid the use of transients

I am creating an internal plugin that will offer a filtering mechanism using AJAX for any type of post depending on the settings, which I have stored in a JSON.

When the plugin loads I need to configure the callback for the AJAX call, and I configured it right away (I'm left with OOP):

``````\$gfb = FilterBuilder::get_instance();
\$action_filter_reg_instance = new ActionFilterRegistration();
``````

That sets the callback and it works fine … but that instance of \$ gbf is lost when the page displaying posts is loaded and I need to set more properties when the template loads.

For example, when the page displaying the posts loads, I create a new FilterBuilder object and pass it the query arguments which are then stored in the instance as a property of the class.

When the callback is invoked, it is its own instance of a FilterBuilder, so everything I defined in the template does not exist in this class instance.

This makes me a little tricky because I would like to have access to the query arguments that were defined when that particular instance was created.

For the moment, I have resorted to using transients so that I can have a common place to access the query arguments that the template instance defined from the callback function, but this just feels bad. Also, I think the transients have a maximum length and therefore this could explode if that limit is reached.

What other options are there? Maybe serialize the template class instance into a JSON and load it from the callback? That also sounds … a little meh.

I don't want to use global variables … interested in what you think would be a fancy approach to get around this problem.

Thanks for taking the time to read this! 👍🏽

postgresql – Avoid sorting on group indexed by caused by DATE_TRUNC

Is there a way to avoid `Sort` operation for `GROUP BY`, caused by the `DATE_TRUNC` function not recognized as `tstamp`which is part of the `ix` index? That function does not really affect the order maintained by the `ix`.

``````CREATE INDEX ix ON tbl(col, tstamp, num)

SELECT col,
DATE_TRUNC('MONTH', tstamp AT TIME ZONE 'UTC') AS trunc,
SUM(num)
FROM tbl
WHERE col IN (?, ?, ...)
AND tstamp >= ?
AND tstamp <  ?
GROUP BY col, trunc
``````

Precision parameter for `DATE_TRUNC` is dynamic it could also be `'DAY'` or `'YEAR'`... so I can't index that function without creating an index for each variation.

The execution plan I get:

``````Finalize GroupAggregate
Group Key: col, DATE_TRUNC('MONTH', tstamp AT TIME ZONE 'UTC')
->  Gather Merge
Workers Planned: 2
Workers Launched: 2
->  Partial GroupAggregate
Group Key: col, DATE_TRUNC('MONTH', tstamp AT TIME ZONE 'UTC')
->  Sort
Sort Key: col, DATE_TRUNC('MONTH', tstamp AT TIME ZONE 'UTC')
Sort Method: external merge  Disk: ...kB
-> Parallel Index Only Scan using ix on tbl
Index Cond: ((col = ANY (...)) AND (tstamp >= ...) AND (tstamp < ...))
Heap Fetches: 0
``````

The execution plan I want would look like this:

``````GroupAggregate
Group Key: col, DATE_TRUNC('MONTH', tstamp AT TIME ZONE 'UTC')
->  Index Only Scan using ix on tbl
Index Cond: ((col = ANY (...)) AND (tstamp >= ...) AND (tstamp < ...))
Heap Fetches: 0
``````

(I get it if I don't use `DATE_TRUNC`)

Magento 2, How to avoid the automatic update / recharge of the billing address, while adding information to the fields in the new billing address?

Magento 2, How to avoid the automatic update / recharge of the billing address, while adding information to the fields in the new billing address?

How do you avoid the drama of the forum?

I am asking for advice to a great extent. I am trying to take the best possible steps to prevent drama from becoming a problem in my community. We haven't had this problem yet, but we have recently increased the number of new members, so it is always good to check what other administrators are doing. You can never be too careful.

jsp – Avoid displaying the URL or data in tag url and href

I'm a little new to jsp and I require something that I really don't know how to solve.
I am sending jsp data to a servlet I use method post to send data, but in some cases I need to use tags but then that if it is seen in the url when I press it and in the inspector how can I do to avoid this?

Example:

``````
``````

What is a Google penalty and how to avoid it?

ttp: //www.seorefugee.com/ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

What is a Google penalty and how to avoid it?

1. What is a Google penalty and how to avoid it?

What is a Google penalty and how to avoid it?

Publishing permissions

• you could not post new threads
• you could not post answers
• you could not publish attachments
• you could not edit your posts

.

Authentication: How can I avoid SSL / TLS tethering in my app?

I am debugging my Windows application that has SSL / TLS tethering, and I want to skip / remove it so I can debug the endpoints. How could I get the CLIENT_HANDSHAKE that the app uses?

I can definitely patch the app but not the code because it would make it vulnerable. So how could I do this?

Python – My first code – looking for comments on best practices and things you should avoid doing in the future

After learning a little Python, I tried to code something myself. I tried to do a Blackjack game, which is far from perfect, and it still doesn't have some rules that a real game has (in my game an ace always has 11 points, whereas in reality it can also be counted as 1 point).

However, there is a problem that I am having, simply because I don't understand it: I would like to package some of my code in methods and call them, but I have a problem with some variables. I use j as a variable for the card that would be at the top of the deck. By default it is set to 4, because after the opening hands are dealt, the first card in the deck is the fourth. Every time the player receives an additional card, j increases by 1. When the user finishes playing and it is the dealer's turn, I want to keep the current value of j and not return to j being 4. How do I need to restructure my code? to keep the changes that have been made to j in the while loop, if I put that loop in its own method? Is there a way to "extract" a value from a variable from another method?

Also, I want to develop good habits from the beginning and tried to use the best practices I know of, like using formatted strings or using `j += 1`instead of `j = j + 1`. Is there a bad practice in my code? Where can I improve? Here is the game in its current state, it seems to be working properly as I have not found a way to break it. (A minor flaw is that you have to press "Y" or "y" for another card, but instead of pressing "n" or "N" to have no more cards you can press nothing)

``````import random

# the player plays first
# dealer goes second
# dealer hits on 16 and stands on 17

deck_of_cards = ("Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King", "Ace")
cards = {
"Two": 2,
"Three": 3,
"Four": 4,
"Five": 5,
"Six": 6,
"Seven": 7,
"Eight": 8,
"Nine": 9,
"Ten": 10,
"Jack": 10,
"Queen": 10,
"King": 10,
"Ace": 11,
}

def drawing_a_card(card_num):
i = card_num - 1
drawn_card = deck_of_cards(i)
return drawn_card

random.shuffle(deck_of_cards)
players_first_card = drawing_a_card(card_num=1)
players_second_card = drawing_a_card(card_num=3)

dealers_first_card = drawing_a_card(card_num=2)
players_total = cards(players_first_card) + cards(players_second_card)

print(f"Dealer's first card: {dealers_first_card}")
decision = input(f"You are standing at {players_total}, would you like another card? (Y/N) ")
if players_total == 21 :
print(f"You hit 21! That's Blackjack, you win!")

j = 4
while decision.lower() == "y":
if decision.lower() == "y":
players_next_card = drawing_a_card(card_num=j)
players_total += cards(players_next_card)
j += 1
if players_total > 21:
print(f"That's a Bust! Your total was {players_total}")
break
elif players_total == 21:
print(f"You hit 21! That's Blackjack, you win!")
break
else:
decision = input(f"You are now standing at {players_total}, would you like another card? (Y/N) ")

k = j+1

if players_total < 21:
print("The Dealer will now take his turn...")
dealers_second_card = drawing_a_card(card_num=k)
k += 1
print(f"Dealer's cards are {dealers_first_card} and {dealers_second_card}")
dealers_total = cards(dealers_first_card) + cards(dealers_second_card)
if dealers_total == 21:
print(f"The Dealer hit 21! That's Blackjack, the Dealer wins!")
while dealers_total <= 16:
print(f"Dealer's total is {dealers_total}, he'll take another card.")
dealers_next_card = drawing_a_card(card_num=k)
print(f"The Dealer's card: {dealers_next_card}")
dealers_total += cards(dealers_next_card)
k += 1
if dealers_total == 21:
print(f"The Dealer hit 21! That's Blackjack, the Dealer wins!")
elif dealers_total > 21:
print(f"The Dealers total is {dealers_total}, he has bust and you win!")
if dealers_total >= 17:
print(f"The Dealer stands at {dealers_total}")
if dealers_total < players_total:
print(f"Your total is {players_total}, which is higher than the Dealer's {dealers_total}, you win!")
elif dealers_total == players_total:
print(f"You and the Dealer are both standing at {dealers_total}, it's a draw!")
elif dealers_total > players_total:
print(f"The Dealer beats your {players_total} with his {dealers_total}, you lose!")

$$```$$
``````