Ease of use – Are duplicate options good or bad in a single selection?

If I have a list of countries (or anything really) with the most relevant ones above in a "Proposed" optgroupand then I list all (other) countries below, should I duplicate these "proposed" in the "All countries". optgroup?

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select doesn't seem to mention anything about duplicates options, so from an HTML point of view it seems fine. But I'm curious about a UX perspective if any of these decisions are considered good or bad.

Example:

(NOTE: The following is an excerpt from an actual list of countries. In reality, the list can include hundreds of options.)

Option 1: Duplicate the "suggested" countries in the "all countries". optgroup, This may be a clearer choice for a user if they haven't noticed that the option they're looking for is at the top, but it can also be a little strange for keyboard navigation by entering the country name if two options are available:


Option 2: Do not duplicate the suggested options:


Plugins – WooCommerce Single Product Page Variations – Duplicate / Don't Reset SKUs

A problem was encountered when displaying SKUs on a single Woocommerce product page.

I use two topic functions: the first shows the SKU in the upper description area, the second shows the SKU for the related products below.

However, they are in conflict with one another: If you select a variation option, ALL SKUs on the page, the parent SKU and also within the loop for related products change to the selected variation.

If you select "Choose an Option" and reset the parent SKU to its default settings, it will appear as an array instead.

How can I view the SKU for the variations of the main product without conflicting with the SKUs shown under "Related Products" below?

And to reset the SKU of the main product to the default settings when "Select option" is selected?

The behavior can be viewed here: https://www.ocwhite.com/product/green-litetm-6-round-led-magnifier-screw-down-base/

Here are the two functions used:

/*-------------------------------------------------------------------------*/
/*  Woocommerce - Display SKU on Single Product Pages
/*-------------------------------------------------------------------------*/
add_action( 'woocommerce_single_product_summary', 'demo_show_sku', 5 );
function demo_show_sku(){
    global $product;
    echo 'SKU: ' . $product->get_sku() . '';
}

/*-------------------------------------------------------------------------*/
/*  Woocommerce - Display SKU on Archive Product Pages
/*-------------------------------------------------------------------------*/
add_action( 'woocommerce_shop_loop_item_title', 'demo_show_archive_sku', 20 );
function demo_show_archive_sku(){
  global $product;
  echo 'SKU: ' . $product->get_sku() . '';
}

Any thoughts on how to fix it? Thank you in advance.

This is how you get the first value of the duplicate in this assignment list

I have the following mapping list. I want to get the first value of the duplicate element, but only the last value. What should I do?

    Merge({<|a -> 1, b -> 2, b -> 3, a -> 2, c -> 4, d -> 5, 
       c -> 2|>}, Last)
    Merge({<|a -> 1, b -> 2, b -> 3, a -> 2, c -> 4, d -> 5, 
       c -> 2|>}, First)(*The result I want is <|a -> 1, b -> 2, c -> 4, d -> 5|>*)

As Rohit Namjoshi said, I can first convert the relationship list to the normal list {a -> 1, b -> 2, b -> 3, a -> 2, c -> 4, d -> 5,
c -> 2}
and then try to reach the goal?

Is it possible to skip duplicate keys in a BULK INSERT in MySQL?

I have a INSERT...SELECT Instruction that I want to run from TABLE1 to TABLE2 multiple times because the data in TABLE1 changes over time.

I do not expect select's past data to change over time. The selection only returns new data and the same old data from previous queries.

However, due to the unique key limitation for the primary keys, I cannot reinsert old data.

What I want to achieve is kind of INSERT ...ON DUPLICATE KEY UPDATE... but for one INSERT...SELECT,
Skipping the double keys will be enough, but I'm not sure how to do it

r – Delete duplicate rows and sum the corresponding values ​​of the last column in a data frame

If we want to remove the duplicates from a data frame dfwe just have to write df(!duplicated(df),) and duplicates are removed from it. I have the following data frame:

df <- data.frame(from = c("z","y","z","w","y"), to=c("x","w","x","z","w"), weight=c(2,1,3,5,6))

I want to get something else. in the df(,1:2), the first and third rows are the same between them and I want to: 1) delete one of them; 2) add up the corresponding weight values. For example, In this example, the expected result is:

   from to weight
     z  x      5
     y  w      7
     w  z      5

Anyway if I use:

df2=df(,1:2)
which(duplicated(df2) | duplicated(df2(nrow(df2):1, ))(nrow(df2):1))

I get

(1) 1 2 3 5

which does not allow me to get the desired result (e.g. 1 and 3 are equal between them, 2 and 5 are equal between them, but this information is not included in the latter result).

Google Sheets – Split multiple line cells from different columns and duplicate the surrounding lines

May I know if there is a way to split multiline cells from different columns in Google Sheet and then duplicate the surrounding rows? I'm new to this kind of environment, so I'm really confused.

I have 29 columns, 7 of which have cells with multiple comma-separated data. I tried app scripting but it only works for 1 column.

I want to publish the code and an SS of the file, but unfortunately I'm not in office right now.

I hope someone could help me. Thank you very much.

How to check if there is a duplicate meta title for the category in Magento2

I'm creating a report for the categories with double meta title.

I load all categories and check the conditions individually as below with the direct MySQL queries.

$connection = $this->_resource->getConnection(MagentoFrameworkAppResourceConnection::DEFAULT_CONNECTION);
$categoryId = 4;// current categoryID
$_objectManager = MagentoFrameworkAppObjectManager::getInstance();
$category = $_objectManager->create('MagentoCatalogModelCategory')->load($categoryId);
$metaTitle = $category->getMetaTitle();
$query = "SELECT value FROM catalog_category_entity_varchar WHERE attribute_id='49' AND entity_id <> '".$categoryId."' and AND VALUE='".$metaTitle."'" ;
$Result = $connection->query($query);
$resultData = $Result->fetchAll();
if(count($resultData) > 0{
    $error = "Duplicate present";
}else{
    $error = "No Duplicate";
}

The code above works fine, but I want to change the code by default. Is there a way to load the category collection with filter and check the condition as above?

I'm checking to see if the duplicate meta title next to the selected category needs to display a message.

Please someone suggest how this can be achieved.