instance

Do you prefix your instance variable with 'this' in java ?

And... we have another QAW (Quality Assurance War) on our hand. After reading the more generic "What kind of prefix do you use for member variables?" question, I tried to argue with my QA department about the advantages to always add 'this' before instance (or member) variables in java code. They are not convinced. I know there is a si...

SQL 2005 Express Edition - Install new instance

Looking for a way to programatically, or otherwise, add a new instance of SQL 2005 Express Edition to a system that already has an instance installed. Traditionally, you run Micrsoft's installer like I am in the command line below and it does the trick. Executing the command in my installer is not the issue, it's more a matter of dragg...

Performance of using static methods vs instantiating the class containing the methods

I'm working on a project in C#. The previous programmer didn't know object oriented programming, so most of the code is in huge files (we're talking around 4-5000 lines) spread over tens and sometimes hundreds of methods, but only one class. Refactoring such a project is a huge undertaking, and so I've semi-learned to live with it for no...

Singleton in Java - I didn't do it

I'm trying to track down an issue in our system and the following code worries me. The following occurs in our doPost() method in the primary servlet (names have been changed to protect the guilty): ... if(Single.getInstance().firstTime()){ doPreperations(); } normalResponse(); ... The singleton 'Single' looks like this: private ...

Python object deleting itself

Why won't this work? I'm trying to make an instance of a class delete itself. >>> class A(): def kill(self): del self >>> a = A() >>> a.kill() >>> a <__main__.A instance at 0x01F23170> ...

Get all named instances in a flash movie

Is it possible to get a list of all instances with a name in a flash movie using actionscript 2. Like an array containing all named text areas, or all movieClip instances etc. I would like to get this so the designer can add or remove text areas etc. and the actionscript can dynamically find these and get the texts from a separate dataso...

Trying to connect internally to Oracle, getting an idle instance?

So I have an Oracle instance, and I know it's running on this system, I've su'd to the oracle user, and I'm trying to connect using "/ as sysdba". However, when I do connect, it says the instance is idle. I know the database is up and opened, because my application's talking to it. My paths (ORACLE_HOME, etc.) might be incorrect: any ...

CLR stored procedure calling .NET class instance

Hi, I codded a CLR stored procedure (listed below) The line of code where the exception is thrown was added just for the purpose of having the exception logged in EventLog I deployed the assembly and created the stored proc in database However when I execute the stored procedure no entry is logged in Windows' EventLog If the code wh...

C#: Get list of open windows form instance that are excuted from different assembly.

I have a 'loader app' that loads a menu and when user clicks the menu image button a list view opens based on the text (if text = employee) (Go to class A) (Go to class B) ... ... (Show List View Window) if he clicks again on the same button it opens again, I would like to prevent this.Any ideas? i.e but this for a WPF...

WPF Enforce only ONE instance of application

How do I allow only one instance of a WPF application to run? Thanks. ...

Addressing instance name string in __init__(self) in Python.

I am doing something like this: class Class(object): def __init__(self): self.var=#new instance name string# How do I make the __ init __ method of my instance to use the instance name string for 'c'? Say in case: c=Class() I want c.var equal to 'c'. Thanks for your replies, I am implementing persistence and Class is p...

How do i tell if one instance of my program is running?

How do i tell if one instance of my program is running? i thought i could do this with a data file but it would just be messy :( i want to do this as i only want 1 instance to ever be open at one point. Edit: Re-tagged ...

Need to route instance calls inside a python class

The problem is a need to take the arguments into account before choosing the responder. Here is my attempt so far. from responders import A, B, C class RandomResponder(object) def init(self, *args, *kwargs): self.args = args self.kwargs = kwargs def __getattr__(self, name): # pick a responder based on t...

Free Available databases over Internet for connecting?

There are available any free instance database over Internet? I mean, there are any Oracle/MySQL/SQLserver database instance (read only is enough) in which I can connect for free (may be registering, of course)? ...

Shared Objects in Cocoa

Hey guys. I'm working with CoreData in Cocoa (not document-based). My problem is, that I want to access the SAME NSArrayController from different NIBs. But every NIB has an own instance of this NSArrayController. My question is now how I could generate sharedObjects (like the NSUserDefaultsController). It would help me a lot. Thanks fo...

Object reference not set to an instance of an object.

I usually get this error and (always) don't know how to solve it. This time I got it also, it seems that I'm not understanding a concept or missing something Here's the code // create a new twitteroo core with provided username/password TwitterooCore core = new TwitterooCore(username, password); // request frien...

PHPExcel: scientific notation of double/float

The problem is the following: We are creating an instance of a class testObject and fill a var with a double. A class TestExcel extends from PhpExcel and when submitting the object testObject into the constructor we get a scientific notation of the var when we do a var_dump. Can anyone help us out. My colleagues and I don't understand ...

PHP object keeping

Let's say that in my app I have an object instance created on page 1. The user then goes to some other part of app and I want the instance to remain. How can I 'save' the instance? Sessions? ...

Why can't I store a PHP class instance as a SESSION variable

I have a PHP script that is called in 2 ways from a Dojo Ajax xhrGet call. The first time it is called with an "init" argument which causes the script to create an instance of the StateList class and read in a file of state names. session_start(); @include('StateList.php'); require_once('phplog.php'); //start executing here $comd=$_GET...

How to use self class method on iPhone? (conceptual question)

I write an instance method in ClassName.m: -(void)methodName:(paraType)parameter {...} And call it using [self methodName:parameter]; A warning will pop up, but the code still runs successfully. Is this because I haven't created an instance of the class? Why the method still runs normally? And what is the correct way to call self meth...