instance

VB.NET: Get class name of a instance

Is there a way to get the instance's class name with VB.NET? ...

Custom classes in python: does a method HAVE to be called with an instance?

I'm processing data from an application that has a few quirks in how it keeps time. One of the simpler quirks is that it uses "day of year" (Jan 1 is 1, Febuary 1 is 32, etc) instead of month + day. So I want to make my own date class that inherits from the default datetime class and has a few custom methods. I'm calling this daytime. In...

Examples of multiple instance javascript widgets (on same page)?

Apologies for the quick question, but I'd like to see some sample widgets that allow multiple instances in the same page. (Articles about this technique would also be good!) Digg's widget allows this (http://about.digg.com/downloads/widgets) but I don't know of any others. Do you? Thanks. ...

Is there a built in way to identify instances of a class?

I am doing some diagnostic logging with one of my C#.NET projects and I would like to be able to log an identifier that represents a specific instance of a class. I know I could do this with a static variable that just gets incremented every time a class instance is created but I am just wondering if there is any built-in way in the .NET...

Java - only allow once instance of application

Possible Duplicates: How to implement a single instance Java application? How do I make sure only one instance of my program can be executed? What is a good and easy way to achieve this? I've read methods involving binding to a port. Will this interfere with other applications using the same method? ...

Why is my constructor being called over and over?

I've got the following h file: #ifndef GLOBAL_DATA_H_ #define GLOBAL_DATA_H_ class GlobalData { public: GlobalData(); ... private: ... }; namespace global_data { static GlobalData globalDataInstance; } #endif Countless files include the header file above, and access global_data::globalDataInstance. If I put a bre...

C# - Adding an Event Handler for all instances of a class.

I have to add an unknown number of buttons to a form in WPF (It's actually a toolbox whose element are loaded dynamically). I'm looking for a way to make one event handler for all of these instances. Is this possible? And they're not exactly just buttons, It's a class that inherits the Button class and has some other member variables. Wi...

Add dynamic instances of MovieClips to an array.

I'm trying to add an instance of a MovieClip inside an array. Inside the House Class is a property called HouseObjects. Inside that array, I created a Comp and a Light class. MovieClips are dynamically placed on the stage, via linkage. The MovieClips also act as "toggle buttons." If the button state is ON, value is 1. If the button state...

C# creating common instance

My question is why does this line - ThreadTest tt = new ThreadTest(); in below example create a common instance not a separate instance. Please advise, thanks! class ThreadTest { bool done; static void Main() { ThreadTest tt = new ThreadTest(); // Create a common instance new Thread (tt.Go).Start(); tt.Go(); } ...

How do i access a class instance's parent in PHP ?

The only object oriented programming experience I have is from C#, so PHP is throwing me some curve balls I could use some help with. I have a class I use for all my pages, the "pagebase" if you will. It handles the lowest level html structure. That class is inherited by several other classes. Those classes are the different page types ...

Flex 3 Accessing IncludeInLayout in Component Instance

Hi, I've got a Flex 3 question about using includeInLayout with a component instance. So, to access the instance of my component, I used something like this: var _myCard:Card = this["card"+cardNum]; I wanted to "turn-off" the datagrid in the component, so I used bindings on "includeInLayout" and "visible": if(myArray.length == 0){...

EJB3 Caching Instance Variables

Hi, I've noticed some strange code on a project I am working on - its a SLSB EJB3, and it uses a private instance variable to maintain a cache of data (it even calls it dataCache or something), with a getter/setter. For EJB2 and bellow, this was a typical EJB antipattern - SLSBs are not meant to retain state in between invocations, ther...

Java: newInstance of class thas has no default constructor

I'm trying to build an automatic testing framework (based on jUnit, but that's no important) for my student's homework. They will have to create constructors of some classes, and add them methods. Then, with the testing functions I provide, they will check if they went allright. What I want to do is, by reflection, create a new instanc...

java StackOverflowError when local and instance objects creation

Hi can anybody please explain me why is this code snippet giving me StackOverflowError I really appreciate if you can explain what is happening when instanceObj initializing and calling ObjectTest constructor and java.lang.Object constructor. It seems to me ObjectTest constructor loop over and over.But I don't know exact reason? So any ...

php - automatically create an instance of myClass.

I have a class called myClass in /myDir/myClass.php. When user types url: http://mysite.com/myDir/myClass.php, I want to automatically create an instance of myClass. What technique can I use to do this? the idea is to use myDir directory as top level of programs that user can call directly, but I don't want to add instance_of_myCl...

Dynamically place instances of MovieClip on stage (AS3)

I'm trying to dynamically place instances of MovieClip on the stage. Receiving an error: TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChild() ActionScript: // properties in class ---------- var circle_ary:Array = new Array; var circ_num:int;//...

hitTestObject on dynamically placed MovieClip instances

Trying to do hitTestObject on instances that are dynamically placed on the stage. Receiving an error: TypeError: Error #2007: Parameter hitTestObject must be non-null. at flash.display::DisplayObject/_hitTest() at flash.display::DisplayObject/hitTestObject() at eatCircle() ActionScript: var circ; var circle_ary...

Try to make a process that can TSKILL itself

So I have a problem with a process that I am running, whenever I try to stop it using process.destroy(), it does not stop. I want to create a file (ProcessHandler) that extends Process and do the following: ProcessHandler process = (ProcessHandler)Runtime.getRuntime().exec("cmd.exe /c \"java net/com/codeusa/Server 43594\""); So, my p...

Java instance variable declare and Initailize in two statements

Hi I'm having problem with initialization in java, following code give me compile error called : expected instanceInt = 100; but already I have declared it. If these things relate with stack and heap stuff please explain with simple terms and I'm newbie to java and I have no advanced knolwedge on those area public class Init { int...

redirect and index.php to automatically instance php classes

I would like to create an apache redirect of all .php requests in a specific directory to index.php. In index php I would like to include the file and create an instance of the class. for example: mySite.com/directory/classname.php would be re-directed to mySite.com/directory/index.php index.php would automatically include_once class...