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.

Is it possible to compare #ifdef values for conditional use

I'm trying to come up with a generic, easy to use way to only run certain code, depending upon the …

c++ conditional c-preprocessor preprocessor-directive
Nested conditional if else statements in xpath

I have this XML: <property id="1011"> <leasehold>No</leasehold> <freehold>Yes</…

xpath conditional if-statement xpath-2.0
Building a hash in a conditional way

I am using Ruby on Rails 3.0.10 and I would like to build an hash key\value pairs in a conditional …

ruby hash conditional
Activating OnBeforeUnload ONLY when field values have changed

What I'm trying to achieve is to Warn the user of unsaved changes if he/she tries to close a …

javascript dialog conditional triggers onbeforeunload
Shorthand conditional to define a variable based on the existence of another variable in PHP

Essentially, I'd love to be able to define a variable as one thing unless that thing doesn't exist. I swear …

php variables conditional shorthand
JSF Conditional includes, cause Component ID has already been found in the view

I know we can't repeat the ID of any component we have in the same view tree. I have a …

jsf jsf-2 conditional uiinclude rendered-attribute
R get rows based on multiple conditions - use dplyr and reshape2

df <- data.frame( exp=c(1,1,2,2), name=c("gene1", "gene2", "gene1", "gene2"), value=c(1,1,3,-1) ) In trying to get …

r conditional filtering dplyr reshape2
how to do a conditional decorator in python

Is it possible to decorator a function conditionally. For example, I want to decorate the function foo() with a timer …

python conditional decorator python-decorators
Conditional OR in makefile

I'd like to enable a verbose compilation in my makefile, but I can't figure out how to make a conditional …

makefile logic conditional verbose
If conditions false then prevent default

I have a link. When some one clicks on that I want to check some conditions before letting it work. …

javascript jquery conditional preventdefault