objects

How to order an array of objects by a certain property in XCode

Let's say I have an array of custom objects. The custom class looks like this Person ------- name number Now let's say I want to rearrange the array of these objects so that the objects are sorted by the number. How can this be done? ...

Howto remove unused objects from a git repsitory?

I accidentally added, committed and pushed a huge binary file with my very latest commit to a Git repository. How can I make Git remove the object(s) that was/were created for that commit so my .git directory shrinks to a sane size again? Edit: Thanks for your answers; I tried several solutions. None worked. For example the one from Gi...

How to designate a property as the Default Property for a VbScript class

Given that one can define a class in VB Script, is there any way to specify a default property for that class? e.g. Given Class MyClass Private myName Public Property Get Name() Name = myName End Property end class Is there anyway I can say that Name is the default property? NB: To do this in VB6, one would a...

Creating a new Event with Objects

This is in C# So I'm trying to create an event for ProgressChanged for multiple webBrowser Controls. These are all dynamically created as well as the progress bar. So i can't call upon it prior. What i'm doing is passing the progress bar through object arrays that are ran. It finally gets to the final method in which i create the browse...

Object Factory Question - using database query information to create objects

I have several objects, like products, order, etc. When I get information from my database I take a row and create one of the types of objects. I then work with that object created. I read this is called a factory. Is there some advantage to doing this? Especially in a loosely typed language like PHP? Thanks edit: is this where I g...

Remove existing object

Hi, I have written some code like this. public void Preview() { _printTemplate = new MarineBunkerPrintTemplate(); UpdateInfo(); _printTemplate.SetInfo(); } Here whenever i call Preview() method i am creating new object of _printTemplate, Instead of i have to check existing o...

How do I link a static C object file to Perl?

I have a function written in C (Say in HelloWorld.c file). I want to compile this and need to create a staic object file HelloWorld.a Finally I need to call this from a Perl program (HelloWorld.pl). ...

Binding Listview to multiple Object datasources ASP.net 3.5

Hello, I am using Object as the data source to my Listview and trying to display data in a Hierarchical manner. I am not able to figure out how to bind these objects to my listviews. Below pasted is the code. I am trying to place Listview inside another listview, inside another listview inorder to display data in a hierarchical manne...

How to check if an object exists in an NSMutableArray

Is there a method, like containsObject: for NSMUtableArrays to check if an object exists in there without having to loop through the whole array and check each element? What's the best way to check if an object exists in an NSMutableArray? ...

Getting information about a class with NSLog

When I first started learning XCode I remember hearing something about how it has cool features to inspect an object and get information about its class. Now I need to use these cool features. How can I use NSLog to get class information about an object and other cool information about an object. ...

javascript objects cant see each other? :: google chrome extension

i have two files one called stats.js one called storage.html in stats.js in contains var stats = { myFunc : function() { //do something } } in storage.html I have <html> <head> <script src="stats.js"></script> <script> $(document).ready(function() { stats.myFunc(); }); </script> </head> </html> But I get Uncaugh...

Objective-c: requesting aid in understanding how to use files/objects effectively.

Hello. I am sorry to bother so late, but i am very much a bundle of nerves. I have tried to understand how to use the information in the couple of objective-c and objective-c game design books I have purchased, but unfortunately, the information is laid out in a way which I dont really comprehend. I would like to state my query and is...

Getting an object from an NSSet

If you can't get an object with objectAtIndex: from an NSSet then how do you retrieve objects? ...

Simple class concepts in C++ (cards in a deck)

Hey you guys were absolutely great with my last problem so hopefully you can help clarify something else to me. Classes confuse me! For this particular assignment, we are to do the classic 'Cards in a Deck' program. We are to make two classes, one called 'Card' and the other 'Deck'. Now I've gotten a large chunk of this done so far but...

How to sort an array of an array of objects by those objects attributes

If have an NSMutableArray foo of an NSMutableArray bar of objects. Each of the objects have a property that is a numerical value. In each NSMutableArray bar I want to sum this numerical property of each object. Then I want to sort the NSMutableArray foo by this sum. What's a good way to do this? ...

Instantiating two objects inside a method for use as 'return values'

I've got the following class: public class Matriz { ... static public void create(Matriz a, Matriz b) { ... a=new Matriz(someValue,anotherValue); b=new Matriz(someValue,anotherValue); ... } } And in my main method: public static void main(String[] args) { Matriz a=null,b=null; Matriz.create(a,b); ...

Instantiate and reuse instances of objects in XAML

I want to instantiate objects in XAML, and reuse these instances. I think it should be simple but I'm stuck, I'm probably missing something obvious. Say I want to add Cats to different Rooms (Room has an ObservableCollection containing objects of type Cat). In the UserControl.Resources I create ObjectDataProviders: <ObjectDataProvider ...

Serializing objects in C# 4.0, is there a simpler way?

When set up an object for serialization I do the following: [Serializable] public class ContentModel { public int ContentId { get; set; } public string HeaderRendered { get; set; } public ContentModel() { ContentId = 0; HeaderRendered = string.Empty; } public ContentModel(SerializationInfo info,...

scala - creating objects without making constructor parameter a member of the object

I have class Address(elem: scala.xml.Elem){ val attr1 = (elem \ "attr1") text ... } I do not want elem to be a member of Address to keep the the footprint to minimum as I create few millions of such objects in memory. What is the scala way to achieve this? Thanks. ...

C++ Does not name to a type

This might be an easy question, but I cannot figure out why the compiler it's giving me this error. I have two classes. Agent and Environment. WHen I try to add an object of type Agent in my Environment class I get Agent does not name to a type error. I am including Agent.h in my Environment.h class #ifndef AGENT_H_INCLUDED #define AGE...