class

Locked Classes with VBA/VB

I want to package my classes (in VBA or VB), but I want to put a lock on them before I do so. I want the computer to return a message similar to one in the Word file attached. Can anybody point me in the right direction? There doesn’t seem to be a lot of help in this regard. I would need something that would lock just the classes that I...

Class Library subclass

Hi everybody, I am required to find out if the following is a standard practice to create a subclass. Take for instance, I have to create a class library (ClLib) with 2 classes using Visual Studio: Class1.cs & Class2.cs. Next, I open up the .CSPROJ file of ClLib and modify the following line: Compile Include="Class2.cs" / to become ...

Direction of the association arrow in UML class diagrams

On this webpage which shows how to draw a class diagram, why is the arrow for association pointing from order to customer, and not from customer to order? UML Tutorial - Class Diagrams ...

Association of n to 1 objects in a UML class diagram

Is it safe to say that in a UML class diagram, if there is an association of n to 1 objects, then the association arrow is pointing from the class associated with n objects to the class associated with 1 object? n ----> 1 ...

python unbound method again

This gets me into difficult time (sorry, i am still very new to python) Thank you for any kind of help. The error print Student.MostFrequent() TypeError: unbound method MostFrequent() must be called with Student instance as first argument (got nothing instead) This Student.MostFrequent() is called all the way in the end (l...

No appropriate default constructor available?

I've got a peculiar error writing some C++/CLI code. I'm trying to make a copy of a class which holds some data. The class is defined as: public ref class RawDataPacket { protected: float* m_internalData; public: RawDataPacket(const float* newInternalData); RawDataPacket(const RawDataPacket^ rdp); RawDataPacket(RawDataPacket^ rdp)...

How to add a class depends on value with jquery.

From my question http://stackoverflow.com/questions/1908889/how-to-change-css-with-jquery, I now understant what I need to learn and what I want to do. I want to add class active or inactive depends on the value with jquery. For example changing <td align='center'><a href="http://127.0.0.1/ci/index.php/admin/pages/changePageStatus/21...

Invoking a method from a class

Hi all, I'm developing a serial port communication application. I've written a class. In serial port's DataReceived event, I need to invoke a method to do some string operations. I want to make these operations in another thread. But since my application is not a windows from application (it's a class only), it does not have the Invoke...

Advantages of Domain object representing only elements of one type over being able to represent several different types of elements

hi 1) As far as I’m aware, each domain object instance ( at BLL layer ) should completely represent an element of the domain ( an employee, book, car etc ). So what is an advantage of having two types of domain objects, say one type representing a particular forum and other type representing a thread(s) in that forum, over having ...

Alphabetizing functions in a Python class

Hi All, Warning, this is a sheer-laziness query! As my project develops, so also do the number of functions within a class. I also have a number of classes per .py file. So what I would like to do is re-sort them to that the function names are organised [sorry, UK here, I've already compromised hugely with the 'z' in Alphabetizing ;-)] ...

how do we compare 2 class names of an object

Is there a way to get compare class name betweeen 2 objects? Like: NSString *bla = [[NSString alloc] init]; if([bla class] isEqual: NSString]) NSLog(@"success"); unsure if my syntax is correct. ...

How to populate strongly typed viewdata from a base controller?

All my controllers are based off of a BaseController, to share properties between them and override OnActionExecuting to set some values based on the route. I'm creating a BaseViewData class to do the same for all my view data. At the moment I'm populating the view data like so (C#): var viewData = new BaseViewData { Name = "someN...

Can a Grails Domain Class inherit from a class that is not a domain class?

I tried to do this, but it insists on their being a table of the base class. I tried using tablePerHierarchy false as well and that didn't make any difference. I have a few domain classes that share a bunch of methods that operate on an inherited transient field. I had hoped that just having the class over in the non-domain secti...

What is the proper way to handle module level arrays in a VBA class?

What is the proper way to handle a module level array in a VBA class? I use Property Let and Property Get for other variables, but I haven't figured out how to pass arrays to and from Properties. Updated. This code works thanks to Mark Nold. Option Explicit Private mstrTestArray() As String Public Property Get TestArray() As String(...

Set Container class value from contained class

Sounds a simple question but haven't found a way to do, so would solicit any responses I get. I have a winform which in turn contains a user control object. based on some condition in the user control, i have to set a value in the winform. One way could be to pass the winform object as parameter to user control but that would give cycl...

Dynamically creating instance variables in PHP classes

Hey all, I'm not sure if this is a trivial questions but in a PHP class: MyClass: class MyClass { public $var1; public $var2; constructor() { ... } public method1 () { // Dynamically create an instance variable $this->var3 = "test"; // Public....? } } Main: $test = new MyClass(); $test->method1()...

C# directives & namespace problem

Hi everybody, I have a problem here. I have a class library namely ClLib, and has the following 8 cs files. Express (parent class) - 1E1 - 1E2 - 1E3 Normal (parent class) - 1N1 - 1N2 - 1N3 Also, a method is also included in each 8 class file. For example, public class 1E1:Express { publ...

Difference between Class and Structure in PHP and Java

What is real difference between Class and Structure when you are dealing with Object Oriented Programming. This question is asked many times during my interviews for SE. Some people says that there is only one difference: Structure members are public by default and Class members are private by default. Some says there are many differen...

How to call classes from a variable variable?

I'm not quite sure how to correctly put this question. I want to dynamically call functions that are contained in classes (I think this means they are called 'methods'). Here is an example of my code which I hope helps explain what I am trying to achieve. In this instance $result returns all the different modules that are loaded. This ...

Template type deduction in C++ for Class vs Function?

Why is that automatic type deduction is possible only for functions and not for Classes? ...