macos – How to identify the selected audio input device from the command line?

I executed this command to display the I / O registry kit and I was looking for information to indicate the active microphone input device. But the second microphone indicates "active" (when running the command), but the built-in microphone was selected in the zoom application.

ioreg -p IOUSB -w0
+-o Root  
  +-o AppleUSBXHCI Root Hub Simulation@14000000  
    +-o Apple Optical USB Mouse@14600000  
    +-o FaceTime HD Camera (Built-in)@14400000  
    +-o ASM107x@14300000  
    | +-o PCP-USB@14310000  
    | +-o ASM107x@14320000  
    | | +-o IOUSBHostDevice@14321000  
    | | | +-o USB Keyboard@14321300  
    | | +-o Apple USB Ethernet Adapter@14324000  
    | +-o  CP 1500D@14340000  
    +-o Bluetooth USB Host Controller@14500000  
    +-o USB Optical Mouse@14200000  

Has anyone written a script to initiate a system call for the active camera?

Displays different gutenberg models among the selected publication attributes

According to, I managed to add a template to the custom article type with the following code –

 * Portfolio post template.
function portfolio_post_template() {

  $template = (

  $post_type_object = get_post_type_object( 'work' );
  $post_type_object->template = $template;
add_action( 'init', 'portfolio_post_template' );

Here is the problem, I try to display a different presentation depending on what the user has selected in the presentation drop-down list under the publication attributes section, but the hook action is with init, there is no information on the publication model selected at that time that allows me to define a condition to use a different model of gutenberg.

Is there a better hook to use instead of init? Or is there a different way to define a gutenberg model while retaining the information of the selected message template?

usability – How to resolve the ambiguity of the selected state in a segmented control with only two segments?

I'm working on a web application with two similar data grids in one page. The user should be able to switch between these two data grids on the same page.

I've used segmented buttons to navigate between these two grids. But I think that this component visually becomes a seesaw and that the current state of the seesaw becomes ambiguous.

For now, I'm only relying on the color / hue to display the selected state, but I do not know which state to choose.

Is there a better approach to solve this problem?

Segmented buttons surrounded in red
enter the description of the image here

html – p-dropdown does not display the selected item

I migrate my "select" to "p-dropdown" for greater fluidity and manage to load the list of elements correctly, but when displaying data saved in BBDD, I do not select the element that has passed through ng-model.

That is, I create a new order and, to indicate the municipality to which the request corresponds, there is a "drop-down list" that properly loads the municipalities.
fill in the data (by selecting the municipality, etc.) and save them.
Then, when I enter the command, all the data is loaded correctly, except for the Municipality, which selects the first item from the drop-down menu instead of the one I had previously selected.

In BBDD, I checked and the municipality is registered correctly.


Example loading data for the selected command "Selected command"

  IdMunicipio: 5,
  MunicipioNombre: "Melilla",


It worked fine for me when I applied it to select, but here it becomes impossible …

Thanks in advance

php – How to merge selected queries into the wp_term column?

I return attribute values ​​from wp_term and that's one of my queries for an attribute, say color. And I have the same queries for other attributes. I'm looking for a way to merge them into query, because I could not make it work with multiple mysqli functions to display them. Is it possible to merge these queries:

$sql = "SELECT p.`ID` AS 'Product ID', 
        p.`post_title` AS 'Product Name', 
        t.`term_id` AS 'Attribute Value ID', 
        REPLACE(REPLACE(tt.`taxonomy`, 'pa_', ''), '-', ' ') AS 'Attribute Name', 
        t.`name` AS 'Carat' 
        FROM `wp_posts` AS p 
        INNER JOIN `wp_term_relationships` AS tr ON p.`ID` = tr.`object_id` 
        INNER JOIN `wp_term_taxonomy` AS tt ON tr.`term_taxonomy_id` = tt.`term_id` AND tt.`taxonomy` LIKE 'pa_carat%'
        INNER JOIN `wp_terms` AS t ON tr.`term_taxonomy_id` = t.`term_id` 
        WHERE p.`post_type` = 'product' 
        AND p.`post_status` = 'publish' ORDER BY p.`ID`";

$sql .= "
SELECT p.`ID` AS 'Product ID', 
       p.`post_title` AS 'Product Name', 
       t.`term_id` AS 'Attribute Value ID', 
       REPLACE(REPLACE(tt.`taxonomy`, 'pa_', ''), '-', ' ') AS 'Attribute Name', 
       t.`name` AS 'Color' 
       FROM `wp_posts` AS p 
       INNER JOIN `wp_term_relationships` AS tr ON p.`ID` = tr.`object_id` 
       INNER JOIN `wp_term_taxonomy` AS tt ON tr.`term_taxonomy_id` = tt.`term_id` AND tt.`taxonomy` LIKE 'pa_color%'
       INNER JOIN `wp_terms` AS t ON tr.`term_taxonomy_id` = t.`term_id` 
       WHERE p.`post_type` = 'product' 
       AND p.`post_status` = 'publish' ORDER BY p.`ID`";

entity – Update the entity reference view based on the selected field

I have a content type called License that has two fields, field_product and field_billing_cycle. Both are entity reference fields, using the selected widget. The content type of the product has a multi-valued entity reference that refers to billing types. Thus, each product has its own billing cycle with different prices and lengths, etc.

When editing / creating a license, I want to display only the billing cycles available for the selected product. I created an entity reference view and configured it to take conditional filter arguments (the view seems to work, I set the context filter on a product ID and display the good cycles). The only thing left to do is to group everything together so that the billing cycles are updated when the selection list is changed, but I can not achieve the desired results. Here is what I have until now:

function mymodule_form_node_licence_form_alter(&$form, FormStateInterface $form_state, $form_id) {

  $form('field_start_date')('widget')(0)('value')('#ajax') = (
    'callback' => 'mymodule_update_end_date',
    'event' => 'change',

  $form('field_product')('widget')(0)('value')('#ajax') = (
    'callback' => 'mymodule_update_billing_cycles',
    'event' => 'change',


function mymodule_update_end_date($form, $form_state) {

  $start_date = $form('field_start_date')('widget')(0)('value')('#value')('object')->getPhpDateTime();
  // Calculate end date (add two months).
  $end_date = $start_date->modify('+2 month')->format('Y-m-d');

  $response = new AjaxResponse();
  $selector = '#edit-field-end-date-0-value-date';
  $method = 'val';
  $arguments = ($end_date);
  $response->addCommand(new InvokeCommand($selector, $method, $arguments));
  //$response->addCommand(new AlertCommand('Blah'));
  return $response;


function mymodule_update_billing_cycles($form, $form_state) {
   $response = new AjaxResponse();
   $response->addCommand(new AlertCommand("This is a test"));
   return $response;

The modification code of the end date when the start date is changed is activated, but the change of product is not!

I want to get to the point where, when the product is defined, the cycles are updated. When the cycle is set, the end date is updated based on the cycle time added to the start date field. If the start date field is then changed, it should be updated again based on the selected cycle, but I am stuck. I googled and googled but I did not manage to make it work. Where am I going to hurt?

***** Update *****

Ok, so I understood why the event was not triggered and I corrected it, the function above works now. For anyone with a similar problem, it seems that I should have added the ajax manager differently for the selection list:

function mymodule_form_node_licence_form_alter(&$form, FormStateInterface $form_state, $form_id) {

  $form('field_start_date')('widget')(0)('value')('#ajax') = (
    'callback' => 'mymodule_update_end_date',
    'event' => 'change',

  $form('field_product')('widget')('#ajax') = (
    'callback' => 'mymodule_update_billing_cycles',
    'event' => 'change',
    'progress' => (
      'type' => 'throbber',
      'message' => 'Please Wait...',)


So now, I'm on the next problem … How do I refresh the entity reference view, by switching to the newly selected product ID?

dslr – How to set the viewfinder in AF-area mode if the values ​​are gray (can not be selected) on the Nikon D3500?

When setting the viewfinder in AF-area mode on my D3500, I can only choose 2 of 4 options: single-point AF and auro-area AF. The remaining two areas: Dynamic AF and 3D tracking are grayed out and the camera indicates that they can not be selected in this mode. This remains the case in all MASP modes. What could block the menu?

They are all available here:

javascript – How can I change the message format when a particular category is selected?

It was very easy to do that. Just paste a little jQuery in admin_footer. But it does not work anymore, thanks to Gutenberg.

Here is the feature that I need to reproduce:

add_action (& # 39; admin_footer & # 39 ;, function () {
<? php

The format of the publication is changed, but when you save the publication, it is restored. 🙁

magento 2.2.8 Configurable product: change of color to display the second image of the gallery as selected

I'm using magento 2.2.8 and I am facing a strange problem on the product details page.

On the product details page, my gallery shows the wrong image selected instead of the first one.


  1. Land on the product details page
  2. Click on the second image in the product gallery
  3. Change the color of the product
  4. The gallery of images updates and replaces the first image which is the
    main image, it shows the second selected image.

I use the Porto theme, I also checked on luma and I got the same problem.

I try to find and repair the cause if someone directs me in the right direction.

Thank you

search console google – Duplicate without the user has selected canonical, even if the pages are different Why?

I use Search Console and I have encountered this problem with my Angular 7 app for an online store. At first I thought it was a Javascript rendering problem, but I made sure that all server resources were ready when the page was loaded.

However, Google sees multiple pages of different product categories duplicated for the main page. I have run the inspection tool and the live test tool and discovered that the screenshots of the pages were different from what they would normally be .

So, I do not understand why Google always sees them as duplicates. I imagined it might have been due to the time needed for indexing by Google, but Google tells me that their latest analysis took place after I asked for a new indexation.

What could be the problem?