Questions tagged [null]

Null means *nothing* or *unknown*, depending on context. Please use the "sql-null" tag for SQL specific questions.

"Null" has different meanings depending on context.

Set theory

Null is another name for the empty set, denoted by the symbol ∅. For this reason, some programming languages use null or nil for the empty list or empty tuple. Lisp uses nil to mean the empty list and the boolean value false.

Pointers and References

Null (or sometimes nil or None), in programming languages that support it, is the value of an uninitialized variable, a pointer that doesn't point to a meaningful memory address, or an object that fails to respond to any message.

Nullable references were invented by C.A.R. Hoare in 1965 as part of the Algol W language. Hoare later described his invention as a "billion-dollar mistake".

For more information, see Null pointer.

Agreeing with Hoare's sentiment, many languages don't have a special null value, choosing to use optional types instead.

Relational Databases

NULL as a special marker in SQL or a relational database stands in place of a value that is missing, or in a join means "no corresponding row." The operators IS NULL and IS NOT NULL are required for comparisons to a literal null: other comparisons between NULL and any value evaluate to "unknown."

For more information, see Null (SQL).

ASCII

Null or NUL is the name given to the character with ASCII code zero (0) - i.e. hex 00. In some languages, notably C, NUL is used to mark the end of a character string.

For more information, see Null character.

16208 questions
8
votes
5 answers

How to handle null values in linq?

recordsList.ListOfRecords = new StudentRecordsBAL() .GetStudentsList() .Select(q => new StudentRecords() { _RollNumber = q._RollNumber, …
Gautam G
  • 494
  • 2
  • 6
  • 15
8
votes
3 answers

How do I identify an empty NSData Object that appears as empty brackets?

I am dealing with a corruption issue in Game Kit's GKTurnBasedMatch class (see this thread) which sometimes results in an invalid game state, with corrupted matchData. So as a workaround, I'm creating a way out a way to identify these invalid…
todd412
  • 1,308
  • 2
  • 17
  • 24
8
votes
3 answers

Null To Boolean IValueConverter not working

How do I use an IValueConverter to convert nulls into booleans? I'm using wpf to try to display a bunch of boolean values (in checkboxes). When a new record is created, these values are null, and appear as 'indeterminate' in the checkboxes. I want…
mcalex
  • 6,628
  • 5
  • 50
  • 80
8
votes
4 answers

Passing `null` reference for a `ref struct` parameter in interop method

I am using C# to call a DLL function. [DllImport("MyDLL.dll", SetLastError = true)] public static extern uint GetValue( pHandle handle, ref somestruct a, ref somestruct b); How can I pass a null reference for argument 3? …
user1964059
  • 105
  • 1
  • 5
8
votes
8 answers

Iterate through method's parameters for validation purposes

I've been thinking that it would be useful to be able to do such a thing, for example, to check the parameters for null references and eventually throw an exception. This would save some typing and also would make it impossible to forget to add a…
RobSullivan
  • 651
  • 2
  • 7
  • 15
8
votes
1 answer

Is PChar('') guaranteed to be a pointer to #0 (not nil)?

I understand that in Delphi, an empty string (AnsiString or WideString) can be represented by a nil pointer, or by a pointer to an actual empty string. By experiment I've shown that in Delphi XE2 (with particular compiler settings) PChar('') <> nil.…
Ian Goldby
  • 5,609
  • 1
  • 45
  • 81
8
votes
2 answers

cannot copy CSV into postgreSQL table : timestamp column won't accept the empty string

I want to import a CSV file into version 9.2 but the CSV file has double-quote double-quote in the final column position to represent a NULL value: "2","1001","9","2","0","0","130","","2012-10-22 09:33:07.073000000","" which is mapped to a column of…
Tim
  • 8,669
  • 31
  • 105
  • 183
8
votes
1 answer

How does JavaScript store null values internally?

I always wondered how JavaScript stores null values internally. null is different than any value. I imagine that the scope's variables are stored in some kind of array of structures, each structure corresponding to a variable. Does this structure…
Aalex Gabi
  • 1,525
  • 1
  • 18
  • 32
8
votes
4 answers

Force method call on null variable to throw a NullPointerException

Possible Duplicate: How come invoking a (static) method on a null reference doesn’t throw NullPointerException? Static fields on a null reference in Java I tried the code from this old video: class Impossible { public static void…
user1849186
8
votes
4 answers

call setbuf(stdout, NULL): no symbol "NULL" in the current context

What should I do if I want to use identifier NULL in gdb's call statement? Is it because I didn't include stdio.h in gdb? I have tried : call #include but this doesn't seem to work.
CDT
  • 10,165
  • 18
  • 66
  • 97
8
votes
3 answers

Understanding C# generics and Nullable value type. Return null or nullable

Suppose I have the following class: public class GenericClass { public T Find() { //return T if found otherwise null or Nullable } } Somewhere I'd like to specialize my class using T with a class, other times with a…
Heisenbug
  • 38,762
  • 28
  • 132
  • 190
8
votes
3 answers

Ruby undefined method `strftime' for nil:NilClass

I've only been working with Ruby for a short time and I've hit a wall today while working on a calendar to put requests on. I spent time searching through different undefinied method error documents on stackoverflow, the ruby guides, etc. as well as…
Alexander
  • 1,577
  • 5
  • 21
  • 35
8
votes
8 answers

what value does null really have?

(I know what null is and what its is used for) Question: OK, say we make a reference to an object in whatever language. The computer makes a little 32-bit (or other size, depending on computer's design) space in memory for that reference. That…
Gordon Gustafson
  • 40,133
  • 25
  • 115
  • 157
8
votes
1 answer

Blank value in web service for Int64 type

I consume a web service that has a numeric element. The Delphi wsdl importer sets it up as Int64. The web service allows this element to be blank. However, because it is defined as Int64, when I consume the web service in Delphi without setting a…
Sam M
  • 4,136
  • 4
  • 29
  • 42
8
votes
1 answer

@ManagedProperty in a Spring managed bean is null

I've some trouble with injecting one managedbean in another by defining a managedproperty. I'm googling and stackoverflowing now for 3 days, but with no result... I'm developing with eclipse 4.2 and deploying to an integrated Tomcat 7 So, can…
Alexander Bering
  • 603
  • 1
  • 6
  • 11