http://assertselenium.com/2013/01/29/webdriver-wait-commands/
Wednesday, December 10, 2014
Running Groovy Code From Java
public class CodeExecutor {
/**
* @param args
*/
public static void main(String[] args) {
runWithGroovyShell();
}
static void runWithGroovyShell() {
new GroovyShell().evaluate("println 'Hello World'");
}
}
http://stackoverflow.com/questions/3989592/calling-a-groovy-function-from-java
Friday, December 5, 2014
Java Swing Design Patterns
Sharing a few good links for Swing Desing Paterns
- https://www.link-intersystems.com/blog/2013/07/20/the-mvc-pattern-implemented-with-java-swing/
- http://www.cs.wcupa.edu/rkline/java/mvc-design.html
Friday, February 1, 2013
SOAP URI
Examples:
- SOAPAction: "http://www.aktien.de/
transaktion#buy" - SOAPAction: "doit.exe"
- SOAPAction: ""
- SOAPAction:
The presence of the SOAPAction field of the HTTP header can be used by firewalls to filter SOAP requests.
The field value of an empty String means the
purpose of the request is to be determined from HTTP request URI itself
(examples line 3).
No field value at all (examples line 4) means there is no hint for the purpose of the message provided.
Links
http://stackoverflow.com/Saturday, January 26, 2013
Enums why cant we override equals
in the java.lang.Enum class equals method is like
public final boolean equals(Object other) {
return this==other;
}
actually overriding it with something else does not make sense hence its final. As for Enums equals() and == are the same things.
public final boolean equals(Object other) {
return this==other;
}
actually overriding it with something else does not make sense hence its final. As for Enums equals() and == are the same things.
Java Generic < ? > vs < T >
Using "?" is the same as "any", whereas "T" means "a specific type". So, compare these interfaces:
When to use which one
There are also use cases for choosing over (or vice versa) that apply when you don't add type parameter to the class that encloses the method. For example, consider the difference between
and
The first method will actually not compile UNLESS you add an appropriate type parameter to the enclosing class, whereas the second method WILL compile regardless of whether the enclosing class has a type parameter
public interface StrictClass {
public T doFunction(Class class);
}
public interface EasyClass {
public < ? > doFunction(Class class);
} When to use which one
There are also use cases for choosing
public boolean add(List j) {
boolean t = true;
for (JLabel b : j) {
if (b instanceof JLabel) {
t = t && labels.add(b);
}
}
return t;
} and
public boolean add(List j) {
boolean t = true;
for (JLabel b : j) {
if (b instanceof JLabel) {
t = t && labels.add(b);
}
}
return t;
}The first method will actually not compile UNLESS you add an appropriate type parameter to the enclosing class, whereas the second method WILL compile regardless of whether the enclosing class has a type parameter
Using Type Tokens to Retrieve Generic Parameters
Interesting read
http://www.jquantlib.org/index.php/Using_TypeTokens_to_retrieve_generic_parameters
http://www.jquantlib.org/index.php/Using_TypeTokens_to_retrieve_generic_parameters
Subscribe to:
Posts (Atom)