Hi,
In one of my projects, I have some classes that represent entities that cannot change once created, aka. immutable classes.
Example : A class RSAKey that represent a RSA key which only has const methods. There is no point changing the existing instance: if you need another one, you just create one.
My objects sometimes are heavy a...
I am about to create a simple demo in flash where I have 3 layers, 3 keyframes.
Currently I am just use some simple gotoAndStop() to move to the next keyframe.
But now I need a custom event to do that but I can't create a class inside the action of a keyframe so I am not able to create a custom event.
I just have AS3 developing experie...
In some sample codes there are methods and classes declared WITHIN other methods and/or classes.
I've never heard/read about this. What effect does this kind of programming have? Wouldn't it be better to write down classes in a seperate file and methods side by side and not within each other (like every book tells you)? What are the adv...
Class A
{
};
What is the difference between A a , A* a and A* a = new A().
...
I am playing around with an iPhone app, and need to accomplish something that I am sure is very basic:
I have a slider that is implemented in a Controller.m class. However, I need its value must be available in a different class, MainView.m class where I have defined an equation that depends on the value of the slider. How can I do i...
I have a class defined called extBlock.
I then make an instance of that class with this
extBlock mainBlock = new extBlock(1, 1024);
I get this error:
error C2440: 'initializing' : cannot convert from 'extBlock *' to 'extBlock'
Can anyone help me with why I am getting this error.
I have seen examples online of declaring it like th...
I'm using Python 2.x and I'm wondering if there's a way to tell if a variable is a new-style class? I know that if it's an old-style class that I can do the following to find out.
import types
class oldclass:
pass
def test():
o = oldclass()
if type(o) is types.InstanceType:
print 'Is old-style'
else:
print 'Is NOT old-...
I have an NSMutableArray. It's members eventually become members of an array instance in a class. I want to put the instantiantion of NSMutable into a function and to return an array object. If I can do this, I can make some of my code easier to read. Is this possible?
Here is what I am trying to figure out.
//Definition:
function Obje...
Given:
case class FirstCC {
def name: String = ... // something that will give "FirstCC"
}
case class SecondCC extends FirstCC
val one = FirstCC()
val two = SecondCC()
How can I get "FirstCC" from one.name and "SecondCC" from two.name?
...
I'm trying to use this tutorial to make plots with Gnuplot in C++. However I will be using the pipe to Gnuplot from within a class, but then I run into some problems:
I've got a header file where I declare all variables etc. I need to declare the pipe-variable here too, but how do I do that?
I've tried doing it straight away, but it do...
Hello
Is it possible to call functions from class like this:
$class = new class;
$function_name = "do_the_thing";
$req = $class->$function_name();
Something similar solution, this doesn't seem to work?
Martti Laine
...
Is there anything the Dalvik VM supports (in terms of bytecode) which is not used currently because the .class files don't have it?
As an example, if people would write their own Source-to-DX converter for their functional language XYZ, would they be able to implement e. g. full tail calls although the .class file does support tail call...
We all know the infamous "cannot redeclare class" error. Is there any method to overcome this and actually declare a new class with the same name, or is this impossible in PHP 5?
...
Suppose, I write
class A { };
compiler should provide (as and when needed)
a constructor
a destructor
a copy constructor
= operator
Is this all what the compiler provides? Are there any additions or deletions to this list?
...
I'm trying to to use this class
http://robbyonrails.com/articles/2005/05/11/parsing-a-rss-feed
but am not sure where to place the file so that it functions like a helper.
...
The title is a bit rusty, sorry about that.
Now let me explain what i'm trying to do.
I have a few listed items, like this:
<li>
<a id="toggle" class="0"><h4>ämne<small>2010-04-17 kl 12:54</small></h4></a>
<p id="meddel" class="0">text</p>
</li>
<li class='odd'>
<a id="toggle" class="1"><h4>test<small>2010-04-17 kl 15:01<...
Hello, again.
I have a few list elements, like this:
<li class="item">
<a class="toggle"><h4>ämne<small>2010-04-17 kl 12:54 by <u>nike1</u></small></h4></a>
<div class="meddel">
<span>
<img style="max-width: 70%; min-height: 70%;" src="profile-images/nike1.jpg" alt="" />
<a href="account.php?usr=...
For example:
var myObj={
myValue="hola",
asMember=function(){ alert( this.myValue ); }
};
myObj.asMember(); // will work fine
var asGlobal=myObj.asMember; // global alias for that member function
asGlobal(); // won't work in javascript (will work in AS3, but i need js now)
So the question is, can I rewrite asMember so that i...
I am creating a geometry library in C# and I will need the following immutable types:
Vector2f (2 floats - 8 bytes)
Vector2d (2 doubles - 16 bytes)
Vector3f (3 floats - 12 bytes)
Vector3d (3 doubles - 24 bytes)
Vector4f (4 floats - 16 bytes)
Vector4d (4 doubles - 32 bytes)
I am trying to determine whether to make them structs or clas...
I'm building an android application, which has a list view, and in the list view, a click listener, containing an onItemClick method. So I have something like this:
public class myList extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
getListView().setOnItemClickListener(new OnItemClickListe...