Skip to main content

Questions tagged [control-flow]

Control flow (or flow of control) refers to the order in which statements are evaluated or executed.

0 votes
0 answers
16 views

Execute function and continue control flow with Teloxide

I want to execute some code every time a message is received by my telegram bot and always pass the control to the next branch let handler = Update::filter_message() .branch( dptree::...
PrinceOfBorgo's user avatar
-1 votes
0 answers
43 views

What may I do other than printing a message to display this concept? [closed]

''' <<<Control flow in Python>>> A Python program to simulate a scenario of baking and eating cupcakes at a party ''' # Class Initialization class Cupcake: def __init__(self, ...
Malihe Mahdavi sefat's user avatar
0 votes
0 answers
28 views

Can you import libraries in if statements in Python? [duplicate]

I'm working on some code that grabs some data from a website and then transforms it into a data object that will work for whatever machine learning library the user is using. I wanted to do some ...
Willow Unknown's user avatar
-1 votes
1 answer
40 views

Is there a tool or specific syntax to insert cases into switches with consecutive indices and make the indices below adjust

I have a function that takes an integer and returns a string that is picked by a switch. The strings are part of a coherent text and I want to be able to add cases to the switch whenever I want to ...
user3808217's user avatar
-2 votes
1 answer
33 views

Can you execute a block of code if a python loop is not broken [duplicate]

I'm looking for a more pythonic way to construct this check: good_result = None for item in items: result = process(item) if result.isGood(): good_result = result break if not ...
Ward's user avatar
  • 97
1 vote
2 answers
287 views

Angular new control flow @for with async pipe and aliasing variable with as

I migrated from the structural directives *ngIf and *ngFor to the new control flow with @if and @for in Angular. But there is one case that I used previously but I cannot seem to get it to work with ...
Wilt's user avatar
  • 43.4k
0 votes
0 answers
31 views

Avoiding cpu/gpu synchronization due to python control flow with a constant as alternative leads to incorrect gradients

I have the following if-and-else query, which is called multiple times in my training loop: if torch.logical_or(d0 < 1e-5, d1 < 1e-5): h0 = torch.tensor(1e-6, dtype=dtype, device=device) ...
Ripleys's user avatar
  • 31
0 votes
0 answers
106 views

Angular 17 template code completion not working in PhpStorm 2024.1.1

I migrated project to Angular 17.3.6. Also updated PhpStorm to 2024.1.1 and there is recent Angular plugin. I cannot get IDE to provide code completion in Angular templates. Also it doesn't recognize ...
Nebojsha's user avatar
  • 381
0 votes
4 answers
133 views

Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?

From my previous knowledge the (logical AND) has a higher precedence than the (logical OR), so for example in the following line of Java code boolExp2 will be compared with boolExp3 before comparing ...
Yazan AlAtout's user avatar
0 votes
0 answers
37 views

Get control flow information with JaCoCo

Looking for a way to retrieve control flow information, such as local variables and their values and which instructions/branches were executed for the tested methods using JaCoCo (0.8.11). I am ...
Arseni's user avatar
  • 11
2 votes
1 answer
47 views

Why does a continue in this ForEach-Object loop cause Powershell to error

When piping the output of a command to a ForEach-Object loop in PowerShell, using a continue statement causes it to error out. Works as expected: ipconfig | ForEach-Object { $_ } Errors: ipconfig |...
DeadChex's user avatar
  • 4,606
0 votes
1 answer
59 views

How to copy function instructions and store them in buffer? [closed]

Why isn't this code directly storing the assembly instructions of func into the buffer? The value of the buffer is junk and doesn't change. #include <stdio.h> #include <stdlib.h> #...
Mohammed's user avatar
0 votes
0 answers
282 views

Angular 17 - new control flow migration question

I performed migration with this command - ng g @angular/core:control-flow. Now I am getting an error - Type 'unknown' must have a 'Symbol.iterator' method that returns an iterator. This error is ...
Learner's user avatar
0 votes
1 answer
318 views

how do i make a floating window that stays above programs, moveable and will accept input from another script

I am trying to build an indesign script that will produce a floating window that can display report results. I need to use this as a check-off "sheet" that will stay visible and moveable. ...
Bryan Pinkey's user avatar
1 vote
1 answer
485 views

Angular: How to reference the result of a function in the new control flow @if with an logical AND (&&)

With the old control flow I could reference the result of a function in this way. <span *ngIf="column.getValue && column.getValue(item) as value">{{value}}</span> But ...
fieldhof's user avatar
  • 175

15 30 50 per page
1
2 3 4 5
57