python – Program restarts by itself and does not end until 2 valid entries

Guys, I was doing Gustavo Guanabara exercises and I came across an intriguing situation: my code restarts and hers does not !!! This is Python World Lesson 22 exercise 112. I used a structure of 3 files according to the diagram below:

test /
…. courseInVideo /
…….. currency /
…………____ init____.py
……..____ init____.py
…….. dado.py

Here is the content of the currency / ____ init____.py:

def metade(num, boleano):
    if boleano:
        return moeda(num/2)
    return num/2

def dobro(num, boleano):
    if boleano:
        return moeda(num*2)
    return num*2

def aumentar(num, acrescimo, boleano):
    result = num + (num * acrescimo / 100)
    if boleano:
        return moeda(result)
    return result

def diminuir(num, reducao, boleano):
    result = num - (num*reducao/100)
    if boleano:
        return moeda(result)
    return result

def moeda(num):
    conversor = str(num).split('.')
    saida = "RS" + conversor(0) + ',' + conversor(1)
    return saida

def resumo(num, acrescimo, reducao):
    saida = 20*'-' + 'n' + 'RESUMO DO VALOR' + 'n' + 20*'-' + 'nPreço analisado: ' + moeda(num) + 'nDobro do preço: ' + dobro(num, True) + 'nMetade do preço: ' + metade(num, True) + 'n' + str(acrescimo) + '% de aumento: ' + aumentar(num, acrescimo, True) + 'n' + str(reducao) + '% de redução: ' + diminuir(num, reducao, True)
    print(saida)

Content of data.py:

def leiaDinheiro(entrada):
    valido = True
    while valido:
        num = input(entrada)
        if num.isalpha():
            print(f'ERRO: "{num}´" é um preço inválido!')
        else:
            valido = False
            return float(num)

And the EmVideo / ____ init____.py course:

from teste.cursoEmVideo import dado
from teste.cursoEmVideo import moeda

p = dado.leiaDinheiro('Digite o preço: R$')
moeda.resumo(p, 80, 35)

Can anyone see why the program restarts after reading valid data, in this case numeric data? Even, as I mentioned in the title, the program really ends, but only after two valid data reads (not necessarily consecutive).

sharepoint server – SP 2016: disabled sandbox code service restarts

In an effort to stop the spucworkerprocessproxy process, I stop the Sandboxed Code Service (because we don't use sandbox code) by running:

$serviceInstance =  Get-SPServiceInstance | ? { $_.TypeName -eq '
Microsoft Sharepoint Foundation Sandboxed Code Service';

Stop-SPServiceInstance -Identity $serviceInstance.Id -Confirm:$false;

After performing the above, the status of the Sandboxed Code Service became "Unprovisioning" and the spucworkerprocessproxy was arrested and the entire load on his database was gone. And there was a lot of joy.

However, the next morning, the service was operational again, with spucworkerprocessproxy. Sad paperclip.

How can we stop this thing, and keep it? Thank you.

samsung – Android restarts after startup

My odroid xu4 card is started with Android and gets the console, but then it tries to open the fstab file. But the file path does not work properly and it starts to restart.

shell @ odroidxu3: / $
[2.387631] fs_mgr: path of the fstab file
[2.387690] fs_mgr: unable to open file
[2.440814] sysrq: SysRq: R / O emergency reassembly
[2.442844] Emergency reassembly finished
[3.273570] restart: restart the system with the command & # 39; & # 39;

Please help me with the same.

Ignoring the view controller trigger with a button restarts my application

Each time I reject a view, my application restarts. Anyone with the same problem?

posts – Scans an iteration of 500 results at a time, increments a page, and restarts with the next 500

Below, I will explain all the steps and explain how everything works so that you better understand what I'm trying to achieve.

  • The function import_employees starts and enters the $settings('page') = 1' which is the first page.
  • Then, once the script is finished, the current_page is incremented if the next_page is not null. It restarts the script with the next batch of 500 units until the last page, then resets the current_page to the value 1.

Does anyone know what I could do wrong? All information provided will be useful.

var_dump($records) reveals the following information:

object(stdClass)(1336)
  public 'paginator' => 
    object(stdClass)(1335)
      public 'total' => int 3081
      public 'per_page' => int 500
      public 'current_page' => int 1
      public 'last_page' => int 7
      public 'prev_page' => null
      public 'next_page' => string 'https://oc.com/api/v1/employees/?page=2' (length=61)

var_dump($next_page); reveals the following:

array (size=3)
  'page' => int 2
  'started' => int 1572849045
  'finished' => int 0

The complete code is listed here:

function import_employees()
{
    $log = ();
    $start_script = false;
//    $name = 'octopus_import_employees';
    $settings = get_settings();
    $octopus = get_octopus();

    /* Start the script at 0 */
    $settings('started') = 0;
    $settings('page');

    /* If the started timestamp is less than or equal to finished, start the script */
    if ($settings('started') <= $settings('finished')) {
        $start_script = true;
    }

    /* If start script is true, continue */
    if ($start_script) {

        /* Grab the first 500 records from Octopus */
        $records = $octopus->get_raw('employees', (
            'updated_at_after' => $settings('started'),
        ));

        /* Once the time is fixed, if no records need updating */
        if (!$records) {
            echo '
No updates for offices in Octopus.

& # 39 ;;
return;
}

/ * Returns all Octopus records as an object * /
foreach ($ records-> data as $ record) {

$ sync = false;
$ time_changed = false;

// If there is an employee with an Octopus ID
if (octopus_id_exists ($ record-> id)) {

$ wp_employee = get_id ($ record-> id);

/ * Retrieves sync settings * /
$ sync_settings = get_post_meta ($ wp_employee-> ID, _setting_update, true);

/ * Change the timestamp of the last modified WP to Unix * /
$ wp_modified = strtotime (get_post_meta ($ wp_employee-> ID, _ last_modified, # true));
}
}

if (! is_null ($ records-> paginator-> next_page)) {
$ next_page = $ records-> paginator-> current_page ++;
var_dump ($ next_page);
$ settings (& # 39; page) = $ next_page;
$ parameters ("started") = time ();
$ parameters ("finished") = 0;
var_dump ($ settings);
} other {
$ parameters (& # 39; page) = 1;
$ settings ('done') = time ();
}
}
}

get_settings () function
{
/ * Set the default page, started and ended * /
return (
& # 39; page & # 39; => 1,
& # 39; started & # 39; => 0,
& # 39; finished & # 39; => 0,
)
}

The router restarts when analyzing the port

This question is very much related to restarting the router when using Nmap. The difference is that I am really interested in a practical solution to this problem.

I have a piece of C code that performs port scans with raw sockets. The port that interests me is very rarely open. I want to increase my sweep rate. But as soon as I increase the throughput, my router starts to reboot.

Now, the answer to the related thread related above says "You are probably running out of the router's resources, mainly the NAT table."

So, I first tried to get indicators (because the router will soon break down) from the C code. So I checked the return values ​​of sendto and errno and so on, but that does not just mean that something is not wrong. Is it possible to get a flag inside C code that tells me that I have to slow down to prevent the router from restarting?

The other thing I've tried to do is port forwarding, but it does not work, the router is still restarting. I must confess that I am not really an expert on routers and NAT tables, but I thought that there was no mapping involved for each new outbound connection if the source port was transferred. Is it a mistake to think that port forwarding will help in this case, if so why?

macos – MBP Restarts After Unlocking Filevault Partition

I'm running a retina MBP 2015 with 512 GB SSD with macOS 10.14 and Windows10 with bootcamp. The macOS partition is encrypted with FileVault.

Recently, I can not start in macOS anymore.
Here is what happens:
After the "login" (to unlock the partition, before loading the operating system), it restarts and returns to the same login screen.

Similarly, when I go to RecoveryOS> Disk Utility> Mount my "Macintosh HD" partition, after entering the disk password, it also restarts.

And when I want to recover the partition from a TimeMachine backup, after entering the disk password, guess what, it restarts.

Clues?

macos – MBP Restarts After Unlocking Filevault Partition

I'm running a retina MBP 2015 with 512 GB SSD with macOS 10.14 and Windows10 with bootcamp. The macOS partition is encrypted with FileVault.

Recently, I can not start in macOS anymore.
Here is what happens:
After the "login" (to unlock the partition, before loading the operating system), it restarts and returns to the same login screen.

Similarly, when I go to RecoveryOS> Disk Utility> Mount my "Macintosh HD" partition, after entering the disk password, it also restarts.

And when I want to recover the partition from a TimeMachine backup, after entering the disk password, guess what, it restarts.

Clues?

VPS unplanned restarts | Talk Web Hosting

I am just looking for opinions.

Do you think that a VPS host should post a notice if they will restart the servers / your vps that day? As for a kernel patch.

It happened to me and curious to know what your thoughts are.

Should he expect several unexpected reboots in a year? What would you consider acceptable?

Thank you!

Windows 10 does not detect when it restarts

A picture

My computer does not detect when I restart it, the computer's uptime counter does not reboot, and my computer's name change does not update after a reboot. I thought it might be because the computer was not turned off long enough because it is still on. So I turned it off all last night and it made no difference, the computer did not detect it restarted. I certainly did not put the computer to sleep and it was not in hibernation because I did not activate this feature, I tried repeatedly to reboot my computer. no idea what's going on?

Here are my sysinf and dxdiag files

I use Windows 10 Pro to be able to use group policies if needed.