I am writing an application in Java that places an icon in the system tray (via SWT). When this icon is clicked, I wish to have it automatically type some keys (via the Robot class) into whatever text field is in focus at the time of clicking (could be in any window). Unfortunately, clicking the system tray icon steals the focus away fro...
Hello,
I’m working on a reflection project, and now I’m stuck.
If I have an object of “myclass” that can hold a List
does anyone know how to get the type as in the code below if the property myclass.SomList is empty?
List<myclass> myList = dataGenerator.getMyClasses();
lbxObjects.ItemsSource = myList;
lbxObjects.SelectionChanged +=...
hey guys, I've removed some of the complexities of my needs to the core of what I need to know.
I want to send a collection of Values to a method, and inside that method I want to test the Value against, say, a property of an Entity. The property will always be of the same Type as the Value.
I also want to test if the value is null, or...
Is there way to override return types in C#? If so how, and if not why and what is a recommended way of doing it?
My case is that I have an interface with an abstract base class and descendants of that. I would like to do this (ok not really, but as an example!) :
public interface Animal
{
Poo Excrement { get; }
}
public class Anim...
I suppose the type of Y below is REAL.
SUBROUTINE F(X, Y)
C IMPLICIT NONE
REAL :: X, Y
C REAL :: A, B
C REAL, PARAMETER :: C = 3.14E0
C X = Y + 2 * SIN(Y)
END
But what is it's type here?
SUBROUTINE F(X, Y)
C IMPLICIT NONE
REAL X, Y
C REAL :: A, B
C REA...
Is there a way to tell the php complier that I want a specific implicit conversion from one type to another?
A simple example:
class Integer
{
public $val;
}
function ExampleFunc(Interger $i){...}
ExamFunc(333); // 333 -> Integer object with $val == 333.
[edit]... someone asked for an example. Here's an example from c#. This is a...
I just can't find a "good" explanation for this...
...
I want to do something like the following in VB.NET, is it possible?
Function task(value as Object, toType as Type)
Return DirectCast(value, toType)
End Function
...
What are the advantages and disadvantages of using one instead of the other in C++?
...
Hi
Given two methods on the same class in Java :
public void doSomething( Person person );
public void doSomething( Employee employee );
where
Employee extends Person
If I call :
doSomething( employee )
I find that doSomething( Person ) get's invoked.
I'd have expected the overload with the closest matching contract be invoked...
Hey guys,
for a rails project I need to provide the user with a downloadable HTML version of a statistics page. I got so far as creating a controller action that will set the header as follows and then render and return my vanilla html page:
headers["Content-Type"] ||= 'application/x-unknown'
headers["Content-Disposition"] = "attachmen...
I have to create a photo gallery app in iPhone. It should function same as the Photos app which is shipped with iPhone. But it should show the images which I package with the app.
UIImagePickerController reads only the following source types.
UIImagePickerControllerSourceTypePhotoLibrary,
UIImagePickerControllerSourceTypeCamera,
...
Let's say we do:
default_scope :select => '*, 1+1 AS woah'
in a model, we can then access woah as a method on the model, but it's a string. How do we typecast this so that it's an integer?
In my real-world example I'm actually selecting an id from a joined table but it's being typed as a string. I need it to be a ruby integer.
...
I have a method I'm writing that uses reflection to list a class's static properties, but I'm only interested in those that are of a particular type (in my case, the property must be of a type derived from DataTable). What I would like is something like the if() statement in the following (which presently always returns true):
PropertyI...
Hi,
I'm trying to open a Report which has several sub reports in it. In some of the reports the values are null. I always get the error messgae. Also, there will always be some reports will null values.
...
I know that "string" in C# is a reference type. This is on MSDN. However, this code doesn't work as it should then:
class Test
{
public static void Main()
{
string test = "before passing";
Console.WriteLine(test);
TestI(test);
Console.WriteLine(test);
}
public static void TestI(string t...
Hi all!
I got a RSA pubkey.dat (almost obvious what it is) that has the following structure on contents:
ASN1 Integer of around 1024 bits (Modulus)
ASN1 Integer (Exponent)
Blob of 256 bytes (Signature)
No tags like "----begin---" or so. pure hex values in it.
There's any way to identify its format like if it's DER/PEM/etc , so i ca...
Hello.
I've made an example to demonstrate my problem:
Metrical.java
public interface Metrical<T>
{
double distance(T other);
}
Widget.java
public class Widget implements Metrical<Widget>
{
private final double value;
public Widget(double value) { this.value = value; }
public double getValue() { return value; }
...
I want to use only alphabetic keyboard, how to restrict it? I've used following statement but it doesn't hide the button that converts keyboard in numeric one
tempTextField.keyboardType = UIKeyboardTypeAlphabet;
...
Hello,
It's possible to create a type idenitifier for example:
type PByte = ^Byte;
Is it possible to do the following:
function a:shortint;
begin
Exit(8);
end;
type b = a;
so you can call "b" and "a". Is it possible?
I'm asking,because I'd like to replace "Exit" with "return" so I can call this:
return(5);// for example
...