How to sort by merged cells in Google Sheet

I have been using this script for sorting and so I know it works. Now I’m trying to use it on a new Google Sheet project. Except that the column I want to sort the entire sheet by isn’t just one column but a merge, which I derived by merging columns 3 to 6. How do I modify my script to sort by the derived column? Here is my script:

function onEdit(event){
  var sheet = event.source.getActiveSheet();
  var editedCell = sheet.getActiveCell();

  var columnToSortBy = 3; // doing 3:6 doesn't work
  var tableRange = "A11:R82";

  if(editedCell.getColumn() == columnToSortBy){   
    var range = sheet.getRange(tableRange);
    range.sort( { column : columnToSortBy } );

After some trials and error, I did the following, but it’s still not working:

function onEdit(event){
  var sheet = event.source.getActiveSheet();
  var editedCell = sheet.getActiveCell();

  var columnToSortBy = (3,4,5,6);
  var tableRange = "A11:R82";

  if(columnToSortBy.includes(editedCell.getColumn()) ){   
    var range = sheet.getRange(tableRange);
    range.sort( { column : columnToSortBy(0) }, { column : columnToSortBy(1) },{ column : columnToSortBy(2) },{ column : columnToSortBy(3) } );

Postgresql: sort by value position in array column, then by secondary order

I’m not quite sure what the best way to phrase this is…

So in my DB there is pillars text array which is basically an enum where providers ordered what values meant the most to their business, from most important to providing that value for their clients, to least important.

I’m using PostGIS to query providers in a specific area, and want to return providers ordered first by the pillar that a client selected they were looking for, then by closest location.

so if the pillars all have values ['a', 'b', 'c', 'd'], in any order depending on what providers selected, and the client selected pillar c

the results of the query would preferably return any/all providers that have pillar c at array index 0 first, ordered by distance to geopoint, then by providers that have pillar c at array index 1 second ordered by distance to client geopoint, then idx 2, then idx 3

I’m really only looking for the top 3 results in all cases, and providers with pillar c at idx 1 would only be needed if there were less than 3 results for index 0

Is this possible to pull off in a single query? or should I just run it with a where clause and check the results length until I have 3 results?

The pillars column is indexed with a gin index btw

sort CPT on Custom Taxonomy Archive page

I have created a custom post type called “al_product” and attached to it a custom taxonomy called “product_category”.

In my archive-product_category.php I have this (relevant) code:

            if ( $termchildren  ) {
                // we have kids...just show the terms.
                foreach ( $termchildren as $child ) {
                    if ($i % 2 == 0) {
                        echo '<div class="tax-entry flex">';
                    } else {
                        echo '<div class="tax-entry flex" style="flex-direction: row-reverse;">';
                        <figure class="wp-block-media-text__media">
                            <?php if ( get_field('product_category_img', $child) ) echo wp_get_attachment_image( get_field('product_category_img', $child), 'full' ) ;?>
                        <div style="flex:60% 0 0;" class="wp-block-media-text__content">
                            <h2><?php echo $child->name ;?></h2>
                                if (get_field('short_description', $child )){ 
                                    echo get_field('short_description', $child );
                                    echo $child->description;
                            // Get (at most) 2 "product" posts in the child term.
                            $posts = get_posts( array(
                                'post_type'      => 'al_product',
                                'posts_per_page' => 2,
                                $taxonomy_name   => $child->slug,
                            ) );

                            // If there's exactly 1 post, use the post permalink.
                            if ( 1 === count( $posts ) ) : ?>
                                <a class="button" href="<?php the_permalink( $posts(0) ); ?>">See this Product</a>
                            <?php // Else, use the term link.
                            else : ?>
                                <a class="button" href="<?php echo esc_url( get_term_link( $child, $taxonomy_name ) ); ?>">See this Series</a>
                            <?php endif; ?>

                    </div> <!-- END FLEX -->
            } else { 
                // no the products
                echo '<div class="productCategories grid">';
                while ( have_posts() ) : the_post();

                    <div class="product_cat">
                        <a href="<?php the_permalink();?>">
                            <?php the_post_thumbnail('small');?>
                            <h2><?php the_title();?></h2>
                            $subtitle = get_field('subtitle');
                            if ( $subtitle ) { 
                            echo '<h3 class="entry-subtitle">'.$subtitle.'</h3>';
                        <?php //if (get_field('specs')('part_number')) echo '<span>'.get_field('specs')('part_number').'</span>';?>

                echo '</div>';

The section I’m questioning is when there are no kids so we show products.

Currently this is returning the products correctly but sorting by title. I would like to sort by menu_order.

I added this to my functions.php:

add_action( 'pre_get_posts', 'rt_change_product_sort_order'); 
function rt_change_product_sort_order($query){
    if(get_query_var( 'product_category' )):
       //Set the order ASC or DESC
       $query->set( 'order', 'DESC' );
       //Set the orderby
       $query->set( 'orderby', 'menu_order' );

To no avail. I’ve also tried replacing the “If” statement with each of these:

if(is_post_type_archive( 'product_category' )):
if(get_query_var( 'product_category' )):
if(get_query_var( 'al_product' )):

What am I missing here?

c# – Sort and Delete duplicate image files

I’m trying to make a console application to sort and delete duplicate image files. I have a folder with about 20000 images which take up roughly 70GB of space.

I wrote the following script and it seems to work fine, but the issue is that my PC runs out of available RAM memory (it has 16GB) without reaching halfway through.

static void Main(string() args)
    var uniqueData = new HashSet<string>();
    int progress = 0;
    int fileCount = Directory.GetFiles(imageFolderPath).Length;

    foreach (var file in Directory.GetFiles(imageFolderPath))
        string data, year, month;

        using (var image = Image.FromFile(file))

            using (var ms = new MemoryStream())
                image.Save(ms, ImageFormat.Jpeg);
                data = Convert.ToBase64String(ms.ToArray());

            try //try to get image date
                var date = Encoding.UTF8.GetString(image.GetPropertyItem(36867).Value).Split(':');
                year = date(0);
                month = date(1);
                year = "Unknown";
                month = "Unknown";

        if (!uniqueData.Contains(data))

            string yearDirectory = Path.Combine(outputFolderPath, year);
            if (!Directory.Exists(yearDirectory))

            string monthDirectory = Path.Combine(yearDirectory, (int.TryParse(month, out int i) && i > 0 && i < 14) ? CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(i) : month);

            if (!Directory.Exists(monthDirectory))

            File.Move(file, Path.Combine(monthDirectory, Path.GetFileName(file)));

        Console.WriteLine($"{progress} / {fileCount}");

Running time of heap sort, when all number are identical

Given n numbers that all are identical, then what would be the running time of heap sort?

Will it be in linear time $O(n)$ or, best case $Theta(nlog n)$?

Platform Identifier – Import & Sort Your Lists QUICKLY! | NewProxyLists

The platform identifier is used to quickly sort in your large lists of links into individual platforms.


Using a powerful inHtml & inUrl sorting feature sorting your lists is now a breeze.

More information:

Best Regards​

python – How do I custom sort against a Pandas Dataframe’s MultiIndex?

I have a Pandas dataframe that looks like the following.

data = pd.DataFrame({
    'x': (10, 9, 8, 4),
    'y': (1, 2, 3, 4),

data.index = pd.MultiIndex.from_tuples((
    ('high', 'high'), 
    ('high', 'low'), 
    ('low', 'high'), 
    ('low', 'low')
), names=('score', 'grade'))

I want to sort this dataframe based on the 2 index score and grade. I want the sort such that low comes before high for both index. How do I do this?

I tried this code below, but only the first index score is sorted as desired.

data.sort_index(level=(0, 1), key=lambda s: sorted(s, reverse=True))

Any ideas on how to custom sort against multiple indexes?

XFRM sort buttons | XenForo Nulled Download


Adds XFRM sort buttons.

This add-on is designed to be used on forums which use the XenForo Resource Manager and have the resources default sort order by title.

(Example of sort buttons)


(Example of Options page)



  • CSS changes can be made to andy_xfrmsortbuttons.less tamplate.
  • All phrases start with…

.(tagsToTranslate)xenforo(t)xenforo themes(t)xenforo nulled(t)xenforo free(t)xenforo 2.2(t)nulled(t)nulled script(t)whmcs(t)whmcs nulled(t)scripts(t)nulled scripts(t)vbulletin(t)vbulletin nulled(t)vbulletin 5 nulled(t)xenforo resources(t)wordpress download(t)wordpress nulled forum

unity – How can I display and sort a game server list by latency in a scalable manner?

If I have a game that allows players to self-host a multiplayer session which other players can join by browsing a game server browser to select a game I ideally want to be able to sort that list by latency, so that the lowest latency servers are top of the list.

I’m unsure about how to do this in a scalable manner, if for example there are 10,000 servers active at a given time, and 100,000 players looking for a game then it feels like every client receiving all 10,000 servers and pinging all 10,000 servers would generate excessive network traffic with 100,000 clients pinging each server on some regular interval; especially as some players may already be playing on some of these servers. This would mean each server receiving 100,000 ping requests on a regular basis.

I realise that I could reduce the servers sent back to the client from the master server list; it’s unlikely any player would ever want to browse all 10,000 servers so I could reduce it to say, 200 servers or so as that is probably sufficient to find a suitable game. The problem here though is that I would still be unable to determine the 200 servers with the best latency without pinging all 10,000 from the client for all 100,000 clients browsing the server list to find that top 200 by latency.

I could register the latency between the host and the master server in the master server list, and return servers to the client whose latency most closely matches the latency between the client and master server list and hope that enough of these servers are close to the client; but the risk here is that a client that’s 100ms from the master server and a server that’s 100ms from the master server could either be next to each other (0ms apart) or could be opposite sides of the master server geographically so be 200ms apart. I could have regional master servers to mitigate some of the most extreme cases here, but it still feels like a very suboptimal solution.

Finally, there are other issues; if a self-hosted server needs NAT punch through for clients to connect, or a relay server, then any latency check would also require these things; this further complicates the problem; initiating NAT punchthrough just to check the latency to one of, say, 10,000 servers feels excessive.

Does anyone have any advice on how producing a scalable server list sorted by latency for each client can be achieved? This seems to be something a number of games have supported over the years so it must be possible.

Any suggestions, or advice as to how this problem is typically solved, or can be solved, would be greatly appreciated.

Don’t You Just Hate These Sort of People Online That Despise Your Helpfulness and Thoughts? | Forum Promotion