Questions tagged [is-empty]

Questions about items that can be described as empty or having no data value

776 questions
3
votes
4 answers

How to treat zero values as true using php?

Here is my sample code: $issue_id = $_POST['issue_id']; if(!empty($issue_id)){ echo 'true'; } else{ echo 'false'; } If I pass 0 to $_POST['issue_id'] by form submitting then it echo false. Which I want is: Condition will be true if the…
Abdus Sattar Bhuiyan
  • 3,016
  • 4
  • 38
  • 72
3
votes
4 answers

After filtering, check if array is not empty after filtering or has all original values; like Javascript's some() and every()

JavaScript has the concept of array checker functions some and every, basically checking if a condition applies to either at least one or all elements of an array. function isBiggerThan10(element, index, array) { return element > 10; } [2, 5, 8,…
k0pernikus
  • 60,309
  • 67
  • 216
  • 347
3
votes
1 answer

Implementation of isEmpty()

I'm trying to figure some basic things out. I was exploring standard library ArrayList.java when found that ArrayList has implementation of method isEmpty(). ArrayList.java: public boolean isEmpty() { return size == 0; } ArrayList extends…
Nederes
  • 125
  • 1
  • 10
3
votes
2 answers

Why am I getting an empty list as my output using solve command?

I am trying to solve an equation using sympy's solve command but my output is an empty list [ ]. The only reason I think this could be happening is because there is no solution but I doubt that is the reason. Anyone know why I am not getting an…
Zach Thomas
  • 147
  • 12
3
votes
1 answer

CodeIgniter 3 - Session item getter with PHP empty function

I've just noticed something weird using CodeIgniter 3 session system and I'm wondering if it's an issue or just something normal with PHP. To explain, I have this variable initialized : $this->session->connected_client_id = 9; When I'm doing this…
Marc
  • 1,350
  • 2
  • 11
  • 29
3
votes
3 answers

In Ruby, recursively remove blank items from json string

I've got a JSON string that I need to remove all the blank values from. Something…
Mike Potter
  • 35
  • 1
  • 6
3
votes
2 answers

AngularJS - controller doesn't get data from service when using $http

I have simple web app where I like to load some data from json. At the moment the data is hardcoded within my service and everything is working. When I change my service to load the same data from an external json file the controller renders the…
phil-k
  • 67
  • 1
  • 8
3
votes
6 answers

How do I hide several lines if php variable is empty?

As a learner in PHP, I'm struggling to hide from displaying several lines, if a chosen variable is empty. I can get this to work on a basic level, but am lost when the content to be hidden gets more complicated. The concept I am aiming at is…
MGB
  • 35
  • 1
  • 4
3
votes
4 answers

Check a PHP array for empty values and fill that particular key's value with default value if empty

I have to read a PHP array for empty values. If there are any empty values for any key, I just wanted them to be filled with some default value if empty. 1. Is there any in built function to check if empty in an array and fill it up? (OR) 2. What…
Neocortex
  • 653
  • 9
  • 32
3
votes
1 answer

Check if a table is empty (MSAccess Database + Delphi)

I need to findout whether a created table has entries in it or not. What I need is, if (TableIsEmpty) then do_something else do_something_else; What I've written for the purpose is : Function IsTableEmpty:Boolean; Var DataSource :…
Priyabrata
  • 1,202
  • 3
  • 19
  • 57
3
votes
1 answer

Empty Query - More Like This (Lucene)

I'm new at Java and Lucene. I'm trying a simple MLT test, but I'm not getting any results. import java.io.File; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; import…
Nyan Maru
  • 87
  • 8
3
votes
4 answers

How do i compare against an empty variable?

If I set a variable to 0, I get the weird behavior that a comparison to "" (empty) is true. How do I check that the variable is really empty? tmp = 0; if ( tmp != "") { //do something - This is where the code goes. } else { //isEmpty - I…
Enigma
  • 125
  • 4
3
votes
1 answer

How does jQuery "empty:"-selector works? (remove empty tags)

I'm trying to remove all the empty tags from DOM-tree. Empty means both completely empty (like ) and with several whitespaces (like ...). Also inner empty tags should also be removed. E.g.

f1nn
  • 6,989
  • 24
  • 69
  • 92
3
votes
2 answers

Searchbar works correctly but doesn't show any results

I've added a search bar to my project and it works quite well. You can search for object (of a table view) and the relations also work. But the search display doesn't show the result names. For example: I have no object which begins with "x" >>> So…
user2242550
3
votes
1 answer

Perl mechanize response is only "" with https

I'm kind of new with perl, even newer to Mechanize. So far, when I tried to fetch a site via http, it's no problem. Now I need to fetch a site with https. I've installed Crypt::SSLeay via PPM. When I use $mech->get($url), though, this is the only…
TCruise
  • 31
  • 1