Top "Conditional-statements" questions

In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language which perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.

Yii Criteria: condition for relation

i have two tables: User and User_works (User HAS_MANY User_works). How can I add a condition to …

yii compare conditional-statements criteria relation
How to know if all the cells have the same value in some column

How to know if all the cells have the same value in some column (title changed) I want to have …

sql sql-server tsql conditional-statements equivalent
Rxjs conditional switchMap based on a condition

I have a situation like the following: myObservable1.pipe( switchMap((result1: MyObservable1) => { if (condition) { return myObservable2; } else { return of(…

rxjs conditional-statements switchmap
Assignment Condition in Python While Loop

In C, one can do while( (i=a) != b ) { } but in Python, it appears, one cannot. while (i = sys.stdin.…

python loops while-loop conditional-statements
R - fastest way to select the rows of a matrix that satisfy multiple conditions

This is an extension to the question on returning the rows of a matrix that meet a condition in R. …

r performance matrix conditional-statements multiple-columns
PostgreSQL create a new column with values conditioned on other columns

I use PostgreSQL 9.1.2 and I have a basic table as below, where I have the Survival status of an entry …

postgresql insert-update conditional-statements
How to filter by conditions for associated models?

I have a belongsToMany association on Users and Contacts. I would like to find the Contacts of the given User. …

cakephp associations conditional-statements cakephp-3.0 query-builder
Declaring an implicitly typed variable inside conditional scope and using it outside

In the simplified code below, if(city == "New York City") { var MyObject = from x in MyEFTable where x.CostOfLiving == "VERY …

c# foreach var conditional-statements implicit-typing
Conditional with statement in Python

Is there a way to begin a block of code with a with statement, but conditionally? Something like: if needs_…

python conditional indentation conditional-statements with-statement
Ansible Do Task If Apt Package Is Missing

I'm looking to do a series of tasks if a specific apt package is missing. for example: if graphite-carbon is …

conditional-statements ansible apt ansible-playbook