null

ColdFusion "system has attempted to use an undefined value" Null Pointers

So I have this error on a feed that magically stopped working for no reason. The error i get is "The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code. Null Pointers are another name for undefined values. " OK, i look up Null pointers and Ben Nadel (god...

Should we allow null/empty parameters?

I recently had a discussion with a co-worker on whether we should allow null or empty collections to be passed as method parameters. My feeling is that this should cause an exception, as it breaks the method's 'contract', even if it does not necessarily break the execution of the method. This also has the advantage of 'failing fast'. My ...

Binding Label and Value to ComboBox Winforms

I have this code Public Sub FillCategoryCombobox(ByVal categoryList As List(Of tblCategory), ByVal LvName As ComboBox) LvName.Items.Clear() Dim itemValue = New Dictionary(Of Integer, String)() For Each category As tblCategory In categoryList itemValue.Add(category.CategoryID, category.CategoryName) Next category ...

Interesting C++ code snippet, any explanations?

Possible Duplicate: Why am I able to make a function call using an invalid class pointer class B { public: int i; B():i(0){} void func1() { cout<<“func1::B\n”; } void func2() { cout<<“i = “<<i; } }; int main() { B *bp = new B; bp->func1(); delete bp; b...

NULL comparison, take 2

Hello all, I have a subquery, used in WHERE section: A.column <> B.column Unfortunately, it doesn't work, if either A.column or B.column is NULL. So, I converted it to: ((A.column <> B.column) OR ((A.column IS NULL) <> (B.column IS NULL))) , presuming that "Table.column IS NULL" is boolean value and I can compare 2 boolean values....

SQL Server 2008 - Shredding XML to tables need to keep UNKNOWN DATE value as NULL

Hello. I was wondering if someone could help I've successfully been able to import an XML document to a table with an XML data type in SQL Server2008, how ever when I try and shred from that table to a staging table any DATE values without an entered date are inserted to the staging table as 1900-01-01. Is there a cleaver way i'm mi...

Using null coalescing in foreach statement

Hey All Trying to figure out how to get the null coalescing operator to work in a foreach loop. I'm checking to see what a string ends with and based on that, route it to a certain method. Basically what I want to say is.... foreach (String s in strList) { if s.EndsWith("d") ?? Method1(s) ?? Method2(s) ?? "Unknown file type"; } ...

In Java, is null an existing object on the heap?

In Java, is null an existing object on the heap? I'm trying to understand the difference between an uninitialized local variable (what does not compile) and one initialized with null (what compiles). ...

Why does using a prepared statement fail with nulls and succed with GStrings?

The problem in a nutshell: This is what happens when trying to insert a row with a few null columns using a prepared statement and groovy.sql.Sql: groovy:000> val ===> [123123123, 2, null, 0, 0, , null, , 1213020112511801, 1283425009158952, 1, 2, null, 0, 0, , null, , 1213020112511801, 1283425009158952] groovy:000> destSql.execute "ins...

Check if value isset and null

Hi, I need to check if value is defined as anything, including null. isset treats null values as undefined and returns false. Take the following as an example: $foo = null; if(isset($foo)) // returns false if(isset($bar)) // returns false if(isset($foo) || is_null($foo)) // returns true if(isset($bar) || is_null($bar)) // returns true...

PHP Strange NULL variable situation

Hi Everyone, I'm having a tough time with this one, I have a class which populates an array. Sometimes the array will not be populated and I want make an edge-case for when this happens however I can't seem to tell when its null! Here's the code: $results_dev = $class->get_data_nologin("4a9d-4f41-9566-7705",$key,"Sensors"); echo ...

Powershell 2.0 generates nulls between characters

With powershell 2.0: write-output "abcd" >> mytext.txt writes: a nul b nul c nul d nul od -c shows the nul as a true binary zero, \0 , or: a \0 b \0 c \0 d \0 (and \r \0 \n \0) I am trying to generate some SQL, so I don't think this will do. Any ideas of what's going on and how to use write-output to just get the specifie...

counting null data in MySQL

let say i have one table, which have data like: name status bob single bob single jane null tina null shane married i want if status "single or data null" it means single. so if data empty script can read it as single and can count together. so i can show result like: Single Married 3 ...

return nothing , using array == null or array.length == 0 ?

Supposing I have a function with following signature: Foo[] getSomeFoos() { //return null --- option A or //return new Foo[0]; --- option B } What is the recommended practice to return the value indicating there is no elements returned? Any pros or cons for each option? ...

Best way to handle a NULL

At the top of my functions I'm trying the best way to handle a null coming into my procedures in C#. Which is the best way for checking and handling the null and why? I've added the complete code of what I'm using right now and Resharper is telling me to use Option #1. Normally I do what it says as I understand why it makes it more effic...

Dealing with nulls for foreign keys, displaying in grid

I have to display some data (I am using teleriks grid with ajax binding) but there are problems with the data I have. For example, a lot of records have null values for the foreign keys, like as an example Let's say we have a table with a lot of foreign key references, like CategoryID, LocationID, FoodTypeID, etc etc (I am just making ...

NULL check before deleting an object?

This came up as one of the code review comments. Is it a good idea to check for NULL before calling delete for any object? I do understand delete operator checks for NULL internally and is redundant but the argument put forth was delete as an operator can be overloaded and if the overloaded version doesnt check for the NULL it may cra...

UITextField inside an UITableViewCell

I currently have two UITextFields inside two corresponding UITableViewCells. This is how it looks: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if...

SQL Server does not use an index comparing datetime to not null

Hello, I have a simple table not related to any other. It has a not PK column that it is a date. I have created a non-clustered index to that column. If I make this query: select * from table where datecolumn is not null <-- does not use the index and goes really slow. But if I remove the not, this way: select * from table where datec...

JavaScript false/null var inside if clause

Hello! What kind of variables will NOT pass through this: if(myVar){//code} Boolean false? NULL? Boolean false and NULL? Anything else? Thank you. ...