I have a custom class of type NSObject that contains a single NSMutableArray. This class is called Mutable2DArray and is designed to emulate a 2 dimensional array of type NSMutableArray. There is a custom init method - (id)initWithX:(int)x Y:(int)y that asks for the dimensions for the array and allocates the required arrays within the on...
I'm battling with this assignment :)
I've got two classes: Ocean and Grid.
When I declare an object of the Grid inside the Ocean:
unsigned int sharkCount;
Grid grid;
The compiler/complainer says:
error C2146: syntax error : missing ';' before identifier 'grid'
Can you possibly predict what produces this error with the limited i...
I'd like for all of my objects to be able to return a JSON string of themselves.
So I created a base class for all of my objects to extend, with an AsJSON() method:
class BaseObject {
public function AsJSON()
{
$JSON=array();
foreach ($this as $key => $value)
{
if(is_null($value))
continu...
Say I got:
class X_
{
public:
void do() { }
}
class Y_ : public X_
{
}
And I have this function:
void foo(X_ whatever)
{
whatever.do();
}
Can I send a "Y_" object to the foo function, would this work?
I just realized that I could have tested this myself :)
...
Hi
I have a main JFrame that calls a class(A) and that class calls another class (B)
In Class B I need a refrence to main JFrame
How to find that?
Thanks
...
If I have a algorithm A that i have proven belongs to P can this algorithm also belong to the NPC class or is it strictly P? What about NP? P Belongs to NP right?
Thx for any help!
/Marthin
...
Is it possible to instantiate a class and then invoke its methods between scriptlets in JSP?
I am getting errors and I don't know why (java class and methods are fine).
Any other way to do the same (i just want a string from a method in a class)?
...
The following function writes a struct to a file.
#define PAGESIZE sizeof(BTPAGE)
#define HEADERSIZE 2L
int btwrite(short rrn, BTPAGE *page_ptr)
{
long addr;
addr = (long) rrn * (long) PAGESIZE + HEADERSIZE;
lseek(btfd, addr, 0);
return (write(btfd, page_ptr, PAGESIZE));
}
The following is...
It seems that often I will want to execute some methods from a Class when I call it and choosing which function will depend on some condition. This leads me to write classes like in Case 1 because it allows me to rapidly include their functionality. The alternative would be Case 2 which can take a lot of time if there is a lot of code an...
Howdy All... first time at stack overflow.
I'm looking into using some of the metaprogramming features provided by Ruby or Python, but first I need to know the extent to which they will allow me to extend the language. The main thing I need to be able to do is to rewrite the concept of Class. This doesn't mean that I want to rewrite a...
I have an element that has two classes but can't seem to select it with jQuery.
Is it possible.
Here's the code:
<html>
<head runat="server">
<script type="text/javascript" src="abc/scripts/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
alert($(".x.y").html()); //sho...
I've download a trial of Altova UModel and am starting using UML. As a practical beginning I am modelling a personal information manager application, which includes a web bookmark managing.
A Bookmark can belong to many (or no) Tags at once and a Tag can contain many (or no if all the bookmarks it contained were deleted) bookmarks. The ...
Let's take 2 UML class model entities: One represents an actual Order and another represents an Orede Type. Any Order corresponds to one Type. A 2-way-naviglabe many Orders to one Type relation is meant. Order Type instances are, for example, "Request availability", "Request price", "Preorder", "Buy", "Cancel", "Request support", etc. O...
Hi all
I have a question about PHP Class. I am trying to get the result from Mysql via PHP. I would like to know if the best practice is to display the result inside the Class or store the result and handle it in html.
For example, display result inside the Class
class Schedule {
public $currentWeek;
functio...
So in C++ There's a lot of times where you need to make an "index" class. For example:
class GameID{
public:
string name;
int regionid;
int gameid;
bool operator<(const GameID& rhs) const;
}
Now, if we were to represent GameID as pair<string, pair<int, int> >, the operator comparison just comes with it. Is t...
Is it possible to load a class in Java and 'fake' the package name/canonical name of a class? I tried doing this, the obvious way, but I get a "class name doesn't match" message in a ClassDefNotFoundException.
The reason I'm doing this is I'm trying to load an API that was written in the default package so that I can use it directl...
i just know this is a dumb question, so excuse me in advance.
i want to essentially classify a simple function in it's own .as file. the function compares integers. but i don't know how to call the class and receive a boolean return.
here's my class
package
{
public class CompareInts
{
public function CompareInts(small:int, ...
Hi all, I'm writing a Ruby library which has a module with a bunch of classes inside it. Many of these classes need to be usable and modifiable by calling scripts, but I don't want (some of) the initializers to be visible/callable:
module MyLib
class Control
def initialize
# They can use this
end
def do_stuff
...
I'm working on robot simulation in Java (a Swing application). I have an abstract class "Robot" from which different types of Robots are derived, e.g.
public class StupidRobot extends Robot {
int m_stupidness;
int m_insanityLevel;
...
}
public class AngryRobot extends Robot {
float m_aggression;
...
}
As you can see, ...
Hi,
I want to use some kind of data structure in PHP (5.2), mainly in order to not pollute the global namespace. I think about two approaches, using an array or a class. Could you tell me which approach is better ?
Also, the main purpose would be for storing configurations constants.
Thanks
$SQL_PARAMETERS = array (
'server' => '...