sharepoint online – Why is the PnP Search Results web part not sorting library titles?

I am using SharePoint online.
Within a particular site I wanted a page in SitePages to display a sorted list of all the libraries in the site.
I mapped the following Managed Properties as shown at the tenancy level.

As far as I know, it is not possible to initiate a full crawl at the tenancy level.
enter image description here

I verified that the new values for these managed properties had automatically appeared in the site search schema.
I then re-indexed the site, and waited for an hour or so.
I then added the PnP Search Results web part on the page.

Config Section 1

I set Search query keywords to: *

Config Section 2

I then used the following code to include all libraries, but exclude ‘system’ libraries:

Query Template:

-“Site Pages” -“Form Templates” -“Site Assets” -“Documents” -“Style Library” path:”” (contentclass:STS_List_DocumentLibrary)

Edit Sort Order

I did not create any default sort orders here.

Edit Sortable Fields

These are the sortable fields I created:

enter image description here

The two managed properties then appear in the ‘Sort by’ dropdown, but selection of either has no effect on the sort order of the libraries displayed.
I presume I am missing something obvious here – any thoughts or pointers will be much appreciated!

Thanks in advance,


c++ – Tower Defense: Sorting Algorithm with multiple weights (enemy AI)

I’m writing a sorting algorithm for a tower defense mobile game. As a quick synopsis, I have a “tower” that can shoot at incoming threats that are within X distance from the base of the tower.

Each incoming enemy, will have an associated {distance_from_tower} and {enemy_weight}. The {distance_from_tower} will be a value between 0 and X (X being the max range of the tower). The {enemy_weight} is a valued weight of “how important” it is to target that enemy mob. For example:

Three enemies:

Archer: {distance_from_tower} = 3 , {enemy_weight} = 1

Knight: {distance_from_tower} = 7 , {enemy_weight} = 5

Zombie: {distance_from_tower} = 10 , {enemy_weight} = 3

Currently, I have a simple sorting algorithm that only sorts enemies by their distance from the tower. (So, in the above example, the tower would target: Archer –> Knight –> Zombie)

Which is a “fine” first logical step, but I want my towers targeting to be more robust. I want the sorting to take into account both the {distance_from_tower} AND the {enemy_weight}. (For reference as well, these two values are updated at every Z seconds during the game, so they are constantly being recalculated).

I would like for the tower to be “smarter” and have a more robust sorting mechanism, that takes into account both weights, as said above. That could potentially lead to the tower targeting an enemy mob that is further away because the {enemy_weight} value of that respective enemy mob is of “high priority”. (So, in the above example, the inclusion of using both weights could lead to the tower targeting in this order: Knight –> Archer –> Zombie).

I’ve been digging around for a few possible solutions, such as using a Travelling Salesman approach, Dijkstra’s algorithm, or Floyd’s algorithm, and I can’t figure out the best way to go about sorting using both weights in a manner that makes sense to me. Any intuition or help is greatly appreciated! Thanks!

algorithm – c++ quicksort routine not sorting correctly

I need to sort a vector of accounts based on postcode.

Here is the routine I am using:


    if (l == -1 && r == -1)
    l = 0;
        r = Accounts.size();

    if (l == r) return;
    int pivot = r - 1; // number that we are trying to find the right place for. 
    int a = l, b = r - 2;

    while (a < b)
        if (Accounts(a)->postcode < Accounts(pivot)->postcode) a++;
        else if (Accounts(b)->postcode >= Accounts(pivot)->postcode) b--;
        else swap(Accounts(a), Accounts(b));

    swap(Accounts(pivot), Accounts(a));
    qSort(l, a);
    qSort(a + 1, r);

here is the output and as you can see there are errors with L271 – Post Code 2604 and F002 – 6231 Post code being in the wrong place. Can I please get some assistance?

REM                   Removed****       1004    72111.09        113.10
M00ney                   Removed****    1004    26000.12        1024.00
RE                   Removed****        1004    1982123.00      873213.00
123456                   Removed****    1675    8123189.00      3000000.30
REM                   Removed****       2006    1021000.16      0.00
U3123                  Removed****      2006    69600.01        18200.00
**L721                  Removed****       2604    21600.10        103.00**
U2123                  Removed****      2006    21600.00        13.10
123456                  Removed****     2612    146000.14       121024.00
U2122                  Removed****      2612    21600.00        0.00
U1123                   Removed****     2612    21600.00        13.10
U211193                  Removed****    2615    1821600.00      13.10
F001                   Removed****      3018    8096.00 256.00
**F002                  Removed****       6231    1096.00 0.00**
1234567                  Removed****    5278    9999999.99      0.00

algorithms – Sorting n weight disks with decision tree

I was refreshing some old tests about sorting algorithms, there was a question as follow:

Question: we have n weight disks with different weights and we want to sort them pair by pair, How many times we have to weight in worst case (maximum comparisons) to sort the whole disks?

the answer was $ lceil logn! rceil $.

My issue is that I could not get to the answer and could anyone elaborate on how the answer is working?

Also one of the options was $ lceil nlogn rceil $, and as we know,
the order of $logn!$ and $nlogn$ are same, So why shouldn’t the
ceilings be equal too?

and How does having an ordered and distinct set of size n, matter in decision tree?

8 – How to create a view of different entity types with common sorting?

Both, profiles and nodes (of one spec. nodetype) have the same taxonomy attached. (Using the profile module).
How to create a view of both together, profiles and nodes (of this type) to show as a result both sorted together (date created desc)?
Duplicate results with same nid must be filtered out (DISTINCT is not working in D8/9).

Part 2 of question:
Both, profiles and nodes (of one spec. nodetype) have a geolocation field (geolocation module) that contains coordinates (lat, long).
(In a view it is possible to do proximity sorting the result if it is a view of only nodes).
In this view profiles AND nodes (two different entity types) should be sorted together, sort order: proximity asc.

Is there a way to get this work if combining two different entity types in one view in Drupal 8/9?

c++ – Pyramid sorting with С++

void heapify(int arr(), int n, int i)
    int largest = i;   
    int l = 2*i + 1; // левый = 2*i + 1
    int r = 2*i + 2; // правый = 2*i + 2
    if (l < n && arr(l) > arr(largest))
        largest = l;
    if (r < n && arr(r) > arr(largest))
        largest = r;
    if (largest != i)
        swap(arr(i), arr(largest));
        heapify(arr, n, largest);
void heapSort(int arr(), int n)
    for (int i = n / 2 - 1; i >= 0; i--)
        heapify(arr, n, i);
    for (int i=n-1; i>=0; i--)
        swap(arr(0), arr(i));
        heapify(arr, i, 0);

Hello, I want to ask this question: here is the code of pyramidal sorting, and how it can be changed so that in the first function there was no recursion and it is possible pyramidal sorting in one function. And it is possible that the code was not heavy, after all I am new to that ask a lot of questions. I will be grateful for your help

sorting – sort Teams list alphabetically in MS Teams?

I have a whole bunch of Teams that I need to look at on a regular basis in MS Teams, and I’d like to organize them by sorting them alphabetically. Sorting things alphabetically may seem passé in a time where drag and drop sorting is the thing to do, but it sure is nice not to have to actively decide where to put things. Is there a way to do this other than manually? I can’t find anything, and this seems like a really dumb feature to omit so my assumption is that I’m probably just missing something.