class

Define 'poco'?

Can someone define what exactly 'poco' means? I've encountering the term more and more often and I'm wondering is it only about plain classes or it mean something more? ...

C++: ctors for structs?

C++: Since a struct is a class with everything "public", are default -ctors created and called? The reason I ask is to understand the overhead, if any, that C++ may have over C, when structs are used. An opinion I have heard is that classes have some overhead that structs don't, in C++, but I question this. ...

Jython and Java nested class

Hi, I'm using Jython to write tests for a Java project. It works well, but I can't figure how to get access to a java public nested class. package mypackage; public class NyClass { public class MyNestedClass { ... } } Does somebody knows how to do this? ...

Static nested class in Java, why?

Hi All, I was looking at the Java code for LinkedList and noticed that it made use of a static nested class Entry. public class LinkedList<E> ... { ... private static class Entry<E> { ... } } What is the reason for using a static nested class, rather than an normal inner class? The only reason I could think of, was so that Entry ...

Classes: Public vars or public functions to change local vars?

Exactly what the topic title says, In which cases would you prefer using public functions to change local variables over just defining that variable as public and modifying it directly? ...

Techniques to remove dependencies?

Scenario: An event is raised in class A that needs to be handled by a method in class B. (currently via a delegate) The data that gets passed from the event to the method is currently wrapped in class C. This obviously requires class B to be dependent on class C. Is there any techniques/refactoring that i can perform in order to remove...

javascript problem

i have a php script and i'm using ajax with it . i have a textarea form connect with the ajax class the problem when i pass a text like ( &some text ) the function return an empty text ,i geuess that i have a problem with (&) , what is the problem here ? here the javascript function function sendFormData(idForm, dataSource, divID, if...

Java Class Accessibility

Slightly related to my other question: What is the difference between the following: private class Joe protected class Joe public class Joe class Joe Once again, the difference between the last 2 is what I'm most interested in. ...

Searching for the best PHP nested sets class (PEAR class excluded)

I'm looking for a PHP (with MYSQL) nested sets class with all needed functions. For example: createLeftNode, createRightNode,createRootNode, createSubNode,deleteNode and moveTree. Not only 1 left, 1 right, 1 up and 1 down but also a part of a tree in a nother tree. Thanks! ...

Access Response Object in a class ASP.NET

I have a function that checks if a cookie (by name) exists or not: Private Function cookieExists(ByVal cName As String) As Boolean For Each c As HttpCookie In Response.Cookies If c.Name = cName Then Return True Next Return False End Function I have a class that handles cookies in an application-specific manner, and I ...

Visual Studio: How do I show all classes inherited from a base class?

In Visual Studio, How do I show all classes inherited from a base class? For example, in ASP.NET MVC there are several 'ActionResult' types -- and they all inherit from / implement the base class 'ActionResult'. It looks like unless you just 'know' that 'View' and 'Json' are valid 'ActionResult' types, there is no way you can easil...

C++ Opening a file and inputting data to a class object

Simple question, hopefully an easy way and just want to verify I'm doing it the correct / efficient way. I have a class T object, which is typically put into a vector that is created in my main() function. It can be any kind of data, string, int, float.. etc. I'm reading from a file... which is inputted from the user and passed onto t...

VBA: Add property to class

I would like to do something like add a nice-to-Excel-functions Name property to the WorkBook class. Is there a good way to do this? More detailed problem: In VBA you can assign a formula to a range in an Excel worksheet. I want to do so, and I want my formula to refer to a second workbook, which is an object called wb in my code. I the...

In C++ You Can Have a Pointer to a Function, Can you also have a pointer to a class?

I'm not talking about a pointer to an instance, I want a pointer to a class itself. ...

How does one - without inheritance - override a class method and call the original from within the new method?

I found one source which successfully overrode Time.strftime like this: class Time alias :old_strftime :strftime def strftime #do something old_strftime end end The trouble is, strftime is an instance method. I need to override Time.now - a class method - in such away that any caller gets my new method, while the new me...

How to build a PHP form Dynamically with OOP?

How would I go about creating a real world form creation class that I can use to display a new form with fields of different types, as how many fields I want, I can use drop downs and I can do all of this by using OOP? ...

Are there any static duck-typed languages?

Can I specify interfaces when I declare a member? After thinking about this question for a while, it occurred to me that a static-duck-typed language might actually work. Why can't predefined classes be bound to an interface at compile time? Example: public interface IMyInterface { public void MyMethod(); } public class MyClass //D...

C++: Derived + Base class implement a single interface?

In C++, is it possible to have a base plus derived class implement a single interface? For example: class Interface { public: virtual void BaseFunction() = 0; virtual void DerivedFunction() = 0; }; class Base { public: virtual void BaseFunction(){} }; class Derived : public Base, public Interface { ...

Script for College Class Registration

I sign up Spring courses tomorrow morning (transferring in to the Computer Science program). Since I'm a transfer student, I get the last pick of leftover classes not already taken. Emphasis on 'last pick' and 'leftover'. It's highly probable that whatever classes I intend on picking tomorrow, I might not even get because other students ...

Variable variable class extensions in PHP--is it possible?

Is something like the following possible in PHP? $blah = 'foo1'; class foo2 extends $blah { //... } class foo1 { //... } This gives an error. I want to dynamically set $blah so I can extend whatever class I want. Edit: The reason for wanting to do this because I wanted to use a function out of another class in a related cl...