public static final class MethodHandles.Lookup extends Object
A lookup class which needs to create method handles will call
MethodHandles.lookup
to create a factory for itself.
When the Lookup
factory object is created, the identity of the lookup class is
determined, and securely stored in the Lookup
object.
The lookup class (or its delegates) may then use factory methods
on the Lookup
object to create method handles for access-checked members.
This includes all methods, constructors, and fields which are allowed to the lookup class,
even private ones.
Lookup
object correspond to all major
use cases for methods, constructors, and fields.
Each method handle created by a factory method is the functional
equivalent of a particular bytecode behavior.
(Bytecode behaviors are described in section <IP_ADDRESS> of the Java Virtual Machine Specification.)
Here is a summary of the correspondence between these factory methods and
the behavior the resulting method handles:
| lookup expression | member | bytecode behavior |
|---|---|---|
lookup.findGetter(C.class,"f",FT.class) |
FT f; | (T) this.f; |
lookup.findStaticGetter(C.class,"f",FT.class) |
static FT f; | (T) C.f; |
lookup.findSetter(C.class,"f",FT.class) |
FT f; | this.f = x; |
lookup.findStaticSetter(C.class,"f",FT.class) |
static FT f; | C.f = arg; |
lookup.findVirtual(C.class,"m",MT) |
T m(A*); | (T) this.m(arg*); |
lookup.findStatic(C.class,"m",MT) |
static T m(A*); | (T) C.m(arg*); |
lookup.findSpecial(C.class,"m",MT,this.class) |
T m(A*); | (T) super.m(arg*); |
lookup.findConstructor(C.class,MT) |
C(A*); | new C(arg*); |
lookup.unreflectGetter(aField) |
(static )?FT f; | (FT) aField.get(thisOrNull); |
lookup.unreflectSetter(aField) |
(static )?FT f; | aField.set(thisOrNull, arg); |
lookup.unreflect(aMethod) |
(static )?T m(A*); | (T) aMethod.invoke(thisOrNull, arg*); |
lookup.unreflectConstructor(aConstructor) |
C(A*); | (C) aConstructor.newInstance(arg*); |
lookup.unreflect(aMethod) |
(static )?T m(A*); | (T) aMethod.invoke(thisOrNull, arg*); |
C
is the class or interface being searched for a member,
documented as a parameter named refc
in the lookup methods.
The method type MT
is composed from the return type T
and the sequence of argument types A*
.
The constructor also has a sequence of argument types A*
and
is deemed to return the newly-created object of type C
.
Both MT
and the field type FT
are documented as a parameter named type
.
The formal parameter this
stands for the self-reference of type C
;
if it is present, it is always the leading argument to the method handle invocation.
(In the case of some protected
members, this
may be
restricted in type to the lookup class; see below.)
The name arg
stands for all the other method handle arguments.
In the code examples for the Core Reflection API, the name thisOrNull
stands for a null reference if the accessed method or field is static,
and this
otherwise.
The names aMethod
, aField
, and aConstructor
stand
for reflective objects corresponding to the given members.
In cases where the given member is of variable arity (i.e., a method or constructor) the returned method handle will also be of variable arity. In all other cases, the returned method handle will be of fixed arity.
Discussion: The equivalence between looked-up method handles and underlying class members and bytecode behaviors can break down in a few ways:
C
is not symbolically accessible from the lookup class's loader,
the lookup can still succeed, even when there is no equivalent
Java expression or bytecoded constant.
T
or MT
is not symbolically accessible from the lookup class's loader,
the lookup can still succeed.
For example, lookups for MethodHandle.invokeExact
and
MethodHandle.invoke
will always succeed, regardless of requested type.
ldc
instruction on a CONSTANT_MethodHandle
constant is not subject to security manager checks.
Lookup
,
when a method handle is created.
This is a key difference from the Core Reflection API, since
java.lang.reflect.Method.invoke
performs access checking against every caller, on every call.
All access checks start from a Lookup
object, which
compares its recorded lookup class against all requests to
create method handles.
A single Lookup
object can be used to create any number
of access-checked method handles, all checked against a single
lookup class.
A Lookup
object can be shared with other trusted code,
such as a metaobject protocol.
A shared Lookup
object delegates the capability
to create method handles on private members of the lookup class.
Even if privileged code uses the Lookup
object,
the access checking is confined to the privileges of the
original lookup class.
A lookup can fail, because
the containing class is not accessible to the lookup class, or
because the desired class member is missing, or because the
desired class member is not accessible to the lookup class, or
because the lookup object is not trusted enough to access the member.
In any of these cases, a ReflectiveOperationException
will be
thrown from the attempted lookup. The exact class will be one of
the following:
In general, the conditions under which a method handle may be
looked up for a method M
are no more restrictive than the conditions
under which the lookup class could have compiled, verified, and resolved a call to M
.
Where the JVM would raise exceptions like NoSuchMethodError
,
a method handle lookup will generally raise a corresponding
checked exception, such as NoSuchMethodException
.
And the effect of invoking the method handle resulting from the lookup
is exactly equivalent
to executing the compiled, verified, and resolved call to M
.
The same point is true of fields and constructors.
Discussion:
Access checks only apply to named and reflected methods,
constructors, and fields.
Other method handle creation methods, such as
MethodHandle.asType
,
do not require any access checks, and are used
independently of any Lookup
object.
If the desired member is protected
, the usual JVM rules apply,
including the requirement that the lookup class must be either be in the
same package as the desired member, or must inherit that member.
(See the Java Virtual Machine Specification, sections 4.9.2, <IP_ADDRESS>, and 6.4.)
In addition, if the desired member is a non-static field or method
in a different package, the resulting method handle may only be applied
to objects of the lookup class or one of its subclasses.
This requirement is enforced by narrowing the type of the leading
this
parameter from C
(which will necessarily be a superclass of the lookup class)
to the lookup class itself.
The JVM imposes a similar requirement on invokespecial
instruction,
that the receiver argument must match both the resolved method and
the current class. Again, this requirement is enforced by narrowing the
type of the leading parameter to the resulting method handle.
(See the Java Virtual Machine Specification, section <IP_ADDRESS>.)
The JVM represents constructors and static initializer blocks as internal methods
with special names ("<init>"
and "<clinit>"
).
The internal syntax of invocation instructions allows them to refer to such internal
methods as if they were normal methods, but the JVM bytecode verifier rejects them.
A lookup of such an internal method will produce a NoSuchMethodException
.
In some cases, access between nested classes is obtained by the Java compiler by creating
an wrapper method to access a private method of another class
in the same top-level declaration.
For example, a nested class C.D
can access private members within other related classes such as
C
, C.D.E
, or C.B
,
but the Java compiler may need to generate wrapper methods in
those related classes. In such cases, a Lookup
object on
C.E
would be unable to those private members.
A workaround for this limitation is the Lookup.in
method,
which can transform a lookup on C.E
into one on any of those other
classes, without special elevation of privilege.
The accesses permitted to a given lookup object may be limited,
according to its set of lookupModes
,
to a subset of members normally accessible to the lookup class.
For example, the publicLookup
method produces a lookup object which is only allowed to access
public members in public classes.
The caller sensitive method lookup
produces a lookup object with full capabilities relative to
its caller class, to emulate all supported bytecode behaviors.
Also, the Lookup.in
method may produce a lookup object
with fewer access modes than the original lookup object.
Discussion of private access:
We say that a lookup has private access
if its lookup modes
include the possibility of accessing private
members.
As documented in the relevant methods elsewhere,
only lookups with private access possess the following capabilities:
Class.forName
emulate invokespecial
instructions
delegated lookup objects
which have private access to other classes
within the same package member
Each of these permissions is a consequence of the fact that a lookup object with private access can be securely traced back to an originating class, whose bytecode behaviors and Java language access permissions can be reliably determined and emulated by method handles.
Class
object is
available. Such cross-loader references are also possible with the
Core Reflection API, and are impossible to bytecode instructions
such as invokestatic
or getfield
.
There is a security manager API
to allow applications to check such cross-loader references.
These checks apply to both the MethodHandles.Lookup
API
and the Core Reflection API
(as found on Class
).
If a security manager is present, member lookups are subject to
additional checks.
From one to three calls are made to the security manager.
Any of these calls can refuse access by throwing a
SecurityException
.
Define smgr
as the security manager,
lookc
as the lookup class of the current lookup object,
refc
as the containing class in which the member
is being sought, and defc
as the class in which the
member is actually defined.
The value lookc
is defined as not present
if the current lookup object does not have
private access.
The calls are made according to the following rules:
lookc
is not present, or if its class loader is not
the same as or an ancestor of the class loader of refc
,
then smgr.checkPackageAccess(refcPkg)
is called,
where refcPkg
is the package of refc
.
lookc
is not present, then
smgr.checkPermission
with RuntimePermission("accessDeclaredMembers")
is called.
lookc
is not present,
and if defc
and refc
are different,
then smgr.checkPackageAccess(defcPkg)
is called,
where defcPkg
is the package of defc
.
If a method handle for a caller-sensitive method is requested, the general rules for bytecode behaviors apply, but they take account of the lookup class in a special way. The resulting method handle behaves as if it were called from an instruction contained in the lookup class, so that the caller-sensitive method detects the lookup class. (By contrast, the invoker of the method handle is disregarded.) Thus, in the case of caller-sensitive methods, different lookup classes may give rise to differently behaving method handles.
In cases where the lookup object is
publicLookup()
,
or some other lookup object without
private access,
the lookup class is disregarded.
In such cases, no caller-sensitive method handle can be created,
access is forbidden, and the lookup fails with an
IllegalAccessException
.
Discussion:
For example, the caller-sensitive method
Class.forName(x)
can return varying classes or throw varying exceptions,
depending on the class loader of the class that calls it.
A public lookup of Class.forName
will fail, because
there is no reasonable way to determine its bytecode behavior.
If an application caches method handles for broad sharing,
it should use publicLookup()
to create them.
If there is a lookup of Class.forName
, it will fail,
and the application must take appropriate action in that case.
It may be that a later lookup, perhaps during the invocation of a
bootstrap method, can incorporate the specific identity
of the caller, making the method accessible.
The function MethodHandles.lookup
is caller sensitive
so that there can be a secure foundation for lookups.
Nearly all other methods in the JSR 292 API rely on lookup
objects to check access requests.
| Modifier and Type | Field and Description |
|---|---|
static int |
PACKAGE
A single-bit mask representing
package access (default access),
which may contribute to the result of lookupModes . |
static int |
PRIVATE
A single-bit mask representing
private access,
which may contribute to the result of lookupModes . |
static int |
PROTECTED
A single-bit mask representing
protected access,
which may contribute to the result of lookupModes . |
static int |
PUBLIC
A single-bit mask representing
public access,
which may contribute to the result of lookupModes . |
| Modifier and Type | Method and Description |
|---|---|
MethodHandle |
bind(Object receiver,
String name,
MethodType type)
Produces an early-bound method handle for a non-static method.
|
MethodHandle |
findConstructor(Class<?> refc,
MethodType type)
Produces a method handle which creates an object and initializes it, using
the constructor of the specified type.
|
MethodHandle |
findGetter(Class<?> refc,
String name,
Class<?> type)
Produces a method handle giving read access to a non-static field.
|
MethodHandle |
findSetter(Class<?> refc,
String name,
Class<?> type)
Produces a method handle giving write access to a non-static field.
|
MethodHandle |
findSpecial(Class<?> refc,
String name,
MethodType type,
Class<?> specialCaller)
Produces an early-bound method handle for a virtual method.
|
MethodHandle |
findStatic(Class<?> refc,
String name,
MethodType type)
Produces a method handle for a static method.
|
MethodHandle |
findStaticGetter(Class<?> refc,
String name,
Class<?> type)
Produces a method handle giving read access to a static field.
|
MethodHandle |
findStaticSetter(Class<?> refc,
String name,
Class<?> type)
Produces a method handle giving write access to a static field.
|
MethodHandle |
findVirtual(Class<?> refc,
String name,
MethodType type)
Produces a method handle for a virtual method.
|
MethodHandles.Lookup |
in(Class<?> requestedLookupClass)
Creates a lookup on the specified new lookup class.
|
Class<?> |
lookupClass()
Tells which class is performing the lookup.
|
int |
lookupModes()
Tells which access-protection classes of members this lookup object can produce.
|
MethodHandleInfo |
revealDirect(MethodHandle target)
Cracks a direct method handle
created by this lookup object or a similar one.
|
String |
toString()
Displays the name of the class from which lookups are to be made.
|
MethodHandle |
unreflect(Method m)
Makes a direct method handle
to m, if the lookup class has permission.
|
MethodHandle |
unreflectConstructor(Constructor<?> c)
Produces a method handle for a reflected constructor.
|
MethodHandle |
unreflectGetter(Field f)
Produces a method handle giving read access to a reflected field.
|
MethodHandle |
unreflectSetter(Field f)
Produces a method handle giving write access to a reflected field.
|
MethodHandle |
unreflectSpecial(Method m,
Class<?> specialCaller)
Produces a method handle for a reflected method.
|
public static final int PUBLIC
public
access,
which may contribute to the result of lookupModes
.
The value, 0x01
, happens to be the same as the value of the
public
modifier bit.public static final int PRIVATE
private
access,
which may contribute to the result of lookupModes
.
The value, 0x02
, happens to be the same as the value of the
private
modifier bit.public static final int PROTECTED
protected
access,
which may contribute to the result of lookupModes
.
The value, 0x04
, happens to be the same as the value of the
protected
modifier bit.public static final int PACKAGE
package
access (default access),
which may contribute to the result of lookupModes
.
The value is 0x08
, which does not correspond meaningfully to
any particular modifier bit.public Class<?> lookupClass()
The class implies a maximum level of access permission,
but the permissions may be additionally limited by the bitmask
lookupModes
, which controls whether non-public members
can be accessed.
public int lookupModes()
A freshly-created lookup object on the caller's class has all possible bits set, since the caller class can access all its own members. A lookup object on a new lookup class created from a previous lookup object may have some mode bits set to zero. The purpose of this is to restrict access via the new lookup object, so that it can access only names which can be reached by the original lookup object, and also by the new lookup class.
public MethodHandles.Lookup in(Class<?> requestedLookupClass)
lookupClass
.
However, the resulting Lookup
object is guaranteed
to have no more access capabilities than the original.
In particular, access capabilities can be lost as follows:
requestedLookupClass
- the desired lookup class for the new lookup objectNullPointerException
- if the argument is nullpublic String toString()
Class.getName
.)
If there are restrictions on the access permitted to this lookup,
this is indicated by adding a suffix to the class name, consisting
of a slash and a keyword. The keyword represents the strongest
allowed access, and is chosen as follows:
MethodHandles.lookup
.
Objects created by Lookup.in
always have restricted access, and will display a suffix.
(It may seem strange that protected access should be stronger than private access. Viewed independently from package access, protected access is the first to be lost, because it requires a direct subclass relationship between caller and callee.)
toString
in class Object
in(java.lang.Class<?>)
public MethodHandle findStatic(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException
findVirtual
or findSpecial
.)
The method and all its argument types must be accessible to the lookup object.
The returned method handle will have
variable arity if and only if
the method's variable arity modifier bit (0x0080
) is set.
If the returned method handle is invoked, the method's class will be initialized, if it has not already been initialized.
Example:
import static java.lang.invoke.MethodHandles.*; import static java.lang.invoke.MethodType.*; ... MethodHandle MH_asList = publicLookup().findStatic(Arrays.class, "asList", methodType(List.class, Object[].class)); assertEquals("[x, y]", MH_asList.invoke("x", "y").toString());
refc
- the class from which the method is accessedname
- the name of the methodtype
- the type of the methodNoSuchMethodException
- if the method does not existIllegalAccessException
- if access checking fails,
or if the method is not static
,
or if the method's variable arity modifier bit
is set and asVarargsCollector
failsSecurityException
- if a security manager is present and it
refuses accessNullPointerException
- if any argument is nullpublic MethodHandle findVirtual(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException
refc
) prepended.
The method and all its argument types must be accessible to the lookup object.
When called, the handle will treat the first argument as a receiver
and dispatch on the receiver's type to determine which method
implementation to enter.
(The dispatching action is identical with that performed by an
invokevirtual
or invokeinterface
instruction.)
The first argument will be of type refc
if the lookup
class has full privileges to access the member. Otherwise
the member must be protected
and the first argument
will be restricted in type to the lookup class.
The returned method handle will have
variable arity if and only if
the method's variable arity modifier bit (0x0080
) is set.
Because of the general equivalence between invokevirtual
instructions and method handles produced by findVirtual
,
if the class is MethodHandle
and the name string is
invokeExact
or invoke
, the resulting
method handle is equivalent to one produced by
MethodHandles.exactInvoker
or
MethodHandles.invoker
with the same type
argument.
Example:
import static java.lang.invoke.MethodHandles.*; import static java.lang.invoke.MethodType.*; ... MethodHandle MH_concat = publicLookup().findVirtual(String.class, "concat", methodType(String.class, String.class)); MethodHandle MH_hashCode = publicLookup().findVirtual(Object.class, "hashCode", methodType(int.class)); MethodHandle MH_hashCode_String = publicLookup().findVirtual(String.class, "hashCode", methodType(int.class)); assertEquals("xy", (String) MH_concat.invokeExact("x", "y")); assertEquals("xy".hashCode(), (int) MH_hashCode.invokeExact((Object)"xy")); assertEquals("xy".hashCode(), (int) MH_hashCode_String.invokeExact("xy")); // interface method: MethodHandle MH_subSequence = publicLookup().findVirtual(CharSequence.class, "subSequence", methodType(CharSequence.class, int.class, int.class)); assertEquals("def", MH_subSequence.invoke("abcdefghi", 3, 6).toString()); // constructor "internal method" must be accessed differently: MethodType MT_newString = methodType(void.class); //()V for new String() try { assertEquals("impossible", lookup() .findVirtual(String.class, "<init>", MT_newString)); } catch (NoSuchMethodException ex) { } // OK MethodHandle MH_newString = publicLookup() .findConstructor(String.class, MT_newString); assertEquals("", (String) MH_newString.invokeExact());
refc
- the class or interface from which the method is accessedname
- the name of the methodtype
- the type of the method, with the receiver argument omittedNoSuchMethodException
- if the method does not existIllegalAccessException
- if access checking fails,
or if the method is static
or if the method's variable arity modifier bit
is set and asVarargsCollector
failsSecurityException
- if a security manager is present and it
refuses accessNullPointerException
- if any argument is nullpublic MethodHandle findConstructor(Class<?> refc, MethodType type) throws NoSuchMethodException, IllegalAccessException
The requested type must have a return type of void
.
(This is consistent with the JVM's treatment of constructor type descriptors.)
The returned method handle will have
variable arity if and only if
the constructor's variable arity modifier bit (0x0080
) is set.
If the returned method handle is invoked, the constructor's class will be initialized, if it has not already been initialized.
Example:
import static java.lang.invoke.MethodHandles.*; import static java.lang.invoke.MethodType.*; ... MethodHandle MH_newArrayList = publicLookup().findConstructor( ArrayList.class, methodType(void.class, Collection.class)); Collection orig = Arrays.asList("x", "y"); Collection copy = (ArrayList) MH_newArrayList.invokeExact(orig); assert(orig != copy); assertEquals(orig, copy); // a variable-arity constructor: MethodHandle MH_newProcessBuilder = publicLookup().findConstructor( ProcessBuilder.class, methodType(void.class, String[].class)); ProcessBuilder pb = (ProcessBuilder) MH_newProcessBuilder.invoke("x", "y", "z"); assertEquals("[x, y, z]", pb.command().toString());
refc
- the class or interface from which the method is accessedtype
- the type of the method, with the receiver argument omitted, and a void return typeNoSuchMethodException
- if the constructor does not existIllegalAccessException
- if access checking fails
or if the method's variable arity modifier bit
is set and asVarargsCollector
failsSecurityException
- if a security manager is present and it
refuses accessNullPointerException
- if any argument is nullpublic MethodHandle findSpecial(Class<?> refc, String name, MethodType type, Class<?> specialCaller) throws NoSuchMethodException, IllegalAccessException
invokespecial
instruction from within the explicitly specified specialCaller
.
The type of the method handle will be that of the method,
with a suitably restricted receiver type prepended.
(The receiver type will be specialCaller
or a subtype.)
The method and all its argument types must be accessible
to the lookup object.
Before method resolution, if the explicitly specified caller class is not identical with the lookup class, or if this lookup object does not have private access privileges, the access fails.
The returned method handle will have
variable arity if and only if
the method's variable arity modifier bit (0x0080
) is set.
(Note: JVM internal methods named "<init>"
are not visible to this API,
even though the invokespecial
instruction can refer to them
in special circumstances. Use findConstructor
to access instance initialization methods in a safe manner.)
Example:
import static java.lang.invoke.MethodHandles.*; import static java.lang.invoke.MethodType.*; ... static class Listie extends ArrayList { public String toString() { return "[wee Listie]"; } static Lookup lookup() { return MethodHandles.lookup(); } } ... // no access to constructor via invokeSpecial: MethodHandle MH_newListie = Listie.lookup() .findConstructor(Listie.class, methodType(void.class)); Listie l = (Listie) MH_newListie.invokeExact(); try { assertEquals("impossible", Listie.lookup().findSpecial( Listie.class, "<init>", methodType(void.class), Listie.class)); } catch (NoSuchMethodException ex) { } // OK // access to super and self methods via invokeSpecial: MethodHandle MH_super = Listie.lookup().findSpecial( ArrayList.class, "toString" , methodType(String.class), Listie.class); MethodHandle MH_this = Listie.lookup().findSpecial( Listie.class, "toString" , methodType(String.class), Listie.class); MethodHandle MH_duper = Listie.lookup().findSpecial( Object.class, "toString" , methodType(String.class), Listie.class); assertEquals("[]", (String) MH_super.invokeExact(l)); assertEquals(""+l, (String) MH_this.invokeExact(l)); assertEquals("[]", (String) MH_duper.invokeExact(l)); // ArrayList method try { assertEquals("inaccessible", Listie.lookup().findSpecial( String.class, "toString", methodType(String.class), Listie.class)); } catch (IllegalAccessException ex) { } // OK Listie subl = new Listie() { public String toString() { return "[subclass]"; } }; assertEquals(""+l, (String) MH_this.invokeExact(subl)); // Listie method
refc
- the class or interface from which the method is accessedname
- the name of the method (which must not be "<init>")type
- the type of the method, with the receiver argument omittedspecialCaller
- the proposed calling class to perform the invokespecial
NoSuchMethodException
- if the method does not existIllegalAccessException
- if access checking fails
or if the method's variable arity modifier bit
is set and asVarargsCollector
failsSecurityException
- if a security manager is present and it
refuses accessNullPointerException
- if any argument is nullpublic MethodHandle findGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException
refc
- the class or interface from which the method is accessedname
- the field's nametype
- the field's typeNoSuchFieldException
- if the field does not existIllegalAccessException
- if access checking fails, or if the field is static
SecurityException
- if a security manager is present and it
refuses accessNullPointerException
- if any argument is nullpublic MethodHandle findSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException
refc
- the class or interface from which the method is accessedname
- the field's nametype
- the field's typeNoSuchFieldException
- if the field does not existIllegalAccessException
- if access checking fails, or if the field is static
SecurityException
- if a security manager is present and it
refuses accessNullPointerException
- if any argument is nullpublic MethodHandle findStaticGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException
If the returned method handle is invoked, the field's class will be initialized, if it has not already been initialized.
refc
- the class or interface from which the method is accessedname
- the field's nametype
- the field's typeNoSuchFieldException
- if the field does not existIllegalAccessException
- if access checking fails, or if the field is not static
SecurityException
- if a security manager is present and it
refuses accessNullPointerException
- if any argument is nullpublic MethodHandle findStaticSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException
If the returned method handle is invoked, the field's class will be initialized, if it has not already been initialized.
refc
- the class or interface from which the method is accessedname
- the field's nametype
- the field's typeNoSuchFieldException
- if the field does not existIllegalAccessException
- if access checking fails, or if the field is not static
SecurityException
- if a security manager is present and it
refuses accessNullPointerException
- if any argument is nullpublic MethodHandle bind(Object receiver, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException
defc
in which a method
of the given name and type is accessible to the lookup class.
The method and all its argument types must be accessible to the lookup object.
The type of the method handle will be that of the method,
without any insertion of an additional receiver parameter.
The given receiver will be bound into the method handle,
so that every call to the method handle will invoke the
requested method on the given receiver.
The returned method handle will have
variable arity if and only if
the method's variable arity modifier bit (0x0080
) is set
and the trailing array argument is not the only argument.
(If the trailing array argument is the only argument,
the given receiver value will be bound to it.)
This is equivalent to the following code:
whereimport static java.lang.invoke.MethodHandles.*; import static java.lang.invoke.MethodType.*; ... MethodHandle mh0 = lookup().findVirtual(defc, name, type); MethodHandle mh1 = mh0.bindTo(receiver); MethodType mt1 = mh1.type(); if (mh0.isVarargsCollector()) mh1 = mh1.asVarargsCollector(mt1.parameterType(mt1.parameterCount()-1)); return mh1;
defc
is either receiver.getClass()
or a super
type of that class, in which the requested method is accessible
to the lookup class.
(Note that bindTo
does not preserve variable arity.)receiver
- the object from which the method is accessedname
- the name of the methodtype
- the type of the method, with the receiver argument omittedNoSuchMethodException
- if the method does not existIllegalAccessException
- if access checking fails
or if the method's variable arity modifier bit
is set and asVarargsCollector
failsSecurityException
- if a security manager is present and it
refuses accessNullPointerException
- if any argument is nullMethodHandle.bindTo(java.lang.Object)
,
findVirtual(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType)
public MethodHandle unreflect(Method m) throws IllegalAccessException
accessible
flag is not set,
access checking is performed immediately on behalf of the lookup class.
If m is not public, do not share the resulting handle with untrusted parties.
The returned method handle will have
variable arity if and only if
the method's variable arity modifier bit (0x0080
) is set.
If m is static, and if the returned method handle is invoked, the method's class will be initialized, if it has not already been initialized.
m
- the reflected methodIllegalAccessException
- if access checking fails
or if the method's variable arity modifier bit
is set and asVarargsCollector
failsNullPointerException
- if the argument is nullpublic MethodHandle unreflectSpecial(Method m, Class<?> specialCaller) throws IllegalAccessException
invokespecial
instruction from within the explicitly specified specialCaller
.
The type of the method handle will be that of the method,
with a suitably restricted receiver type prepended.
(The receiver type will be specialCaller
or a subtype.)
If the method's accessible
flag is not set,
access checking is performed immediately on behalf of the lookup class,
as if invokespecial
instruction were being linked.
Before method resolution, if the explicitly specified caller class is not identical with the lookup class, or if this lookup object does not have private access privileges, the access fails.
The returned method handle will have
variable arity if and only if
the method's variable arity modifier bit (0x0080
) is set.
m
- the reflected methodspecialCaller
- the class nominally calling the methodIllegalAccessException
- if access checking fails
or if the method's variable arity modifier bit
is set and asVarargsCollector
failsNullPointerException
- if any argument is nullpublic MethodHandle unreflectConstructor(Constructor<?> c) throws IllegalAccessException
newInstance
operation,
creating a new instance of the constructor's class on the
arguments passed to the method handle.
If the constructor's accessible
flag is not set,
access checking is performed immediately on behalf of the lookup class.
The returned method handle will have
variable arity if and only if
the constructor's variable arity modifier bit (0x0080
) is set.
If the returned method handle is invoked, the constructor's class will be initialized, if it has not already been initialized.
c
- the reflected constructorIllegalAccessException
- if access checking fails
or if the method's variable arity modifier bit
is set and asVarargsCollector
failsNullPointerException
- if the argument is nullpublic MethodHandle unreflectGetter(Field f) throws IllegalAccessException
accessible
flag is not set,
access checking is performed immediately on behalf of the lookup class.
If the field is static, and if the returned method handle is invoked, the field's class will be initialized, if it has not already been initialized.
f
- the reflected fieldIllegalAccessException
- if access checking failsNullPointerException
- if the argument is nullpublic MethodHandle unreflectSetter(Field f) throws IllegalAccessException
accessible
flag is not set,
access checking is performed immediately on behalf of the lookup class.
If the field is static, and if the returned method handle is invoked, the field's class will be initialized, if it has not already been initialized.
f
- the reflected fieldIllegalAccessException
- if access checking failsNullPointerException
- if the argument is nullpublic MethodHandleInfo revealDirect(MethodHandle target)
target
- a direct method handle to crack into symbolic reference componentsSecurityException
- if a security manager is present and it
refuses accessIllegalArgumentException
- if the target is not a direct method handle or if access checking failsNullPointerException
- if the target is null
MethodHandleInfo
Dracula Javadoc Sample, Made with Allan Im.


This tournament is being played at the Indiana Convention Center
in Indianapolis, IN.
Thu 30 Jun |
|
| 8:00am | Lone Star 16 EP 25-13, 25-13 |
| 10:00am | Uno Girls 16 Elite 25-16, 25-20 |
Fri 1 Jul |
|
| 8:00am | Coast 16-1 Austin 25-19, 25-14 |
| 10:00am | Austin Juniors 16 Mizuno 25-14, 25-13 |
| 12:00pm | Rage 16-Gabe 23-25, 25-10, 15-13 |
Sat 2 Jul |
|
| 11:00am | San Gabriel Elite 16 Roshambo 25-22, 25-21 |
| 1:00pm | Aspire 16 Rox 25-15, 25-13 |
Sat 2 Jul |
|
| 6:00pm | Momentous 16-Dan 25-21, 25-15 |
Sun 3 Jul |
|
| 8:00am | Rage 16-Gabe 26-24, 25-19 |
| 10:00am | Tstreet 16-Mike 25-16, 25-17 |
| 12:00pm | Arizona East Valley 16N1 25-21, 25-18 |
Thu 30 Jun |
|
| 5:30pm | APAC 16 25-12, 24-26, 15-9 |
| 7:30pm | Dynasty 16 Black 25-23, 25-18 |
Fri 1 Jul |
|
| 4:00pm | Legacy 16-National 23-25, 27-25, 15-13 |
| 6:00pm | Six Pack 16 25-19, 14-25, 10-15 |
| 8:00pm | NCVC Asics 16-1 25-21, 25-12 |
Sat 2 Jul |
|
| 3:30pm | Tejas 16.1 25-15, 25-22 |
| 5:30pm | MAVS 16-1 25-16, 25-12 |
Sat 2 Jul |
|
| 7:00pm | Idaho Crush 16U 17-25, 25-13, 15-3 |
Sun 3 Jul |
|
| 9:00am | Forza1 16 Asics Red 25-20, 17-25, 13-15 |
Thu 30 Jun |
|
| 5:30pm | Houston Juniors 16 Elite 23-25, 21-25 |
| 7:30pm | Adrenaline 16 Rox 25-20, 25-23 |
Fri 1 Jul |
|
| 4:00pm | Celtic Force 16 Green 25-15, 25-14 |
| 6:00pm | Puget Sound 16 Steph 21-25, 22-25 |
| 8:00pm | Academy 16 Red 25-20, 25-27, 16-14 |
Sat 2 Jul |
|
| 3:30pm | NORCO 16 Black 19-25, 23-25 |
| 4:30pm | Dynasty 16 Black 16-25, 18-25 |
Sat 2 Jul |
|
| 3:30pm | NORCO 16 Black 19-25, 23-25 |
| 4:30pm | Dynasty 16 Black 16-25, 18-25 |
Sat 2 Jul |
|
| 8:00pm | San Antonio Sting 16 Black 25-21, 21-25, 15-17 |
Sun 3 Jul |
|
| 11:00am | Tejas 16.1 13-25, 19-25 |
Thu 30 Jun |
|
| 8:00am | Austin Juniors 16 Molten 23-25, 26-28 |
| 10:00am | TriCounty 16 Green 31-33, 25-20, 15-7 |
Fri 1 Jul |
|
| 8:00am | CVC 16 Blue 25-19, 23-25, 15-6 |
| 10:00am | Club One Arizona 16 Platinum 19-25, 23-25 |
| 12:00pm | North Pacific Juniors 16-1 National 24-26, 24-26 |
Sat 2 Jul |
|
| 8:00am | Rocky Select 16 Black 25-22, 25-23 |
| 10:00am | Jamba 16 Parker 25-27, 15-25 |
Sat 2 Jul |
|
| 6:00pm | Rockwood Thunder 16 Navy 15-25, 22-25 |
Sun 3 Jul |
|
| 10:00am | TriCounty 16 Green 25-12, 23-25, 15-13 |
| 1:00pm | Instinct 16 White Tigers Wild Gold 17-25, 23-25 |
Thu 30 Jun |
|
| 8:00am | Springfield 16 Blue 19-25, 18-25 |
| 10:00am | Miami Elite 16 Julie 23-25, 22-25 |
Fri 1 Jul |
|
| 8:00am | Instinct 16 White Tigers Wild Gold 25-18, 25-20 |
| 10:00am | Willowbrook 16 Gold 16-25, 15-25 |
| 12:00pm | AP 16 Gazelle 17-25, 17-25 |
Sat 2 Jul |
|
| 8:00am | SC Midlands 16 Nat E NB 25-19, 25-20 |
| 10:00am | Elevation 16 Elias 17-25, 25-17, 15-4 |
Sat 2 Jul |
|
| 6:00pm | Instinct 16 White Tigers Wild Gold 25-16, 23-25, 16-14 |
Sun 3 Jul |
|
| 9:00am | Jamba 16 Parker 25-16, 25-15 |
| 12:00pm | Rockwood Thunder 16 Navy 26-24, 23-25, 15-11 |
Thu 30 Jun |
|
| 3:00pm | Altitude 16 Black Rox 25-17, 25-11 |
| 5:00pm | Eastside Cleveland 16 Sky 21-25, 23-25 |
| 7:00pm | Fort Smith 16 Black Neeley.S 25-15, 20-25, 14-16 |
Fri 1 Jul |
|
| 3:00pm | OT 16 Asics Blue 8-25, 17-25 |
| 5:00pm | PVA 16 ELITE 17-25, 30-28, 14-16 |
| 7:00pm | San Francisco Juniors RoShamBo 16-1 15-25, 25-9, 15-13 |
Sat 2 Jul |
|
| 2:30pm | Northern Kentucky 16-2 Tide 25-20, 25-20 |
Sat 2 Jul |
|
| 6:00pm | Goldenwest 16 Asics 20-25, 20-25 |
Sun 3 Jul |
|
| 11:00am | Cobb Atlanta 16 Michael 25-18, 25-23 |
| 1:00pm | Webfoot Gold 16-1 21-25, 25-20, 9-15 |
Thu 30 Jun |
|
| 3:00pm | NIVA BB4 16-25, 20-25 |
| 5:00pm | Prostyle 16 Black Elite 25-20, 23-25, 15-13 |
| 7:00pm | Sportime 16 Gold 25-15, 25-19 |
Fri 1 Jul |
|
| 3:00pm | Rancho Valley 16 Premier 17-25, 24-26 |
| 5:00pm | Fortitude 16N Black 17-25, 22-25 |
| 7:00pm | Toledo 16-1 Antonio 20-25, 16-25 |
Sat 2 Jul |
|
| 2:30pm | Seacoast 16 Open 25-20, 25-22 |
Sat 2 Jul |
|
| 6:00pm | A4 Volley 16-Purple 10-25, 18-25 |
Sun 3 Jul |
|
| Capital City Juniors 16 18-25, 23-25 |
Thu 30 Jun |
|
| 3:00pm | Carolina Juniors 16-2 25-22, 19-25, 10-15 |
| 5:00pm | Club V 16 Black EP 18-25, 11-25 |
| 7:00pm | Arizona Revolution 16 Premier 9-25, 12-25 |
Fri 1 Jul |
|
| 3:00pm | Miami Hype 16's 25-22, 25-18 |
| 5:00pm | Brandywine Blackout 16-1 12-25, 13-25 |
| 7:00pm | Club SyrV 16U 21-25, 22-25 |
Sat 2 Jul |
|
| 2:30pm | Rage 16-Garren 17-25, 18-25 |
Sat 2 Jul |
|
| 7:00pm | Paradigm Rebellion 25-23, 24-26, 15-9 |
Sun 3 Jul |
|
| 10:00am | Beach Elite 16B Adidas in semifinals on Court 26 |
| 1:00pm | TBA in finals on Court 24 |
Thu 30 Jun |
|
| 1:00pm | Sunshine 16 Westside 17-25, 22-25 |
| 4:00pm | Seattle Juniors 16 17-25, 25-22, 12-15 |
| 5:00pm | Houston Juniors 16 National 25-27, 25-22, 15-7 |
Fri 1 Jul |
|
| 4:00pm | NW Juniors 16 UA Blue 25-14, 25-14 |
| 6:00pm | South Indy 16 Black 25-20, 25-17 |
| 8:00pm | NIVA Volt 22-25, 22-25 |
Sat 2 Jul |
|
| 2:00pm | Rancho Valley 16Select 25-22, 25-23 |
| 4:00pm | Coast 16-3 Troy 25-6, 25-23 |
| 7:00pm | Santa Monica 16 Premier 25-22, 21-25, 12-15 |
Sun 3 Jul |
|
| 10:00am | ITVC 16 Black in quarterfinals on Court 32 |
| 12:00pm | TBA in semifinals on Court 32 |
| 1:00pm | TBA in finals on Court 33 |


Back from Radiohead concert last night outside Seattle. AWESOME show.
8/21/2008, 7:50:40 PM
Favs: 0
Retweets: 0
link--- layout: tweet ---
Back from Radiohead concert last night outside Seattle. AWESOME show.
8/21/2008, 7:50:40 PM
Favs: 0
Retweets: 0
link


The other day I was showing my friend my website from my phone and noticed that it wasn't set up right for the smaller screen. Things were overlapping and it just looked kinda messy. It made me start to think what I could do to make my website look better but it also made me wonder what other issues might come up with my future designs and issues some people might have other than just a layout problem.
While looking up accessibility options, it made me realize how some simple tweaks, can make a huge difference in making sure everyone can understand what you are showing them.I'm sure you guys have seen images with text that was hard to read. You need to make sure you get the contrast between your image and text at a good ratio so that it's easier to see the difference. No one wants to strain their eyes trying to decipher words in a image.
Color and contrast is not only an issue with images but with the text and your background.  You can also use highlighting options so you know what's selected.
While color is really useful for a lot of things to help people interact with your website, you can still have issues for people who are color blind. If you have an error that is only changed in color, how will they know what's wrong? You need to use other tools such as making it bold or perhaps it changes font.
There's still a lot more I can learn about how to make sure I sufficiently code everything to be as accessible as possible. We all love the internet and apps, so we should strive to make it as easy to use for everyone out there. I know when I start editing my webpage more I'm gonna make a concious effor to change anything I have wrong now to make it a better experience.


This hearing has no judge and booking is incomplete. Once a judge is added the booking will be completed. Add a judge


This verse was sent now from above,
Devoted to the man I love.
Happy New Year – I want to say,
Will you be happy every day?
I want to give you inspiration,
Inspire your imagination,
Please never go, and stay with me –
I’ll make you happy, you will see!


public abstract class Classifier
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
Classifier.ErrorTypes
a variable that represents the different error calculation types
|
| Modifier and Type | Field and Description |
|---|---|
static double |
MISSING_VALUE
The way we represent missing values from within our implementation
|
static boolean |
ON_WINDOWS
Are we on a Windows machine (sometimes this matters)
|
| Constructor and Description |
|---|
Classifier()
A dummy constructor which keeps
Serializable happy |
| Modifier and Type | Method and Description |
|---|---|
void |
addTrainingDataRow(java.lang.String[] x_i)
Adds an observation / record to the training data array.
|
abstract void |
Build()
build the machine learning classifier (implemented by a daughter class), you must
set the data first |
double |
calculateInSampleLoss(Classifier.ErrorTypes type_of_error_rate,
int num_cores_evaluate)
Calculates the in-sample error based on a specified error metric
|
Classifier |
clone() |
void |
dumpDataToFile(java.lang.String optional_title)
Useful for debugging.
|
double |
Evaluate(double[] record)
A wrapper for
Evaluate(double[], int) where one processor core is used |
abstract double |
Evaluate(double[] record,
int num_cores)
After the classifier has been built, new records can be evaluated / predicted
(implemented by a daughter class)
|
void |
finalizeTrainingData()
This method finalizes the training data after all
records have been added via the method
addTrainingDataRow(java.lang.String[]) . |
int |
getN()
How many observations are in the training data set?
|
int |
getP()
How many features are in the training data set?
|
double |
getResponseFromRecord(double[] record)
Given a data record, return the Y (response) value i.e.
|
static boolean |
isMissing(double x)
Is this value missing?
|
void |
setData(java.util.ArrayList<double[]> X_y)
This method sets the training data of this machine learning classifier.
|
void |
setUniqueName(java.lang.String unique_name) |
abstract void |
StopBuilding()
Stop the classifier during its building phase
|
void |
suppressOrWriteToDebugLog()
Useful for debugging only.
|
void |
writeStdOutToLogFile() |
public static final boolean ON_WINDOWS
public static final double MISSING_VALUE
public Classifier()
Serializable
happypublic static boolean isMissing(double x)
x
- The value we wish to check if it is missingpublic void addTrainingDataRow(java.lang.String[] x_i)
MISSING_VALUE
's.x_i
- The observation / record to be added as a String array.public void finalizeTrainingData()
addTrainingDataRow(java.lang.String[])
.public void setData(java.util.ArrayList<double[]> X_y)
n
, p
,
y_orig
, X_y
and X_y_by_col
.X_y
- The list of double vectors to be set as the training data.public abstract void Build()
set the data
firstpublic void suppressOrWriteToDebugLog()
https://blogs.oracle.com/nickstephen/entry/java_redirecting_system_out_and
public abstract double Evaluate(double[] record, int num_cores)
record
- The observation to be evaluated / predictednum_cores
- The number of processor cores to be used during the evaluation / predictionpublic double Evaluate(double[] record)
Evaluate(double[], int)
where one processor core is usedrecord
- The observation to be evaluated / predictedpublic double getResponseFromRecord(double[] record)
record
- the data recordpublic abstract void StopBuilding()
public int getP()
public int getN()
public void dumpDataToFile(java.lang.String optional_title)
public double calculateInSampleLoss(Classifier.ErrorTypes type_of_error_rate, int num_cores_evaluate)
type_of_error_rate
- The error metric to use to compute lossnum_cores_evaluate
- The number of processor cores to usepublic Classifier clone()
clone
in class java.lang.Object
public void setUniqueName(java.lang.String unique_name)
public void writeStdOutToLogFile()


https://medium.com/bugbountywriteup/want-to-take-over-the-java-ecosystem-all-you-need-is-a-mitm-1fc329d898fb
https://max.computer/blog/how-to-take-over-the-computer-of-any-java-or-clojure-or-scala-developer/
Software has the ability to check for software updates automatically.
Think updates, container pulls, dependency pulls, and more!
When in a MitM position, tools can check for this traffic and force a response that an update IS available...your evil upgrade.
[evilgrade](https://github.com/infobyte/evilgrade) | Malicious software update MitM exploit kit. Includes support for JRE, WinZip, OpenOffice, iTunes, Notepad++ and more
[dilettante](https://github.com/mveytsman/dilettante?source=post_page-----1fc329d898fb----------------------) | Maven central doesn't do SSL when serving you JARs. MiTM proxy.
See Tools > MitM > Evilgrade for example attack scenario


Settings
Input
Source:
UART
BLE
Protocol:
Smart port
CRSF
Bluetooth
Address:
Outputs
USB
Mode:
Disabled
Pass-thru
Filter
Bluetooth serial
Name:
Mode:
Disabled
Pass-thru
Filter
BLE
Name:
Mode:
Disabled
Pass-thru
Filter
Web
WiFi
Default:
Off
Station (outbound)
Access point (inbound)
Access point and station
Access point
Hostname:
SSID:
Password:
Client
Hostname:
SSID:
Password:
Map
Tiles:
API key:
MQTT
Broker:
Port:
Topic:
Misc
Internal sensors:
%STATUS%
Telemetry


Susan Kennedy
Unafffiliated
Retired
Some college
80908
None
I currently sit on the Board for Overflow Support Foundation connected with Jibu. A project in Africa that is in 6 countries and teaches through business franchise method a way for the average African to own and run their own business and at the same time providing clean, affordable water. All of my other experience was before 2015. I was on the school board for 6 years for Monument Academy in Monument Colorado, The Public Relations Committee for Gleneagle Golf Club for 3 years.
As a business owner of multiple mobile home parks and rv parks within Canon City, Colorado Springs, and Durango, I have had to navigate conflicts that arose with tenants, city officials, and the court system in all 3 counties. I did this for 11 years and worked hard to help under privilege individuals navigate government programs for help. I also was involved in the mentoring plan for homeless women through the Springs Rescue Mission in Colorado Springs.
I want to help Colorado become a model for fairness and high quality elections.
It will be very similar to sitting on a jury and hearing all the facts, allowing everyone to speak, affirming different opinions and not letting emotions dictate the outcome. Understanding the rules of the committee and helping all involved function within those parameters would be necessary and keep the committee focused on task.
I believe my ability to see a vision and bring others on board is crucial to being able to lay out information in a way that others can see and apply. As a house flipper and rental property owner of 10 years, I have been able to look at a multitude of problems and see a way to solve them. In working with difficult tenants, I was able to lay out solutions to their problems in a way they could understand. When working on a house project, I managed multiple crews, city inspectors and surrounding neighbors through keeping everyone informed, and always addressing any concerns promptly. Staying calm and focused, stating the facts of a problem have always served me well.
Female


Make reservation parking space for your car at any company availabe
MAKE RESERVATIONfrom $15.00 per day
from $15.00 per day
from $15.00 per day
For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by
For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by
For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by
For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by
Here are information about our parking companies we work with:
For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by
Here are our clients sliding estimonials WWF's website:
For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by 1.2 million members in the United States and close to 5 million globally.


I am no electronic expert, but with (a lot of) patience I've managed to almost complete a custom project which can be described as follows: solar powered arduino with battery backup and several sensors: 2 x temperature (1 external, 1 internal), 1 x light sensor (LDR), 2 x voltage sensors (battery + solar), 1 x pressure sensor. All of the sensors readings are updated every 2 mins and then uploaded to emonCMS through a RFM69CW interface.
I have attached a schematic of the project, which has changed a bit (removed the current sensors and added the environmental sensors described above) but should give you an idea of what it is all about.
Thanks to Jeelib and the awesome work of all the people at OEM, the project has been running standalone (on battery only at the moment) for one month.
I am overall happy of the result, but there is one thing I am very confused about and did not manage to understand.
As you can see in the attached code (indipowerV4.ino) at line 46, I have declared:
const int time_between_readings= 2;
then, at line 364, I've written:
for (int i=0; i<time_between_readings; i++)
{
dodelay(55000);
}
The problem is that, in reality, the update interval is quite random. At times it updates every 2 mins as per my request, at times it updates every 10 mins. I have attached an image showing what I mean.
It is not a big issue, but it is annoying, in particular because I do not understand why this is happening.
Also, what bothers me most is that a similar "sleep code" runs smoothly on both the emonTX and the two emonTH I own.
I would really be thankful to anyone that can give me a hint on this!
Sleepy::loseSomeTime in custom project not working properly
Submitted by mrcsrplln on Wed, 23/12/2015 - 09:17Hi everyone,
I am no electronic expert, but with (a lot of) patience I've managed to almost complete a custom project which can be described as follows: solar powered arduino with battery backup and several sensors: 2 x temperature (1 external, 1 internal), 1 x light sensor (LDR), 2 x voltage sensors (battery + solar), 1 x pressure sensor. All of the sensors readings are updated every 2 mins and then uploaded to emonCMS through a RFM69CW interface.
I have attached a schematic of the project, which has changed a bit (removed the current sensors and added the environmental sensors described above) but should give you an idea of what it is all about.
Thanks to Jeelib and the awesome work of all the people at OEM, the project has been running standalone (on battery only at the moment) for one month.
I am overall happy of the result, but there is one thing I am very confused about and did not manage to understand.
As you can see in the attached code (indipowerV4.ino) at line 46, I have declared:
const int time_between_readings= 2;
then, at line 364, I've written:
for (int i=0; i<time_between_readings; i++)
{
dodelay(55000);
}
The problem is that, in reality, the update interval is quite random. At times it updates every 2 mins as per my request, at times it updates every 10 mins. I have attached an image showing what I mean.
It is not a big issue, but it is annoying, in particular because I do not understand why this is happening.
Also, what bothers me most is that a similar "sleep code" runs smoothly on both the emonTX and the two emonTH I own.
I would really be thankful to anyone that can give me a hint on this!


The games on this website teach a child to program.
The Isla programming language is open source and the code is on Github. The code that powers the games on this website is also open source and also on Github.


Location
Id:
24
Name:
Rick's Battery Microverse
Tipo:
Microverse
Dimension:
Replacement Dimension
Residents:
['https://rickandmortyapi.com/api/character/65', 'https://rickandmortyapi.com/api/character/388']


-
free +
openWe know what it's like to be a student or budding entrepreneur. That's why all of our events are free, so you have access to the resources you need.
-
healthcare focused
Healthcare entrepreneurs have a special set of challenges.  Send us an email and learn how you can get involved or what programming you would like to see.
Meet the Team
Will Clifton, MD
Motivated to connect more physician-entrepreneurs, Will founded Enventure, a grass-roots community focused on growing and educating Houston's medical entrepreneur community. Enventure connects young and aspiring entrepreneurs with experienced professionals to accelerate the growth of Houston's medtech startup scene. Enventure's educational programming and one-on-one mentorship launched four life science startups in Houston in 2014.
Will earned his biomedical engineering degree from USC, where he joined his first medical startup, commercializing a glucose sensor the size of a human hair. After making Houston his home in 2007, Will received his MD from Baylor College of Medicine. Currently, Will is the Director of Clinical Development for Procyrion, developing a miniature heart assist pump implanted without surgery. Will has consulted for many of Houston's seed-stage startups, including MolecularMatch, NanoLinea, Anaxiom, and Nano3D.
Joanna Nathan
Joanna earned her Master's of Bioengineering from Rice and turned a senior design project into a medical startup. The Saranas 'Smart Sheath' detects internal bleeding without changing the cardiologist’s workflow. Not satisfied with the opportunities for young entrepreneurs in Houston, Joanna co-founded Enventure, where she has led many new programs and fundraising initiatives. Joanna loves to help others solve important medical problems one startup at a time.
Triparna Ghosh-Choudhury
Triparna Ghosh-Choudhury was born and raised in Texas and that is where her heart truly lies. She attended St. Mary's University and received her B.S. in Biology with minors in Chemistry and Math. She is currently a pre-doctoral fellow at Baylor College of Medicine with a focus on developing combination therapeutics in ovarian cancer. Along with a passion for science she also discovered a passion for entrepreneurship and helped found enventure in mid-2012. After graduating with her PhD, she intends to stay in Texas and work in the start-up community.
Sarah Hein
Sarah is the first employee and Director of Research at Courier Therapeutics, a cancer immunotherapy starup. She has participated in enventure since 2013, coming on as a core member in 2015 and launching the Foundations workshop series to provide in-depth entrepreneurship education to the TMC community. Sarah graduated with her PhD in Molecular and Cellular Biology at Baylor College of Medicine, where she studied how past pregnancy can have lasting effects on a woman's likelihood of developing breast cancer, which she presented at an international Gordon Research Conference.
 Fergus Wong
Fergus is a designer at enventure and develops identity, posters, and presentations for enventure programs.
Fergus received a B.S. in Bioengineering from the University of California, Berkeley and a PhD in Bioengineering from Rice University. During his graduate studies, Fergus interned under medical device entrepreneur Dr. Billy Cohn and created prototypes such as a robotic catheter placement device that automates vascular access procedures and a portable leg compression device to improve lower leg blood circulation. His interests are in life science entrepreneurship and medical device design.
Grady Gastelum
Grady is a PhD candidate in the Translational Biology and Molecular Medicine (TBMM) program at Baylor College of Medicine. Prior to graduate school, he earned his B.S. in Cell & Molecular Biology at San Diego State University. Grady’s current research focuses on lung cancer, using animal models to elucidate the signaling pathways responsible for tumor initiation and progression. He joined Enventure at the beginning of 2016 and helps run the Foundations workshop series. After graduate school, Grady plans to focus his career on biomedical innovation in Houston.
Emily Evans
Emily is a Rice Bioengineering PhD Student studying cancer nanoimmunotherapy. She is a Bioventures alum and facilitates programming for BYOBrainstorm and Bioventures 2017. She is most interested in developing therapeutics for cancer and neglected diseases.
Kedar Karkare
Kedar is a PhD candidate at the University of Houston studying evolutionary genetics. Prior to graduate school, he received his bachelors degree in biology from the University of North Carolina at Chapel Hill. Kedar ran the BYOBrainstorm series in 2016 and is participating is a team leader in Bioventures 2017. He is also a business development intern at Fannin Innovation Studios.
Sayantan Mitra
Mitra is pursuing his Ph.D. in Biochemistry and Molecular Biology at Baylor College of Medicine. Before joining BCM, he earned his bachelor's and master's degrees from the University of Calcutta. Mitra's research focuses on characterizing the structural flexibility of NS1 protein in flu virus. Mitra is also delving into the business aspect of science by serving as an adviser for Canada-based start-up BenchSci. He is also a business development intern at Fannin Innovation Studio. Apart from science, Mitra loves exploring national parks, rock climbing, and photography.
Alumni
Matthew Collinson-Pautz
Matt is currently a research intern at Bellicum Pharmeceuticals. He has been involved in Houston's cutting edge ideas and research since 2009. As a founding member of enventure, Matt helped expand the infrastructure to stimulate growth in the biotech sector. As a graduate student in the Translational Biology and Molecular Medicine program, Matt is working towards completion of his PhD focusing on cancer vaccine development.
Amy Hurwitz
Amy Hurwitz is a Ph.D. candidate at Baylor College of Medicine in the Interdepartmental Program for Translational Biology and Molecular Medicine (TBMM). Prior to graduate school, Amy received a B.S. in biochemistry with a minor in business law from the University of Southern California in Los Angeles and also spent time doing research at UCLA and Caltech. Outside of her career interests in translating exciting technologies into marketable products, co-founding enventure in 2012, she has enjoyed Scottish Highland dancing since the age of 5 and mid-distance running.
Simran Madan
Simran is an HHMI Med into Grad pre-doctoral fellow in the Translational Biology and Molecular Medicine Program at Baylor College of Medicine. She conceived of and developed the BioVentures course as a new initiative for Enventure. Simran participated in the first offering of the course in 2014 as a member of the Riha Life team, which tied for first place. She received her B.S. in Cell and Molecular Biology from the University of Texas at Austin. Her current research focus is urea cycle disorders and osteosarcoma. She has received a CPRIT pre-doctoral fellowship for her work on osteosarcoma.
Varun Kumar
Varun is an internal medicine resident at Baylor College of Medicine. A Houstonian since the first grade, Varun was a graduate of Rice University and was active in the Rice 360 Initiative. As a medical student at BCM, he was part of the core team from the first Enventure meetup to its growth into an organization of over 500 members. Varun helped develop the educational curriculum and laid the groundwork for the Foundations course. He is now pursuing a career in medical innovation as a resident physician with an interest in interventional cardiology.
Le Huang
Le Huang is a Ph.D. graduate in Genes and Development Program at University of Texas Graduate School of Biomedical Sciences at Houston. Her graduate research was to use genetic model to study the kidney development and the mechanisms of Wilms tumor, a pediatric kidney cancer. She became interested in entrepreneurship through Jack Gill’s class “Life Science Entrepreneurship” offered at Rice University and Enventure programs. She is very fascinated about the rapid growth of the life science entrepreneurship community, resources and environment in Houston.
Courtney Garcia
Courtney Garcia is a Ph.D. candidate in the Neuroscience department at Baylor College of Medicine studying neural correlates and circuit development of sensory perception. Career development, collaboration, and a fascination for biotechnology commercialization and business development have led Courtney to enventure where she hopes to contribute to the success of the Houston healthcare entrepreneurial community. Other passions of Courtney's include training and racing her Arabian horses in Endurance competitions, fitness and craft beer.
Board of Directors
-
David Schubert
David Schubert
COO, Accelerator Corp
From May of 2012- August of 2014, Mr. Schubert served as Executive Director of the Houston Area Translational Research Consortium (HATRC) at Rice University, a biotechnology-based non-for-profit organization that focused on filling the gap between R&D investment and translation of discovery to the clinic in the form of marketable products to treat diseases.
From 2005-May of 2012, Mr. Schubert served as the President and Chief Business Officer of Accelerator Corp. Prior to Accelerator, in 2001 Mr. Schubert spun CellExSys out of Targeted Genetics Corporation (where he led Business Development and Investor Relations from 1997-2001), and then successfully led the acquisition of CellExSys by Chromos Molecular Systems (Vancouver, BC). Mr. Schubert began his career in 1993 at Baxter Healthcare Corporation where he served in various roles in strategic planning, sales and marketing in both Europe and the United States.
Mr. Schubert holds an MBA degree with concentrations in Marketing and Management from The Pennsylvania State University, an M.S. in Biology with a concentration in Immunology from Utah State University and a BS in Biology and a BA in Psychology from Eastern Nazarene College in Quincy, Massachusetts. Mr. Schubert serves as Chairman of the Board of Axonia Medical, and as member of the Board of Directors of The National Marrow Donor Program (NMDP).
-
Ann Tanabe
Ann Tanabe
CEO, BioHouston
Ms. Ann Tanabe has been serving the Houston entrepreneurship community at BioHouston since January 2011. Ms. Tanabe served as Vice President of Investor Relations at Synthesis Energy Systems, Inc. from May 2008 to December 2010. She serves as the Vice President of Investor Relations and Corporate Communications at Encysive Pharmaceuticals Inc. Ms. Tanabe served as Director of Investor Relations and Corporate Communications at Encysive Pharmaceuticals Inc. (formerly Texas Biotechnology Corp). From October 2000 to July 2003, she served as Investor Relations Manager and Corporate Communications Coordinator to Texas Biotechnology (the predecessor of Encysive Pharmaceuticals). She earned a BA degree from Loyola Marymount University.


Cyberspace, the seamless integration of physical, social, and mental spaces, is an integral part of our society, ranging from learning and entertainment to business and cultural activities, and so on. There are, however, a number of pressing challenges associated with cyberspace. For example, how do we strike a balance between the need for strong cybersecurity and preserving the privacy of ordinary citizens?
To address these challenges, there is a need to establish new science and research portfolios that incorporate cyber-physical, cyber-social, cyber-intelligent, and cyber-life technologies in a cohesive and efficient manner. This is the aim of the IEEE Cyber Science and Technology Congress (CyberSciTech). IEEE CyberSciTech has been successfully held in Auckland, New Zealand, in 2016, in Orlando, USA, in 2017 and in Athens, Greece, in 2018.
In 2019, we will continue to offer IEEE CyberSciTech with the aim of providing a common platform for scientists, researchers, and engineers to share their latest ideas and advances in the broad scope of cyber-related science, technology, and application topics. In addition, this is also a platform to allow relevant stakeholders to get together, discuss and identify ongoing and emerging challenges, in order to understand and shape new cyber-enabled worlds.
All accepted papers will be published by IEEE (IEEE-DL and EI indexed) in Conference Proceedings. Best Paper Awards will be presented to high quality papers. Selected papers will be recommended to prestigious journal special issues.
Authors are invited to submit their original work that has not previously been submitted or published in any other venue.
Regular, work-in-progress (WiP), workshop/special session, and poster papers all need to be in IEEE CS format and submitted via EDAS.
A regular paper is between 6-8 pages. A WiP, workshop, or special session paper should be between 4-6 pages and a poster paper should be between 2-4 pages.
Publication
All accepted papers in the main tracks, workshops, special sessions and demos/posters will be published in an IEEE Computer Society proceedings (EI indexed).
At least one author must register for the conference and present the work.
Papers that are not presented at the conference will be removed from the IEEE proceedings.
Extended versions of selected excellent papers will be considered for publication in special issues of prestige journals (SCI/EI indexed).
[19 Apr] Call for Late Breaking Innovation Papers Announced!
[27 Mar] Venue updated!
[25 Mar] Special Issue updated!
[13 Feb] Submission Opens
[11 Nov] The CyberSciTech 2018 proceedings are now available on IEEExplore!
Regular Paper Due (firm): April 20, 2019
Late Breaking Innovation Due (extended): May 15, 2019
Work-in-Progress Paper Due: May 15, 2019
Poster Paper Due: May 15, 2019
Workshop Paper Due: May 15, 2019
Authors Notification: May 25, 2019
Camera-ready Submission: June 20, 2019
Special Interest Group on Computer Security of Information Processing Society of Japan


// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt #ifndef UNITY_STANDARD_CONFIG_INCLUDED #define UNITY_STANDARD_CONFIG_INCLUDED // Define Specular cubemap constants #ifndef UNITY_SPECCUBE_LOD_EXPONENT #define UNITY_SPECCUBE_LOD_EXPONENT (1.5) #endif #ifndef UNITY_SPECCUBE_LOD_STEPS #define UNITY_SPECCUBE_LOD_STEPS (6) #endif // Energy conservation for Specular workflow is Monochrome. For instance: Red metal will make diffuse Black not Cyan #ifndef UNITY_CONSERVE_ENERGY #define UNITY_CONSERVE_ENERGY 1 #endif #ifndef UNITY_CONSERVE_ENERGY_MONOCHROME #define UNITY_CONSERVE_ENERGY_MONOCHROME 1 #endif // "platform caps" defines: they are controlled from TierSettings (Editor will determine values and pass them to compiler) // UNITY_SPECCUBE_BOX_PROJECTION: TierSettings.reflectionProbeBoxProjection // UNITY_SPECCUBE_BLENDING: TierSettings.reflectionProbeBlending // UNITY_ENABLE_DETAIL_NORMALMAP: TierSettings.detailNormalMap // UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS: TierSettings.semitransparentShadows // disregarding what is set in TierSettings, some features have hardware restrictions // so we still add safety net, otherwise we might end up with shaders failing to compile #if defined(SHADER_TARGET_SURFACE_ANALYSIS) // For surface shader code analysis pass, disable some features that don't affect inputs/outputs #undef UNITY_SPECCUBE_BOX_PROJECTION #undef UNITY_SPECCUBE_BLENDING #undef UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS #elif SHADER_TARGET < 30 #undef UNITY_SPECCUBE_BOX_PROJECTION #undef UNITY_SPECCUBE_BLENDING #undef UNITY_ENABLE_DETAIL_NORMALMAP #ifdef _PARALLAXMAP #undef _PARALLAXMAP #endif #endif #if (SHADER_TARGET < 30) || defined(SHADER_API_GLES) #undef UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS #endif #ifndef UNITY_SAMPLE_FULL_SH_PER_PIXEL // Lightmap UVs and ambient color from SHL2 are shared in the vertex to pixel interpolators. Do full SH evaluation in the pixel shader when static lightmap and LIGHTPROBE_SH is enabled. #define UNITY_SAMPLE_FULL_SH_PER_PIXEL (LIGHTMAP_ON && LIGHTPROBE_SH) // Shaders might fail to compile due to shader instruction count limit. Leave only baked lightmaps on SM20 hardware. #if UNITY_SAMPLE_FULL_SH_PER_PIXEL && (SHADER_TARGET < 25) #undef UNITY_SAMPLE_FULL_SH_PER_PIXEL #undef LIGHTPROBE_SH #endif #endif #ifndef UNITY_BRDF_GGX #define UNITY_BRDF_GGX 1 #endif // Orthnormalize Tangent Space basis per-pixel // Necessary to support high-quality normal-maps. Compatible with Maya and Marmoset. // However xNormal expects oldschool non-orthnormalized basis - essentially preventing good looking normal-maps :( // Due to the fact that xNormal is probably _the most used tool to bake out normal-maps today_ we have to stick to old ways for now. // // Disabled by default, until xNormal has an option to bake proper normal-maps. #ifndef UNITY_TANGENT_ORTHONORMALIZE #define UNITY_TANGENT_ORTHONORMALIZE 0 #endif // Some extra optimizations // Simplified Standard Shader is off by default and should not be used for Legacy Shaders #ifndef UNITY_STANDARD_SIMPLE #define UNITY_STANDARD_SIMPLE 0 #endif // Setup a new define with meaningful name to know if we require world pos in fragment shader #if UNITY_STANDARD_SIMPLE #define UNITY_REQUIRE_FRAG_WORLDPOS 0 #else #define UNITY_REQUIRE_FRAG_WORLDPOS 1 #endif // Should we pack worldPos along tangent (saving an interpolator) // We want to skip this on mobile platforms, because worldpos gets packed into mediump #if UNITY_REQUIRE_FRAG_WORLDPOS && !defined(_PARALLAXMAP) && !defined(SHADER_API_MOBILE) #define UNITY_PACK_WORLDPOS_WITH_TANGENT 1 #else #define UNITY_PACK_WORLDPOS_WITH_TANGENT 0 #endif #endif // UNITY_STANDARD_CONFIG_INCLUDED


“Women who perhaps suffered most in this period were, ironically, those like the Queen who did not wish to marry. Tudor society did not have many avenues open to single women and, following the Reformation, those avenues were even less. Before, women were able to become nuns and look forward to a rewarding life in convents, perhaps be a Mother Superior one day. But with the Reformation, the convents were closed. Wealthy single women (heiresses of property) could look forward to being mistress of their estates and wield the power in the community this would bring, but for poor women, the only long-term “career” really open to them was domestic service. It was not surprising, therefore, that most women married. Marriage was seen as the desirable state for both men and women, and single women were sometimes looked upon with suspicion. It was mainly single women who were accused of being witches by their neighbours.”
“Our boys, when they arrive at years of maturity and can take earn of a wife, should get married, and there should not be a lot of young men growing up in our midst who ought to be, but are not married. While I do not make the remark to apply to individual cases, I am firmly of the opinion that a large number of unmarried men, over the age of twenty-four years, is a dangerous element in any community, and an element upon which society should look with a jealous eye. For every man knowing himself, knows how his fellow-man is constituted; and if men do not marry, they are too apt to do something worse. Then, brethren, encourage our young men to marry, and see that they are furnished employment, so that they can marry” (George Q. Cannon, Annual Conference at Salt Lake City, Sunday morning, April 7, 1878. Reported by George F. Gibbs. Journal of Discourses, vol. 20, p.7).
"Stigmatized singles and deemed them abnormal (marriage is elevated and the only “normal” path to intimacy). Single men and women are “extra”; psychiatry shapes this picture of singles. In a survey taken in 1957, eighty percent of Americans believed that people who preferred to remain single were “sick,” “neurotic,” or “immoral.” Unmarried women were deemed suspect, as they could steal away a husband at any time. And unwed men were seen as “narcissistic, deviant, and pathological."
Unmarried women were rounded up and imprisoned in an effort to control women’s productive and reproductive rights, in between World Wars I and II. Women’s roles in society were starting to diversify, and this was an effort to reassert control. In order to be released, a man would have to come and pay for the right to marry her. This affected women who could not find a man to marry and women who did not want to marry due to either economic factors, her own autonomy, or the simple desire not to marry.
“If heterosexuality is one of the ways in which men’s power over women is maintained, then lesbianism is or can be a threat to that power. This aspect of resistance involves all women outside of heterosexuality, including celibate or unmarried women. Like lesbians, they are all women who are not subject to men’s social and sexual power through a personal relationship. Thus, although attacks were made on unmarried women teachers primarily as spinsters rather than as lesbians, it will be argued that they were maligned for being outside heterosexuality.”
“While emotional problems are common among single men, a number of unwed men adjust completely to life without women and find a thoroughly satisfying existence alone. Some of these seem to have found fulfillment in their working life exclusively. Examples can be found in every field. Other men find a sense of completion by rounding out their business lives with an engrossing hobby, often in the sports field…
However well he may adjust to his lonely life, the single man suffers disabilities that seem to be traceable directly to his bachelorhood. Unwed men are much less healthy than their married brothers. Metropolitan Life Insurance Company studies show that more than four times as many unattached men as married men (ages 20–74) die of tuberculosis. At ages 20–44, five to six times as many unmarried men as husbands die of influenza and pneumonia. Prior to mid-life, nine divorced men are victims of cirrhosis of the liver to each married man killed by that disease.”
A survey done in 2003 on AVEN showed that 41.65% of respondents considered themselves "straight asexual", 9.94% considered themselves gay asexual, 22.89% considered themselves bi-asexual, 16.75% considered themselves "asexual asexual" (This could mean two things. Aromantic asexual, or does not use the SAM.), and 8.77% considered themselves "other" which included changing attraction, and all other orientations.
In 2014, Asexual Census published a survey with results regarding the asexual population (it was determined that appx. 30% of people who call themselves asexual also identify as arospec, appx. 15% for people who are gray-a, and appx. 10% for demisexuals.)
Based on this data, tumblr user ace-muslim calculated that 81.6% of aromantic respondents are asexual, 9.5% of aromantic respondents are gray-A, 2.5% of aromantic respondents are demisexual, 6.4% of aromantic respondents are non-ace. There were a total of 3,324 non-ace respondents, of whom 4.3% are aromantic. This comes to 143 aromantic non-ace respondents.
Queerplatonic was originally coined in a 2010 Dreamwidth journal entry. It was considered a good term because not only did it avoid talking about the gender of their partner, it also emphasized the platonic-ness of the relationship. Sometimes QPPs (queerplatonic partners) were referred to as zucchini, because of the frustration with lack of words to describe platonic relationship partners. This term was coined on the same Dreamwidth entry. The following quotes are excerpts from that Dreamwidth entry:
“Ok, I am now referring to these kinds of relationships as zucchini. This is official, and so shall it be. I am actually not averse to borrowing a word from another language since English does that oh so very much anyhoodle. This is so frustrating because it feels like English forces me to define these relationships by something they are not, rather than what they are, and I loathe reverse definitions. Although I kind of like queerplatonic as a definer for the attraction I feel to my zucchini; it neatly avoids discussing the gender of either party involved, while emphasizing the idea that it is a deep (almost symbiotic in some ways) emotional connection that transcends what I think of as friendship. Hrm.”
“ZUCCHINI. I am totally using that now. I also think borrowing may be a way to go, my main worries are whether we can find a word in another language that means what we want it to (sadly I'm only familiar with various Indo-European ones, German's not helpful because the word is cognate [although there, I should add, the words for friend and boy/girlfriend are actually the same], French has got the ami/e vs copain/copine distinction going on but I'm not sure what that actually means in practice... gah) and possible worries about appropriation. Although it *is* how languages work, so. :/ Oh my I liiiike queerplatonic. I think I've mentioned before that one of the options I play with is "having a queer romantic orientation" - I really *like* this because I think "queer" works really well for these sorts of "YOUR BOXES, THEY ARE INSUFFICIENT" relationships - zucchini and other sorts of vegetables - but I'm worried it'll end up reinforcing the idea that heteroromantic ace folk can't be queer.”
This was the first aromantic flag. However, it was changed due to the fact that it looked too similar to the Rastafarian and Jamaican flags, and changes were suggested.
This flag was one of the many flags proposed as a replacement for the first flag. It was not the only one, but it was one of the most common, hence its inclusion here. However, many aromantic people, including people with autism, found that this flag was difficult to look at.
This is currently the most commonly used aromantic flag and solved the yellow problem, as well as being completely unique.


Disabled Dropdown
Sri Lanka
Philippines
Singapore
Select Province
Western
Eastern
Southern
Northen
Central


In my latest project I had kept my solution tidy with my main app project, my unit test project and integration test project. I tend to stick with a naming convention such as MainApp, MainApp.Tests.Unit & MainApp.Tests.Integration.
I had begun writing my integration tests for a repository that hits the database and returns data. Currently it was one method being called in the repository. xUnit allows you to setup any test dependencies in the constructor of your test class. It also allows you to do any tidying up in a Dispose method if you implement IDisposable although this is frowned upon. However I felt for my needs I would implement this.
I was creating data in the database in the constructor which will get called before the test runs, retrieving data in the test, asserting and then deleting all data and resetting the auto-incrementing from the tables in the Dispose method.
This was working perfectly until I wanted to test another method on my repository.
I now needed to add data for my new method but realised if I added different data to the database in the constructor, I would be creating unnecessary data unrelated to the test.
My options were to move the constructor logic into separate methods and then call the methods in the test or have separate test classes per method in the repo.
I started playing with the attributes on my tests to see if xUnit offered me something and was chuffed to find the BeforeAfterTestAttribute
. This does exactly what it says on the tin. Its an abstract class that you inherit from for your own implementation and overide the Before
and After
methods;
public class RepoMethod1BeforeAfter : BeforeAfterTestAttribute
{
public override void After(MethodInfo methodUnderTest)
{
//Insert data into tables
}
public override void Before(MethodInfo methodUnderTest)
{
//Drop data from tables
}
}
[Fact]
[RepoMethod1BeforeAfter]
public void RepoMethod1_Should_be_Awesome()
{
//Check it's awesome
}
You can then put an attribute on the relevant tests that need to have specific data inserted/deleted and it keeps the design of your test class follow best practices as well as not implementing IDisposable.
The only thing I can spot as a slight issue is remembering to put the attribute on your tests but I think that'll be quite obvious when your tests start failing!