object

Event handler cannot access Object method in JavaScript

How can I access util.log() method from a static html event handler? In other words, when I click the checkbox, I like to call util.log method. onclick="util.log(\'hey\')" <-- how to rewrite the event function here? I know all the answers are correct down here but is it possible to access local methods while insert the html into inne...

XML to Java Object only using Java5 (no external libs)

Hi, normally I would use JaxB, XMLBeans or Simple to convert a XML file to a Java Object. In this case I can however only use Java5 and no external libraries (for several reasons). What is the best way to do that? My XML input is very simple. What is the most flexible and elegant way to get the XML into a Java-Object (I don't really ne...

Delayed reference setting in Java

I am developping a CORBA like inter object protocol that would support object aggregate transmission. When objects of an aggregate are serialized, they may have references to objets serialized later. These are forward references. A simple example is a circular list. If each object has a reference to the previously serialized object, th...

Java: Is the following a class or an object?

public class Animal { public Animal() { System.out.println("Animal"); } } public class Mammal extends Animal { public Mammal() { System.out.println("Mammal"); } } Is this an object or a class? If not, what would be an example of an Object? ...

How can I use the ThreadPool without making Sub foo(o as object) each time?

Every time that I want to make a thread in the ThreadPool I make a stupid little function like Worker_O below. Sub Worker(ByVal i As Integer) 'do important stuff End Sub Sub Worker_O(ByVal o as Object) Worker(CType(o, Integer)) End Sub Sub MakeThread() Dim worker1 as new Threading.WaitCallback(AddressOf Worker_O)) Thre...

PHP syntax to call methods on temporary objects

Is there a way to call a method on a temporary declared object without being forced to assign 1st the object to a variable? See below: class Test { private $i = 7; public function get() {return $this->i;} } $temp = new Test(); echo $temp->get(); //ok echo new Test()->get(); //invalid syntax echo {new Test()}->get(); //...

PHP functions wont work with String object, but works with it typed manually

Hi, I'm trying to strip tags from a text output coming from an object. The problem is, that I can't. If I type it manually like "<p>http://www.mylink.com&lt;/p&gt;", it works fine! When doing echo $item->text; it gives me the same string "<p>http://www.mylink.com&lt;/p&gt;"; Doing var_dump or even gettype, gives me a string(). So, I'm s...

get first related object in template

Hay all, I'm having difficulty accessing the first related object within a template. I'm using {{ course.student_set.all[0].get() }} but its throwing loads of errors. How do i get the first related object? Thanks ...

get process(e.g. TextEdit) as an object in cocoa

hi. I am a newbie and i want to get a process or a key window as an object as i need to send message to it.In fact , i need to get them so that i can manipulate them with my input method kid(IMKit). the corresponding method is -(BOOL)inputText:key:modifiers:client: i want the key window/process receive the event as client. I am appre...

storing huge amount of records into classic asp cache object is SLOW

we have some nasty legacy asp that is performing like a dog and i narrowed it down to because we are trying to store 15K+ records into the application cache object. but that's not the killer. before it stores it, it converts the ADO stream to XML then stores it. this conversion of the huge record set to XML spikes the CPU and causes a...

How to Cast Objects in PHP

Ive some clases that share some attributes, and i would like to do something like: $dog = (Dog) $cat; is it posible or is there any generic work around? Its not a superclass, or a interface or related in any way. They are just 2 different clases i would like php map the attributes from a cat class to a dog and give me the new object. –...

How to define a C# object at run time?

We have XML code stored in a single relational database field to get around the Entity / Attribute / Value database issues, however I don't want this to ruin my Domain Modeling, DTO, and Repository sunshine. I cannot get around the EAV/CR content, but I can choose how to store it. Question is how would I use it? How could I turn the X...

Designing objects for Hibernate

I need some help with a design problem. I'm having trouble wrapping my head around how to design an object (or maybe multiple objects) so that I can query the way I would like to. Let me start by showing a sql query that returns exactly the information I want: select distinct rights_table.receiver_guid, user_info.name from rights_tabl...

PHP object overflow

I'm trying to organize classes in a project in a fashion similar to: $TheRoberts = new family; class family { public function __construct() { $bobby = new father; $cindy = new daughter; } } class father extends family { function PayBills() {} function GoToWork() {} } class daughter extends family { ...

what is an objects hashcode

If the hashCode() method is not overridden, what will be the result of invoking hashCode() on any object in Java? ...

When do you use * in variable definitions (in Objective-C)?

Hi there, I'm still getting confused by Objective-C. Sometimes you declare a variable like so: NSRect rect; And sometimes like so: NSValue *value; I never know when to add the *, so far I always looked it up in Apple's documentation. I know the difference is between a value and a pointer to an object. But are there any hard and ...

How to Convert JSON object to Custom C# object ?

Is there an easy way to populate my C# Object with the JSON object passed via AJAX? //This is the JSON Object passed to C# WEBMETHOD from the page using JSON.stringify {"user":{"name":"asdf","teamname":"b","email":"c","players":["1","2"]}} //C# WebMetod That receives the JSON Object [WebMethod] public static void SaveTeam(Ob...

OO Design Question

Looking for opinions on this: I have broken out various responsibilities into separate objects. However, many of these objects have dependencies on each other. All of these objects are adhering to interfaces so I'm not tied to an implementation. I'm concerned about the dependencies between objects and the potential for circular depen...

just-in-time initialization

What does just-in-time initialization means? ...

MSVC Object Layout Quirk

I have a simple class in C++ that has an integer and a vtable: class Something { virtual void sampleVirtualMethod(); int someInteger; }; If you look at the object layout for MSVC (using the /d1reportSingleClassLayout) you get: class Something size(8): +--- 0 | {vfptr} 4 | someInteger +--- W...