Problema con Delay o pausa en Javascript

Estoy aprendiendo javascript y he hecho un programa que resuelve un sudoku, el programa va bien pero quería hacer que se muestre paso a paso como se va solucionando. Por lo que cree la función necesaria para ir dandole el value a los input’s en cada ciclo de la función recursiva.
En si el problema que tengo es que no puedo hacer que haya una pausa entre cada ciclo, he probado setTimeout y otra funcion para dormir el programa, pero no hay caso, lo único que consigo es que demore mas en solucionarlo y luego escupa toda la solución completa.
Mi pregunta seria: ¿Javascript no modifica el DOM hasta que toda la función termina de ejecutarse?¿Por mas que dentro de la función vaya modificando paso a paso? No encuentro otra explicacion, paso el trozo de codigo:

 function resolverSudoku(sudoku,row,col){
        if(row == 8 && col == 9){
            //mostrarResultado(sudoku);
            return true;
        }else{
            //No salir del rango
            if(col == 9){
                row++;
                col = 0;
            }
            //Ingresar los datos
            if(sudoku(row)(col) != 0){ //Entrara por aca al detectar un numero que no se debe modificar
                if(resolverSudoku(sudoku,row,col+1)){
                    return true;
                }
            }else{
                for (var i = 1; i < 10; i++) {
                    //Reviso si el numero cumple las condiciones y si es asi lo ingreso
                    if(isColFree(sudoku,i,col) && isRowFree(sudoku,i,row) && isSquareFree(sudoku,i, row, col)){
                        sudoku(row)(col)=i;
                        mostrarCasillas(sudoku,row,col); //muestra casilla a casilla (supuestamente)

                        ///////ACA HARIA LA PAUSA, O DENTRO DE LA FUNCION mostrarCasillas.

                            //Paso a la siguiente recursividad
                            if(resolverSudoku(sudoku,row,col+1)){ //retornara true solo cuando llegue al final de todos los ciclos
                                return true;
                            } // si retorna false, paso al siguiente valor del for                      
                            sudoku(row)(col)= 0; //quito el valor que ya que no forma parte de la solucion
                        }                   
                    }//for

                }           

            //Si llega aca (no encontro i que entre) deberia retornar falso para volver al ciclo anterior
            return false;
        }//else
        return false;
    }//funcion

function mostrarCasillas(sudoku,row,col){       
        var m = (row+row*8)+col;
        casillas(m).setAttribute('value', sudoku(row)(col));
        sleep(1000);                
    }
La función resolver sudoku es llamada por un boton...             

youtube live – Delay on stream download

I have just done a live stream that I wish to download. Yesterday I did the same thing, but when I went into YouTube studio and clicked the 3 dots, the “Download” option was grayed out (other streams were not like this). However today it wasn’t grayed out. Can someone explain why YouTube does this; is it for processing or whatnot?

unity – Why do I get a delay on a 2D Trigger collision only on Build?

I have a weird problem.
When I play the game in the Editor everything seems fine.
My Player has to walk into a trigger, that triggers to flickering the lights.
In the Editor its happening immediately when the Player enters the Trigger but however
on the Build when I first start the Scene it happens with a delay and is however a bit slower, for example the lights going down slower and the postprocessing effect seems slower, while the game still runs at a normal speed, when I open the option menu
and restart the Scene it works fine again.
What could this be?
I am setting the Time.timeScale to 1 before leaving the Scene and not changing it in the menu.

Also I am loading the Scene with LoadSceneAsync and AsyncOperator.

Trigger Code:

public GameObject _Trigger2;
public GameObject _Trigger3;
public GameObject _ShadowFigure;
public HouseManager _HouseManager;
public GameObject _Forest;
public GameObject _Doggo;

void Awake()
{
    _Forest.SetActive(false);
    _Trigger2.SetActive(false);
    _Trigger3.SetActive(false);
    _ShadowFigure.SetActive(false);
    _Doggo.GetComponent<ToniFollowScript>().enabled = false;
    if(_Doggo.GetComponent<ToniFollowScript>().isActiveAndEnabled)
    _Doggo.GetComponent<SwitchCharacters>().enabled = false;
}

private void OnTriggerEnter2D(Collider2D collision)
{
    if(collision.gameObject.tag == "Player")
    {
        //The Problem only occurs on this one line underneath
        _HouseManager._startDimmingLights = true;
        _Doggo.GetComponent<ToniFollowScript>().enabled = true;
        _Trigger2.SetActive(true);
    }
}

private void OnTriggerExit2D(Collider2D collision)
{
    Destroy(this.gameObject, 0.1f);
}

also here my OptionMenu Script when I press Escape:

(Header("Menu Option Buttons"))
public GameObject _menuOptionButtons;
public bool _menuIsOpen = false;

void OnEnable()
{
    _menuOptionButtons.SetActive(false);
}

void Update()
{
    OpeningClosingMenu();

    if(!_menuOptionButtons.activeInHierarchy)
    {
        _menuIsOpen = false;
    }
}
void OpeningClosingMenu()
{
    if (Input.GetKeyDown(KeyCode.Escape))
    {
        if (Time.timeScale == 1f)
        {
            Time.timeScale = 0f;
            _menuIsOpen = true;
            _menuOptionButtons.SetActive(true);
        }
        else
        {
            Time.timeScale = 1f;
            _menuIsOpen = false;
            _menuOptionButtons.SetActive(false);
        }
    }
}

public void Resume()
{
    Time.timeScale = 1f;
    _menuIsOpen = false;
    _menuOptionButtons.SetActive(false);
}
public void Restart()
{
    Time.timeScale = 1f;
    //Loads the active Scene again
    SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
public void MainMenu()
{
    Time.timeScale = 1f;
    if(Time.timeScale == 1f)
    SceneManager.LoadScene(0);
}

Thanks.

differential equations – NDSolve for closed loop system with delay unit (try to compare with Simulink)

I am trying to reproduce a Simulink schematic with a delay unit.

enter the image description here

To do this, I use the NDSolve command with an additional equation that implements a unit delay loop.

The results do not match, and I associate it with a misunderstanding of how the unit is delayed and the joint solution of the algebraic and differential equations using the NDSolve command.

It helps to fix the error.

enter the image description here

enter the image description here

ClearAll["Global`*"]
pars = {[Alpha] = 1, Subscript[W, origin] = 1, [Eta] = 1, u = 1}
s = NDSolve[{x'
      u, Subscript[W, o]
    Subscript[W, origin] + 
     Subscript[W, o][t - 0.001] + [Eta]*Tanh[x
   Subscript[W, o][t /; t <= 0] == 0}, {x, Subscript[W, o]
    10}]
Plot[Evaluate[{x
Plot[Evaluate[{Subscript[W, o]
 PlotRange -> All]

How to resolve the 2 hour delay on outlook.com?

Sometimes Outlook.com receives an email after 2 hours. I mean the email should be received at 10 p.m., but it was received at 12:06 a.m. (next day).

How to resolve the 2 hour delay on outlook.com?

I mean the email website called outlook.com no office 365.

macos: separate repeat key and delay rate for each keyboard

Is there a way to set the key repeat and delay until the key repeat rate is separate for apple's built-in keyboard (MBP 15 "2018) and external keyboard (MX keys in my case). The keys The external keyboard feel very different and when the settings are fixed, I feel that there is a big difference in delay and repeat rate between the built-in keyboard and the external keyboard.

Any help would be very much appreciated.

As you can see in the settings it appears to be a global setting and not a specific keyboard setting. I tried searching Karabiner-Elements but couldn't find anything relevant.
enter the image description here

ntpd – NTP – After how much delay would NTP select a remote server in the group?

A selected server will be indicated by *. But how long will it take to select a server from the pool if the ntp service is restarted?

I am trying to monitor the NTP server and its drift, but every time I restart the service the selection process takes a while and I wanted to know how long it would take.

~$ ntpq -p
remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*time4.stupi.se  .PPS.            1 u    2  128  377    7.796   16.636   4.146
+213-21-116-142. 192.36.144.22    2 u   18   64  377    8.261   17.013   3.807
+ntp.xpd.se      192.36.144.22    2 u   38   64  377    8.855   20.929   2.537
+mail.joacimmeli 192.36.144.22    2 u   28   64  377    9.228   19.509  25.804
+juniperberry.ca 193.79.237.14    2 u   26   64  377   44.612   19.835   2.443
~$

Implement jquery as addClass, removeClass and delay functions in Javascript

Suppose $ is not the browser. Now you have to implement $, it will take a string, which is a query, you will use querySelector to select the item. (Reference: https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector)

$('text')

Now implement jquery as addClass and removeClass functions. (Reference: https://developer.mozilla.org/en-US/docs/Web/API/Element/classList)

$('#test').removeClass('blue').addClass('red');

Now implement jquery as delay functions. (Reference: https://api.jquery.com/delay/)

$('#test').removeClass('blue').delay(2000).delay(1000).addClass('red');

Code sample

function $(selector) {
    let element = document.querySelector(selector)
    element.queue = ()
    element.active = false
    return element
}

Element.prototype.next = function () {
    if (this.queue.length) this.runTask(this.queue.shift())
}

Element.prototype.runTask = function (callBack) {
    this.active = true
    callBack().then(() => {
        this.active = false
        this.next()
    })
}

Element.prototype.register = function(callBack){
    if (this.active) {
        this.queue.push(callBack)
    } else {
        this.runTask(callBack)
    }
}

Element.prototype.addClass = function (className) {
    that = this
    let callBack = () => new Promise(resolve => setTimeout(function () {
        that.classList.add(className)
        resolve()
    }, 0))
    this.register(callBack)
    return this
}

Element.prototype.removeClass = function (className) {
    that = this
    let callBack = () => new Promise(resolve => setTimeout(function () {
        that.classList.remove(className)
        resolve()
    }, 0))
    this.register(callBack)
    return this
}

Element.prototype.delay = function (ms) {
    that = this
    let callBack = () => new Promise(resolve => setTimeout(function () {
        resolve()
    }, ms))

    this.register(callBack)
    return this
}

$('#test')
.removeClass("red").delay(500)
.addClass("blue").delay(500).delay(500).removeClass("blue")
.delay(500).addClass("red").delay(500).removeClass("red")
.delay(500).addClass("blue").delay(500).removeClass("blue")
.delay(500).addClass("red").delay(500).removeClass("red")



    
        
    
    
        

Can anyone review the Code?

keyboard – Caps lock delay issue in Ubuntu 20.04

Hello Ubuntu community,

I recently started booting Ubuntu 20.04 along with Windows 10 for game development and I have noticed a problem that I think many have had before me …

When I type I tend to use a lot of uppercase instead of uppercase to write uppercase characters, when I turn it on in Ubuntu (and I have tried other distributions like Pop, Fedora, Mint, Manjaro etc.) it tends to lag a bit when I try to turn it off and results in a text similar to this: Hello my friend

I've looked everywhere and found some scripts that suggest they fix this problem, but they didn't work for this version of Ubuntu and most of the other modern versions of the other Linux distributions that I tried.

I would like to know if there is any way to solve this problem. Learning to use shift instead of capitals will be time consuming and I can't afford to mess around today.

Notes:

  • I have a relatively new mechanical keyboard (purchased last month).
  • I DO NOT get this problem on macOS or Windows.