null

Rails not adding model field to insert query

Hi, I've added a column to a db in rails via a migration, and updated new.html.erb to add the field to the form. The correct data is in the request params, but the insert query that is generated has a null for the column every time. Here are the request params: {"commit"=>"Create", "assignment"=>{"start_date"=>"08/04/2010", "proj...

I cant seem to find a pleasing answer for this on the web for this specfic question, "In MySQL do colums that have 'NULL' waste memory"?

Taken from one of my previous questions. Table is telling on which item (post , photo or reply) the comment is taking place on. commentid ---- postid ----- photoid-----replyid ----------------------------------------------- 1 22 NULL NULL 2 NULL 56 NULL 3 23...

MySQL mystery: Null value is not different from non-null string

Why is this query returning 0 rows? select t.f1, t.f2 from (select null f1, 'a' f2 from dual) t where t.f1<>t.f2; This is a distilled version of a complex query I have. I want to compare two tables containing one-to-one related data and I want to select those rows that contain different values for certain fields. But also there can be...

Guice Inject Field in class not created by Guice

I have a class like so, that I create myself somewhere in my code: class StarryEyes { @Inject MyValidator validator; public StarryEyes(String name) { //.. } public doSomething() { // validator is NULL } } I want Guice to inject an instance of validator, which has a @Singleton annotation. I have a module th...

Why casting to object when comparing to null ?

While browsing the MSDN documentations on Equals overrides, one point grabbed my attention. On the examples of this specific page, some null checks are made, and the objects are casted to the System.Object type when doing the comparison : public override bool Equals(System.Object obj) { // If parameter is null return false. if ...

Displaying random li's display's NULL

How do I display a random set of list items, I think I have this down. Thanks! //Count the number of li's in the object var listCount = $("li.contentBlock", obj).length; //Generate a random number from the count of li's var randomListNumber = Math.floor(Math.random() * listCount -1); //Gener...

I've "fixed" a memory leak, but.. how to fix it in a better way?

It was a very fast and makeshift, bug fix.. It worked, but I would like to find a better understanding and solution. This was the Class Constructor generating the leak final transient DataInputStream din; final transient DataOutputStream dout; final transient BufferedReader bin; final transient BufferedWriter bout; NData(Socket s...

SQL eleminate mulitple value(s) if same identifier has a associated NULL value

Ok here goes: I have a table with id ( can be duplicate but not NULL ) and value ( can be duplicate and NULL ) id value ----- ----- 1 red 1 red 1 (null) 2 blue 2 blue 3 (null) So how do I return the id's and value's of all the records that have a value, but if a null value is also found don'...

Treat Null as Max

Hey, So if I had a table in my database with the values 1 2 3 4 NULL And I executed the query SELECT MAX(col1) FROM <table> I'd get 4. Is there any way to change this so Null would be treated as the maximum as oppose to the minimum? Thanks! ...

UIImage that came from UIImagePickerController's photo library, is white image

Hello, When get UIImage that came from UIImagePickerController's photo library, i get white image, why is that? tnx ...

testing if a shared_ptr is NULL

I have the following code snippet: std::vector< boost::shared_ptr<Foo> >::iterator it; it = returnsAnIterator(); // often, it will point to a shared_ptr that is NULL, and I want to test for that if(*it) { // do stuff } else // do other stuff Am I testing correctly? The boost docs say that a shared_ptr can be implicitly converted ...

Actionscript 3 Null Object Error Message

Hi guys.. I am building a AS3 only project and got runtime error that said "Cannot access a property or method of a null object reference." Here is my code: main.as public class videoMain extends Sprite{ private var videoPlayer:Player; public function videoMain (){ loadPlayer() loadProgres...

checking field values for null

I've been working through this for a while and I'm missing the obvious. I'm trying to make sure that if a textbox value is left blank an error isn't thrown and instead a simple message is displayed in the textbox. However, what I've got and several other methods I've tried similar to this haven't worked. I can't figure out why this is...

How can I check if a string I have returned from a cursor is emtpy or null in an Android cursor?

This is my code, it always falls into the else even when I know that the value going in (via debugger) is emtpy. name = cursor.getString(cursor.getColumnIndex("Genus")) + " " + cursor.getString(cursor.getColumnIndex("Species")); if(name != "" && name != null) tv.setText(name); else tv.setText("Error"); ...

What's wrong with my code?

There is a null error, and i've been trying to solve it for 2 days. Booking.java package one.two; import android.app.Activity; import android.database.Cursor; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.SimpleCursorAdapter; import android.widget.Spinner; import android.w...

#1009 null object reference (AS3, TextField)

Hi, I would like some help (and I'm new to this site) I want a typewriter-effect. So that it looks like the code in the string is typed character by character (for an animation). However, I get a #1009 back. It talks about a null object reference (the error is in Dutch). My dynamic text field is in the same scene, on a different layer...

Calling instance method on a null reference in IL..

Is it correct that a instance method can be called on a null reference in IL..? Is there any example to show this..? ...

How to replace leading null values with the first non-null value in a row?

I'll try to avoid describing the background here. I now have a query result (not a table) which contains rows like this: ID SP1 SP2 SP3 SP4 SP5 SP6 SP7 SP8 1 null null 2500 1400 700 null null null There may be leading and/or trailing null values around a section of non-null v...

Check chains of "get" calls for null

Hi. Let's say I'd like to perform the following command: house.getFloor(0).getWall(WEST).getDoor().getDoorknob(); To avoid a NullPointerException, I'd have to do the following if: if (house != null && house.getFloor(0) && house.getFloor(0).getWall(WEST) != null && house.getFloor(0).getWall(WEST).getDoor() != null) ... Is there a...

If null.Equals(null) why do I get a NullReferenceException

I have the following line of code --> var selectedDomainID = lkuDomainType.EditValue.Equals(null) ? string.Empty : lkuDomainType.EditValue; that is, sometimes, generating a NullReferenceException What I don't understand is why. Isn't the whole point of my code to check for null and if so assign string.empty?? When I check in DEBUG ...