Top "Conditional" 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.

Javascript switch vs. if...else if...else

Guys I have a couple of questions: Is there a performance difference in JavaScript between a switch statement and an …

javascript cross-browser conditional
How do I use regular expressions in bash scripts?

I want to check if a variable has a valid year using a regular expression. Reading the bash manual I …

regex bash conditional
How to check if matching text is found in a string in Lua?

I need to make a conditional that is true if a particular matching text is found at least once in …

string lua conditional string-matching
The condition has length > 1 and only the first element will be used

I have a dataframe, trip: > head(trip.mutations) Ref.y Variant.y 1 T C 2 G C 3 A C 4 T …

r if-statement conditional calculated-columns
How to compare strings in C conditional preprocessor-directives

I have to do something like this in C. It works only if I use a char, but I need …

c conditional c-preprocessor
Python conditional assignment operator

Does a Python equivalent to the Ruby ||= operator ("set the variable if the variable is not set") exist? Example in …

python variables conditional
In Twig, check if a specific key of an array exists

In PHP we can check if a key exists in an array by using the function array_key_exists(). In …

php arrays twig conditional short-circuiting
How does "do something OR DIE()" work in PHP?

I'm writing a php app to access a MySQL database, and on a tutorial, it says something of the form …

php mysql exception-handling conditional
Multiple conditions in ternary conditional operator?

I am taking my first semester of Java programming, and we've just covered the conditional operator (? :) conditions. I have two …

java conditional operator-keyword
MySQL Conditional Insert

I am having a difficult time forming a conditional INSERT I have x_table with columns (instance, user, item) where …

mysql insert conditional