class

How to get the instance name of an object

I use the below code to write code to query a web method in a specified interval. now in the this.Poll function I have to do this.tmo = setTimeout(this.strInstanceName + ".Poll()", this.iInterval); instead of this.tmo = setTimeout(this.Poll(), this.iInterval); because IE looses the this pointer after setTimeout So I have to pass...

Implement abstract class as a local class? pros and cons

Hi, for some reason I'm thinking on implementing interface within a some function(method) as local class. Consider following: class A{ public: virtual void MethodToOverride() = 0; }; A * GetPtrToAImplementation(){ class B : public A { public: B(){} ~B(){} void MethodToOverride() { /...

Specifying different page base classes for different directories in your web.config file

I have a website (coded in vb.net) with an "admin" section (the admin section being a folder in the actual site)... So in every page of the site I'm using my own custom class as the page base (which has been set in the web.config file) but I want to inherit from different class for the files in the "admin" folder... Is there any way to i...

Any way to force classes to have public static final field in Java?

Is there a way to force classes in Java to have public static final field (through interface or abstract class)? Or at least just a public field? I need to make sure somehow that a group of classes have public static final String TYPE = "..."; in them. ...

java question: Is it a method?

Hello, I'm no Java guy, so I ask myself what this means: public Button(Light light) { this.light = light; } Is Button a method? I ask myself, because it takes an input parameter light. But if it was a method, why would it begin with a capital letter and has no return data type? Here comes the full example: public class Butt...

Is it a good idea to create a class for object identified by names?

I have a list of services which can be identified by names. Every service has a set of parameters (IP address, port, availability and so on). There are also method which can be applied to the services (close connection, open connection, send a message to the server, check if it is responding and so on). So, I thought it is a natural app...

Using Adldap php class, but getting error when looking for group user belongs to

<?php ini_set('display_errors',1); error_reporting(E_ALL); require_once('/include/adLDAP.php'); $adldap = new adLDAP(); $username = "user123"; $password = "pass123"; $authUser = $adldap->authenticate($username, $password); if ($authUser === true) { echo "<p>User authenticated successfully</p>"; ...

Should this immutable struct be a mutable class?

I showed this struct to a fellow programmer and they felt that it should be a mutable class. They felt it is inconvenient not to have null references and the ability to alter the object as required. I would really like to know if there are any other reasons to make this a mutable class. [Serializable] public struct PhoneNumber : IEquata...

PHP pagination class

I am looking for a php pagination class, I have used a rather simple one in the past and it is no longer supported. I was wondering if anyone had any recommendations ? It seems pointless to build my own when there are probably so many good ones out there. Thanks in advnace! ...

GAE - Getting TypeError requiring class instance be passed to class's own method...

I'm really new to programming... I set up a class to give supporting information for Google's User API user object. I store this info in the datastore using db.model. When I call the okstatus method of my user_info class using this code: elif user_info.okstatus(user): self.response.out.write("user allowed") I get this error: un...

document.getElementById not working for <a> tag

hi, I'm very new to js so kindly help me with this. I am trying to add a class to a tag using onClick. The code is as shown below: <a class="gkvSprite" href="#" id="abc" onClick="showhide('1')">Click 1</a> <a class="gkvSprite" href="#" id="def" onClick="showhide('2')">Click 2</a> <a class="gkvSprite" href="#" id="hij" onClick="showh...

Class parameter in Faces Config

Is there a way to pass a class into a property as a Class object? i.e. <managed-property> <property-name>clazz</property-name> <value>java.lang.Double.class</value> </managed-property> ...

Passing class instances between applications in Android.

Hi I have an application App1 which defines class A and uses instances of this class. What I want to achieve is - after App1 is installed on the device to be able to load App2 which defines and implements class B which is subclass of class A (imported from App1 package); and be able to get an instance of class B in the App1. Class B doe...

Class Plugins in PHP?

i just got some more questions while learning PHP, does php implement any built in plugin system? so the plugin would be able to change the behavior of the core component. for example something like this works: include 'core.class.php'; include 'plugin1.class.php'; include 'plugin2.class.php'; new plugin2; where core.class.php conta...

Problem using in GWT project classes from other project/source folders

My project contains 2 source folder, one is generic J2EE application another is smartCleintGWT, I want to use some already existing DTO classes from first source folder (src) Note that class used on client side and on server side of GWT project! When I do that I getting error [ERROR] Errors in 'file:/C:/..Projects/Admin/DMX/src_conso...

IBOutlet is NIL when using Forward Declarations to call a class?

I have been having huge issues with this, so I drew a diagram... I successfully get to the CLASS A - METHOD B but at that point, IBOutlet Z is Nil? :( Any ideas? note Somebody told me it might be an Overrelease and to use NSZombieEnabled but that confused me ...

Is there a way to circumvent Python list.append() becoming progressively slower in a loop as the list grows?

I have a big file I'm reading from, and convert every few lines to an instance of an Object. Since I'm looping through the file, I stash the instance to a list using list.append(instance), and then continue looping. This is a file that's around ~100MB so it isn't too large, but as the list grows larger, the looping slows down progress...

Class Cast Exception

why do i get this exception? Map myHash = null myHash = (HashMap)Collections.synchronizedMap(new HashMap()); If i try to use this hashmap, i get java.lang.ClassCastException ...

php class basic question

hi <?php class myClass { var $input; var $output; function myClass($input) { $output = 'You entered: ' . $input; return $output; } } $test = new myClass; echo $test->myClass(123); ?> this works, but returns this warning: Warning: Missing argument 1 for myClass::myClass() I read in to this, and seems that the constructor ...

Binding type variables that only occur in assertions

Hi! I find it extremely difficult to describe my problem, so here goes nothing: I have a bunch of assertions on the type of a function. These assertions rely on a type variable that is not used for any parameter of the function, but is only used for internal bindings. Whenever I use this function it does not compile because, of course, ...