The If Else statement cannot be executed based on the value of the edited dropdown selection in Google Sheets Script

I have a drop down box on a sheet (made of wheat, wood, stone, etc.). When this dropdown box is edited, one of the following similar functions should be performed based on the dropdown selection (for example, if the dropdown selection is wheat, select from area X). I have a function that seems to log exactly which cell the dropdown is in, the previous value, and the updated value. But now that I have an if else statement for each selection, it seems to have conflicting values ​​in the log.

I think either I am not setting the value correctly as a string or I am incorrectly instantiating the variables so that they are one thing for parts of the method – and something else for different parts? Here is the code below as it is current

function onEdit (evt) {

  var selection = evt.value;
  var range = evt.range;

  Logger.log("Hex Changed from: " + evt.oldValue + " to : " + selection);

    if (selection = "Brick") {
    Logger.log("It was " + selection);
    Logger.log("The Paste Area is from row " +(range.getRow()+2) + " and column " +(range.getColumn()-1) + " to row " + (range.getRow()+6) + " and column " + (range.getColumn()+1));
  } else if (selection = "Gold") {
    Logger.log("It was " + selection);
    Logger.log("The Paste Area is from row " +(range.getRow()+2) + " and column " +(range.getColumn()-1) + " to row " + (range.getRow()+6) + " and column " + (range.getColumn()+1));
  } else if (selection = "Sheep") {
    Logger.log("It was " + selection);
    Logger.log("The Paste Area is from row " +(range.getRow()+2) + " and column " +(range.getColumn()-1) + " to row " + (range.getRow()+6) + " and column " + (range.getColumn()+1));
  } else if (selection = "Stone") {
    Logger.log("It was " + selection);
    Logger.log("The Paste Area is from row " +(range.getRow()+2) + " and column " +(range.getColumn()-1) + " to row " + (range.getRow()+6) + " and column " + (range.getColumn()+1));
  } else if (selection = "Wheat") {
    Logger.log("It was " + selection);
    Logger.log("The Paste Area is from row " +(range.getRow()+2) + " and column " +(range.getColumn()-1) + " to row " + (range.getRow()+6) + " and column " + (range.getColumn()+1));
  } else if (selection = "Wood") {
    Logger.log("It was " + selection);
    Logger.log("The Paste Area is from row " +(range.getRow()+2) + " and column " +(range.getColumn()-1) + " to row " + (range.getRow()+6) + " and column " + (range.getColumn()+1));
  } else {
    Logger.log("Something went wrong");

The problem is that the & # 39; selection & # 39; value in the if statements is ALWAYS "Brick" even if the selection in the first part of the log was correctly identified as the drop-down list for which it was edited (see screenshot below).

So my question is, how can I get the code to run so that if it correctly chooses what the updated "selection" variable is (now happening), it will execute the correct if statement (not happening now)?

Script log

centos – a stop job is executed for / nfs – server inventory in a 20-minute start cycle

I messed up the configuration on a server and put the chicken in front of the egg. After a restart, my server hangs and waits for an NFS mount that is only available after a VM was started later.

I connect to the terminal and see:

( ***  ) A stop job is running for /nfs (3min 10s / 3min 31s)

And after 3min 31s

(  *** ) A stop job is running for /nfs (3min 40s / 4min 11s)
( ***  ) A stop job is running for /nfs (4min 43s / 5min 53s)

I didn't wait more than 15 minutes

( ***  ) A stop job is running for /nfs (15min 15s / 16min 2s)

How can I end this process and continue with the system start? What is the actual timeout if this timer does not actually show anything useful?

SQL Server – MS SQL – CLR stored procedure is executed as a deleted user

I have a SQL Server 2017 database that contains some CLR stored procedures. When trying to access these CLR-SPs, the CLR-SP returns the error "Login failed".

My user is connected and working properly. It appears that the CLR SP is encoded to run as another specific user.

I don't have access to the underlying code for the CLR SPs. Can I change which user it is running as?

SQL Server – The IS NULL condition in the predicate for distributed query is not executed remotely

I'm running the predicate-constrained query below, but it doesn't run the code completely away.

This only happens for the IS NULL predicate in the BIT column

Select * from [RemoteServer].[DBName].dbo.[TableName] where [column] is null

The distributed server in this case is SQL Server and the column is the BIT data type.

For this purpose, the remote query pulls all data back to the main server and then applies the filter. The execution plan looks like this ..

Enter the image description here

This only happens when I look for the condition zero. When I do this [column] = 1 or column = 0, the query is run remotely.

Optimization – Are empty Update () methods executed and slow down the game while playing?

From an optimization point of view, is it advisable to delete the predefined update () methods in all my C # scripts if there is no code in them?

Does the game slow down on hundreds / thousands of GameObject (s) with Update () {} empty?
Can they be left blank or is it better to delete them?

Javascript – jquery window not executed when loading

I use jquery to toggle a loader animation when the page loads: when the page (text and images) loads, the div with the loader animation is displayed above the page. When the page is fully loaded, the div is turned off with the loader.

    $(window).on('load',function() {

    // Other things...

and this works for the first time when you open the page, but the second time when images are already cached, $ (window) .on (& # 39; load & # 39 ;, …) is not executed (I think , because images load faster) before document.ready) and consequently the loader is not switched off.

P.S. I noticed this when testing on Android with Chrome. I don't see this problem on my PC

Does anyone have an idea to fix this problem?

Parallelism – Spring Batch: No transaction is executed when using SimpleTaskExecutor

I have a simple step that consists of a synchronized StaxEventItemReader, an ItemProcessor, which will take a while to finish, and a JpaItemWriter. If I run without SimpleTaskExecutor there is no problem. However, if you try to run the step with multiple threads, the following exception is thrown: javax.persistence.TransactionRequiredException: no transaction is in progress.

I already had a similar question, but the original author removed it.

Javascript – Ajax is executed automatically when a page is started

I want Ajax to load automatically when a page starts, since this is the DIV that will load other pages or functions in the future, but doesn't show or mark anything at the moment. The JS is not on the central page, but in another file. This is the HTML and JS code:


 function() loadDoc() {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) {
            document.getElementById("biografia_es").innerHTML = this.responseText;
    };"GET", ".biografia_es.html", true);

Any help is appreciated.

Why is this simple javascript executed multiple times?

Why is this javascript executed 2-4 times per page load:

// mei_library_turn.js
(function ($, Drupal) {
  Drupal.behaviors.mei_library_turn = {
    attach: function() {


      // There would be a lot more code in here, but I've stripped it all out to debug.


})(jQuery, Drupal, drupalSettings);

This is the entirety of the Javascript file. What could cause this to fire multiple times? The script is not repeated in the header of the document.

When I load the page, it mostly fires 3-4 times. Sometimes only twice.

I realize that one time () can be used to mask problems like this, but it increases the complexity of scripts and I want to understand why the code runs multiple times at all.

Here is the page where I attach the library:

public function book($marc_num) {

    $output = ();

    $output('something')('#attached')('library')() = 'mei_library/librarybook';

    return $output;


Here is my library file:

  version: 1.x
    js/mei_library_turn.js: {}