Questions tagged [null-test]

5 questions
23
votes
3 answers

In MySQL, which is more efficient: IFNULL or NULLIF?

These two MySQL functions do the same thing: IFNULL(column_name, 'test') = 'test' or NULLIF(column_name, 'test') IS NULL Which one is more efficient?
user2259597
  • 249
  • 1
  • 2
  • 6
3
votes
5 answers

Is if(obj && obj != nil) correct and necessary?

Two parts to this question 1) Is this understanding of what's going on correct? "if (obj)" is testing to see if the pointer is not 0x0, aka set to an integer memory address "if (obj != nil)" is comparing the memory address of the object to the…
DougW
  • 28,776
  • 18
  • 79
  • 107
1
vote
0 answers

How to do a one-sample location, two-way approximate Z test in R using estimates from the delta method?

I used the delta method to estimate the difference between two coefficients from a glm fit (attached code below). Now, I want to compare this estimate to zero (i.e., a null hypothesis of no difference). One article mentions using a one-sample…
Rspacer
  • 2,369
  • 1
  • 14
  • 40
0
votes
1 answer

How to properly write a null test on input that is nullable to avoid warnings in Java?

How to write a proper test on a method that can return a null to assign the value to a nonnull variable? @Nonnull String abc; if(holderForState.getNodeElementSelectedAPI() == null || holderForState.getNodeElementSelectedAPI().equals("")) { throw…
KKorzuno
  • 3
  • 2
-1
votes
2 answers

Empty PHP variables

Is there a better way besides isset() or empty() to test for an empty variable?
Josh K
  • 28,364
  • 20
  • 86
  • 132