Dialog option “Use by default for this action” or “Always” not displaying

I just completed my Android application which scans NFC tags. When an NFC tag comes near the device, the device tries to show all the apps which can scan the NFC tag.

I want it to remember which app it should use scan the NFC tag. It displayed my app, but I do not want the system to always ask me which app to use.

In my two devices, it not does show any option like Use by default for this action or Always. Why is this so?

Screenshot 1 Screenshot 2

Custom ribbon button action always disabled when command is defined

I want to add new button to the ribbon in Pages library. To do so, I have following code:


    
      
        
          

The ribbon button appears on proper place. But it is always disabled. After try things, I figured out that when I remove command attribute from

Automorphisms of graded rings and the induced action on the projective scheme

I am trying to understand the proof of proposition 4.17 in “Fourier-Mukai transforms in algebraic geometry” by D. Huybrechts about the structure of the group of autoequivalences of $D^b(X)$ in the case of ample (anti-)canonical bundle.

So here is a brief outline of the set-up for my question:

Suppose our autoequivalence $F$ maps $mathcal{O}_X$ to itself and $w_X^{otimes k}$ to itself too. Then we get a map $$oplus H^0(X,w_X^{otimes k})=oplus Hom(mathcal{O}_X, w_X^{otimes k}) xrightarrow{phi_F} oplus Hom(F(mathcal{O}_X), F(w_X^{otimes k}))=oplus Hom(mathcal{O}_X, w_X^{otimes k})=oplus H^0(X,w_X^{otimes k})$$ $$s mapsto F(s)$$

It is also shown that this in fact induces a graded ring automorphism.

Since we assume $w_X$ to be ample, we have $X cong Proj (oplus H^0(X, w_X^{otimes k}))$ so that we get an automorphism $X xrightarrow{phi_F^{flat}} X$. Then it is claimed that if we compose $F$ with the pullback $(phi_F^{flat})^{*}$ action on $D^b(X)$ we actually get an automorphism which acts as identity on $oplus H^0(X, w_X^{otimes k})$.

What is the best way to see it?

It is well-known that for $X=Proj (S_{bullet})$ the category of quasi-coherent sheaves is equivalent to saturated graded $S_{bullet}$-modules, but is there an analog for the graded ring itself? Something along the lines: if $X$ is $Proj$ of a saturated graded ring (whatever that might be), then automorphisms of $X$ naturally correspond to automorphisms of the graded ring (natural being given by $sharp$ and $flat$, as in the affine case).

Lie algebra action on complex algebraic variety

Suppose that $X$ is a complex algebraic variety, i.e. it is integral, separated, and of finite-type over $mathbb{C}$. Let $mathfrak{g}$ be a finite-dimensional complex Lie algebra.

Suppose that $mathfrak{g}$ acts on $X$, i.e. we have a homomorphism $phi:mathfrak{g}to mathrm{Vec}(X)$, where $mathrm{Vec}(X)$ is the Lie algebra of vector fields on $X$. Suppose further that for every closed point $xin X$, the canonical morphism
$$ mathfrak{g}to T_xX$$
is surjective. This should be the way to say the action is ‘homogeneous’. My question is: does this imply $X$ is smooth? Or at least that the tangent sheaf is locally free? Feel free to assume $X$ is, say, normal if that is necessary.

Blend SDK for WPFのTriggerとActionの挙動について

.NET Framework 4.5.2にLivet1.3を導入し、WPFのクライアントアプリケーションを作成しています。この度トリガーの勉強がてら、LivetのInteractionMessageTriggerと同じような機能を持つカスタムのトリガーを作ってみたのですが、目的の場所でTriggerBaseのInvokeActionsを呼び出した時、各ActionのInvokeActionが実行される時とされない時があります。ActionのInvokeActionが実行されるときの条件のようなものはありますでしょうか? 以下が問題のトリガーです。

public class CustomInteractionMessageTrigger : TriggerBase
{
    public string MessageKey
    {
        get { return (string)GetValue(MessageKeyProperty); }
        set { SetValue(MessageKeyProperty, value); }
    }

    public InteractionMessenger Messenger
    {
        get { return (InteractionMessenger)GetValue(MessengerProperty); }
        set { SetValue(MessengerProperty, value); }
    }

    protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
    {
        if (e.Property == CustomInteractionMessageTrigger.MessengerProperty)
        {
            ((InteractionMessenger)(e.NewValue)).Raised += CustomInteractionMessageTrigger_Raised;
        }
    }

    private void CustomInteractionMessageTrigger_Raised(object sender, InteractionMessageRaisedEventArgs e)
    {
        if (e.Message.MessageKey == MessageKey)
        {
            InvokeActions(e.Message);
        }
    }

    public static readonly DependencyProperty MessageKeyProperty =
        DependencyProperty.Register(nameof(MessageKey), typeof(string), typeof(CustomInteractionMessageTrigger), new PropertyMetadata(null));

    public static readonly DependencyProperty MessengerProperty =
        DependencyProperty.Register(nameof(Messenger), typeof(InteractionMessenger), typeof(CustomInteractionMessageTrigger), new PropertyMetadata(null));
}

上記コードの InvokeActions(e.Message) にブレークポイントを付けたところ、呼び出されていることは確認できました。InvokeActionsを呼べばActionは必ず実行されるものだと思っていたのですが…

開発環境のOSはWindows 10(1703)、IDEはVisualStudio 2015 Update3です。

情報不足などがありましたらご指摘ください。
よろしくお願いいたします。

Custom post type save_post action not firing

Sorry if this is already answered on here. I looked around and couldn’t see any answers to my question so I thought I’d post my own.

I’m building a plugin for a client that gathers customer feedback on a recent project that has been completed.

The admin would use the system to send a “prompt” to the customer asking them for their feedback with a link to a form on the site.

I have created a custom post type called “customer_prompts” which only has a title field and a few custom fields which are stored in a custom database table, not post meta.

Below is my code for the save_post action. It seems that when I hit publish, it does not fire the save_post action and only saves the title value to wp_posts.

add_action('save_post', 'save_prompt');
function save_prompt($post_id){
$post = get_post($post_id);

    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) 
          return;

    if ( 'customer_prompt' == $_POST['post_type'] ) 
    {
        if ( !current_user_can( 'edit_page', $post_id ) )
            return;
    }
    else
    {
        if ( !current_user_can( 'edit_post', $post_id ) )
        return;
    }

    global $wpdb;

    $prompt_id = com_create_guid();
    $customer_feedback_name = $_POST['_sdg_customer_feedback_name'];
    $customer_feedback_email = $_POST['_sdg_customer_feedback_email'];
    $salesperson = $_POST['_sdg_salesperson'];

    $values = array(
        'id' => $prompt_id, 
        'sdg_customer_name' => $customer_feedback_name,
        'sdg_customer_email' => $customer_feedback_email,
        'sdg_salesperson' => $salesperson,
        'sdg_post_id' => $post->id
    );

    $insert = $wpdb->insert($table_name, $values);

    if($insert) {
        mail($customer_feedback_email, 'hello', 'hello');
    }

}

Any help would be greatly appreciated as I cannot work out what is going on here.

Thanks,
Jamie.

How to design friction in an iOS app to prevent accidental action?

I am designing an app for iOS where I need to prevent the user from unintentionally trigger an alarm (the action of calling for emergency should be easily accessible, but at the same time it should prevent any accidental initiation).

I don’t want to use a confirmation dialog since it requires the user to read and looking for a button in a different position (it seems like too much friction on the other side).

To use a ‘slide to’ action button occurred to me initially as an good idea, similar to what was/is used to unlock an iPhone screen, but then I run into this topic: Creating a “Slide to power off” like slider on iOS, basically saying that Apple discourages usage of these kinds of components, and they refuse to publish such an app in the store.

Do you have any experience with this kind of user scenarios? Or do you have experience with Apple refusing to publish your app for such reasons?

How does the Great Weapon Master feat’s bonus-action attack work against a zombie that survives thanks to…

I was thinking about the Great Weapon Master feat (PHB, p. 165), part of which reads:

On your turn, when you score a critical hit with a melee weapon or reduce a creature to 0 hit points with one, you can make one melee weapon attack as a bonus action.

And the Undead Fortitude trait of Zombie creatures (Monster Manual, p. 316):

Undead Fortitude. If damage reduces the zombie to 0 hit points, it must make a Constitution saving throw with a DC of 5 + the damage taken, unless the damage is radiant or from a critical hit. On a success, the zombie drops to 1 hit point instead.

If a PC with the GWM feat drops the Zombie to 0 hit points with an non-crit, non-radiant damage attack and the Zombie succeeds on the saving throw, does the PC get another attack as a bonus action?

Question: Who beside me feel a class action lawsuit should be filed?

Am I the only one that resents being denied internet access by internet companies that mandatorily require we give them permission into our internet lives?
I SAY SUE!
Not for the monetary gain; but just for our right to be able to say no!
Does anyone know how we can get this started.
Thank you,
BB
Email: lbb5757@yahoo.com

Accessing the database from a plugin outside of action hooks

I am working on a plugin that provides an endpoint for handling OAuth2 authorization against a remote server, on successful authorization stores some information from that server in the WordPress database, and redirects the user to a page on the WordPress site.

In order to store the data the plugin makes use of the wpdb function, which I understand to be recommended practice.

E.g.:

# Require wp-load.php in order to access $wpdb.
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'wp-load.php');

global $wpdb;
$table_name = $wpdb->prefix . 'placespeak';
$query_array = [$app_id];
$client_info = $wpdb->get_row(
    $wpdb->prepare(
        "SELECT * FROM " . $table_name . " WHERE id = %d",
        $query_array
    )
);

The current version of the plugin is hosted on github here.

However, when I submitted the plugin to the WordPress plugin directory, I received this response:

Calling core loading files directly

Including wp-config.php, wp-blog-header.php, wp-load.php, or pretty much any other WordPress core file that you have to call directly via an include is not a good idea and we cannot approve a plugin that does so unless it has a very good reason to load the file(s). It is prone to failure since not all WordPress installs have the exact same file structure.

Usually plugins will include wp-config.php or wp-load.php in order to gain access to core WordPress functions, but there are much better ways to do this. It’s best if you tie your processing functions (the ones that need but don’t have access to core functions) into an action hook, such as “init” or “admin_init”.

That’s entirely sensible, but I’m not sure how to proceed.

Because the endpoint is not part of the WordPress admin interface, there are no hooks to wrap it in (I think?).

I tried requiring the “stripped down” version of wp-load, e.g.

define( 'SHORTINIT', true );
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'wp-load.php');

but that produced a Call to undefined function trailingslashit() error when I perform a database query using wpdb as above, which appears to be a known limitation of using the SHORTINIT version of wp-load.

Is there another method for accessing the database, which should work in this context, and which will be acceptable to the plugin directory maintainers?