8 – Count multivalue image field values in views-view-fields.html.twig

Making a presentation template for the gallery. The photo gallery has an image field with multiple values. I need to output the number of gallery photos (in the field_gallery_photo). How do I do this? I tried adding a field with a photo to the view, and all the values are shown in one line. The result is not accurate:

{{ fields.field_gallery_photo.content | length }}

usa – UK US tax treaty J1 visa Article 20: Do researchers count as “professors or teachers”?

I’m in the US doing research, and from the UK. I’d like to claim the UK-US tax exemption. I think that I am eligble, as my role is completely research based. However my HR department isn’t sure as I’m not technically a “professor” or “teacher” (the language stated in the tax treaty, although neither term is defined in the document). Other people I know at different institutions seem to be sure that I qualify. Can anyone provide a reference for me to show to my HR department to convince them.


plugins – Get all product count from a order in Woocommerce

I am having trouble with Woocommerce product details and order details relationship.

I need to get a count of products that have meta_key = ‘porduct_status_in_supplier’ and value of this meta is ‘no’ in order that order_id = ’55’

i try this SQL but not true

    oc_posts as p,
    oc_postmeta as pm,
    oc_woocommerce_order_items as i,
    oc_woocommerce_order_itemmeta as im
    p.post_type = 'shop_order'
    and p.ID = pm.post_id
    and p.ID = i.order_id
    and pm.meta_key = 'porduct_status_in_supplier'
    and pm.meta_value = 'no'

dnd 5e – Does playing magical music count as casting a spell?

Only your DM can answer this question

It seems that this musical fragment is a homebrew creation of your DM. If your DM has given you an actual item description with precise mechanics, look over them carefully to see if it is mechanically casting a spell. Regardless, you must check with your DM for this, because they are the one who created the item and decided how it works. You can ask out of character (“Does this count as casting a spell?”) or in character (“Does this feel similar to my normal bardic spellcasting, or is it different?”), but your DM is the only one who can answer this.

It might not actually matter as much as you think

Given that this musical fragment deals damage, it seems quite likely that your DM will declare that breaks invisibility like an attack or spell, even if it isn’t considered one. Furthermore, even if the DM allows you to remain invisible, keep in mind that once you play the fragment, you are no longer hidden — that is, enemies now know your position from the sound you made, even if they can’t see you. And unless you’re a rogue who can hide as a bonus action, you’re likely going to remain un-hidden while the enemies take their turns. They’ll have disadvantage to attack you, but you can still be attacked, and hit with most spells.

dynamic programming – Count minimum number of steps to destroy all blocks

Given a sequence of integers $A_x$ of length $n$ such that $1 leq A_x leq N$,in one step we can remove an element, but when we remove an element we also delete all adjacent numbers which have the same value as the element we remove. We want to count the minimum number of steps to remove all elements.

For example, if our sequence is $[1, 2, 2, 2, 2, 3, 3, 3, 1]$, we can remove it in three steps: firstly we remove the twos, then we remove the threes, and on the end we remove the final two ones.
Our sequence transforms as follow: $[1, 2, 2, 2, 2, 3, 3, 3, 1] to [1, 3, 3, 3, 1] to [1, 1]$.

I tried using Dynamic Programming to solve this problem, and my idea was to use $DP[i][j]$ to represent the minimum steps to clear the interval $[i, j]$, however I’m not sure how to work out the transitions, and I’m stuck on the part that there can be some element in the middle of the interval which can be merge with the ends of the interval, and my DP relations cannot handle such cases.

Can i get number of action count in a SharePoint Designer workflow in SPO — Modernization script provide wrong data – Any SPO Powershell script?

Stack Exchange Network

Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

sql – Undefined index al mostrar los resultados de una consulta en php, utilizando un count

estoy trabajando en proyecto de un restaurante y tengo una pequeña duda al mostrar los datos de la siguiente consulta.

SELECT count(id) FROM menus WHERE Data_pedido = ‘2020-09-09’;

La traduccion de esta consulta utilizando $smtp es la siguiente.
Consulta en php

Tambien tengo un echo con resultado que consulta esta mandando respuesta
El error que me esta dando y echo con resultados de sql

Aqui muestro los datos utilizando php.
Aqui muestro los resultados con php

La duda la consulta funciona correctamente , pero a la hora mostrar en php me muestra index Unbouned haciendo referencia a que no hay tabla que mostrar y raro porque los datos que me llegan estan. Alguien sabe como podria mostrar los datos

sql – Como juntar os dois resultados usando COUNT de tabelas diferentes no postgreSQL

Eu tenho a coluna id_maquina em uma tabela tab_log_alertamaquina e na outra eu tenho id_maq_acao na tabela tab_user_acao_promo, ambas tem um valor em comum, me trazem o ID da máquina, estou usando o COUNT para extrair o total de cada coluna.

Não selecionar abaixo, me trás o total de retiradas que a máquina teve:

SELECT       id_maq_acao,
             COUNT(id_maq_acao) AS value_occurrence
    FROM     public.tab_user_acao_promo
    GROUP BY id_maq_acao
    ORDER BY value_occurrence DESC
    LIMIT  4  ;

Nesse select me retroceder o total de erros que a máquina teve:

SELECT       id_maquina,
             COUNT(id_maquina) AS value_occurrence
    FROM     public.tab_log_alertamaquina
    GROUP BY id_maquina
    ORDER BY value_occurrence DESC
    LIMIT    4;

Eu preciso unir esses resultado, Quantidade de erros X Quantidades de retiradas

Tentei usar o INNER JOIN, mas o mesmo está somando os resultados de erros com retiradas no COUNT

Select id_maquina,id_maq_acao,count(*) FROM public.tab_log_alertamaquina
INNER JOIN public.tab_user_acao_promo ON 
tab_user_acao_promo.id_maq_acao = tab_user_acao_promo.id_maq_acao
where "id_maquina" = "id_maq_acao" 
group by 
having count(*)>4
ORDER by count DESC

functions – WordPress Sticky Post Count “Fix” Breaking Pagecount by 72 pages!

I have a permanent sticky post on my front page and have implemented the code (pasted below) into my functions.php file to stop it adding an extra post to my post count on the front page (it’s a grid so i can’t have one post dangling off the bottom).

However…. when the code is implemented it’s adding a whopping 72 extra pages to my page count. From 799 (which is what it should be) to 871. Any page past 799 obviously comes up at 404 because it doesn’t exist.

Can someone please help me figure out what’s causing it? Cheers

add_action( 'pre_get_posts', function( $query )
    if ( $query->is_home && $query->is_main_query() )
        $posts_per_page = get_option( 'posts_per_page' );
        $sticky_posts   = get_option( 'sticky_posts' );

        // if we have any sticky posts and we are at the first page
        if ( is_array($sticky_posts) && !$query->is_paged() )
            $sticky_count = count($sticky_posts);

            if ( $sticky_count < $posts_per_page )
                $query->set('posts_per_page', $posts_per_page - $sticky_count);
                $query->set('posts_per_page', 1);