19,435 questions
-1
votes
1
answer
56
views
Set Terraform Child Module Variable Values Conditionally
I have a Terraform child module for an Azure Function App. This Function App also implements an Azure Monitor Alert (referenced from another child module) and provisions a set of dedicated Action ...
Best practices
0
votes
4
replies
104
views
How to properly implement target requirements in game?
I'm a self-taught beginner learning through trial and error. I'm working on a card game in Unity (C#), and I'm trying to design a clean and extensible system for validating targets during gameplay.
...
0
votes
7
answers
302
views
Conditional Join in SQL query
I need a single SQL query that would satisfy the below criteria.
I have 2 tables, say Table1 with these values:
ID
Code
Description
1
1000
abc
2
1000
pqr
3
1000
efg
4
2300
rst
5
2300
uvw
6
2930
xyz
7
...
3
votes
2
answers
153
views
Why does code under a label execute even if I don't branch to it, for an if/else selecting two constants?
I'm learning Assembly through the "Easy 6502 by skilldrick" website.
I have one question. I'm in the part about branching. I wrote the following code:
LDA #$FA
ADC #$01
BCS ...
7
votes
6
answers
2k
views
C program: Use an array outside the scope it was defined in
I have some code in which an array of strings is defined in a conditional statement. The array is out of scope where I need it. So I defined another pointer in the outer scope. In the conditional ...
1
vote
2
answers
91
views
Referencing multiple columns in e.range.getColumn()
I have an onEdit script that check for updates to certain cells and then does stuff based on the contents of the cell:
function onEdit(e) {
var sheet = e.source.getActiveSheet();
if (sheet....
0
votes
2
answers
146
views
How do I assign a value according to conditional statement that use dates from multiple columns [closed]
I am using a large dataset which contains patients with 5 different cancer types. Each patient can have one or more cancer diagnosis, identified in the n.cancers column. There are also columns for ...
4
votes
2
answers
84
views
Is there a way to use itertools with conditions for sets and arbitrary length?
I'm trying to create a list of subsets that add to a particular sum (e.g. 12), but with a limit on the occurrences of some of the terms.
The base set to iterate on is {1,2,3,4,5,6,7,8}. I'm trying to ...
0
votes
0
answers
54
views
How to set pipeline variables based on another pipeline variable whose value is assigned using Library variable?
I am having difficulty in achieving a requirement. I need to determine the Agent pool based on Build.Reason. If the reason is PullRequest, I need to assign the value of agent pool using value of a ...
3
votes
0
answers
157
views
Conditional / branching logic in C: Check for error first vs if/else? [closed]
Recently I've been finding myself wondering more and more what's the more "correct" way to write conditional logic in C, in particular, handling of errors vs success paths.
Should you ...
0
votes
3
answers
84
views
How to preserve component state while dynamically rendering and unmounting components in React?
I'm building a React.js application where I need to conditionally render components based on user interactions (like tabs or dynamic forms). The issue is that when a component is unmounted and later ...
2
votes
2
answers
84
views
Apply a conditional rank to a temporary table
Here's an idea of what the temporary table contains:
ID
FullRank
Special
1
1
No
1
2
Yes
1
3
No
2
1
Yes
2
2
No
3
1
No
3
2
Yes
3
3
Yes
3
4
No
3
5
No
And this is what I'm trying to achieve...
ID
FullRank
...
-2
votes
2
answers
139
views
Applying changes to a dataframe based on a condition [closed]
I have the following sample data frame:
ID <- rep(1:4, each=9)
Parameter <- rep(c("Tlag", "A1", "A2", "A3", "A4", "alpha1", "...
0
votes
1
answer
53
views
How can I change nlog logging level based on event properties
I have created a custom event property in my logging, to categorise different logs from different areas. I want to be able to set a default logging level of Info, but then increase the logging level ...
0
votes
0
answers
49
views
EXCEL - Comparing multiple dates against a single date value for highlighting
I'm trying to use conditional formatting to compare the date output from multiple cells and columns against one date value.
The condition works but in an undesired state. The condition evaluates ...
1
vote
1
answer
83
views
Filter data with dates based on condition
I need to filter my data based on two sets of conditions and dates: For the stations not including "150" in the station's name, I need to filter with start_date_AN and end_date_AN and for ...
0
votes
1
answer
66
views
Code Add on to Current to Avoid Using Conditional Formatting
I have the following code, which SET 1 Columns H:K respond to Columns F:G. SET 2 Columns N:Q respond to Columns L:M. Set 3 Columns T:W respond to Columns R:S. Now following that same logic I want the ...
2
votes
3
answers
93
views
Toggle Boolean on 'flick'
Have a next task
Create a function that always returns True/true for every item in a given list.
However, if an element is the word 'flick', switch to always returning the opposite boolean value.
...
0
votes
0
answers
25
views
Which is efficient for displaying a component in angular conditionally based on a checkbox value? *ngIf directive or [hidden] property? [duplicate]
I have a checkbox and I need to show a datebox only if the checkbox is checked. What is the best and most efficient way to achieve this.
<div class="box" [hidden]="!checked">
...
2
votes
2
answers
308
views
Versions conditioned on framework in Directory.Packages.props
I need to use different nuget version for .NET and .NET Framework. I can do it in csproj using e.g. Condition="'$(TargetFramework)'=='net48'". How can I do this in Directory.Packages.props?
...
0
votes
2
answers
111
views
Conditional formatting custom formula that can compare a string referenced on another sheet
I am trying to indirectly reference another sheet within my Google sheets document in order to compare a string and color the cell accordingly if the text matches. Let's say that Sheet 1 is a list of ...
-2
votes
3
answers
125
views
Why do I need to specify element => element when iterating over an !array.Exists conditional statement?
Just starting to learn and grasp C# and apologies if this has been asked somewhere but I've been looking for a couple hours and can't quite understand why I need to specify the syntax in the latter ...
1
vote
1
answer
36
views
Ansible: save item from nested list based on match from a separate list
I'm new to ansible so i'll try to explain this as best as I can...
I have two lists created from separate json_query results. One of them contains nested lists with two related items each (vm and ...
0
votes
2
answers
104
views
Comparing an array element to a value throws an error
I'm not sure what I am doing wrong, but when I execute the code below:
func twoSum(_ nums: [Int], _ target: Int) -> [Int] {
let length = nums.count-1;
for index1 in 0...length {
...
1
vote
3
answers
111
views
Function to evaluate vector based on time and stops once it reaches a threshold
I have a data frame with three variables ID, year and value. I would like to know how many times the "value" has been larger than a threshold going backwards, from the most recent year to ...
0
votes
1
answer
167
views
How to show a plot only in HTML output in quarto
I wanted to have a dynamic .qmd report which included some mapview plots, but the code would not compile if NOT in HTML format, because it would complain about code generating HTML code for non HTML ...
1
vote
1
answer
55
views
Can you create multiple columns based on the same set of conditions in Polars?
Is it possible to do something like this in Polars? Like do you need a separate when.then.otherwise for each of the 4 new varialbles, or can you use struct to create multiple new variables from one ...
0
votes
0
answers
178
views
Tailwind default styling not being applied when using a custom 'cn' util function with tailwind-merge and clsx
I am using Tailwind V4 and created a custom utility function:
import type { ClassValue } from 'clsx';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
export const cn = (......
0
votes
1
answer
109
views
How can I define an infinite loop condition in the for loop in java?
I was making a program in which user can keep entering numbers till user enters a multiple of 10. So I wanted to created a for loop for that and didn't knew what should be the infinite loop condition ...
0
votes
1
answer
54
views
How to override styling when both conditions are true with Tailwind css
In my Astro component I am using class:list for my tailwind styling.
I have the following situation where both conditions are true, I want isRedColor to be leading. How can I fix that?
<span
...
-1
votes
5
answers
227
views
If statement vs. function pointer (performance) [closed]
Consider the following:
while(running) {
if(logMode == true)
log();
bar();
}
VS
if (logMode == true)
func_ptr = log;
else
func_ptr = noop; //noop is empty function that ...
1
vote
2
answers
135
views
Dynamically updating and doing math on arrays in Excel
I am dynamically populating an array in Excel from another array in a different sheet based on a criteria and was successful in that but now I wish to auto update the returned total based on another ...
0
votes
0
answers
59
views
SAS if-then Statement to Python Vectorized Approach - My Values are Not Matching Up
I am trying to replicate some values in a dataset. The original data that I am running my code against for verification purposes has two categories across multiple groups, like so:
grp5
0 ...
1
vote
1
answer
35
views
spss conditional based on macro text
I'm trying to build a simple variable in spss like below but can't figure it out from documentation. In sas, you simply need to put qoutes around your macro to resolve. Can't figure out how in SPSS.
...
1
vote
1
answer
69
views
Swift custom struct: string interpolation not picking up custom description
In the following Swift code:
import Foundation
struct MySet<T: Hashable>: CustomStringConvertible {
let set: Set<T>
}
extension MySet {
var description: String {
return &...
0
votes
1
answer
102
views
RangeError (length): Invalid value: Not in inclusive range 0..5: 6
I am working in quiz app i want when user select answers of all question it should render result screen, it render all question and one can select answers well but after last question instead of ...
-2
votes
2
answers
160
views
What is better: x == False or not x? [duplicate]
There are two different ways to check for a negative condition in python:
if not x:
and
if x == False:
Which is best by standarts of clear code/faster? I saw people using both, but which of this ...
0
votes
1
answer
86
views
How to avoid evaluating one statement excluded by predicate during the conditional like `if` in Scheme?
Here is the minimal example:
1 ]=> (if #f (quasiquote ((unquote if))) (quasiquote (if)))
;Classifier may not be used as an expression: #[classifier-item 12]
2 error> (quasiquote (if))
;Value: (...
0
votes
1
answer
62
views
R how to recreate new columns based on an if statement [duplicate]
I have a long column that contains the results of selected items separated by commas within the same cell. I want to create new columns based on conditions.
example
favorite_fruits <- c("...
0
votes
1
answer
53
views
Wordpress show post link as plain text if post not published
How can I cause a link in WordPress (currently 6.7.2) to display as plain text if the target post is not published?
I know how to create hyperlinks and how to create a permalink to a not-published ...
0
votes
1
answer
34
views
How to start over when a certain condition is met?
I'm writing a program which I want it to start over, that is, reset to initial value and continue when a certain condition is met. But when the condition is met, the program does not reset to the ...
1
vote
1
answer
79
views
regex for separating by delimiter with multiple lookahead conditions and a single lookbehind condition
I am attempting to use a regex to separate observations by a space as delimiter when that space is preceded by strings (LLC, SYSTEM INC, LIMITED PARTNERSHIP, SYSTEM, or SYSTEM PARTNERSHIP) and ...
0
votes
2
answers
512
views
Fill with value from cell if two other cells' values match
I have an Excel worksheet sorted like this:
name_in_system id external_name external_id
A A 231
B ...
0
votes
1
answer
90
views
Excel conditional sum with criteria in curly brackets
I have a curious issue with excel sum(array = criteria). I'm trying to write a conditional sum for an array with multiple criteria, and to avoid a very long formula, I would want to enter the criteria ...
-1
votes
1
answer
126
views
Why is my column split not working correctly?
Why is my python3 code to split column 4 at the bases of "," to the column 7, 8, 9 with condition if the column 5 value is "LUB" not working?
source data:
20240801 CASH MAN1 ...
1
vote
1
answer
212
views
Use nested while loops with a Advanced Custom Fields repeaster field?
With WordPress, I'm using Advanced Custom Fields with a repeater field https://www.advancedcustomfields.com/resources/repeater/ and I'm trying to work out how to add some conditions to the repeater ...
2
votes
0
answers
222
views
Outlook 2025 not honoring email conditional HTML
The long trusted conditional HTML statements for Outlook do not seem to be honored by the latest version of Outlook (2025). They still work in older versions.
Example code:
<!--[if gte mso 9]> ...
0
votes
1
answer
62
views
Terraform How to execute a block conditionally
I'm learning Terraform and trying to use it for provisioning a virtual machine in Proxmox and came across a issue where I want to add a second disk only on the first index of the count.
I've try ...
0
votes
0
answers
61
views
Calculated Column with three conditions
I"m building a dashboard that will identify missing values for three data points: Billing, Reason, Origin. They are all text and do not contain numbers.
How do I construct a calculated column I ...
0
votes
1
answer
74
views
How can I change the font color of an cell in Excel based on its formatting using VBA?
I have this VBA code running on my excel sheets that takes each cell and hyperlinks it to another cell in the workbook if a text match is found. It works great, but it overwrites the cell color ...