Does anybody know why the NetDataContractSerializer might add "nil" entries in a serialized collection?
For example,
<Jobs z:Id="17">
<_items z:Id="18" z:Size="4">
<JobRecord z:Id="19">
<Name z:Id="20">Job1</Name>
</JobRecord>
<JobRecord i:nil="true" />
<JobRecord i:nil="true" />
<JobRecord ...
I have a view that will be displaying downloaded images and text. I'd like to handle all the downloading asynchronously using ASIHTTPRequest, but I'm not sure how to go about notifying the view when downloads are finished...
If I pass my view controller as the delegate of the ASIHTTPRequest, and then my view is destroyed (user navigates...
In my NSFetchedResultsController, I set a sortDescriptor that sorts based on the date property of my managed objects. The problem that I have encountered (along with several others according to Google) is that nil values are sorted at the earliest end rather than the latest end of the date spectrum. I want my list to be sorted earliest...
Greetings!
When assigning a value to an array as in the following, how could I replace the nils by 0?
array = [1,2,3]
array[10] = 2
array # => [1, 2, 3, nil, nil, nil, nil, nil, nil, nil, 2]
If not possible when assigning, how would I do it the best way afterwards? I thought of array.map { |e| e.nil? ? 0 : e }, but well…
Thanks!
...
Having the strange problem that [].include?(:test) returns nil instead of expected false. The whole thing only happens when running the app (i see it in rubymine debug mode), not in irb or rails console.
I tested following
[].include?(:test) # nil
[].include?(:test).nil? # nil
[].class # Array
Seems as if include? is overwritten so...
Found the answer. It was a silly mistake from my part. I did not convert NSNumber to int like how I was supposed to.
Thanks for reading
...
I'm using Delphi Pro 6 on Windows XP with FastMM 4.92 and the JEDI JVCL 3.0. Given the code below, I'm having the following problem: only the first exception handling block gets a valid instance of E. The other blocks match properly with the class of the Exception being raised, but E is unassigned (nil).
For example, given the curre...
I am working on an iPhone App where I am pulling data from an XML file and inserting it into a sqlite database located in the App. I am able to successfully do this process, but it appears that if I try to sqlite3_bind_text with a NSString that has a value of "nil", the App quickly dies.
This is an example of code that fails: (modified...
So I am seemingly encountering some strange behavior when using NSString's -sizeWithFont family of method calls depending on whether or not I'm invoking it on the iPhone Simulator or an actual device.
Simply enough, when the receiver of the -sizeWithFont:constrainedToSize:lineBreakMode: method call is nil, the resulting CGSize passed ba...
So ive got a ActionMailer mailer
class ReportMailer < ActionMailer::Base
def notify_doctor_of_updated_document(document)
recipients document.user.email_id
from "(removed for privacy)"
subject "Document #{document.document_number} has been updated and saved as #{document.status}"
sent_on Time.now
bod...
I have created a polymorphic association around a model called status.
Some contacts will have a status associated with it. Many won't.
If I try to call a status when one is not there, I get an error. Right now, even if I haven't created a status for the model, it still runs whatever is in the if-end block.
Here's what I am trying, ...
Hi all
I'd like to ask - what is the function doing nil conversion from nil's to zeroes in elisp?
I'm a newbie and I think I am inventing the wheel with my code:
(defun chgnull (x)
(if (null x) 0 1))
(mapcar 'chgnull '(1 2 nil))
Search through Emacs sources by keyword "to zero" and such haven't shown anything relevant.
...
Hey guys. I've got a perplexing issue. In my subclassed UITableViewController my datasource methods lose their tableview reference depending on lines of code I put inside the method. For example, in this code block:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 3;
}
...
I would like to be able to gather all records in a table where the user_id is not null.
This is what I have but it doesn't seem to be working (even though I've had it working in a seperate project):
named_scope :all_registered, :conditions => ["user_id != ?", nil]
...
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"...
if (myFloat == nil){
\\Do Method
}
In the above situation, the method will run only if myFloat is nil. Will it also run if myFloat was set to 0?
...
At various points during my application's workflow, I need so show a view. That view is quite memory intensive, so I want it to be deallocated when it gets discarded by the user. So, I wrote the following code:
- (MyView *)myView {
if (myView != nil)
return myView;
myView = [[UIView alloc] initWithFrame:CGRectZero]; // ...
I have been programming iPhone SDK for around 6 months but am a bit confused about a couple of things...one of which I am asking here:
Why are the following considered different?
if (varOrObject == nil)
{
}
vs
if (nil == varOrObject)
{
}
Coming from a perl background this is confusing to me...
Can someone please explain why on...
Is there a way to make blank form inputs submit nil? Right now, I'm going through and in a before_save manually converting all "" into nil.
This really doesn't seem very DRY, and I feel like I must be missing something.
...
I want to show a post author's name; <% @post.author.name %> works unless author is nil. So I either use unless @post.author.nil? or add a author_name method that checks for nil as in <% @post.author_name %>. The latter I try to avoid.
The problem is that I may need to add/remove words depending on whether there is a value or not. For i...