I'm running into a strange problem. I have a vector of lists and I use unlist on them. Some of the elements in the vectors are NULL and unlist seems to be dropping them. How can I prevent this?
Here's a simple (non) working example showing this unwanted feature of unlist
a = c(list("p1"=2, "p2"=5),
list("p1"=3, "p2"=4),
l...
In C# 4, wasn't there a short cut for checking for null values like so:
if( myobject?.myproperty?.myotherproperty?.value != null )
The value would return null and not throw an exception.
Anyone have a link to how to use it or at least the syntax?
...
The model:
class Product(models.Model):
name = models.CharField(max_length = 128)
def __unicode__(self):
return self.name
class Receipt(models.Model):
name = models.CharField(max_length=128)
components = models.ManyToManyField(Product, through='ReceiptComponent')
class Admin:
pass
def __unicode__(self):
return ...
What are the best practices if you have a class which accepts some parameters but none of them are allowed to be null?
The following is obvious but the exception is a little unspecific:
public class SomeClass
{
public SomeClass(Object one, Object two)
{
if (one == null || two == null)
{
throw new I...
The following code compiles perfectly with Eclipse, but fails to compile with javac:
public class HowBizarre {
public static <P extends Number, T extends P> void doIt(P value) {
}
public static void main(String[] args) {
doIt(null);
}
}
I simplified the code, so T is not used at all now. Still, I d...
The database development standards in our organization state the varchar fields should not allow null values. They should have a default value of an empty string (""). I know this makes querying and concatenation easier, but today, one of my coworkers questioned me about why that standard only existed for varchar types an not other dat...
Ultrawingrid 9.2 VS2008 .net 3.5
My wingrid uses a bindingsource. All datetimes which are null in SQL Server are delivered to the bindingsource as #1/1/1800#
I would like Ultrawingrid to display this date as blank as it would a null from source.
Also, if the date is null in the grid ( i.e. blanked out ) I would like to update the dat...
Hi I would like to know diff between the above comparisons?
I am getting null pointer exception when I check object.getItems() == null.
But if I change it to null == object.getItems(), it workes fine.
I did look into this http://stackoverflow.com/questions/2938476/what-is-the-difference-between-null-object-and-objectnull-closed
But I d...
this code loads the data
jQuery.ajax({
type: "GET",
url: "getOptionsJson.php",
cache: false,
dataType: "json",
data: "config_id="+config_id,
success: function(json) {
jQuery.extend(dataArr, json.ajax);
jQuery.extend(opts, json.ajax2);
printResult(config_id)...
Hi,
I have an NSString in an NSObject file, I inherited this NSString into my MainViewController where it gets the value.
Now, I want to use this NSString value in another UIViewController subclass.
From some reason I always get (null)
Here's my code:
MainViewController:
leftWebViewUrl = [NSMutableString stringWithString:leftWebVi...
hello,
i have created two create actions..one to call the create view and the other to process the create view using httppost.
when i call the create view, it gets published correctly , dropdowns and all.
the problem is that when i fill out the create form and click on the submit button, i get an error;
Object reference not set to an ...
I have a listbox select and I want when the user selects null for the empty string it produces to pull the nulls from the SQL table.
Here's what I have now. Blank strings return nothing because there are no empty fields in the table.
SELECT * FROM dbo.Table WHERE ID = " & TextBox2.Text & " and And Field1 IN (" & Msg1 & ")
How do I co...
hi expert, want to ask, in java if(NULL==variables) or if(variables==NULL) which will be more effective and what are the difference,
thanks
...
I'm doing:
select sum(clicks),
date
from stats
group by date
...however when the sum is null for some date, the whole row is discarded, I want to see: | null | some_date |, how to do so?
...
I'm having the following tables:
Table a
+-------+------------------+------+-----+
| Field | Type | Null | Key |
+-------+------------------+------+-----+
| bid | int(10) unsigned | YES | |
| cid | int(10) unsigned | YES | |
+-------+------------------+------+-----+
Table b
+-------+------------------+------+
...
Example:
A validation method contains this check to see if an NSError object shall be created or not:
- (BOOL)validateCompanyName:(NSString *)newName error:(NSError **)outError {
if (outError != NULL) {
// do it...
Now I pass an NSError object, like this:
NSError *error = nil;
BOOL ok = [self validateCompanyName:@"Apple"...
Hi. I use an instance of NSXMLParser. I store found chars in NSMutableStrings that are stored in an NSMutableDictionary and these Dicts are then added to an NSMutableArray.
When I test this everything seems normal: I count 1 array, x dictionnaries and x strings.
In a detailview controller file I want to show my parsed results. I call t...
Hallo all,
I have a ListView which contains a Button in each line. The following code is part of the getView() Method
public View getView(final int position, View convertView, ViewGroup parent) {
View row = convertView;
TextView tv;
Button saveA_button;
EditText edittext;
FITB_ViewWrapper wrapper...
I've got a string like this in my Excel VBA:
strSQL = "SELECT * FROM Total WHERE (SimulationID = (" & TextBox1.Text & ") And Test1 = (" & Example & "))"
However, sometimes Test will be 'is null', which makes the query
And Example = is NULL
How can I change it to add an if/then statement or something to make it say
And Example is ...
I have the follwing jQuery:
$("#textArea").keyup(function(){
var textAreaValue = $("textArea");
if(!textArea.value.indexOf("some string")){
textArea.value = textArea.value.replace("some string",null);
alert("It was there!");
}
});
Is it normal for e...