algorithms – Find a list of actions that result in desired state

I have a problem that I need to solve, and I’m looking for which area of computer science (algorithms. etc) would be appropriate to solve this problem.

In the system we have a list of actions that a user has previously taken. The possible actions are:

  • User creates item of type A.
  • User creates item of type B.
  • User creates item of type C.

The date and time the action was taken is also recorded.

We have a function passesRules which takes the list of all actions the user has previously taken as input, and applies a set of rules and returns a boolean. The boolean is true if any of the rules are true, and false if none of the rules are true.

There are many possible rules, but in general they take the form of:

  • Has user created 5 items of type A in the last 10 days?
  • Has user created 2 items of type B in the last 3 days?
  • Has user created more than 6 items of type C in last 5 days, AND
    created 3 items of type A in the last 10 days?

What I want to do is to create a function predictActions which predicts the actions the user must take so that passesRules returns true.

Obviously with the rules described above there are multiple different sets of actions that could make passesRules return true. I would like predictActions to return an array where each element in the array is a list of actions the user could take to make passesRules return true.

predictActions should take the following parameters:

  • The list of actions the user has previously taken.
  • The list of rules.
  • The current date.

I’m not asking for a solution, but I don’t know what area of computer science to investigate further to model and solve this problem. Something from graph theory, or some type of constraint solver?


dnd 5e – Do legendary actions trigger effects that happen at the beginning of the monster’s turn?

Consider this scenario. The monster is standing in the area of the cleric’s spirit guardians. As written, the monster takes damage at the beginning of its turn as long as it’s standing in the field. Suppose, however, that the monster takes a legendary action before its turn in initiative order. Does this trigger the effect of the spirit guardians, in addition to the normal trigger that would happen at the beginning of its regular turn? My ruling on the matter during the game was that it did not… This would seem to violate the whole purpose of legendary actions, resulting in a massive debuff of the monster (i.e. taking double spirit guardian damage simply because it took another turn in the initiative order).

magento2 – Apply filters or mass actions on grids with fake collection (or wirhout ui components)

I a admin grid with a change on _prepareCollection() function to get the collection from a response of api call, its working fine. But I do not have the filters or mass functions, how can I do that without ui components?

enter image description here

I have this change on my grid file:

 * Collection
protected function _prepareCollection()
    $filter = (
        'query' => 'cat yellow',
        'page' => 1,
        'region' => '',
        'year' => '',

    $collection = $this->_api->searchCat($filter);

    return parent::_prepareCollection();

If I could simulate a collection, maybe I could use ui components, but I’m lost, how can I resolve my problem?

The idea is use the filter to search cats with cat api, and the mass action is to import those registers into a products.

tpm – What kind of “actions” can a TPM2 policy authorize?

I’ve been instructed to use the state of our system’s TPM’s PCR registers to prevent the system we’re working on from booting if one of the PCR registers is different from what we expect. In service of that goal, I’m reading over this article:

there is a paragraph near the middle that reads:

TPM2 has the ability to create policies based off of PCRs: If the PCR contents do not match expectations, the policy will not authorize the action.

What kind of actions are they talking about here? And what would be the immediate ramifications if the action was not authorized?

Some background:
Before today, I was under the impression that the principle trick of the TPM was to encrypt or decrypt data using a key that the TPM holds securely. Now this article suggests that the TPM can also (two different functions) encrypt or decrypt data based on the current state of its’ PCR registers… this seems similar enough to my previous understanding that I can believe it.

If my understanding is correct, I can see how this would be useful to our project’s goals; encrypt a blob of data that is critical to the success of the boot (say… the kernel*) with the state of the PCR registers while the PCR registers are in a known-trustworthy state (i.e. while known-trustworthy software is loaded). If software that writes different PCR registers replaces the known-trustworthy software, then the kernel blob won’t decrypt properly, and execution “halts”. Presumably there are ways to handle this halting gracefully, like Bitlocker or LUKS; I imagine if I just encrypted executable code and then decrypted it with the wrong key, it would produce gibberish, and the machine would do unexpected things rather than halt gracefully when running that gibberish.

A co-worker has taken the position that there’s a simpler way; that a TPM can permit or refuse an action directly… so, like, it halts the processor or something, I guess? He doesn’t express himself very well, and when I tried to summarize his position he told me I got it wrong, so… I’m deliberately keeping the details of his position scant. Suffice it to say, my understanding of what a TPM does wouldn’t allow for what he describes…

You could interpret the two sentences from the article as supporting his position, or mine, depending on what actions it is possible to ask the TPM to authorize, and what the immediate consequences ramifications of the TPM denying you the authorization to do something. Does anyone here have an opinion?

*…how would I “encrypt the kernel”, exactly? :-p

Avoiding Repetitive Actions

I’m developing a UI for a product that will have “Install/Configure” option and “Documentation” on the search of the cards.

enter image description here

However, the UI looks ugly because of the repetitive buttons. Is there any other alternative to sort it out?

woocommerce – Replace Qty in cart for Bookable Product at the backend with persons for all subsequent actions

I am using the following code to replaced the quantity column in cart with persons for bookable products (i am using WooCommerce Bookings plugin). However, it only changes the cart Qty in the front end but other actions like shipping costs / cart fees set based on qty in cart is not getting updated.

    // Only for bookable product items
    if( isset($cart_item('booking')) && isset($cart_item('booking')('_qty')) ){
        $quantity  = '<span style="text-align:center; display:inline-block; line-height:10px">'.$cart_item('booking')('_qty').'<br>
        <small>(' . __('persons','woocommerce') . ')</small><span>';

    return $quantity;

Short buffs and long actions

How do buffs with short durations (guidance for 1 minute lets say) work when used to buff rolls for long actions? (such as a heal check for treat disease)

Does the buff work at all? Does it have to be cast right at the end before the check?

numenera – Clarification on cooperative actions

Numenera Discovery, page 118 states:

Helping: If you use your action to help someone
with a task, you ease the task. If you have an
inability in a task, your help has no effect. If you
use your action to help someone with a task
that you are trained or specialized in, the task
is eased by two steps. Help is considered an
asset, and someone receiving help usually can’t
gain more than two assets on a single task if
that help is provided by another character.

Am I understanding this correctly? Does this mean players can always help each other? Would this mean that in every non-combat situation when players are together as a group, the players are effectively guaranteed to have two levels of assets (from either a trained character, or multiple characters helping)?

mobile – When designing a list of items with associated actions, what is the best approach?

It's hard to answer without visuals, because it's really the context that will determine which of these options might work best for you.

If there are only a few actions and they are relatively simple – e.i. actions that the user is aware of and that do not require further explanation – option 1 or 2 might be the most effective. They seem to focus on efficiency. The user stays on the same page and both only require two clicks.

If there are many actions, or if additional information is needed before the user can choose which action to take, something like option 4 might work best.

For example, I'm in the process of redesigning a food order flow right now, and I'm actually moving each product to its own product page to accommodate additional modifiers that my client wants to add. This adds complexity to the flow (adding a screen, essentially), but it makes it easier for users to make purchasing decisions because it removes less relevant information (the rest of the menu) to make make room for additional relevant information (descriptions and modifiers).

oracle – Flash area full – Actions

I have seen some recommendations in the Oracle documents on what to do if the FRA is full.

For example, I also have this configuration:
Databases have Dataguard and RAC.
Oracle says:
1. Make more disk space – I can't

BACKUP RECOVERY ZONE – I'm interested in this option. What is not the same as the standard full backup where FRA is also cleaned up? Is it faster? I see it clearing the flashback logs, maybe I need it?

If you use other alternatives, I would be very much appreciated.

Thanks in advance.