objects

Nested Dynamic PHP Class

Alright, I may just need a terminology update, but I have been playing in Magento and Joomla, and they do references like $mage = new Mage; $mage->block('blockname'); where class Mage through some process I am failing to figure out is calling: class blockname extends something{ } Don't quote me on that code, however I am looking t...

WCF returning custom types

Hi. I'm a newbie to WCF, trying to perform relatively simple task. I'm trying to return list of objects read from the database but cannot overcome some really annoying exceptions. The question is very simple? What's wrong with the picture? [ServiceContract] public interface IDBService { [OperationContract] string Ping(st...

initialization of objects in c++

I want to know, in c++, when does the initialization of objects take place? Is it at the compile time or link time? For ex: //file1.cpp extern int i; int j=5; //file2.cpp ( link with file1.cpp) extern j; int i=10; Now, what does compiler do : according to me, it allocates storage for variables. Now I want to know : does it also p...

Calling a method on an object a bunch of times versus constructing an object a bunch of times

I have a List called myData and I want to apply a particular method (someFunction) to every element in the List. Is calling a method through an object's constructor slower than calling the same method many times for one particular object instantiation? In other words, is this: for(int i = 0; i < myData.Count; i++) myClass someObje...

Does this copy the reference or the object?

Sorry, I am being both thick and lazy, but mostly lazy. Actually, not even that. I am trying to save time so I can do more in less time as there's a lot to be done. Does this copy the reference or the actual object data? public class Foo { private NameValueCollection _nvc = null; public Foo( NameValueCollection nvc) { ...

Newb Question: passing objects in java?

Hello, I am new at java. I am doing the following: Read from file, then put data into a variable. I have declared the checkToken and lineToken as public strings under the class. public static void readFile(String fromFile) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(fromFile)); St...

Python access an object byref / Need tagging

I need to suck data from stdin and create a object. The incoming data is between 5 and 10 lines long. Each line has a process number and either an IP address or a hash. For example: pid=123 ip=192.168.0.1 - some data pid=123 hash=ABCDEF0123 - more data hash=ABCDEF123 - More data ip=192.168.0.1 - even more data I need to put this data...

How to parse text as JavaScript?

This question of mine (currently unanswered), drove me toward finding a better solution to what I'm attempting. My requirements: Chunks of code which can be arbitrarily added into a document, without an id: <div class="thing"> <elements... /> </div> The objects are scanned for and found by an external script: var things = yd.ge...

How do you add multiple values to a Dictionary Class in VBA 6.5

I am designing a program behind excel and using VBA 6.5. I am having some problems with the built in dictionary object. I understand the basics and have found numerous examples on how to add simple data to them but I'm more concerned with custom objects. My problem: I have an object with several constructors - X, Y, Yf, A, P, etc. Now t...

How to sort an array of objects(Points) in Java?

Hi, So I wanna sort an array of Points using the built in sorting method, by a specific coordinate, say x. How can I do this? Heres a sample code: Point A[] = new Point[10]; // ... Initialize etc. Arrays.sort(A, x-coordinate); Is there a built-in comparator for x-coordinates in Point Class? If not, how can I create one and use it. An...

Object method gone after obj.prototype = new ParentObj(); in JavaScript

Hi, I am trying inherit objects in JavaScript. Take a look at this example: var BaseObject = function() { }; var ChildObject = function() { }; ChildObject.prototype.childMethod = function() { }; ChildObject.prototype = new BaseObject(); ChildObject.prototype.constructor = ChildObject(); However, as soon as I do prototypal inherita...

Java execution speed

I'm new to Java programming. I am curious about speed of execution and also speed of creation and distruction of objects. I've got several methods like the following: private static void getAbsoluteThrottleB() { int A = Integer.parseInt(Status.LineToken.nextToken()); Status.AbsoluteThrottleB=A*100/255; Log.level1("Absolute T...

Extjs 3.x: Can I make a panel or a container movable?

I have an Ext.Container and I need to add to it a user-movable object. I see elsewhere that an Ext.Window is not supposed to be nested into objects, thus what are my options regarding other movable Ext objects? Regards, Casper ...

How to iterate over an array of objects in JavaScript?

I'm using PHP to fetch "tasks" from my database and encoding it as JSON. When I transfer the data over to javascript, I end up with something like this: Array { [0] => Task { id: 2, name: 'Random Task', completed: 0 } [1] => Task { id: 8, name: 'Another task', completed: 1 } } etc. I gu...

Initializing constructor from stored cache in C#

I'm not sure exactly how to describe this question, but here goes. I've got a class hierarchy of objects that are mapped in a SQLite database. I've already got all the non-trivial code written that communicates between the .NET objects and the database. I've got a base interface as follows: public interface IBackendObject { void Re...

Iterating JavaScript object properties and arrays with for..in when ordering is important

This has been an age old question and I am aware of the usual reasons for not using for..in or perhaps even objects when any sort of ordering is needed, but I recently came across this article from MDC on the delete operator. Cross-browser issues Although ECMAScript makes iteration order of objects implementation-dependent, it may app...

ActionScript 3: how do you compare if the object where you clicked on is that type of object.

Hi all, I have a red box called mc1_mc and every time when you drag on it you get a new little blue box added to the stage. Yhe idea is that you can drag those blue boxes too. however I dont know how to detect them. this is the code: var newBlok:Boolean; var blokIndex:int = 0; var blokje:blok; var huidigBlok:DisplayObject; var prullen...

How to effeciently spread objects on a 2D surface in a "natural" way?

Hello all, i would like to effeciently generate positions for objects on a given surface. As you probably guessed this is for a game. The surface is actually a 3D terrain, but the third dimension does not matter as it is determined by terrain height. The problem is i would like to do this in the most effecient and easy way, but still g...

Global Objects iphone

What is the easiest way to create a global object. I have tried declaring the object outside the method with no luck. @implementation UV_TouchpadViewController; NSMutableString *string = [NSMutableString stringWithFormat:@"text"]; ...

Using object as iframe

I heard that iframes are deprecated in HTML5, and object tags should be used instead. But the page does not load from the frame. Im not familiar with object tags, do i need to specify a classid or type text/html? Here's the tag: <object src="http://site.com/"&gt;&lt;/object&gt; Am I missing something, or has my browser(Chrome 6) not ...