class

Getting the path to where my classes lie in Android

Hi there :) I have some difficulties in finding the directory in which a given class lies. E.g. I have an external lib Plugins.jar imported and want to get the parent directory... How is it done in Android? Afaik the Dalvik VM unpacks my Plugins.jar, optimizes it and packs it together with the rest of my app. Thus I'm not sure if there...

Class Inheriting from Another Class

Hi, I have a Class FileDoc Public Class FileDoc Inherits BaseClass Public Sub DeleteDoc() dim catId as integer = Cat_ID End Sub a bunch of properties... End Class And I have another Class... Public Class BaseClass Private _Cat_ID As Integer Public Property Cat_ID() As Integer Get Return _Cat_ID End Get S...

PHP, simple class for working with MySql and mysql_close problem

Here is a simple php class for working with database. The problem with this class is in __destruct method, that launch mysql_close function. If I create two DB objects that are situated in code very close it cause an error. It looks like that mysql_close close all database connections, not just his own($this->dbLink). Why it is happens? ...

Confusing JavaScript statement: "var x = new this();"

Hi everyone, I thought I understood the concept of the JavaScript prototype object, as well as [[proto]] until I saw a few posts regarding class inheritance. Firstly, "JavaScript OOP - the smart way" at http://amix.dk/blog/viewEntry/19038 See the implementation section: var parent = new this('no_init'); And also "Simple JavaScript ...

Java: Convert Primitive Class

Hi is there an easy in Java to convert primitive class objects into object class objects? Given a class Class cl, I want to convert it into a Class that has no primitives. Eg. Class<?> cl = int.class; ... if (cl.isPrimitive()) { cl = Object of primitive } ... cl == Integer.class I would like a method that does that for all primit...

Modern way to declare a class in php

Wanting to make sure I'm using classes properly. The main script accepts this from the user: 1. month 2. year 3. the type of event they want to find (microsoft or linux) For the program to find a microsoft event it has to run the regular expression: '(ID=)+[0-9]+' For the program to find a linux event it has to run the regular express...

Issue with assigning class variable in PHP

I am trying to assign a variable to a class in PHP, however I am not getting any results? Can anyone offer any assistance? The code is provided below. I am trying to echo the URL as shown below, by first assigning it to a class variable. class PageClass { var $absolute_path = NULL; function get_absolute_path(){ $url = $...

Accessing a protected member variable outside a class

I'm querying for the ID of a field by accessing a class function which someone has already put in place. The result is a object returned with protected member variables. I'm struggling to see how I can access the member variable values outside the class. ...

how to create an object from given class name in php?

I have a variable $className which is name of declared class in php and I want create an object of this class lunch a static method of this class ...

PHP - extended __construct

Hi guys, i was wonderinf if you could help me out.. I have two classes, one extends the other.. Class B will be extended by various different objects and used for common database interactions.. Now i would like class B to handle its connect and disconnects without direction from class A or any external input.. The problem from what i ...

Changing a class with a variable as the id in jQuery?

Hey all, I am not quite getting why this doesn't seem to be working. The alert pops out the correct id, but the removeClass does not seem to be firing. What am I doing wrong? function testClassSwitch(t_id) { alert("Do things to a button with this ID: " + t_id); $(t_id).removeClass("add-button"); } Thanks! ...

Help Creating Python Class with Tkinter

How do I create a class called rectangle that I can pass it the coordinates and a color and have it fill those one? from Tkinter import * master = Tk() w = Canvas(master, width=300, height=300) w.pack() class rectangle(): def make(self, ulx, uly, lrx, lry, color): self.create_rectangle(ulx, uly, lrx, lry, fill=color) re...

Changing classes back and forth with jQuery?

Hey guys, I have a little button functionality that is not erring, but also not working. The addItem gets called fine, and switches the class from "add-button" to "in-cart-button", but the $("a.in-cart-button").click(... doesn't seem to be firing. When I click the "in-cart-button", instead it triggers the addItem function again... Any id...

passing parameters from constructor to functions in processing/java

I'm having trouble with some objects in processing. the code should have two objects displayed and moving. but i only see one object displayed and moving. maybe there's something i'm missing. check out the code. Rule myRule; Rule myRule1; void setup() { size(200,200); smooth(); //Initialize rule objects myRule = new Rule(0,100...

self:: vs className:: inside static className metods in PHP

I guess there may not be any difference but personal preference, but when reading various PHP code I come across both ways to access the methods class. What is the difference: class Myclass { public static $foo; public static function myMethod () { // between: self::$foo; // and MyClass::$fo...

Class Diagrams - questionably useful?

How is a class diagram actually any different to just looking at the class definition with all the functions collapsed? I've been asked to write some and realized that this is all just .. read the source .. it has comments. What's the point of a class diagram, how is it different to even minorly commented definitions, and what makes a go...

What does the '&' means in a Unary Operator of a Class?

class CDate { // some declarations public: CDate& operator ++ () { // increment function; return *this; } }; Does the '&' mean a reference that is being a return? Thanks SpecC ...

What does square brackets in CSS class names means ?

I saw here square brackets that are used in class names: <input class="validate[required,custom[onlyLetter],length[0,100]]" name="firstname" type="text" /> What does this means ? ...

PHP class public parameter as two dimensional array, how?

Ok, so I have a class and I would like to be able to get any trackName (two dimensional array) after initializing an object in another php script. This is a part of the class that is relevant: class fetchData{ public $artistName; public $trackName; public function getArtistTracks(){ $i = 0; if( $tracks = getTracks() ){ ...

Ruby class inheritance and incremental definition

Let's assume that we need to define a common class for trees (or some other objects we need to have in order to solve a problem). Since our class structure can be quite complex, I prefer to define class methods after its definition. Our common class BaseTree and one of our specific classes Tree are class BaseTree class BaseNode; end ...