class

Should all Front Classes use singleton?

Consider Martin Fowler's Patterns Of Enterprise Application Architecture, and the pattern of Front Controller: http://martinfowler.com/eaaCatalog/frontController.html Apparently, it uses the singleton pattern. Well, I have a package of classes in php application that work together (like Zend's Controller Package) and there is one class t...

Making a winform form owner drawable

I have a form that I am attempting to override the WndProc subroutine on. I am using GetDCEx to get a DC handle to my form. According to Microsoft's documentation on using GetDCEx, my form must have the CS_OWNDC or the CS_PARENTDC flag set my window class in order to use GetDCEx. According to Spy++, my window does not have these class at...

Netbeans deleting a built class?

I have a NetBeans project with quite a few classes in it. I've been working on this project for the past 3 weeks, and just started having this issue today. When clicking the "Run Main Project" button in NetBeans, I see the following error: Exception in thread "main" java.lang.NoClassDefFoundError: stockscreener/Stock Caused by: java.l...

Java - GUI, Panel, and Data Accessing.

I'm making a game with three main panels and a few subpanels, and I'm confused about how you "connect" the panels and their data. I have my main class, which extends JFrame and adds three JPanels. Each of those panels is a subclass of JPanel. (Ex: JPanel gameControlPanel = new GameControlPanel(), where GameControlPanel is a class I crea...

C# Nested Classes, Clean up Declaration

Hello, Is there a way in C# to tidy up the following class declaration? namespace Application.Namespace { public class MasterClass { public class FlyingSaucer { public class Rotator { public class Cube { Still maintaining the class structure, just cleaning...

Months ago in ruby

I can't figure out a way (using class definitions) to get months ago. Seconds, days, and minutes are all fine because they're always constants. However since months isn't always constant, i need to know a way for ruby to know how many days are in the current month. ...

.NET class access modifiers (friend and public)

I am developing a class library that will be used in several projects. In my class library, I have a "Shape" Class which has a number of properties. One of these properties is "Dimensions" returns a class with "Height" "Width" and "Depth" properties. How would I suppress the Dimension class from being viewable in the editor, whilst fre...

Why the class variables does not stores values in php class?

Hello Friends! I just started study of class and object in php. I have a very small program which is as follows. <?PHP class GetUserPermissions { public $tab1; public $tab2; public $tab3; public $tab4; public function setMainPagePermissions() { try { $this->SetPermissionsSelection(1,0,5,0); } ...

Wordpress post image (details) default class

I want to set a default class for all images in a single post eg. they have a red border. How do i do that? Something like on http://net.tutsplus.com ...

Split a large view class in Java?

Hi I have large forms in my GWT webapp. I'm using SmartGWT. The problem is that the classes that implements the forms are too large. The main reason is because each form has one or two TabSets with multiple tabs. The question is: Should I split this classes? Maybe one per tab? Each class is responsible of instantiate the form (the most...

Obscure compiler error on piece of beginner C++ code

Hello guys, g++ is letting out an obscure error, undefined reference to '__gxx_personality_sj0' in two lines of my project. What does this mean in this context? I googled a lot and found out this is usually related to the inclusion of C code in C++ or something like that, which is not what I'm going for. (I know the code isn't high qual...

Error: Generic Array Creation

I don't understand the error of Generic Array Creation. First I tried the following: public PCB[] getAll() { PCB[] res = new PCB[list.size()]; for (int i = 0; i < res.length; i++) { res[i] = list.get(i); } list.clear(); return res; } Then I tried doing this: PCB[] res = ne...

How will an object with a value type and reference type be stored in .NET?

In .NET, integer data type is a value type(stack) and String is a reference type(heap). So If a class A has an integer, and a string type object in it, and a class B creates an object of class A, then how will this object of class A be stored in memory? In stack, or in a heap? This was asked in my Microsoft interview. Need to understan...

Dynamic SWF loading with out running the main class

I've been using SWFLoader and ModuleLoader to dynamically load SWFs. The problem I'm having before I instantiate any class it runs the creationcomplete event of the main class when I do the moduleInfo.load(). Is there a way to load the SWF without creating an instance of the main class? ...

How do you initialize a static templated container?

Hi, I'm trying to figure out the correct way of initializing a static container variable whose template value is a private inner class. Here's a toy example #include <vector> using namespace std; template <class myType> class Foo { private: class Bar { int x; }; static vector<Bar*> bars; }; template <class myT...

Make my own FIFO Queue class for my own class object to fill it?

Hello. I am trying to make a FIFO Queue that is filled with my own class object. I found this example but if I replace < E > with < PCB > it does not work: import java.util.LinkedList; public class SimpleQueue<E> { private LinkedList<E> list = new LinkedList<E>(); public void put(E o) { list.addLast(o); } public E ge...

Using "Static" Keyword to Limit Access in C++ Member Functions

I understand that one benefit of having static member functions is not having to initialize a class to use them. It seems to me that another advantage of them might be not having direct access to the class's not-static stuff. For example a common practice is if you know that a function will have arguments that are not to be changed, to...

Possible to return a String array

Is it possible to make a method that returns a string [ ] in java???? ...

How should I deal with object hierarchies in a RESTful API?

Hi I am currently designing the API for an existing PHP application, and to this end am investigating REST as a sensible architectural approach. I believe I have a reasonable grasp of the key concepts, but I'm struggling to find anybody that has tackled object hierarchies and REST. Here's the problem... In the [application] business ...

Function to create a tree of properties?

I am trying to create a List of properties for objects. I can create a list for basic objects just fine, but if I have a situation where type object A contains a property of type object B which contains a property of type object A.... well.. then I get infinite recursion. What I've done is added a static property to all of my objects ca...