object

__getattr__ equivalent for methods

When an attribute is not found object.__getattr__ is called. Is there an equivalent way to intercept undefined methods? ...

Jquery. Reload SWF object with new parameter

Hi, i'm assigning new playlist to the SWF object. Then it needs to be reloaded it with new param: sections.change(function(){ var current = $(this).val(); var fextention = ".xml"; //show the loading bar showLoading(); //reloading player with relevant playlist: xmlplaylist.val("xml=playlists/"+current+fextentio...

Reviewing history of object recognition/reconstruction. Any one has list with dates?

What I'd love to see is dates! recognition/reconstruction by Single image for me is priority. When appeared first object recognition algorithm, When first programme that was capable of object recognition appeared? What are most interesting dates? ( for ex publishing of most valuable papers) ...

Error: Generic Array Creation

I don't understand the error of Generic Array Creation. First I tried the following: public PCB[] getAll() { PCB[] res = new PCB[list.size()]; for (int i = 0; i < res.length; i++) { res[i] = list.get(i); } list.clear(); return res; } Then I tried doing this: PCB[] res = ne...

Make my own FIFO Queue class for my own class object to fill it?

Hello. I am trying to make a FIFO Queue that is filled with my own class object. I found this example but if I replace < E > with < PCB > it does not work: import java.util.LinkedList; public class SimpleQueue<E> { private LinkedList<E> list = new LinkedList<E>(); public void put(E o) { list.addLast(o); } public E ge...

Possible to return a String array

Is it possible to make a method that returns a string [ ] in java???? ...

How should I deal with object hierarchies in a RESTful API?

Hi I am currently designing the API for an existing PHP application, and to this end am investigating REST as a sensible architectural approach. I believe I have a reasonable grasp of the key concepts, but I'm struggling to find anybody that has tackled object hierarchies and REST. Here's the problem... In the [application] business ...

How do I abort object instance creation in Python?

I want to set up a class that will abort during instance creation based on the value of the the argument passed to the class. I've tried a few things, one of them being raising an error in the __new__ method: class a(): def __new__(cls, x): if x == True: return cls else: raise ValueError Thi...

alert() message isn't being called in my form

Firebug is giving me no error messages, but it's not working. The idea is regardless of whether the user picks an option from dropdown or if they type in something in search box, I want the alert() message defined below to alert what the value of the variable result is (e.g. {filter: Germany}). And it doesn't. I think the javascript brea...

javascript function overloading

Can I do the following? function contains(element) { // if the element is a Vertex object, do this if (element instanceof Vertex) { var vertex = element; for ( var index in self.verticies) { if (self.verticies[index].id == vertex.id) { return true; } } return false; } // else if the element is an Edge object, do ...

PHP return value

If a static method returns an object .. can I in one line get one of the objects attributes? Something like this but in a single line : $obj = Parser::GetFirstItem(); $strTitle = $obj->Title; ...

regex: read character behind number

i have regex code: <script type="text/javascript"> var str = "kw-xr55und"; var patt1 = /[T|EE|EJU].*D/i; document.write(str.match(patt1)); </script> it can read: str= "KD-R55UND" -> as UND but if i type: str= "kw-tc800h2und -> result tc-800h2und. //it makes script read T in front of 800 i want the result as UND ...

how python manage object delete or destruction

Hi, guys, I am rather new to python and learning it to build a gui application (with wypython). I have a question related with object destruction in python. e.g. in myFrame I have onNew (create a new document) and onOpen (open a file) method. briefly, it looks like this. def onNew self.data=DataModel() self.viewwindow=ViewWind...

How to convert the Object[] to String[] in Java?

Hi, everyone, I have a question about Java. I have an Object[] (Java default, not the user-defined) and I want to convert it to a String[]. Can anyone help me? thank you. ...

Accessing class element - a variable or array element?

How would I access the 14.95 here? $object->{0} or $object[0] doesn't work SimpleXMLElement Object ( [@attributes] => Array ( [currencyID] => USD ) [0] => 14.95 ) Interesting... If I do (int)$object->{0} it works.... ...

How to declare a dynamic object array in Java?

Hi, everyone, I want to ask a question about Java. I have a user-defined object class, student, which have 2 data members, name and id. And in another class, I have to declare that object[], (e.g. student stu[?];). However, I don't know the size of the object array. Is it possible to declare an object array but don't know the size? than...

Object name from String in Objective-C

Hi, i want to set the name of an object like UIButton from a string. NSString *string = [[NSString alloc] initWithString:@"someString"]; UIButton *(string) = [[UIButton buttonWithType:UIButtonTypeCustom]retain]; My goal is: UIButton *someString = [[UIButton buttonWithType:UIButtonTypeCustom]retain]; how can i solve this? ...

Questions regarding object type conversion in Java

Hi, I have a question regarding type conversion in Java as follows: suppose I have a class: class A { public void m() } Now I do: A a1 = new A(); // (1) a1.m(); // (2) Object o = new A(); // (3) o.m(); // (4) We can say line (1) as: a1 contains the memory address of the new object A() (created in ...

Check if the typeof(object) in a List is a reference type

Hello, this seems odd to me: if(customerList.Count > 0) { if(typeof(customerList[0]).IsReferenceType) { // do what I want } } How would you do it? ...

Sorting array of type of object respecting to one of the object values

i have a class called student, the class have two elements (Name, ID). in my main class, i have created about 10 students in an array i called it students, now i want to sort the the students array respecting the ID, or the name!! if i used this line of code array.sort(students); is there a way to use the sort method and choose whi...