object

How can i free a pointer vector?

Hello, how can i free up memory in a pointer vector? Here's the code: class A { private: int x,y,z; public: A(param1, param2, param3) { x=param1; y=param2; z=param3; } ~A() { //prompts an alertbox, warning me about the successful call...

Bizarre VSTO behaiour when returning values to a UDF from a catch{} block after exception thrown

Hi, This one is pretty weird ... I have a VSTO Excel 2007 project for C# where I create a bunch of worksheet functions that return object[,]. They all work fine but I wanted to return exception messages/stack traces when the function fails. When I tried this I got #VALUE!'s everywhere. So during troubleshooting the issue I created a s...

LINQ to Get Closest Value?

I have a List, MyStuff has a property of Type Float. There are objects with property values of 10,20,22,30. I need to write a query that finds the objects closest to 21, in this case it would find the 20 and 22 object. Then I need to write one that finds the object closes to 21 without going over, and it would return the object with a ...

creating objects in c++ not using "new"

hey, i want to make a program that lets say represents a matrix now the matrix will be represented by a vector that each object in the vector will represent a cell example: vector now when constructing the matrix the constructor recives a list of cells to insert in the matrix. the size of the list is unknown in compilation time i am ...

Can You Specify the Property Name of a Foreign Object in LINQ

Suppose that I have 2 tables: [User] - UserID - Username [Task] - TaskID - TaskName - TaskCreatedByUserID - TaskAssignedToUserID In the [Task] table, both of the ***UserID fields are foreign keys to the [User] table. So when I use the designer to create my LINQ models, I have access to 2 foreign [User] objects with proper...

Can't remove object from NSMutableArray

Hi guys, i am trying to remove objects from my NSMutableArray but i keep getting bad_access error. I used "removeAllObjects" and "removeObjectAtIndex" but none of these work. If i add objects to this array , everything is fine. What i want to do is to clear my array before filling it again. I didnt release the array before trying to...

PHP: Protect an object property without knowing its name in advance

Ok, this may be impossible, but I thought I'd ask before I rework the whole thing... I have a situation like this: I have an object class that can receive "pieces," which are also objects. It works basically like this: class myObject { //Receives an associative array of "Piece" objects function __construct($objects) { f...

AS3 Custom Object to ByteArray then to Custom Object

Having problem reading bytearray of custom objects. Any help is appreciated public class CustomObject extends Object { public function CustomObject() { public var _x:Number = 100 public var _y:Number = 10 public var _z:Number = 60 } } var cObj:CustomObject = new CustomObject() var bytes:ByteArray = new ByteArray() bytes.writeObject(c...

JavaScript object with internally referenced properties

I'm trying to create a global object with a series of 'slave' properties that are derived from the value of one 'master' property in the same object - something like: var x = 5; var myObj = { master : 17, slave1 : this.master + x, slave2 : (this.master / 2.2) + 1, slave3 : Math.floor(this.slave2) //etc. }; I realiz...

How to pass an object to a view controller

How do you pass an object to a view controller, right before you push the view to show it? ...

PHP return self as array of objects from within the class?

I'm using CodeIgniter to build a php web application, and I'm trying to use good OO practices - of which there appears to be many schools of thought. I specifically have a class biography_model to interact with a MySQL table. This data model has some class properties representing the columns in the table, but it also has some properties ...

Getting a value from an object php

Hi. I used var_dump on an object in my code. print var_dump( $$user); result: object(stdClass)#35 (1) { ["user1_ready"]=> string(1) "0" } How do I get to this value (0 in this case). I tried print $$user which resulted in Catchable fatal error: Object of class stdClass could not be converted to string in I need something like if($...

ActionScript - Difference Between "Wildcard" and Object Datatypes?

When declaring a variable to have an open datatype, is there any difference, especially a performance difference, between typing a variable as a "wildcard" (i'm not sure of the official name for this) and typing a variable as an Object? var myVar:*; var myVar:Object; ...

How to check if an object is nil

I made a Class that has several NSStrings as properties. If I have an object of this class, then how can I know if the object is nil (i.e. all the NSString properties are nil). My class looks like this // MyClass.h #import <Foundation/Foundation.h> @interface MyClass : NSObject <NSCoding> { NSString *string1; NSString *string2; }...

Writing XML data from URL to Object in SSIS Script Task

I have this URL where there is XML data. I have to extract that data from URL and dump it into DW table. I am using SSIS Script Task for that. This is how the data looks like: -<currency> <csymbol>AED</csymbol> <cname>United Arab Emirates Dirhams</cname> <crate>3.6732001305</crate> <cinverse>0.2722421770</cinverse> </currency> −...

Unable to cast object of type 'CompaniesDataTable' to type 'CompaniesDataTable'.

Has anyone come across an error like the following: Unable to cast object of type 'CompaniesDataTable' to type 'CompaniesDataTable'. Here is the code that is causing the error: protected void ObjectDataSource_Companies_Selected(object sender, ObjectDataSourceStatusEventArgs e) { int x = ((Adala.CompaniesDataTable)(e....

How to declare a method that takes an instance as an argument in Python?

I know it is probably a stupid question, but I am new to OOP in Python and if I declare a function def myFunction( b) and pass an instance of an object to it, I get TypeError: expected string or buffer. To be more specific, I have a following code that I use to parse a summary molecular formula and make an object out of it. class Summa...

Object acting like an array? (PHP)

I have seen something like this in an ORM: $b = new Book(); $b->limit(5)->get(); echo 'ID: ' . $b->id . '<br />'; echo 'Name: ' . $b->title . '<br />'; echo 'Description: ' . $b->description . '<br />'; echo 'Year: ' . $b->year . '<br />'; foreach ($b as $book) { echo 'ID: ' . $book->id . '<br ...

append object to another object in php

Hi. I have this object: foreach(range(1,$oc->num_users) as $num) { $user = 'user' . $num; $$user = mysql_fetch_object(mysql_query("SELECT user".$num.", user".$num."_ready, FROM oc_db WHERE leader='".$_SESSION['username']."' ")); This gives objects named user1..X later I have a simular function like this, where I use the $...

Question about var_dump output

When I var_dump an object, the output looks like this: object(XCTemplate)#2477 (4) { ["id"]=> string(1) "1" ["attributes"]=> array(0) { } ["db_table_name"]=> string(14) "template_names" ["cache"]=> array(0) { } } XCTemplate is its class, of course, but what does the integer (here: 2477) after the # mean? ...