class

Design pattern for class interaction

I'm having some trouble deciding how two classes should interact and the problem I'm having seems like it would come up a lot so I was wondering if anyone knows of a design pattern (or any kind of solution) that addresses my issue. Basically I have two classes. Class A deals with displaying information to the user and Class B deals with...

Using jQuery to add class to first TD on each table row

Hey folks, I have a table I'm working with that is like such: <table width="100%" border="0" cellspacing="0" cellpadding="0" id="tablecontent"> <tr class="tablerow"> <td>This is the td I want to add a class to.</td> <td class="cell2">Stuff</td> <td class="cell3">Stuff</td> </tr> <tr class="tablerow"> <td>This is th...

java subclass have method to return its class

Ok, maybe this is a stupid question. But i'm just wondering if this can be done in java. abstract public class ParentClass<T> { abstract public T getTest(); } in the subclass public class SubClass extends ParentClass<MyObject> { public MyObject getTest() { // I can return the object with class MyObject return null; } ...

OO and PHP Classes vs functions

hello everybody. Does anyone know if OO and php classes are more resource consuming than normal functions that have the same result. And is there a simple php script that can give me exact RAM and CPU consumption by any given script so that I can monitor and limit resources usage, to code better for shared hosting. Thank You. ...

Declaring class instance and its initialization

Hi, If I create the variable with type of a class, what is the actual value I will initialize it with? I mean - the int is initialized with value of that type that is number. But in the terms of technical precision, what happens when I create new instance of class? class a { } class b { a InstanceOfA; InstanceOfA=new (); //which ...

Using utility classes in the android programming

Hi Everybody! I have a little idea of the Utility Classes with a slight doubt on demand. If I use a Utility class in my Application than to use that class in my main Activity do I have to create the object of that class or I can directly Import that class in my main activity? I am Sorry if I am not making a clear sense. In the nutsh...

PHP Class variables with Constants

I am getting a parse error on the lines with the constant (DEPLOYMENT). Why is this now allowed, or am I missing something. Parse error: parse error, expecting `')'' in class UploadComponent extends Object { private $config = array( 'accessKey' => 'XXXX', 'secretKey' => 'XXXX', 'images' => array( ...

c++ syntax of create an instance

class class_name instance; class_name instance; The above all work with cl.exe, but is it standard,is it the same with all other compilers? ...

How to view annotation of java classfile via command line?

Hi, Is there a command line tool, preferrably in the JDK, that either prints all annotations in a classfile or takes a specific annotation as argument to print? If so, is there an equivalent command that can be run on a jar file for a specific class contained within? I've googled this for a while and had no luck. :( Thanks, Jack ...

C# access parent class methods from another file

I was wondering if there was a way for an instance of a class to access its parent class's method(s) while preserving the data during runtime. (Did that make any sense?) I have a ConnectionManager that spawns several Connectors (which is in charge of COM port communications) if there is a multiple COM Port setup. file1.cs namespace c...

Variable Class Name Java

I'm creating a new object that takes a string and a class. Let's say I have a class called "Quiz.java". What works: headerItem = new TreeFieldItem(new QuizMenuItem(key, Quiz.class)); My "value" String returns as "Quiz". How do I make this work? private ArrayList<TreeFieldItem> getListItems() { ArrayList<TreeFieldItem> arrayL...

Finding a class and adding it to another element

I need to find a way to the get the class from a li and then add that class to a div that wraps all my main content. so... <div class="structBody"> <ul id="ContentBreadCrumbsColor"> <li class="teal"></li> </ul> <div class="cntrWrap LI_CLASS_GOES_HERE"> HTML TEXT GOES HERE </div> </div> Can anyone help? I have t...

Does it make a difference if I make an enum in a class static?

Basically, if I don't do all objects get a copy of all the enum values? ps: as always, references for your answer are always welcome... ...

C# and/or ASP.NET Class where clause?

I really don't know if this is a C# thing or an asp.net thing. I was looking at this article: http://huyrua.wordpress.com/2010/07/13/entity-framework-4-poco-repository-and-specification-pattern/ and ran into this line: public class GenericRepository<TEntity> : IRepository<TEntity> where TEntity : class I'm fairly new to C#/ASP.NET so ...

What's the support for .className.andClassName in the current browsers?

Confusing title? Sure! In CSS, you can specify: .button.blue { ... } Which will target elements that have both class names. Does anyone know what the browser support is? ...

bash command: search for class in file system of jars

I'm wanting to recursively search my maven repository (an n folder deep heirachy of jars) for a specific class inside an unknown jar. jar -tvf myJar.jar | grep ClassIWant.class works great for a known jar but I'm having problems piping/chaining bash commands to achieve a recursive search. Any hints much appreciated. Related: http://st...

How do you move an internal function to an external Actionscript 3 class file?

I have this catcher game, where soda bottles falls on to the stage, and we use a character as a cursor to catch it. But all the actionscript is built in already into the file internally. But I was asked to put the two classes I use (the cursor and the falling soda bottles) in an external classfile. And since I'm really new to OOP I real...

Visual C++/CLI mutual access between two class objects?

Here is the problem: namespace Program1 { public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) {....} private: RunnableThread^ peerThread; private: System::Void loginButton_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { String^ ip = this->ipTextFi...

jquery variable as div ID or class

var $name = ('div#amuchlongername'); $('#wrapper').prepend('<div id="$name"></div>'); Obviously I know this code is wrong lol, but I'm fairly knew to jQuery and I can't seem to find anything about this. How would one go about achieving a variable name inside a div id? ...

Array as class property ?

Hello, I have this API that requires me to have a specific array key to be send. Since that array needs to be used on ALL class methods, I was thinking on putting as a class property. abstract class something { protected $_conexion; protected $_myArray = array(); } Later on, on the methods of this class, I will then use: $t...