Questions about items that can be described as empty or having no data value
Questions tagged [is-empty]
776 questions
19
votes
15 answers
Using if(!empty) with multiple variables not in an array
I am trying to polish some code with the if(!empty) function in PHP but I don't know how to apply this to multiple variables when they are not an array (as I had to do previously) so if I have:
$vFoo = $item[1];
$vSomeValue = $item[2];…

HGB
- 2,157
- 8
- 43
- 74
18
votes
2 answers
Replace empty cells with logical 0's before cell2mat in MATLAB
I have an array of empty cells and ones that I want to convert to a logical array, where the empty cells are zeros. When I use cell2mat, the empty cells are ignored, and I end up with a matrix of solely 1's, with no reference to the previous index…

Doresoom
- 7,398
- 14
- 47
- 61
17
votes
1 answer
how to create python empty dataframe where df.empty results in True
How can I create an empty dataframe in python such that the test df.empty results True?
I tried this:
df = pd.DataFrame(np.empty((1, 1)))
and df.empty results in False.

Goofball
- 735
- 2
- 9
- 27
15
votes
4 answers
How do I check if a $_GET parameter exists but has no value?
I want to check if the app parameter exists in the URL, but has no value.
Example:
my_url.php?app
I tried isset() and empty(), but don’t work. I’ve seen it done before and I forgot how.

Ben
- 5,627
- 9
- 35
- 49
14
votes
2 answers
PHP: What is the best and easiest way to check if directory is empty or not
I got a root directory with 100s of dynamically generated folders. As time goes some of these folders will need to be extirpated from system on the condition that this(ese) directories(s) must be empty. What would be the best shortest, easiest…

ErickBest
- 4,586
- 5
- 31
- 43
14
votes
1 answer
GNU make wildcard function doesn't find runtime generated files
Summary:
I'm using GNU Make (3.81) on a unix-like system and I've run into an issue where the $(wildcard, pattern) function is unable to find a file generated by a (presumably/apparently?) previously executed recipe, whereas other programs (e.g. ls)…

Francis
- 143
- 1
- 5
12
votes
5 answers
Need to Show a message when DataList is Empty
I'm using DataList to show records on Client Site of my web page. I need to show a message when my DataList is empty. Is there a property of Datalist? How to show that message?

leonyx
- 849
- 7
- 15
- 23
12
votes
2 answers
execute Ant task if TWO conditions are met
The above ant script implements if dir_is_empty then git-clone else git-fetch using Ant-1.7.1 core statements:

oHo
- 51,447
- 27
- 165
- 200
10
votes
1 answer
flutter: NoSuchMethodError: The getter 'isEmpty' was called on null
I am calling web API and receiving the Profile model as a response. When I am using the below code then it is throwing me an error:
try{
if(profile.message.isEmpty){
Navigator.of(context).pushNamed("/home");
}else if(profile == null){
…

Code Hunter
- 10,075
- 23
- 72
- 102
10
votes
3 answers
How to check if a date cell in Excel is empty?
If feels like this should be really easy but I dont get it to work without retrieving the value of the cell again.
To start with, I have 2 date cells:
Dim agreedDate As Date
Dim completedDate As Date
THIS WORKS .. (but looks messy)
agreedDate =…

Malin
- 655
- 4
- 10
- 20
10
votes
1 answer
Fast test if directory is empty
What is the fastest way to test if a directory is empty?
Of course I can check the length of
list.files(path, all.files = TRUE, include.dirs = TRUE, no.. = TRUE)
but this requires enumerating the entire contents of the directory which I'd rather…

krlmlr
- 25,056
- 14
- 120
- 217
9
votes
2 answers
JUnit4 TextUtils.isEmpty() gives different result than String.isEmpty()
I know it's weird, but this is what I have.
I'm writing a unit test to check my logic for an Android application. During the test execution, I see that it fails on that line:
if (!TextUtils.isEmpty(fromFile))
Before that if statement fromFile is…

Roger Alien
- 3,040
- 1
- 36
- 46
9
votes
1 answer
Check if SQL Server 2005 XML field is empty
I just did this:
Delete FROM MyTable WHERE ScopeValue = ""
Delete FROM G_Scope WHERE ScopeValue is ''
Delete FROM G_Scope WHERE ScopeValue = empty
Delete FROM G_Scope WHERE ScopeValue is empty
I want to delete all rows with xml field (not…

msfanboy
- 5,273
- 13
- 69
- 120
9
votes
3 answers
Understanding the difference between Collection.isEmpty() and Collection.size() == 0?
I have read so many article as on difference between isEmpty() and size() > 0 for check that collection is empty or not and found that isEmpty() have perfomance over size() but I could not understand easily why perfomance of isEmpty() is good even…

Kamlesh Kanazariya
- 1,209
- 2
- 15
- 32
8
votes
4 answers
How to set and use empty range in VBA?
I would like to use empty range in following manner :
Set NewRange = Union(EmptyRange, SomeRange)
I've tried to set EmptyRange as empty range using Nothing, Empty and Null but "run-time error '5' Invalid procedure call or argument" occurs, it…

Qbik
- 5,885
- 14
- 62
- 93