php – GLOB inside WHILE returning the duplicate file

I have one while that brings me some data from database, and I use some of that data to search for some images in a folder rise.

After listing these photos, I associate them with people and, at a certain time, when I add these people, I have the option to select the images that I am going to add.

Only, if I add 5 people and put only 4 images, when I bring this data, the function glob will duplicate some of these identifications to complete the person who did not have their associated photo.

The "functional" form with duplication of identifications is like this;

while ($result = $conn->fetch(PDO::FETCH_ASSOC)) {

        $getName = $result('candidate') . '*';
        $mountName = $id . '=' . $getName;

        foreach (glob("admin/core/class/uploads/" . $mountName) as $file) {
                $return = $file;

        $tplTemp .= '
'; }

That way, I bring the results normallyinsert image description here

But as you can see, the images doubled because when you added the 5 people, you only uploaded 4 photos. The system is supposed to work this way (a person is not required to have a photo), but when I don't have a photo, I wanted to put a standard image, which made me think of this code:

while ($result = $conn->fetch(PDO::FETCH_ASSOC)) {
$getName = $result('candidate') . '*';
$listPath = dir("admin/core/class/uploads/");

$amountName = $id . '=' . $getName;

foreach (glob("admin/core/class/uploads/" . $amountName) as $file) {

    //$return = $file;

    if ($file == null) {
        $return = 'admin/core/class/uploads/semfoto.png';
    } else {
        $return = $file;

$tplTemp .= '
'; }

Keep returning the duplicate ID, and it even makes sense, because I'm asking if $file it is empty. I'm a little lost in how I can achieve my result, any explanation?

Is there any way to know which route Flixbus will follow to go from A to B? [duplicate]

So the question is quite simple. Is there any way to know what is the route followed by a Flixbus bus from city A to city B, before buying the ticket?

Known plain text and encrypted text, what method or encryption is being used? [duplicate]

I have plain text and encrypted output (?).
You may know what method is used for this encryption.
I was thinking about Base64 because of the "=" ending, but I'm not sure because of the bars.

Any ideas?

Plain text: 12345

Decryption: / A / P9nt / Ig / Ll / Z8 =

The decrypted password was stored as a value in the Windows registry as reg_sz.

Thank you

magento2 – Magento Framework Config Dom ValidationException: Element & # 39; argument & # 39 ;: Duplicate key sequence

I have an error when developer mode is active.
The exception is dropped when entering any product detail page.
I am running magento 2.3.4
Could you help me find a solution?

1 exception(s):

Exception # 0 (Magento Framework Config Dom ValidationException): Element & # 39; argument & # 39 ;: Duplicate key sequence (& # 39; title & # 39;) in the key identity restriction & # 39; blockArgumentName & # 39 ;.
Line: 1388

Exception # 0 (Magento Framework Config Dom ValidationException): Element & # 39; argument & # 39 ;: Duplicate key sequence (& # 39; title & # 39;) in the key identity restriction & # 39; blockArgumentName & # 39 ;.
Line: 1388

#1 MagentoFrameworkConfigDom->__construct() called at (vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121)
#2 MagentoFrameworkObjectManagerFactoryAbstractFactory->createObject() called at (vendor/magento/framework/ObjectManager/Factory/Compiled.php:108)
#3 MagentoFrameworkObjectManagerFactoryCompiled->create() called at (vendor/magento/framework/ObjectManager/ObjectManager.php:56)
#4 MagentoFrameworkObjectManagerObjectManager->create() called at (vendor/magento/framework/Config/DomFactory.php:43)
#5 MagentoFrameworkConfigDomFactory->createDom() called at (vendor/magento/framework/View/Model/Layout/Update/Validator.php:141)
#6 MagentoFrameworkViewModelLayoutUpdateValidator->isValid() called at (vendor/magento/framework/View/Model/Layout/Merge.php:512)
#7 MagentoFrameworkViewModelLayoutMerge->_validateMergedLayout() called at (vendor/magento/framework/View/Model/Layout/Merge.php:488)
#8 MagentoFrameworkViewModelLayoutMerge->load() called at (generated/code/Magento/Framework/View/Model/Layout/Merge/Interceptor.php:206)
#9 MagentoFrameworkViewModelLayoutMergeInterceptor->load() called at (vendor/magento/framework/View/Layout/Builder.php:86)
#10 MagentoFrameworkViewLayoutBuilder->loadLayoutUpdates() called at (vendor/magento/framework/View/Layout/Builder.php:63)
#11 MagentoFrameworkViewLayoutBuilder->build() called at (vendor/magento/framework/View/Layout.php:257)
#12 MagentoFrameworkViewLayout->build() called at (vendor/magento/framework/View/Layout.php:882)
#13 MagentoFrameworkViewLayout->getBlock() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:414)
#14 MagentoFrameworkViewLayoutInterceptor->getBlock() called at (vendor/magento/module-cms/Helper/Page.php:215)
#15 MagentoCmsHelperPage->prepareResultPage() called at (vendor/magento/module-cms/Controller/Noroute/Index.php:47)
#16 MagentoCmsControllerNorouteIndex->execute() called at (generated/code/Magento/Cms/Controller/Noroute/Index/Interceptor.php:24)
#17 MagentoCmsControllerNorouteIndexInterceptor->execute() called at (vendor/magento/framework/App/Action/Action.php:108)
#18 MagentoFrameworkAppActionAction->dispatch() called at (vendor/magento/framework/Interception/Interceptor.php:58)
#19 MagentoCmsControllerNorouteIndexInterceptor->___callParent() called at (vendor/magento/framework/Interception/Interceptor.php:138)
#20 MagentoCmsControllerNorouteIndexInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/framework/Interception/Interceptor.php:153)
#21 MagentoCmsControllerNorouteIndexInterceptor->___callPlugins() called at (generated/code/Magento/Cms/Controller/Noroute/Index/Interceptor.php:39)
#22 MagentoCmsControllerNorouteIndexInterceptor->dispatch() called at (vendor/magento/framework/App/FrontController.php:159)
#23 MagentoFrameworkAppFrontController->processRequest() called at (vendor/magento/framework/App/FrontController.php:98)
#24 MagentoFrameworkAppFrontController->dispatch() called at (vendor/magento/framework/Interception/Interceptor.php:58)
#25 MagentoFrameworkAppFrontControllerInterceptor->___callParent() called at (vendor/magento/framework/Interception/Interceptor.php:138)
#26 MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:99)
#27 MagentoStoreAppFrontControllerPluginRequestPreprocessor->aroundDispatch() called at (vendor/magento/framework/Interception/Interceptor.php:135)
#28 MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:73)
#29 MagentoPageCacheModelAppFrontControllerBuiltinPlugin->aroundDispatch() called at (vendor/magento/framework/Interception/Interceptor.php:135)
#30 MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/framework/Interception/Interceptor.php:153)
#31 MagentoFrameworkAppFrontControllerInterceptor->___callPlugins() called at (generated/code/Magento/Framework/App/FrontController/Interceptor.php:26)
#32 MagentoFrameworkAppFrontControllerInterceptor->dispatch() called at (vendor/magento/framework/App/Http.php:116)
#33 MagentoFrameworkAppHttp->launch() called at (vendor/magento/framework/App/Bootstrap.php:261)
#34 MagentoFrameworkAppBootstrap->run() called at (pub/index.php:40)

Thanks in advance!

seo: how to make sure Google doesn't think that index.html and start pages are duplicate content?

I am not sure why you have two "home pages". Index.html is usually the homepage of many web servers (such as Microsoft IIS), but it seems that you are using it in addition to another page that is marked as "home". If your website is new without external backlinks to index.html, you can delete it.

However, you should need both, the redirection should solve your problem, but the address of your redirection depends entirely on which page you want the users to go to. But, by redirecting your homepage to index.html, you are forcing everyone who goes directly to your site to be redirected, which is probably not good. You want to avoid redirects when possible, so it seems best to redirect to your homepage from index.html for the few times someone could use index.html as the URL.

A better methodology for duplicate pages would be to simply mark your index.html page as conical with your homepage. This would avoid redirection completely, but it tells search engines that its index.html is intentionally duplicated with its homepage and that the homepage is the original / preferred source.

Where is the backspace key on the iPhone keyboard [duplicate]

When I type on the iOS keyboard, I can't find the backspace character (`). Where is it located? If there isn't, why?

Why do you duplicate my cover photo without retaining your likes and comments on Facebook's mobile?

I tried to change my cover photo using the Facebook mobile application and I wanted to revert one of my old cover photos I used years ago. I checked the cover photos that later appear on the profile picture (cover photo album on my Facebook profile). I clicked on the photo I wanted to use, however, it was updated as a new upload without retaining its likes and comments.

Then, I logged into my Facebook account on my PC, deleted the duplicate and did the same process again. This time, my previously used cover photo, along with likes and comments, was successfully updated without having any duplicates.

What could be the reason for this problem? Is this something common, a kind of mistake? My mobile operating system is iOS. I could not see any complaints / examples on the Internet regarding this issue.

Algorithms: Is it possible to keep the left and right subtree weights on each BST node that has duplicate values?

Is it possible to maintain left and right subtree weights in each node
of BST that has duplicate values?

I must be able to delete a node completely (regardless of how many times it is present)

Currently, in my code, I keep the counting variable on each node that records the number of times it is present in the tree.

During insertion, I can increase the size of the weight of the left and right subtree in each node depending on whether my value is smaller or larger. but how do I adjust the weights when I delete a node (because I can delete a node with count> 1)

Is it possible to duplicate a project in Windows 10 without including a specific window in the output / only specific windows in the output?

Is it possible to duplicate a project in Windows 10 without including a specific window in the output / only specific windows in the output? For example, if a Word document is displayed on the projector and on the main screen, the Word document, as well as a web browser window at the top that is not visible in the projection.

Alternatively, it may be possible to have a window that is on the primary and secondary screen when the projection mode is extended.

Photo management: how can I identify duplicate image files?

digikam (linux, windows and mac) has a sidebar titled versions

The Versions tab shows the history and saved versions of a photo. With the three buttons in the upper right corner, you can choose between a simple list of saved versions, a tree view and a combined list that shows the versions along with the actions performed with the selected photo.

and another search titled

Quick Search is the customizable search box at the top of the search dialog box (Left sidebar) and provides you with a simple means to search the digiKam database with a single query. You can enter any argument in the Search: text field and it will be used to determine the results. For example, you can enter the string & # 39; birthday & # 39; to search the database for complete occurrences of the word & # 39; birthday & # 39; in all metadata text fields, or & # 39; 05 .png & # 39; to search for a specific image file name & # 39; 05 .png & # 39; (no escape as in regular expressions needed).

(It also has an advanced configuration that allows multiple Boolean searches)

and another titled fuzzy

digiKam characterizes each image by a long number using a special technique (Haar algorithm) that allows comparing images by comparing this calculated signature. The less numerical difference there is between two image signatures, the more they resemble each other. This technique has three implementations in digiKam: …

  1. Duplicates
  2. Image (similar items)
  3. Sketch

Although the generation of "signatures" and cross-checking of them in a large number of images can be a slow process. Also keep in mind that some people are not fans because it is a KDE project that does not fully integrate with other desktop environments and tries to be an all-in-one application with image download, catalog / keywords, RAW development, handling Images and more included.