Why is it not possible to create an object of an abstract class?
I understand that the compiler creates a VTABLE with VPTR pointing to NULL. Does this prevent from creating an object of an abstract class?
Say, I have an entity Customer which has relationship with city,order etc.Now,when I am adding a customer object,should I assign customer.cityid, or customer.city? Now,from form I get cityid from dropdown,to assign city object,I will have to make a query using id selected.
If a program has literally just deserialized an object (doesn't really matter how, but just say BinaryFormatter was used).
What is a good design to use for re-injecting the dependencies of this object?
Is there a common pattern for this?
I suppose I would need to wrap the Deserialize() method up to act as a factory inside the container.
Thanks!
Hello everyone,
I'm trying to draw objects using Bezier surfaces with openGL's evaluators. I am struggling with defining the control points for my objects. Can anyone please suggest ways to get the control points for an object? Is there some program that I can use to design my object then import the control points into a file that I can use in my application?
Is possible with Automapper to map a flat object to complex object graph?
Mapper.CreateMap<PersonDto,Person>()
Map PersonDto.BirthCertificateFatherName to Person.BirthCertificate.FatherName
I have binded a list of enum to a combobox. Now I want to get the SelectedItem return the enum, which currently returns it as type object. How do I convert this object to my enum?
My framework is silverlight on windows-phone-7
Hi,
is it possible to let clicks on a HTML element that's overlaying a Flash or Silverlight object bubble through to the Flash / Silverlight object? I've been experimenting with this, but i can't figure out if it is even possible because of possible security restrictions.
I have the following:
function Preferences() {
}
Preferences.players = {
'player1': new Player()
}
players is a static member variable of Preferences and I'm trying to make it an object containing an instance of a Player. However, it doesn't appear to let me do this. It seems like it will allow me to define players if I make it a non-static member variable however. Like so:
function Preferences() {
var players = {
'player1' : new Player()
}
}
Is it possible to create a static member variable containing instances of an object in JS?
Basically I have some class objects, each with three properties. Once one class object is selected in the ComboBox, the corresponding properties shows on three textboxs. I am trying to add one save button. I can change the value of the properties. Once the save button is clicked, all the class ojects with three corresponding properties are saved in the registry. Save setting for later use
It seems Registing tryKey.SetValue Method can not save an object directly?
let's say we have an image that contain square,circle and other few object at some distance and now i want to find the length between these object using c#.
Let's say you have two objects (UITextviews) in your class. When the text view changes, you have a delegate method that catches the change.. but how can you tell programatically WHICH object was changed and called the delegate ??
I have to be missing something, because this should be trivial, but I couldnt find anything.
Note: In this case, its not possible to just break up the class to only have one object (there by bypassing ambiguity).. I looked for things like assigned variable names for nsobjects, nothing there
How can I cast the object in a NSNotification to an integer and to a string? When I log the notification to the console I get...
NSConcreteNotification 0x20af70 {name = kMessageCountNotification; object = 1}
But when I set the text value of a UILabel to that value, I get 72855952
I'm trying to convert an image in my assets folder
"./assets/image1.png"
to type Object. It needs to be Object because that's what the function I'm using it in is expecting.
Any ideas what would be the simplest way to do this?
I'm trying to figure out how to instantiate a case class object with reflection. Is there any support for this? The closest I've come is looking at scala.reflect.Invocation, but this seems more for executing methods that are a part of an object.
case class MyClass(id:Long, name:String)
def instantiate[T](className:String)(args:Any*) : T = { //your code here }
Is close to the API I'm looking for.
Any help would be appreciated.
Why do this:
// If parameter cannot be cast to Point return false.
TwoDPoint p = obj as TwoDPoint;
if ((System.Object)p == null)
{
return false;
}
Instead of this:
// If parameter cannot be cast to Point return false.
TwoDPoint p = obj as TwoDPoint;
if (p == null)
{
return false;
}
I don't understand why you'd ever write ((System.Object)p)?
Regards,
Dan
Hi,
I've an object (basically a VO) in Java and I don't know it's type. I need to know values which are not null in that object. Can someone please help me to do this?
I need to print out an easy to read object graph from Visual Studio because I need to show a customer the state of an object at runtime.
Are there any debug visualizers for this? Expanding everything in a quick watch window isn't easy enough for the customer to comprehend.
Object doesn't support this property or method
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NotSupportedException: Object doesn't support this property or method
I have a model which is accessible through the Django admin area, something like the following:
# model
class Foo(models.Model):
field_a = models.CharField(max_length=100)
field_b = models.CharField(max_length=100)
# admin.py
class FooAdmin(admin.ModelAdmin):
pass
Let's say that I want to show field_a and field_b if the user is adding an object, but only field_a if the user is editing an object. Is there a simple way to do this, perhaps using the fields attribute?
If if comes to it, I could hack a JavaScript solution, but it doesn't feel right to do that at all!
what should be the parameter for create object the following code
dim a
set a=CreateObject("Collection") //getting a runtime error saying ActiveX
//component can't create object: 'Collection
a.add(CreateObject("Collection"))
a.Items(0).Add(1)
MsgBox(a.Items(0).count)
MsgBox(a.Items(0).Item(0))
HI everyone,
during the various stages of compilation in C or C++, i know that an object file gets generated.
i.e., any_name.o file.
what does thos .o file contain actually.
i cant open it since its a binary file.
Could anybody please help me?
are the contents of the object file mainly Dependant on the compiler which we use on unix?
I am using the Rules module to send an email. I need to include a CCK field from my node in the email. The rules module provide a $node object. How do I get from this object to my field so I can output it in the email?
Given a PyObject* pointing to a python object, how do I invoke one of the object methods? The documentation never gives an example of this:
PyObject* obj = ....
PyObject* args = Py_BuildValue("(s)", "An arg");
PyObject* method = PyWHATGOESHERE(obj, "foo");
PyObject* ret = PyWHATGOESHERE(obj, method, args);
if (!ret) {
// check error...
}
This would be the equivalent of
>>> ret = obj.foo("An arg")
I'd like to create a list of method-object pairs. Each method is a function returning a boolean. Then:
foreach(pair) {
if method evaluates to true {
do something with the object
}
}
One way of modelling this that I can think of is to have a class Constraint with a method isValid() and for each constraint produce an anonymous class (overriding the isValid() method). I feel like there could be a nicer way. Can you think of any?
I have the following:
function Preferences() {
}
Preferences.players = {
'player1': new Player()
}
players is a static member variable of Preferences and I'm trying to make it an object containing an instance of a Player. However, it doesn't appear to let me do this. It seems like it will allow me to define players if I make it a non-static member variable however. Like so:
function Preferences() {
var players = {
'player1' : new Player()
}
}
Is it possible to create a static member variable containing instances of an object in JS?