Let me explain. I have a List into which I am adding various ASP.NET controls.
I then wish to loop through the list and set a CssClass, however not every Control supports the property CssClass.
What I would like to do is test if the underlying instance type supports the CssClass property and set it, but I'm not sure how to do the conver...
Is there a better method to establish the positional offset of an object's data member than the following?
class object
{
int a;
char b;
int c;
};
object * o = new object();
int offset = (unsigned char *)&(object->c) - (unsigned char *)o;
delete o;
...
I have an abstract class as follow:
class BaseReturnType { }
class DerivedReturnType : BaseReturnType { }
abstract class BaseClass<T> where T : BaseReturnType
{
public abstract T PolymorphicMethod();
}
class DerivedClass : BaseClass<DerivedReturnType>
{
public override DerivedReturnType Polymorp...
What is the commonly accepted method for converting arbitrary objects to and from their String representations, assuming that the exact class of the object is known ? In other words, I need to implement some methods similar to the following:
public interface Converter {
/**
* Convert this object to its String representation.
...
Hello All,
I am getting an error when I am upadting the product ,the error is coming in the view page .it is "Object reference is not set to an instance of an object".
Please tell me why is the error coming.
category_id:
<%= Html.TextBox("category_id", Model.category_id ) %>
<%= Html.Val...
I am working with ASP.net 3.5 MVC application.
I have one assembly which has ClassA.
I have another assembly which creates the object of ClassA
Now the question is ,
how to Intialize the object as a static only for one session.
The object will be static across the session. New Instance of the object should be created only when new sess...
In PHP5, what is the difference between using const and static? When is each appropriate? And what role does public, protected and private play - if any.
...
While building a new class object in python, I want to be able to create a default value based on the instance name of the class without passing in an extra argument. How can I accomplish this? Here's the basic pseudo-code I'm trying for:
class SomeObject():
defined_name = u""
def __init__(self, def_name=None):
if def_n...
When getting an object from the DB, should the object's properties also be loaded? There seems to be these approaches.
Create well-formed, fully-loaded objects.
Pro: No need to check if a property has been loaded; it has. Pass it around and don’t worry about parts of the object not being there.
Con: Where do you stop? If an object h...
What is the difference between identity and equality in OOP?
...
I know I can use something like User.sort {|a, b| a.attribute <=> b.attribute} or User.find and order, but is it a way like comparable interface in Java, so every time I called sort on User object it will do sort on the predefined attributes.
Thanks,
...
What is an abstract data type in object oriented programming? I gone through wiki, but I didn't get cleared. Please make me clear.
...
what is meant by Business,System,Interface,Persistence classes? Explain me with some examples?
...
I've embedded a virtual tour on one of my client sites.
The site is hosted by Slicehost, and as you can see the load times for the Flash movies are very slow, so my idea was to serve the swf files from Amazon S3 Europe.
To test it, I have all swfs uploaded to the same directory / bucket on Amazon, while the index.html and p2q_embed_ob...
What is the best practice for returning simple objects from functions / procedures in delphi?
eg. 2 kinds of code:
pass created object as reference, populate object in Proc, destroy it afterwards
procedure Proc(var Obj: TMyObject);
begin
// populate Obj
end;
O := TMyObject.Create;
try
Proc(O);
// manipulate populated object
fin...
Hello,
I have got something strange:
This Code does NOT Work:
cell.imvstatus.image = [UIImage imageNamed:[[tutorials objectAtIndex:indexPath.row] objectForKey:@"image"] ];
This code works:
cell.imvstatus.image = [UIImage imageNamed:@"ROR.png" ];
And in the object there is the value "ROR.png"
Whats the problem at the above one?
How c...
It would take too long to explain why I need this, but I was wondering if there was a PHP function to check if a type of object was recognized. In other words, a function that would check if
$dog = new Dog();
would cause an error, because Dog didn't exist. Thanks for you help.
...
Something like below,which is complicated to figure out what it exactly means:
9.<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="945" height="102">
10.
11. <param name="movie" value="66.swf" />
12.
13. <param...
This is a homework problem - so I would appreciate if you could tell me what I am doing wrong and how to fix it, resp. how to optimize my programing techniques :). Thanks!
I built this to save the employee in the array - it will save the first one right but when it saves the others it shows up blank - right out of the constructor. Why...
Accessing private transient object fields from any method in class must be controlled with some code. What is the best practice?
private transient MyClass object = null;
internal get method:
private MyClass getObject() {
if (object == null)
object = new MyClass();
return object;
}
// use...
getObject().someWhat();
o...