object

the class RotateTransform3D

Hi All, I have a 3D cone (called as "conemodel") produced by a method. This cone will be rotated in C# code and added to XAML Viewport3D group after rotated by an angle. Code snippet : public static void CreateTriangleFace(Point3D p0, Point3D p1, Point3D p2, Color color, Viewport3D viewport3d) { ...

A Method that returns true if the Temperature objects represents a temp below freezing point (JAVA)

I'm trying to write a method named isLowerThanFreezing that returns true if the Temperature object represents a temperature below the freezing point for water (32.0 F, 0.0 C, or 273.15 K), and false otherwise. This method should include only one inequality (i.e, one comparison formed using <, <=, >, or >=), which can be accomplished by d...

Why is the output this? (Java)

This is an instance method from a Rectangle class where we modify the x and y coordinates of the rectangle and its width and height public void modify(int newX, int y, int width, int h) { int x = newX; this.y = y; width = width; this.height = height; } Rectangle r3 = new Rectangle(0, 0, 10, 10); r3.modify(5, 5, 50, 50);...

javascript object arrays

I need to migrate a code in java to javascript. In java, I am maintaining a hashmap with key = string and value = arraylist of objects I need to implement the same in javascript: this.hashMap = new Hash(); this.hashMapArrayList =[]; ... var hashMapDataSet = new HashMapDataSet(id1,name1,type1); this.hashMapArrayList[0] = hashMapDataSet;...

Javascript HTTP Request Queue within object variable - initialization doesn't work

Hi folks, I got the following Request Queue implementation from this blog: http://dsgdev.wordpress.com/2006/10/28/building-a-javascript-http-request-queue/ and want to wrap it with a object variable. Unfortunately the variable initialization inside doesn't work. Hope someone can help me with this stuff. Thanks in advance var reque...

Using jQuery to compare two arrays

Hi all, I have two arrays of JavaScript Objects that I'd like to compare to see if they are the same. The objects may not (and most likely will not) be in the same order in each array. Each array shouldn't have any more than 10 objects. I thought jQuery might have an elegant solution to this problem, but I wasn't able to find much onlin...

Method accessing protected property of another object of the same class

Should an object's method be able to access a protected property of another object of the same class? I'm coding in PHP, and I just discovered that an object's protected property is allowed to be accessed by a method of the same class even if not of the same object. In the example, at first, you'll get "3" in the output - as function r...

How to pan in 3DTools:TrackBallDecorator

Hi All, I want to pan a 3D object in 3DTools:TrackBallDecorator. It is possible rotating and zooming in 3DTools, but I don't know how to pan. I use VS 2008 C#. My project has XAML codes. Please, help !... Thanks ...

How to Pass Dummy jQuery Object to Javascript function

Hello all, I have a javascript function that, in most cases, needs to do something with a jQuery object that I pass it. There is a single exception where the function will not need a jQuery object, but because I've written it to accept a string (the command) and a jQuery object, I need something to pass it when I call it. My function is...

calling a class with ajax

I need some help with this please I can't get a handle on it. The problem is that I want to call a class method, in this case with static methods with an ajax call. I have put the helper class in the same folder as the script that is called by ajax for easy referencing and try to include it. Could it be that my refencing is wrong? If...

PHP - OOP - Storing big objects to be saved in session

I'm trying to set up a new class for my web application, rewriting my code starting from original procedural programming. Since I need to populate my object using many different(complex) queries, and this object'll be stored in session, I decided to create another static class containing all long queries. Is it more convenient to define...

Object Positioning Algorithm

I'm wondering if there is an "optimal" solution for this problem: I have a n x m (pixel) sized space with p preexisting rectangled - objects in various sizes on it. Now I want to place q (same sized) new objects in this space without any overlapping. The algorithm I came up with: Create array A[][] with the size [(n)/(size_of_object_...

Java ArrayList Help!

I am working on learning java a little, and i found this question in a java text book on Google books, I have been working on it for a while, and for some reason these seems like it should be simple. Anyone bored and would like to show me what this is suppose to look like in Java code?? (Using ArrayList) Write a program that creates an ...

How to serialize StringFormat in GDI+?

I am coding in GDI+ C++, I want to serialize StringFormat into file. How can I do this ? Many thanks! ...

Classical vs Prototypal... how are they so different?

for example in PHP class foo{ function foo($name){ //constructor $this->name=$name; } function sayMyName(){ return $this->name; } } class bar extends foo{ function sayMyName(){ return "subclassed ".$this->name; } } And in JS function foo(name){ this.name=name; } foo.prototype.sayMyName=function(){return th...

setting one class to aonother database object

hello i am trying to initialize the class object to a database object like this [frn setBuymeObj:infoObj]; but the object 'frn' is getting nil values while there are values in infoObj. I don't know what's the reason ... Help me out of this issue.. thanks in advance ...

Using super with a class method

I'm trying to learn myself the super() function in Python. I though I got a grasp of it untill I came over this example (2.6) and found myself stuck. http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html#super-with-classmethod-example Traceback (most recent call last): File "<stdin>", line 1,...

Object reference problem

Hi guys! Following problem: I would like to build a little clipboard with jQuery. I have tried several times to store an object in the data of a javascript object with $(object).data('id',objectToStore). Objects can be stored there that works fine. The problem is if I try to insert the stored data I only get a reference to that object....

GWT + Object Persistence + Maintaining Data In Memory

Hi, I am currently carrying out research for the design and implementation of a web-based RSS aggregation system, with the aim being the use and evaluation of recommendation algorithms. This system will require a relatively interactive web-based UI (hence my interest in using GWT) and some form of data persistence to store RSS feed det...

Null Object Pattern, Recursive Class, and Forward Declarations

Hi folks, I'm interested in doing something like the following to adhere to a Null Object design pattern and to avoid prolific NULL tests: class Node; Node* NullNode; class Node { public: Node(Node *l=NullNode, Node *r=NullNode) : left(l), right(r) {}; private: Node *left, *right; }; NullNode = new Node(); Of course, as written...