Questions about items that can be described as empty or having no data value
Questions tagged [is-empty]
776 questions
8
votes
1 answer
!empty(trim($_POST['username']
Ok the problem is that when i use the trim function doesnt work but when i run the code without the trim function its working, but not properly working(the form accepts whitespaces)

user2300068
- 97
- 1
- 1
- 5
7
votes
2 answers
How to check whether a DataFrame is empty?
I want to check whether a DataFrame is empty :
BTC_ewma_24 ETH_ewma_24 DASH_ewma_24
24 4011.235578 334.597119 281.15
25 4011.285662 334.591056 281.15
26 4011.373673 334.603479 281.15
27 4011.453068 334.614686 …

Antoine Coppin
- 285
- 2
- 3
- 12
6
votes
2 answers
VBA: IsEmpty, vbEmpty, "Empty" and Empty
In VBA, if I understand correctly, emptiness means that a variant has not been initialized, i.e., it is the default value of a variant before an assignment.
There appear to be four ways to test if a variant is empty:
IsEmpty(var) = True
VarType(var)…

NewSites
- 1,402
- 2
- 11
- 26
6
votes
2 answers
Why does empty logical vector pass the stopifnot() check?
Today I found that some of my stopifnot() tests are failing because the passed arguments evaluate to empty logical vectors.
Here is an example:
stopifnot(iris$nosuchcolumn == 2) # passes without error
This is very unintuitive and seems to…

Karolis Koncevičius
- 9,417
- 9
- 56
- 89
6
votes
2 answers
Create an empty 2d array
I don't like uninitialized VBA arrays, since it's necessary to check if array is initialized, each time prior using UBound() or For Each to avoid an exception, and there is no native VBA function to check it. That is why I initialize arrays, at…

omegastripes
- 12,351
- 4
- 45
- 96
6
votes
1 answer
How to detect whether HTML content, when rendered, is blank/whitespace?
Consider code like the following:
which on a browser would effectively render as a stretch of whitespace.
I'm wondering if, given that or similar markup, there…

Jordan Reiter
- 20,467
- 11
- 95
- 161
6
votes
1 answer
using seq_along() to handle the empty case
I read that using seq_along() allows to handle the empty case much better, but this concept is not so clear in my mind.
For example, I have this data frame:
df
a b c d
1 1.2767671 0.133558438 1.5582137 …

Francesco Cabiddu
- 131
- 8
6
votes
1 answer
Laravel Check Empty Array
I still have trouble with checking if an array is empty or not in laravel.
This is my view:
@foreach($restaurantmenue as $daily)
@if(empty($daily->articles))
no article
@else
…

Mamulasa
- 543
- 4
- 14
- 24
6
votes
1 answer
Typescript equivalent of $.isEmptyObject({}) for empty object
May I know what is the formal way of testing an Object (response from server), if it is an empty object?
Currently, my way of doing is utilising jQuery.
this.http.post(url, data, {headers: headers}).then(
result =>
{
if…

Gavin Yap
- 642
- 12
- 26
6
votes
2 answers
ASP Session variables: Is "" same as IsEmpty?
In ASP an uninitialized Session variable Is Empty. I know that the correct way to check for a Session value, and remove a value, is the following:
IF NOT IsEmpty(Session("myVar")) THEN
' Go ahead and use Session("myVar")
...
' Now if we're…

feetwet
- 3,248
- 7
- 46
- 84
6
votes
4 answers
Make a UIButton inactive if no text is entered in a TextField in Swift
So my concept is simple, I have a textfield and a button labelled 'Next'. I would like the Next button to be disabled to users if they have not put anything in the textfield. To do this, I have run this code:
@IBAction func nextButton(sender:…

Nick89
- 2,948
- 10
- 31
- 50
6
votes
4 answers
Possible to implement object handling of empty()
I know we can implement PHP's countable interface to determine how the function count() works as well as the Iterator interface for using an object like an array.
Is it possible to implement some kind of interface (or any other way) to change the…

teynon
- 7,540
- 10
- 63
- 106
5
votes
2 answers
How can I demonstrate that a function space is not empty?
I declared a class of types that admits a value:
class NonEmpty a where
example :: a
And also, I declared the complement class:
import Data.Void
class Empty a where
exampleless :: a -> Void
Demonstrating a function space is empty is…

Dannyu NDos
- 2,458
- 13
- 32
5
votes
2 answers
MongoDB aggregate match non-empty array
I have a collection in a MongoDB that contains a field "events" which is an array. I need to write an aggregate query for this that checks for the events array to not be empty, but can't find a way to do this.
I want something…

StefK
- 604
- 6
- 18
5
votes
2 answers
Visual Studio Code: Find empty files
Is there a way to find all empty files (with vscode) in a project?
I try to open all my .scss files, and already installed 'search - open all results', however even with regEx I wasn't able to find them all because some of them are empty.
Also I…

matt
- 105
- 10