null

Is null an object in JavaScript?

Possible Duplicate: Null object in javascript Hi, I've read this thread about null in JavaScript, but I'm very confused about the identity of null now. As it is known that typeof(null) evaluates to object because of the language design error, and ECMA states that null is The Null Type. 8.2 The Null Type The Null type ...

MVC ASP.net session is null

I have the following code which was ok until someone else put some other code in the site which sorta mucks it up now. This is my code: var existingContext = HttpContext.Current; var writer = new StringWriter(); var response = new HttpResponse(writer); var context = new HttpContext(existingContext.Request, response) { User = existingCo...

Setting rank to NULL using RANK() OVER in SQL.

In a SQL Server DB, I have a table of values that I am interested in ranking. When I perform a RANK() OVER (ORDER BY VALUE DESC) as RANK, I get the following results (in a hypothetical table): RANK | USER_ID | VALUE ------------------------ 1 | 33 | 30000 2 | 10 | 20000 3 | 45 | 10000 4 | 12 | 500...

Hibernate order by with nulls last

Hibernate used with PostgreSQL DB while ordering desc by a column puts null values higher than not null ones. SQL99 standard offers keyword "NULLS LAST" to declare that null values should be put lower than not nulls. Can "NULLS LAST" behaviour be achieved using Hibernate's Criteria API? ...

In C#, is there a clean way of checking for multiple levels of null references

For example, if I want to call the following: person.Head.Nose.Sniff() then if I want to be safe I have to do the following: if(person != null) if(person.Head != null) if(person.Head.Nose != null) person.Head.Nose.Sniff(); is there any easier way of formulating this expression? ...

convert empty space to null

I am using sql server. I have a table and the columns on this table contains empty spaces for some records. Now i need to move the data to another table and replace the empty spaces with NULL value. I tried to use REPLACE(ltrim(rtrim(col1)),' ',NULL) but it doesn't work. Because it will convert all the value of col1 to NULL. I just n...

axis 2 web service : null parameters issue with http binding

Hi, I am trying to develop a web service with axis2. The problem is that I don't get the parameters passed in the url for an http Binding. Here is my service.xml : <parameter name="ServiceClass">my.package.MyClass </parameter> <operation name="getUser"> <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageR...

sql select with null values

I have SP that selects data from a table with two columns like this @param1 text, @param2 text Select * from tablle1 where field1 like @param1 and field2 like @param2 However , because sometimes Filed2 is null i had to do this , otherwise the query returned nothing @param1 text, @param2 text Select * from tablle1 where field1 like @p...

<column> IS NULL vs <column> = NULL in LINQ to SQL generated SQL

in ASP.NET MVC 2.0 I'm doing something like the below (specifically, matching a record based on some values as well as some NULL values). var result = dataContext.Inventory .SingleOrDefault(x => (x.part_id == model.Part.id && x.location_id == transaction.to_location_id && x.bin_id == tran...

.NET and MySql paramters, AddWithValue NULL variables, how to avoid to check for nulls

Let's say I have a MySql stored procedure that inserts a record with some nullable CHAR fields. In VB.NET if I don't check for Nothing (or Null in other languages), I get an exception from the db driver, so I write: command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("_name", if(name Is Nothing, "", name)...

Java ConcurrentHashMap not thread safe.. wth?

Hello I was using HashMap before like public Map<SocketChannel, UserProfile> clients = new HashMap<SocketChannel, UserProfile>(); now I've switched to ConcurrentHashMap to avoid synchronized blocks and now i'm experiencing problems my server is heavily loaded with 200-400 concurrent clients every second which is expected to grow...

Null Object Reference

Using Nunit to test C# code with the following code block: foreach (XmlNode node in nodeList) { thisReport.Id = node.Attributes.GetNamedItem("id").Value; thisReport.Name = node.Attributes.GetNamedItem("name").Value; thisReport.Desc = node.Attributes.GetNamedItem("desc").Value; if (node.SelectNodes("subreport").Count > 0...

Eliminating NULLs when using CASE in SQL Server SELECT statement

I have a large, messy report to write that joins across 5 tables. There is one column in one table that is being used for several different values--essentially a "tag" column, where the tags are used in creative ways depending on what kind of miscellaneous metadata the users want to use. As a result, my query for the report returns 3 ne...

How much size "Null" value takes in SQL Server

Hi, I am having a large table say 10 columns. 4 of them remains null most of the times. I have a query that does null value takes any size or no size in bytes. I read few articles some of them are saying : http://www.sql-server-citation.com/2009/12/common-mistakes-in-sql-server-part-4.html "There is a misconception that if we have the ...

WCF REST and JSON - Serialization and empty elements

Hey, I am returning a list of items (user defined class) in a REST service using WCF. I am returning the items as JSON and it is used in some client side javascript (so the 'schema' of the class was derived from what the javascript library required). The class is fairly basic, strings and a bool. The bool is optional, so if it is absent...

Null Pointer Exception

Hello All, I have been using a driver to test one of my data structures(Binary Search Tree) and i have come across this issue. -It happens when i insert more than 2 objects into the bst -What I am trying to do: I am inserting 4 objects into the tree, then i am deleting 2 objects, and then printing out my find method so that it displays w...

Set nillable element with Relax NG

Is there a way to declare that an element can be null using Relax NG, something like xsi:nillable="true" using XSD? ...

Inserting null into char(1)

I am creating a INSERT script and I am coming across a problem. There is a middle initial field that is a char(1) Sometimes the records don't have anything in that field so I put a NULL. This causes a Data too long for column error. I don't want to just put ' ' as that leaves just a blanks space. Is there another way around this? ...

really funky C# compiler behavior with nullable literals

The C# 4.0 compiler does not complain about this (not even a warning): if(10.0 > null + 1) { } if (myDoubleValue > null) { } And it seems to be always false. What is going on here? Is null automatically converted to Nullable<double> or something? If so why doesn't this work then: double myDoubleValue = null + 1; Also, why ...

Can you return a value in Scheme that won't be printed in a list?

I'm trying to return an invisible value in a scheme function, but can't seem to get anything that WONT be printed to the screen, which is what I need. Is there a value in scheme that can be added to a list which won't be printed in a (display) call? ...