## ¿Porqué en este loop de JavaScript la impresión de la variable es desde counter y no desde counter-1?

en mi búsqueda por aprender programación por mis propios medios, me he topado con el tema de recursividad y este simple código… mi pregunta ya que la variable counter comienza desde 10 y dentro del loop While el contador resta 1, porqué en la “impresión” aparece desde el 10. Sé que si quisiera empezar desde 10 colocaría el contador en 11… pero obviamente tengo la curiosidad y no entiendo.

var counter = 10; while(counter > 0) {     console.log(counter--); } 

resultado: 10 9 8 7 6 5 4 3 2 1

## Es posible ejecutar un loop if controlado por un input en python?

soy novato en python. Tengo este código para generar balotas de bingo simuladas:

import random letras = ['B','I','N','G','O'] randomletras = random.randint(0,4) numeros = range(1,51) randomnumeros = random.randint(0,49) print((letras[randomletras]) + "-" + str(numeros[randomnumeros]))  print ("Nueva balota: s/n ?") balota = input ("")  if balota =='s': #aquí necesito volver a ejecutar todo el código anterior y volver a formular la pregunta            #else:     #print ('************fin del juego***********')    

de manera que se generen balotas aleatorias, hasta que se seleccione ‘n’

## calculating the index in a FOR loop

I am coding in Matlab: m = [40 50 60]; X=[]; % [] makes an empty matrix for j=1:3 for i=1:3 x=zeros(m(i),1); % a vector of m(i) zeros X=[X;x]; % store x under the old previous ones end end  and would like to run the code in parallel. Is there a way to calculate from which index to which index in X I will be in a given loop storing in please?

## Why python script stops executing the statement of loop but the process itself is alive?

i am running face recognition python script on Ubutnu 18.04 as a daemon which takes pictures from another server with ssh request and performs operations on them . i have this code in python script which is always running but the statement of while loop stops being executed . the process itself is alive

While true:  ssh request to another server to recieve pictures   time.sleep(1) 

i check the directory of another server and the pictures are present there

## Derive a while loop, which seemingly have some logarithmic traits, runs in $\Theta(n)$

I know for a fact that algorithm A runs in $$\Theta(n)$$, but how does one derive that?

Algorithm A

i = 1 while i ≤ n   s = 0   while s ≤ i     s = s + 1   i = 2 ∗ i 

The inner loop is clearly $$O(i)$$ (linear time).

The outer loop is clearly $$O(\log n)$$ (logarithmic time).

A visualitation of the loop in terms of an input $$n$$ would look as follows:

, the black lines represents the amount of work or iterations required in terms of $$n$$.

## Derive a while loop runs in $\Theta( \sqrt{n} )$

I know for a fact that algorithm A runs in $$\Theta(\sqrt{n})$$, but how does one derive that fact?

Algorithm A

i = 0 s = 0 while s <= n:     s += i     i += 1 

Here is what I am thinking. We know that A is upper-bounded by O(n), as we increment $$s$$ by more than 1 in each iteration. We also know that it must be lower-bounded by $$\log n$$, as we increment $$s$$ with by something less than $$2^i$$ in each iteration. (Correct me if I am wrong, these are just my thoughts …).

Now, what else can we say about A? How do we derive that its time complexity is $$\Theta(\sqrt{n})$$?

## “[TTM] Buffer eviction failed” loop

I had locked my ubuntu desktop, then came back 40 minutes later and the lock screen time was stuck at 30 minutes ago. Nothing happened when I pressed enter or tried to get to the login screen, but I could move my mouse around, so I tried Ctrl-Alt-F3 to see if anything happened. I didn’t type in any commands, but the terminal outputed:

linux login: [447864.849129] [TTM] Buffer eviction failed [447864.849145] nouveau 000:01:00.0: systemmd-logind[1077]: fail ttm_validate [447864.849153] nouveau 000:01:00.0: systemmd-logind[1077]: validating bo list [447864.849161] nouveau 000:01:00.0: systemmd-logind[1077]: validate -1 [447895.056421] [TTM] Buffer eviction failed [447925.263809] [TTM] Buffer eviction failed [447955.471490] [TTM] Buffer eviction failed [447985.678829] [TTM] Buffer eviction failed [447915.886441] [TTM] Buffer eviction failed 

… And it seemed to be stuck in this loop. I went back to the lock screen with Ctrl-Alt-F1 (and it took about a minute to do so), and the screen was still stuck even though I could move my mouse around. I can’t press the power options button on the upper right either. I ended up force-shutting down my computer anyway, but is there anything I could have done to fix this?

## find: File system loop detected; ‘/snap/core18/1144’ is part of the same file system loop as ‘/’

Sudo find / -iname ".demoCA' -type d fails with these error messages

find: File system loop detected; ‘/snap/core18/1144’ is part of the same file system loop as ‘/’. find: File system loop detected; ‘/writable/system-data/snap/core18/1144’ is part of the same file system loop as ‘/’ 

Trying to find openssl default CA folder on ubuntu core 18. openssl is not a snap

## Causing infinite loop for SharePoint 2010 Approval Workflow using SharePoint Designer

I’m trying to setup an approval workflow for new and edited items in Document Library.

I created an approval workflow that is set to start when a new item is created and when an item is edited. The workflow updates the approval status on completion.

Now when I create a new item or edit an existing item the workflow kicks off as expected. However when I approve the workflow the workflow completes and then starts a new workflow. It would seem that updating the approval status is causing the workflow to activate again.

Is there any workaround to stop this looping?