Hi,
Struct has default access specifier is public where as class has default access specifier is private. So why can't use struct if change default access specifier as private? why class?
Thanks,
kam
Is it possible to get a reference to this from within a Java inner class?
i.e.
Class outer {
void aMethod() {
NewClass newClass = new NewClass() {
void bMethod() {
// How to I get access to "this" (pointing to outer) from here?
}
};
}
}
how can i call public functions or vars of a sprite class from another class (or frame script)? i keep getting "1061: Call to a possibly undefined method (function i'm trying to call) through a reference with static type flash.display:Sprite.
how can i call public functions or vars of a sprite class from another class (or frame script)? i keep getting "1061: Call to a possibly undefined method (function i'm trying to call) through a reference with static type flash.display:Sprite.
Resolving a class that has multiple constructors with NInject doesn't seem to work.
public class Class1 : IClass
{
public Class1(int param) {...}
public Class1(int param2, string param3) { .. }
}
the following doesn’t seem to work:
IClass1 instance =
IocContainer.Get<IClass>(With.Parameters.ConstructorArgument(“param”, 1));
The hook in the module is simple, and worked before I added the extra constructor:
Bind().To();
Thanks in advance...
Hi,
I have a Android class extending Application to generate some global classes, etc.
It works, in that I can, for example, get the context, etc.
BUT, when I try this:
row = (TextView) findViewById(R.id.list_row_text);
I get
R.id.list_row_text = Class not loaded : <mypackage>.R$id
Any ideas why this is happening?
Thanks
Gerardo
I am going to have different classes for a character that a user play. Like "Mage, Warrior" etc.
I am thinking of a method like have some CharacterBase class (abstract?) and then I have a child class which is like WarriorClass or something like that.
I think the approach is called Factory pattern or something like that. Anyone got a clue of what I'm trying to achieve here, and are there perhaps any better way to do this?
I have a hyper link control and I set the NavigateURL and the ImageURL property at runtime. I also need to set the class of the image tag that it generates but I cannot figure out how I can do that. The solution mentioned here
http://stackoverflow.com/questions/1428879/apply-css-class-to-image-in-asphyperlink
does not work because the image url is hard coded.
any ideas?
Can I get JAXB 2.0 XJC compiler to generate a generic class for me?
Something as simple as:-
public class Shape<T> {
T myShape;
// getter / setter
}
I see references for this in the spec but am not sure I'm reading it right. I always get Object references.
Hi,
I would like to implement an current property in my class which returns the current active context of the class (much like httpcontext.current etc.), like so:
using(classA x = new classA(..))
{
classB.Dosomething();
}
where the method dosomething() gets the current context of classA to perform some operation.
How would i go about creating such functionality?
Greetz,
Richard
When defining nested classes, is it possible to access the "outer" class' methods? I know it's possible to access its attributes, but I can't seem to find a way to use its methods.
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2 && //<-- Here I'd like to
} // reference a method
}); //from the class where
//addMouseListener() is defined!
Thanks
I'm getting the Cannot find symbol error from my code. Does anyone know what can cause this problem?
// Register JDBC driver Class.forName("net.sourceforge.jtds.jdbc.Driver"); method forName(java.Lang.String)
Class.forName("net.sourceforge.jtds.jdbc.Driver);
^
class Base
{
public:
type1 m_Pants;
};
class Derived : Base
{
public:
type2 m_Pants
};
This essentially didn't get flagged as an error, but was creating all kinds of clobbering and issues throughout a project.
Does anyone know of a technicality that wouldn't flag this?
I have a project that has a GUI (written in QT) and a command-line version. I made use of the rectangle class included in QT: QRect. I would like to break the command-line version's dependency on QT, so I need a drop-in rectangle class that supports intersection and union. I could write one, but I'd prefer including one if possible.
Any ideas?
Hi in Flex one can easily define the remote class alias like the following:
package samples.portfolio
{
[RemoteClass(alias="flex.samples.marketdata.Stock")]
[Bindable]
public class Stock
{
public var symbol:String;
public var name:String;
public var low:Number;
}
}
But my question is how do you do it in AIR since
the client app does not know about the server
file structure.
Regards,
Hello,
I m using zend.
I want to define the below code outside the controller class & access in different Actions.
$user = new Zend_Session_Namespace('user');
$logInArray = array();
$logInArray['userId'] = $user->userid;
$logInArray['orgId'] = $user->authOrgId;
class VerifierController extends SystemadminController
{
public function indexAction()
{
// action body
print_r($logInArray);
}
}
How it is possible.
pthread_t thread1;
pthread_create(&thread1,NULL,.......,NULL);// Here I want to attach a thread to a member funtion of class
How can i pass the Member function of a class in the above code.
Here's what I' trying to do:
Currently I am using this to create an array of all elements matching the class name of '.cookie'. Right now I am getting the text value of that element, which is not what I need:
var getAllCookies = $('.cookie').text();
var cookiesArray = jQuery.makeArray(getAllCookies);
alert(cookiesArray[0]);
What I need is to find all elements of a certain class (.cookie), get that elements ID value and store that ID value inside of array.
Running XSD.exe on my xml to generate C# class. All works well except on this property
public DocumentATTRIBUTES[][] Document {
get {
return this.documentField;
}
set {
this.documentField = value;
}
}
I want to try and use CollectionBase, and this was my attempt
public DocumentATTRIBUTESCollection Document {
get {
return this.documentField;
}
set {
this.documentField = value;
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class DocumentATTRIBUTES
{
private string _author;
private string _maxVersions;
private string _summary;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string author
{
get
{ return _author; }
set { _author = value; }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string max_versions
{
get { return _maxVersions; }
set { _maxVersions = value; }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string summary
{
get { return _summary; }
set { _summary = value; }
}
}
public class DocumentAttributeCollection : System.Collections.CollectionBase
{
public DocumentAttributeCollection() : base() { }
public DocumentATTRIBUTES this[int index]
{
get
{
return (DocumentATTRIBUTES)this.InnerList[index];
}
}
public void Insert(int index, DocumentATTRIBUTES value)
{
this.InnerList.Insert(index, value);
}
public int Add(DocumentATTRIBUTES value)
{
return (this.InnerList.Add(value));
}
}
However when I try to serialize my object using
XmlSerializer serializer = new XmlSerializer(typeof(DocumentMetaData));
I get the error:
{"Unable to generate a temporary class (result=1).\r\nerror CS0030:
Cannot convert type 'DocumentATTRIBUTES' to 'DocumentAttributeCollection'\r\nerror CS1502: The best overloaded method match for 'DocumentAttributeCollection.Add(DocumentATTRIBUTES)' has some invalid arguments\r\nerror CS1503: Argument '1': cannot convert from 'DocumentAttributeCollection' to 'DocumentATTRIBUTES'\r\n"}
the XSD pertaining to this property is
<xs:complexType>
<xs:sequence>
<xs:element name="ATTRIBUTES" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="author" type="xs:string" minOccurs="0" />
<xs:element name="max_versions" type="xs:string" minOccurs="0" />
<xs:element name="summary" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Hello,
According to MSDN MethodRental Class allows to change method body of dynamic modules. However because of its limitations I cannot think of practical usages for it. Google did not help me either.
Any ideas what the class can be used for?
When i export WebProject (Struts Portlet) as war from RAD 7.5 it creates war, but that war file does not have my Class files. ie. Action Classes, Actionforms, validations, etc. none of the .java files class added in war. what is the issue. urgent
I have used MFMailComposeViewController class in my iPhone app for email functionality.When I try to fill email body keypad comes.Here How can I use resignFirstResponder for that email body textfiled in MFMailComposeViewController class.
there are two classes
public class Account
{
public Acconut()
{
//constructor
}
}
public class SavingsAccount extends Account
{
}
while doing the inheritance i have got an error message "cannont find symbol Symbol: constructor Account()" what might be the error in my code...??
I want to have each instance of some class have a unique integer identifier based on the order that I create them, starting with (say) 0. In Java, I could do this with a static class variable. I know I can emulate the same sort of behavior with Python, but what would be the most 'Pythonic' way to do this?
Thanks