I develop a game that has a big number of buttons (25).
I want to know if i can access them without initiating them in interface (.h) in my implementation class.
I am trying to create new object of other class in a for loop. like
for(int i =0;i<10;i++){
Computer p1=new Computer(10,20);
}
and when I try anywhere to reach p1.someAction(); it say you must declare p1. But if I declare it on top of program how can I create again in loop? I also try only Computer p1; but it gave exeption ..
Is it possible to reliably determine the compilation time stamp of a given class for both java applications running locally and as applets and/or JNLP webapps ?
I have developed an application using Eclipse IDE. After creating the application I exported the project in jar format. When I am trying to run this jar file, I get the error: Unable to load main class. Please Help.
Hello developers. I have some class with properties firstName and lastName. I want bind TextBlock to concatanation of this two properties. I know that I can create third property that will be return concatanation of these properties. But I dont want to use this approach. Is it possible to Bind TextBlock to two properties. and also I dont want create composite userControl.
in the navigator i can only see the current class' members.
is there a way to include the parents' members.
cause it is very useful when working with a framework, then you don't have to look for them in the documentation.
i think this is available in eclipse but not netbeans.
I know Java's generics are somewhat inferior to .Net's.
I have a generic class Foo<T>, and I really need to instantiate a T in Foo using a parameter-less constructor. How can one work around Java's limitation?
Lets say I have
class Person
{
public Person(int age, string name)
{
Age = age;
Name = name;
}
public int Age{get;set}
public string Name{get;set}
}
and I would like to create a method that accepts a string that contains either
"age" or "name" and returns an object with the value of that property.
Like the following pseudo code:
public object GetVal(string propName)
{
return <propName>.value;
}
How can I do this using reflection?
I am coding using asp.net 3.5, c# 3.5
I have a table view that gets refreshed two different ways. One is through a button and the other is when I call my refresh method, which is the same method that I use for the button, but for some reason, when I hit the button it works, but when I call it through a different class it doesn't.
Here's the code that I use to refresh the tableview:
Msqv *qv = [Msqv new];
[qv refresh:self]; //refresh is an IBAction that is used by the button
I am using jquery to find a first element having a class "error" applied to it using the below code
$('#mainDiv input.error:eq(0)')
But the above one working only for input elements only.
How to make this one to work for both input and select elements?
Hello,
I have a python program/file that I want to run repeatedly and calculate the averages of some variables over these runs. To do so, I thought it might be convenient to convert this program into a function or a class. One way I can think of is to add a
def Main():
line at the top and indent every line manually within it. Is there an easier way? I am using pydev on eclipse.
Thanks.
Is there some way to acces the user object from a custom routing class?
I'd like to add a parameter when generating a url, and that parameter is inside the user session, so I need to access it.
The only way I found to access is using the sfContext::getInstance()-getUser(), but it's known to be inefficient.
Thanks!
I have a class like this
$.fn.dimeBar = function(custom) {
var var1 = 'test1';
var var2 = 'test2';
if(sometest){
//how can i access var1 or var2 here by using string name of variables
//some thing like alert(this['var1']) -- should alert: 'test1'
}
}
I'm looking for a C# class that represents a file system path. I would like to use it (instead of strings) as the data type of variables and method arguments (top reasons: type safety, concat-proof, logical comparisons).
System.IO.Path provides most of the functionality I want, but it is abstract.
System.IO.FileInfo, as I understand, performs IO operations to do its job. I only want a wrapper for the path string.
Thanks!
This might be a dumb question, but I don't get it:
I have a class called Card. I want to do a shallow clone using MemberWiseClone().
In Theory Card inherits from Object. So it should be able to use MemberWiseClone(), even if MWC() is protected ??
Am I missing/forgetting something?
What is the default values for members of a struct and members of a class in c++, and how do these rules differ (e.g. between classes/structs/primitives/etc) ? Are there circumstances where the rules about the default values differs ?
Hello,
is their any way to make this work, without sacrificing the cdef in cdef caller? (no use of cpdef either)
from array import *
from numpy import *
cdef class Agents:
cdef public caller(self):
print "caller"
A[2].called()
cdef called(self):
print "called"
A = [Agents() for i in range(2)]
def main():
A[1].caller()
This is my code:
#include <algorithm>
class A {
void f() {
struct CompareMe {
bool operator() (int i, int j) { return i < j; }
} comp;
int a[] = {1, 2, 3, 4};
int found = std::min_element(a[0], a[3], comp);
}
}
Error message:
no matching function for call to ‘min_element(int&, int&, A::f()::CompareMe&)
What am I doing wrong?
This is pretty strange.
I have a class in Classes folder of my project (a .h file and a .m file).
When I try to import it like so
#import <myClass.h>
I get an error saying "no such file or directory".
It is definitely there. What could be going on?