class

Drupal removing pointless span classes

I am working on a Drupal site here: http://selkirk.treethink.net I have a couple modules that are firing out an insane amount of span classes, which you can see in the source code there. Nice menus is one of these and is causing 60% of them. I need to prevent these modules from doing this but I can't seem to find the code that's doing...

Javacript show/hid div and change a css class based on which div is visible?

Hi - I have little piece of javascript to show/hide divs based on which link is clicked in a list. Its not very eligant, but it works fine. What I'd like to do is to assign an active state the a list item depending on which div is showing. Here is my JS and HTML: var ids=new Array('section1','section2','section3','section4'); functi...

Class from Schema

I have used the xsd.exe tool to generate a class from a schema, when de-serialising a valid XML document then I get exceptions. Example xml is here : http://codepaste.net/wq22hy Class definition is here : http://codepaste.net/bdy598 The problem is at the element, in that the class definition does not seem to handle the recursive nat...

How to lock(sync) a static class?

Hi. I'm creating a static class which is going to hold some vectors with info. I have to make it synchronized so that the class will be locked if someone is editing or reading from the vectors. What is the best way to do this? Is it enough to have a function which is synchronized inside the class like this: public synchronized insert...

How do I activate (execute) methods of a class in Python?

I have a program (simple web server) which I try to understand. There is a class called MyHandler. In this class we define 2 methods do_GET and do_POST. I do not understand several things: Where do we use the two above defined methods? I would expect to see something like that objectname.do_GET() and objectname.do_POST() but I do not ...

Class with pass-by-reference object gives compile error

I've got a class A defined in a separate header file. I want class B to have a reference to a object of class A stored as a variable. Like this: File: A.h class A { //Header for class A... }; File: B.h #include "A.h" class B { private: (24) A &variableName; public: (36) B(A &varName); }; When i try to co...

Change the type of a global variable in a function initializing it

I have a __main__ function where I initialize a lot of variables that are to be used in my program, later on. I have a problem where a variable that I temporarely declare as None in the outer scope, is assigned an object of SomeClass, but due to scoping rules I cannot access it's content in the outer scope. Because the constructor of Som...

Updating a class in an ASP.NET website.

I have a certain class in VB in my App_Code folder, I can't deploy it directly to the website because I have no permission to the FTP, and I was asked to change a certain VB.net class and send it so someone would replace it in the FTP folder. What happens is: there is no App_Code folder in the FTP folder. and the class generates NO DLL ...

Packaging of MATLAB code

In the recent question "How to organize MATLAB code?" Andrew Janke mentioned in his answer using classes to organize MATLAB functions into packages: ... consider rewriting some of the code as objects, using stateless utility classes with class methods and private functions as ways of packaging related functions together and provi...

Basic class naming and visibility questions

I always see people giving me code (I mean code examples for questions on SO and the like) like: class MyData{ ObservableCollection<Color> Colors; ObservableCollection<Fruit> Fruits; ObservableCollection<Pairs> Pairs; public void MatchCurrentSelection(){ ..... etc } } }...

Opinion on Making a Common Utility Class Static

Some of what I've been reading about this yesterday and today: (SO) Should you avoid static classes? (SO) When to Use Static Classes in C# - Mark S. Rasmussen makes a nice comment here Singleton vs Static - Nice quote from here: These differences are extremely subtle but they do impact how resilient the system will hold up after years ...

junit4 test runner

my java test do not compile, I run it and have : no junit tests could not find main class (specified in run-configuration) ...

PHP: Cookie problem

Can anyone tell me what is wrong with my code? <?php class MyCookie { private $expiration = 0; private $path = ""; private $domain = ""; private $secure = false; private $httponly = false; private $names = array(); public function __construct($e, $p = "/temp/", $s = false, $h = false) { $this->expira...

Java: Multiple class declarations in one file

In Java, you can define multiple top level classes in a single file, providing that at most one of these is public (see JLS §7.6). See below for example. Is there a tidy name for this technique (analogous to inner, nested, anonymous)? The JLS says the system may enforce the restriction that these secondary classes can't be referred to...

Calling function in other Class not working

Hey everyone, not sure what is going on here :( Basically I have a function that is needs to tell 2 other classes to do something. It works for one of the classes: BigPlayButton, but not Background for some reason. TabMenu.as Class function Note: The function below WILL call the hitPlayCircle function in my BigPlayButton class, but I ...

Using variables for referencing objects in vb.net (Visual Studio 2008)

Hello, I'm having a problem when using variables in object names. I have a Public class which is called "Tank" In that class, there is a public property called "direction" of an integer type. I keep getting the error: "Tank is a type and cannot be used as an expression" What I'm doing wrong here ? Public Class mainroutines() ' Creat...

Dynamically creating a new javascript class from an existing object.

Say I have the following code: var album = new MyObject('album'); Assume that when the object is constructed, a bunch of properties relative to only albums are loaded via AJAX. Would it be possible to create an Album class so that at a later point, I may just do this: var anotherAlbum = new Album(); The Album constructor would auto...

Generate Info (wrapper) Class from stored procedure

Hello everybody I am in a crucial project and I am trying to speed up the development phase by using codesmith for generating the business class DAL and info class for the tables of my project. There are about 50 tables with relationships parent child many to many and for retrieving data I have to code several inner joins in stored pr...

Class Hierarchy for Interfaces C#

I'm playing around with some classes and interfaces, and have developed a simple method to determine the hierarchy of a class, i.e. to identify the chain of inheritance. public static void OutputClassHierarchy(Type ty) { if (ty.BaseType == null) { Console.WriteLine("{0}: Base", ty); Console.WriteLine(""); ...

Problem with CSS selector

I have a link <a href="..." class="fancylink">text</a> I used the code .fancy { text-decoration:none; } but it still underlined, if I set it to "underlined" it double underline it. So I can't take control of a link style using a Class? ...