What is really the difference between the algorithms remove and remove_if and the member function erase?
Does both of them result in a call to the removed objects destructor?
so i have a nsmutablearray that populates from a socket message.
problem is, when i call numberofrowsinsection on the uitableview, it will be 0, because it loads from the array. the array has 0 objects, because the incomingMessage hasn't been received yet.
i observe this array in my appdelegate, when it changes, i call refreshData on the tableView, but it doesn't refresh. how do you load a uitableview from a dynamic array?
hello
Is there library/header already written to manage C++ objects from C using opaque pointers/handles?
I can write one myself, but I would rather use already made solution, especially if it has fortran bindings.
Thanks
Imagine I have a class that allocates memory (forget about smart pointers for now):
class Foo
{
public:
Foo() : bar(new Bar)
{
}
~Foo()
{
delete bar;
}
void doSomething()
{
bar->doSomething();
}
private:
Bar* bar;
};
As well as deleting the objects in the destructor is it also worth setting them to NULL?
I'm assuming that setting the pointer to NULL in the destructor of the example above is a waste of time.
Is there a way to access the super object when extending objects using $.extend?
I would like to extend an object, override a method, but call the overridden superclass method in the subclass method.
I would like to register a marker interface so I can add it to objects in the ZMI. My product's configure.zcml contains:
<interface interface=".interfaces.IMarkerInterface" />
and, after reinstalling, the interface shows up in the list of available interfaces. But if I try to add it to an object in the ZMI I get a ComponentLookupError. What's missing?
Hi, I have to use Json objects and Create, Update, delete and retrive the records in asp. if anybody have an example, please help me.
Thanks in advance.
What allocators are available out there for use with STL when dealing with small objects. I have already tried playing with pool allocators from Boost, but got no performance improvement (actually, in some cases there was considerable degradation).
Typically in a the input file is capable of being partially read and processed by Mapper function (as in text files). Is there anything that can be done to handle binaries (say images, serialized objects) which would require all the blocks to be on same host, before the processing can start.
I've got a project that I'm using Doxygen to generate documentation to. The documentation of the classes is fine, but I've also got some functions that I use in main() to create objects etc. I'd also like to have these into my documentation, but I have not figured how to do that. Any suggestions?
In a method that gets called frequently, like a painting event, is it more efficient to reuse Point and Rectangle Objects (for specifying locations and bounds), or should I create new ones.
I'm a beginner and I want to write Java code in eclipse. This program takes two LinkedLists of integers (for example, a and b) and makes a LinkedList (for example d) in which every element is the sum of elements from a and b. However, I can't add these two elements from a and b because they are Objects
Example:
a=[3,4,6,7,8]
b=[4,3,7,5,3,2,1]
------
d=[7,7,13,12,11,2,1]
For some odd reason the part where objects are shown and hidden in my script doesn't seem to be working. I'm not sure if its the fact firefox doesn't like that or whether its the function-based code I have (to save duplicating lines of code)?
There is a working example here and the javascript is here
All help appreciated
I expect it should share a common description, like XmlSchema or IDL and should generate classes for target language.
I found Thrift and it's really nice solution, but it doesn't support structures polymorphism.
I would like to have collections of base class objects, where I could place instances of subclasses, serialize this and deserialize at the opposite side. Some mechanism of polymorphic behavior support, like Visitor, would be a perfect.
Does anybody know something suitable for these requirements?
my appdelegate is having the array book, this array is storing the many object. this object are containing the many latitude and longitude values coming from server.
and later i want to assing that values to the coordinate of the cllocationcoordinate2d object.
how can i read that values of latitude and longitude store in the object and that objects are store in the array.
Hello,
why does
List<Object> objectList; = some objects
List<Object> getList()
{
return objectList; //or return new List<Object>(objectList);
}
return a list with all items referenced to the original list's items?
Thanks.
I have a business object structured like this:
Country has States, State has Cities
So Country[2].States[7].Cities[5].Name would be New York
Ok, I need to get a list of all the Country objects which have at least 1 City.IsNice == true
How do I get that?
I know it is not possible to know when a gc occurs, but there are factors that will tell you how often/when it may occur. What factors are these? One is how many objects are created, etc.
Thanks
I have a question. What is wrong with regards to the below code:
ArrayList tempList2 = new ArrayList();
tempList2 = getXYZ(tempList1, tempList2);
//method getXYZ
getXYZ(ArrayList tempList1, ArrayList tempList2) {
//does some logic and adds objects into tempList2
return tempList2;
}
The code will get executed but it seems by passing tempList2 to the getXYZ method argument, it is doing object recycling.
My question is, Is recycling the tempList2 arraylist object correct?
I'm iterating through a variable called content, it contains several HTMLLIElement objects.
How can i use jQuery's or JavaScript's functions with this object?, what I'm trying to do is the kind of validation written in the commented code.
$.each(content, function(index, value){
//if(!value.is(':hidden')){
console.log(index + ' : ' + value);
//}
});
What I'm getting is
Uncaught TypeError: Object # has no method 'is'
If I do value.getAttribute('style'); I get 'display: none;'
is it possible to return findOne result as object ..or it always return an array?
i found something about mongo.objects = 1 adding to php.ini ..but did not work for me.
can some one tell me more about this?
Hello. I'm building a mechanism to take XML data from a queue and call stored procs to save the data from the XML document directly to the database. This seems like something that NHibernate could address, but of course most of the information I find discusses going from objects to database instead of another data format (XML, in this case). Is there a way to use NHibernate in this fashion or am I barking up the wrong tree?
Thanks.
I notice that InterfaceBuilder has UITableViewCell in its library of objects I can drag onto a view. I wonder if it ever makes sense to use one outside of a UITableView.
I have a function
function callback(obj){...}
Is it okay to pass in more objects than were declared in the function signature? Eg, call it like this:
callback(theObject, extraParam);
I tried it out on firefox and it didn't seem to have a problem, but is it bad to do this?
Based on the documentation, predict is a polymorphic function in R and a different function is actually called depending on what is passed as the first argument.
However, the documentation does not give any information about the names of the functions that predict actually invokes for any particular class.
Normally, one could type the name of a function to get its source, but this does not work with predict.
If I want to view the source code for the predict function when invoked on objects of the type glmnet, what is the easiest way?