class

What is class in HTML?

I was at w3schools.com learning html and their code examples included the word "class" such as <div class="page"> . They didn't explain it so i needed you guys to. So please define what class in <div class="page"> means. ...

jquery, find next element by class

How can i find the next element by class. i tried with $(obj).next('.class'); but this return only classes in $(obj) parent I need to take the next element anywhere throughout the code by class name. Because my code looks like <table> <tr><td><div class="class">First</div></td></tr> <tr><td><div class="class">Second</div></td></tr> <...

Design question: Java Class with single method ok?

I need the following functionality Given two sorted lists, merge them I have this skeleton Java code: public class MergeLists{ public List merge(List l1, List l2){ List l3; // merge l1, l2 in to l3 return l3; } public static void main(){ // populate list1 and list2 MergeLists ml = new MergeList...

cast class into another class or convert class to another

my question is shown in this code i have class like that public class maincs { public int a; public int b; public int c; public int d; } public class sub1 { public int a; public int b; public int c; } public void methoda (sub1 model) { maincs mdata = new maincs(){a = model.a , b = model.b , c= model.c} ; /...

What is the purpose of Attributes in C#?

What is the purpose of Attributes in C#? How do I know which attribute have to use for particular functionality? How can I add them dynamically in c#? What are custom attributes ? ...

Class that implements an interface with IList of another interface property...how to?

I have two interfaces like these: public interface IMyInterface1 { string prop1 { get; set; } string prop2 { get; set; } } public interface IMyInterface2 { string prop1 { get; set; } IList<IMyInterface1> prop2 { get; set; } } I have defined two classes that implement the interfaces: public class MyClass1 : IMyInterfa...

RDF/OWL/Protege: let a subclass be a union of some disjoint super classes?

I have following classes: Classes B, C and D are the subclasses of A. A ----+----------> B | +----------> C | +----------> D Besides, I have an object property, hasObjectProperty, and some other classes X, Y, Z, where X, Y, Z are disjoint classes. Then I set restrictions to classes B, C and D as following: (He...

Custom Common Library Classes in Visual Studio .NET

I wrote some classes that I use with many different projects. For example, I use Library.Controls.FlatButton.cs almost in every project. The problem is when I add this as an "existing item"; the class gets created/copied in my soultion folder everytime. And each time I edit/update the contents of that class, I have to update all the Libr...

JQuery if label contains this... do this

I have asp.net repeater on a page. If each item being repeated is wrapped in a label like so: <label class="ItemName">value</label> If this label contains the text '35' I want to display some text next to it. How can i do this using jquery??? jQuery(document).ready(function () { if ($('.ItemName').val().indexOf("35")) { ...

jQuery - Change class on click and remember via cookie

Hey folks. I am trying to set up a page where if you click on a link the class will change. One step further this would have to be stored in a cookie. Each A tag has a unique id. For example, below is my example link: <a href="#" id="unique1" class="up">Link text</a> When a user clicks the link then the class would need to be changed...

Cookies with a jquery class switcher?

Hey guys, I really can't figure out how to use cookies with this class switcher I got here Jquery: <script type="text/javascript"> $(document).ready(function(){ $("a.switch_thumb").toggle(function(){ $(this).addClass("swap"); $(".main").fadeOut("fast", function() { $(this).fadeIn(300).addClass("mai...

Handling property dependencies

When developing a class (in C# but I suppose this question is somewhat language independent) what is the correct way to deal with dependencies between properties? For example where I want to create a property B whose value is derived in some way from the value of property A. Property B is undefined and should not be called if property A...

how can I use an enum to replace several fields? How can I pass these values to an interface?

I have a class which 4 fields which I need to be able to set and get. I have to use setters and getters, but also instead of using regular fields, have to use an enum. This concept confuses me - considering the fields arent necessarily constants. I'll give an example If we call the class Bear, the 4 fields may be: name, type, nickname, ...

Functions with const arguments and Overloading

Was tryin out the stackeroverflow qn so it got me thinking why not overload the the function and I came up with a slightly different code but it says the function cannot be overloaded. My question is why? or is there a another way? #include <iostream> using std::cout; class Test { public: Test(){ } int foo...

functions with const arguments Overloading ( Follow up)

This is a follow up of the Previous Question It got really complicated so I am starting a new thread to make my point clearer.( Didnt want to delete the previous thread because the other guys who gave valuable feedback dont not loose the reputation points they gained) Updated Code: (Complies and Works) #include <iostream> using std...

How to loop on field names of a class

I have got a class which contains more then 150 fields. i need the name of fields (not value) in an array. because its very hard and not a good approach to write 150 fields name (which can be incremented or decremented in count according to requirement change) manually in code. i need help to get loop through names for field or get lis...

Objects which send themselves - a good idea?

Where do you draw the line when moving functions which operate on data into the class which contains that data? For example, imagine you have a simple class which stores a description of the weather, with variables for temperature, humidity, wind speed and direction, and the time at which the measurement was taken. Now imagine you have...

PHP dynamic class loading

Lets say that I have an array that I want to convert to a value object. My value object class is as follows: /* file UserVO.php*/ class UserVO { public $id; public $email; public function __construct($data) { $this->id = (int)$data['id']; $this->email = $data['email']; } } And I create my...

php - automatically create an instance of myClass.

I have a class called myClass in /myDir/myClass.php. When user types url: http://mysite.com/myDir/myClass.php, I want to automatically create an instance of myClass. What technique can I use to do this? the idea is to use myDir directory as top level of programs that user can call directly, but I don't want to add instance_of_myCl...

[AS3, AIR] Load External Class from content in another sandbox.

The problem is: I have (for example) font embeder class, and I want to load external SWF not from application storage folder, but another local path ( "D:\blah-blah\123.swf") in AIR, but as you understand I can't find any decision on the Internet (Google, Adode.com) Security.allowDomain() not working in AIR ( documented on adobe.com) ...