public interface TemporalField
Date and time is expressed using fields which partition the time-line into something meaningful for humans. Implementations of this interface represent those fields.
The most commonly used units are defined in ChronoField
.
Further fields are supplied in IsoFields
, WeekFields
and JulianFields
.
Fields can also be written by application code by implementing this interface.
The field works using double dispatch. Client code calls methods on a date-time like
LocalDateTime
which check if the field is a ChronoField
.
If it is, then the date-time must handle it.
Otherwise, the method call is re-dispatched to the matching method in this interface.
| Modifier and Type | Method and Description |
|---|---|
<R extends Temporal> |
adjustInto(R temporal,
long newValue)
Returns a copy of the specified temporal object with the value of this field set.
|
TemporalUnit |
getBaseUnit()
Gets the unit that the field is measured in.
|
default String |
getDisplayName(Locale locale)
Gets the display name for the field in the requested locale.
|
long |
getFrom(TemporalAccessor temporal)
Gets the value of this field from the specified temporal object.
|
TemporalUnit |
getRangeUnit()
Gets the range that the field is bound by.
|
boolean |
isDateBased()
Checks if this field represents a component of a date.
|
boolean |
isSupportedBy(TemporalAccessor temporal)
Checks if this field is supported by the temporal object.
|
boolean |
isTimeBased()
Checks if this field represents a component of a time.
|
ValueRange |
range()
Gets the range of valid values for the field.
|
ValueRange |
rangeRefinedBy(TemporalAccessor temporal)
Get the range of valid values for this field using the temporal object to
refine the result.
|
default TemporalAccessor |
resolve(Map<TemporalField,Long> fieldValues,
TemporalAccessor partialTemporal,
ResolverStyle resolverStyle)
Resolves this field to provide a simpler alternative or a date.
|
String |
toString()
Gets a descriptive name for the field.
|
default String getDisplayName(Locale locale)
If there is no display name for the locale then a suitable default must be returned.
The default implementation must check the locale is not null
and return toString()
.
locale
- the locale to use, not nullTemporalUnit getBaseUnit()
The unit of the field is the period that varies within the range.
For example, in the field 'MonthOfYear', the unit is 'Months'.
See also getRangeUnit()
.
TemporalUnit getRangeUnit()
The range of the field is the period that the field varies within.
For example, in the field 'MonthOfYear', the range is 'Years'.
See also getBaseUnit()
.
The range is never null. For example, the 'Year' field is shorthand for 'YearOfForever'. It therefore has a unit of 'Years' and a range of 'Forever'.
ValueRange range()
All fields can be expressed as a long
integer.
This method returns an object that describes the valid range for that value.
This method is generally only applicable to the ISO-8601 calendar system.
Note that the result only describes the minimum and maximum valid values and it is important not to read too much into them. For example, there could be values within the range that are invalid for the field.
boolean isDateBased()
A field is date-based if it can be derived from
EPOCH_DAY
.
Note that it is valid for both isDateBased()
and isTimeBased()
to return false, such as when representing a field like minute-of-week.
boolean isTimeBased()
A field is time-based if it can be derived from
NANO_OF_DAY
.
Note that it is valid for both isDateBased()
and isTimeBased()
to return false, such as when representing a field like minute-of-week.
boolean isSupportedBy(TemporalAccessor temporal)
This determines whether the temporal accessor supports this field. If this returns false, then the temporal cannot be queried for this field.
There are two equivalent ways of using this method.
The first is to invoke this method directly.
The second is to use TemporalAccessor.isSupported(TemporalField)
:
// these two lines are equivalent, but the second approach is recommended temporal = thisField.isSupportedBy(temporal); temporal = temporal.isSupported(thisField);It is recommended to use the second approach,
isSupported(TemporalField)
,
as it is a lot clearer to read in code.
Implementations should determine whether they are supported using the fields
available in ChronoField
.
temporal
- the temporal object to query, not nullValueRange rangeRefinedBy(TemporalAccessor temporal)
This uses the temporal object to find the range of valid values for the field.
This is similar to range()
, however this method refines the result
using the temporal. For example, if the field is DAY_OF_MONTH
the
range
method is not accurate as there are four possible month lengths,
28, 29, 30 and 31 days. Using this method with a date allows the range to be
accurate, returning just one of those four options.
There are two equivalent ways of using this method.
The first is to invoke this method directly.
The second is to use TemporalAccessor.range(TemporalField)
:
// these two lines are equivalent, but the second approach is recommended temporal = thisField.rangeRefinedBy(temporal); temporal = temporal.range(thisField);It is recommended to use the second approach,
range(TemporalField)
,
as it is a lot clearer to read in code.
Implementations should perform any queries or calculations using the fields
available in ChronoField
.
If the field is not supported an UnsupportedTemporalTypeException
must be thrown.
temporal
- the temporal object used to refine the result, not nullDateTimeException
- if the range for the field cannot be obtainedUnsupportedTemporalTypeException
- if the field is not supported by the temporallong getFrom(TemporalAccessor temporal)
This queries the temporal object for the value of this field.
There are two equivalent ways of using this method.
The first is to invoke this method directly.
The second is to use TemporalAccessor.getLong(TemporalField)
(or TemporalAccessor.get(TemporalField)
):
// these two lines are equivalent, but the second approach is recommended temporal = thisField.getFrom(temporal); temporal = temporal.getLong(thisField);It is recommended to use the second approach,
getLong(TemporalField)
,
as it is a lot clearer to read in code.
Implementations should perform any queries or calculations using the fields
available in ChronoField
.
If the field is not supported an UnsupportedTemporalTypeException
must be thrown.
temporal
- the temporal object to query, not nullDateTimeException
- if a value for the field cannot be obtainedUnsupportedTemporalTypeException
- if the field is not supported by the temporalArithmeticException
- if numeric overflow occurs<R extends Temporal> R adjustInto(R temporal, long newValue)
This returns a new temporal object based on the specified one with the value for
this field changed. For example, on a LocalDate
, this could be used to
set the year, month or day-of-month.
The returned object has the same observable type as the specified object.
In some cases, changing a field is not fully defined. For example, if the target object is a date representing the 31st January, then changing the month to February would be unclear. In cases like this, the implementation is responsible for resolving the result. Typically it will choose the previous valid date, which would be the last valid day of February in this example.
There are two equivalent ways of using this method.
The first is to invoke this method directly.
The second is to use Temporal.with(TemporalField, long)
:
// these two lines are equivalent, but the second approach is recommended temporal = thisField.adjustInto(temporal); temporal = temporal.with(thisField);It is recommended to use the second approach,
with(TemporalField)
,
as it is a lot clearer to read in code.
Implementations should perform any queries or calculations using the fields
available in ChronoField
.
If the field is not supported an UnsupportedTemporalTypeException
must be thrown.
Implementations must not alter the specified temporal object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations.
R
- the type of the Temporal objecttemporal
- the temporal object to adjust, not nullnewValue
- the new value of the fieldDateTimeException
- if the field cannot be setUnsupportedTemporalTypeException
- if the field is not supported by the temporalArithmeticException
- if numeric overflow occursdefault TemporalAccessor resolve(Map<TemporalField,Long> fieldValues, TemporalAccessor partialTemporal, ResolverStyle resolverStyle)
This method is invoked during the resolve phase of parsing.
It is designed to allow application defined fields to be simplified into
more standard fields, such as those on ChronoField
, or into a date.
Applications should not normally invoke this method directly.
fieldValues
- the map of fields to values, which can be updated, not nullpartialTemporal
- the partially complete temporal to query for zone and
chronology; querying for other things is undefined and not recommended, not nullresolverStyle
- the requested type of resolve, not nullArithmeticException
- if numeric overflow occursDateTimeException
- if resolving results in an error. This must not be thrown
by querying a field on the temporal without first checking if it is supportedString toString()
The should be of the format 'BaseOfRange', such as 'MonthOfYear',
unless the field has a range of FOREVER
, when only
the base unit is mentioned, such as 'Year' or 'Era'.
Dracula Javadoc Sample, Made with Allan Im.


×
Payment Details
{{cheque_detail_error}}
Outgoing Payment Details
Particulars
Tax Rate
Tax Rate
{{tax.tax_rate}} %
Payment Details
Reference No.
Amount
Inc.Tax Amount
Bank Name
Date
Beneficiary
Transfer From Bank
Select Bank
{{item.bank_name}}{{item.bank_branch}},{{item.bank_city}}
Add More
Save
×
Payment Details
{{cheque_detail_error}}
Payment Details
Reference No.
Amount
Inc.Tax Amount
Bank Name
Date
Beneficiary
Transfer From Bank
Select Bank
{{item.bank_name}}{{item.bank_branch}},{{item.bank_city}}
Update
×
Status
Website
Bounced
Cleared
Save
×
{{title_text}}
Comments
Enter OTP


Class Signus
Provides cryptographic functionality.
Namespace: Hyperledger.Indy.SignusApi
Assembly: Hyperledger.Indy.Sdk.dll
Syntax
public static class Signus : Object
Methods
CreateAndStoreMyDidAsync(Wallet, String)
Creates signing and encryption keys in specified wallet for a new DID owned by the caller.
Declaration
public static Task<CreateAndStoreMyDidResult> CreateAndStoreMyDidAsync(Wallet wallet, string didJson)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet to store the DID in. |
| String | didJson | The DID JSON. |
Returns
| Type | Description |
|---|---|
| Task<CreateAndStoreMyDidResult> | An asynchronous Task<TResult> that resolves to a CreateAndStoreMyDidResult when the operation completes. |
Remarks
Saves the identity DID with keys in a wallet so that it can be used to sign
and encrypt transactions. Control over the created DID is provided through the
didJson
parameter which accepts a JSON string with the following
optional parameters:
{
"did": string,
"seed": string,
"crypto_type": string,
"cid": bool
}
The did
member specifies the DID of the new entry. If not
provided and the cid
member is false
then the first 16 bits of the VerKey value
generated will be used as a new DID. If not provided and the cid
member is true
then the full
VerKey value will be used as a new DID. If the did
member is provided then the keys will be
replaced - this is normally used in the case of key rotation.
The seed
member specifies the seed to use when generating keys. If not provided
then a random seed value will be created.
The crypto_type
member specifies the cryptographic algorithm used for generating
keys. If not provided then ed25519 curve is used.
note
The only value currently supported for this member is 'ed25519'.
The cid
member indicates whether the DID should be used in creating the DID.
If not provided then the value defaults to false.
DecryptAsync(Wallet, Pool, String, String, Byte[], Byte[])
Decrypts the provided message using the public key associated with my DID.
Declaration
public static Task<byte[]> DecryptAsync(Wallet wallet, Pool pool, string myDid, string did, byte[] encryptedMsg, byte[] nonce)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet containing the DID and associated secret key to use for decryption. |
| Pool | pool | The pool to use for resolving keys associated with the |
| String | myDid | The DID to use for decryption. |
| String | did | The DID of the encrypting party to use for verification. |
| Byte[] | encryptedMsg | The message to decrypt. |
| Byte[] | nonce | The nonce used to encrypt the message. |
Returns
| Type | Description |
|---|---|
| Task<Byte[]> | An asynchronous Task<TResult> that resolves to a byte array containing the decrypted message. |
Remarks
The DID specified in the myDid
parameter must have been previously created
with a secret key and stored in the wallet specified in the wallet
parameter or
exist on the ledger on the node pool specified in the pool
parameter.
For further information on storing a DID and its secret key see the CreateAndStoreMyDidAsync(Wallet, String) method.
DecryptSealedAsync(Wallet, String, Byte[])
Decrypts the provided message using the public key associated with the specified DID using the anonymous-encryption scheme.
Declaration
public static Task<byte[]> DecryptSealedAsync(Wallet wallet, string did, byte[] encryptedMsg)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet containing the DID and associated secret key to use for decryption. |
| String | did | The DID of the encrypting party to use for verification. |
| Byte[] | encryptedMsg | The message to decrypt. |
Returns
| Type | Description |
|---|---|
| Task<Byte[]> | An asynchronous Task<TResult> that resolves to a byte array containing the decrypted message. |
EncryptAsync(Wallet, Pool, String, String, Byte[])
Encrypts the provided message with the public key of the specified DID.
Declaration
public static Task<EncryptResult> EncryptAsync(Wallet wallet, Pool pool, string myDid, string did, byte[] msg)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet containing the DID to use for encryption. |
| Pool | pool | The node pool to read the public key from if required. |
| String | myDid | The DID used to encrypt the message. |
| String | did | The DID the message is to be encrypted for. |
| Byte[] | msg | The message to encrypt. |
Returns
| Type | Description |
|---|---|
| Task<EncryptResult> | An asynchronous Task<TResult> that resolves to an EncryptResult once encryption is complete. |
Remarks
If the wallet specified in the wallet
parameter contains the public key
associated with the DID specified in the did
parameter and the value has
not expired then this key will be used for encryption.
On the other hand, if the public key is not present in the wallet or has expired the public
key will be read from the ledger in the node pool specified in the pool
parameter and the wallet will be updated with the new public key if required.
For further information on registering a public key for a DID see the StoreTheirDidAsync(Wallet, String)method and for information on the expiry of values in a wallet see the CreateWalletAsync(String, String, String, String, String) and OpenWalletAsync(String, String, String) methods.
EncryptSealedAsync(Wallet, Pool, String, Byte[])
Encrypts the provided message with the public key of the specified DID using the anonymous-encryption scheme.
Declaration
public static Task<byte[]> EncryptSealedAsync(Wallet wallet, Pool pool, string did, byte[] msg)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet containing the DID to use for encryption. |
| Pool | pool | The node pool to read the public key from if required. |
| String | did | The DID the message is to be encrypted for. |
| Byte[] | msg | The message to encrypt. |
Returns
| Type | Description |
|---|---|
| Task<Byte[]> | An asynchronous Task<TResult> that resolves to a byte array containing the encrypted message once encryption is complete. |
Remarks
If the wallet specified in the wallet
parameter contains the public key
associated with the DID specified in the did
parameter and the value has
not expired then this key will be used for encryption.
On the other hand, if the public key is not present in the wallet or has expired the public
key will be read from the ledger in the node pool specified in the pool
parameter and the wallet will be updated with the new public key if required.
For further information on registering a public key for a DID see the StoreTheirDidAsync(Wallet, String)method and for information on the expiry of values in a wallet see the CreateWalletAsync(String, String, String, String, String) and OpenWalletAsync(String, String, String) methods.
GetDidMetadataAsync(Wallet, String)
Gets the metadata associated with the specified DID.
Declaration
public static Task<string> GetDidMetadataAsync(Wallet wallet, string did)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet that contains the DID. |
| String | did | The DID to get the metadata for. |
Returns
| Type | Description |
|---|---|
| Task<String> | An asynchronous Task<TResult> that resolves to a string containing the metadata associated with the DID. |
Exceptions
| Type | Condition |
|---|---|
| WalletValueNotFoundException | Thrown if the wallet does not contain the specified |
| InvalidStructureException | Thrown if the value provided in the |
GetEndpointForDidAsync(Wallet, Pool, String)
Gets the endpoint details for the specified DID.
Declaration
public static Task<EndpointForDidResult> GetEndpointForDidAsync(Wallet wallet, Pool pool, string did)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet containing the DID. |
| Pool | pool | The pool to resolve the endpoint data from if not present in the wallet. |
| String | did | The DID to get the endpoint data for. |
Returns
| Type | Description |
|---|---|
| Task<EndpointForDidResult> | An asynchronous Task<TResult> that resolves to an EndpointForDidResult containing the endpoint information associated with the DID. |
Remarks
If the did
is present in the wallet
and is considered "fresh" then
the endpoint will be resolved from the wallet. If, on the other hand, the DID is not present in the wallet or
is not fresh then the details will be resolved from the pool
and will be cached in the wallet.
KeyForDidAsync(Pool, Wallet, String)
Gets the verification key for the specified DID.
Declaration
public static Task<string> KeyForDidAsync(Pool pool, Wallet wallet, string did)
Parameters
| Type | Name | Description |
|---|---|---|
| Pool | pool | The pool to use for resolving the DID if it does not exist in the |
| Wallet | wallet | The wallet to resolve the DID from. |
| String | did | The DID to get the verification key for. |
Returns
| Type | Description |
|---|---|
| Task<String> | An asynchronous Task<TResult> that resolves to a string containing the verification key associated with the DID. |
Remarks
If the provided wallet
does not contain the verification key associated with the specified DID then
an attempt will be made to look up the key from the provided pool
. If resolved from the pool
then the DID and key will be automatically cached in the wallet
.
note
The CreateAndStoreMyDidAsync(Wallet, String) and CreateKeyAsync(Wallet, String) methods both create similar wallet records so the returned verification key in all generic crypto and messaging functions.
Exceptions
| Type | Condition |
|---|---|
| WalletValueNotFoundException | Thrown if the DID could not be resolved from the |
KeyForLocalDidAsync(Wallet, String)
Gets the verification key for the specified DID.
Declaration
public static Task<string> KeyForLocalDidAsync(Wallet wallet, string did)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet to resolve the DID from. |
| String | did | The DID to get the verification key for. |
Returns
| Type | Description |
|---|---|
| Task<String> | An asynchronous Task<TResult> that resolves to a string containing the verification key associated with the DID. |
Remarks
This method will obtain the verification key associated with the specified did
from the provided wallet
but will
not attempt to retrieve the key from the ledger if not present in the wallet, nor will it perform any freshness check against the ledger to determine
if the key is up-to-date. To ensure that the key is fresh use the KeyForDidAsync(Pool, Wallet, String) method instead.
note
The CreateAndStoreMyDidAsync(Wallet, String) and CreateKeyAsync(Wallet, String) methods both create similar wallet records so the returned verification key in all generic crypto and messaging functions.
Exceptions
| Type | Condition |
|---|---|
| WalletValueNotFoundException | Thrown if the DID could not be resolved from the |
ReplaceKeysApplyAsync(Wallet, String)
Applies temporary signing and encryption keys as main in the specified wallet for an existing DID owned by the caller
Declaration
public static Task ReplaceKeysApplyAsync(Wallet wallet, string did)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet the DID is stored in. |
| String | did | The did to replace the keys for. |
Returns
| Type | Description |
|---|---|
| Task | An asynchronous Task that with no return value the completes when the operation completes. |
ReplaceKeysStartAsync(Wallet, String, String)
Generates new signing and encryption keys in the specified wallet for an existing DID owned by the caller
Declaration
public static Task<string> ReplaceKeysStartAsync(Wallet wallet, string did, string identityJson)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet the DID is stored in. |
| String | did | The did to replace the keys for. |
| String | identityJson | The identity information as JSON. |
Returns
| Type | Description |
|---|---|
| Task<String> | An asynchronous Task<TResult> that resolves to a string containing the new verification key when the operation completes. |
Remarks
The developer has some control over the generation of the new keys through the value passed to
the identityJson
parameter. This parameter expects a valid JSON string
with the following optional members:
{
"seed": string,
"crypto_type": string
}
The seed
member controls the seed that will be used to generate they keys.
If not provided a random one will be created.
The crypto_type
member specifies the type of cryptographic algorithm will be
used to generate they keys. If not provided then ed22519 curve will be used.
note
The only value currently supported for this member is 'ed25519'.
SetDidMetadataAsync(Wallet, String, String)
Sets metadata for the specified DID.
Declaration
public static Task SetDidMetadataAsync(Wallet wallet, string did, string metadata)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet containing the DID. |
| String | did | The DID to set the metadata on. |
| String | metadata | The metadata to store. |
Returns
| Type | Description |
|---|---|
| Task | An asynchronous Task that completes when the operation completes. |
Remarks
Any existing metadata stored for the DID will be replaced.
Exceptions
| Type | Condition |
|---|---|
| WalletValueNotFoundException | Thrown if the |
| InvalidStructureException | Thrown if the value provided to the |
SetEndpointForDidAsync(Wallet, String, String, String)
Sets the endpoint details for the specified DID.
Declaration
public static Task SetEndpointForDidAsync(Wallet wallet, string did, string address, string transportKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet containing the DID. |
| String | did | The DID to set the endpoint details on. |
| String | address | The address of the endpoint. |
| String | transportKey | The transport key. |
Returns
| Type | Description |
|---|---|
| Task | An asynchronous Task that completes when the operation completes. |
Exceptions
| Type | Condition |
|---|---|
| InvalidStructureException | Thrown if the |
SignAsync(Wallet, String, Byte[])
Signs the provided message using the specified DID.
Declaration
public static Task<byte[]> SignAsync(Wallet wallet, string did, byte[] msg)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet that contains the DID. |
| String | did | The DID to sign with. |
| Byte[] | msg | The message to sign. |
Returns
| Type | Description |
|---|---|
| Task<Byte[]> | An asynchronous Task<TResult> that resolves to a byte array that contains signed message when signing is complete. |
Remarks
The DID specified in the did
parameter must already be stored
in the Wallet specified in the wallet
parameter
with a signing key in order to be able to sign a message. See the
CreateAndStoreMyDidAsync(Wallet, String) method for details.
StoreTheirDidAsync(Wallet, String)
Stores a remote party's DID for a pairwise connection in the specified wallet.
Declaration
public static Task StoreTheirDidAsync(Wallet wallet, string identityJson)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet to store the DID in. |
| String | identityJson | The identity JSON. |
Returns
| Type | Description |
|---|---|
| Task | An asynchronous Task that with no return value the completes when the operation completes. |
Remarks
The DID and optional associated parameters must be provided in the identityJson
parameter as a JSON string:
{
"did": string,
"verkey": string,
"crypto_type": string
}
The did
member specifies the DID to store. This value is required.
The verkey
member specifies the verification key and is optional.
The crypto_type
member specifies the type of cryptographic algorithm will be
used to generate they keys. If not provided then ed22519 curve will be used.
note
The only value currently supported for this member is 'ed25519'.
VerifySignatureAsync(Wallet, Pool, String, Byte[], Byte[])
Verifies a signature created by a key associated with the specified DID.
Declaration
public static Task<bool> VerifySignatureAsync(Wallet wallet, Pool pool, string did, byte[] msg, byte[] signature)
Parameters
| Type | Name | Description |
|---|---|---|
| Wallet | wallet | The wallet containing the DID of the signed message. |
| Pool | pool | The node pool to obtain the verkey from if required. |
| String | did | The DID used to sign the message. |
| Byte[] | msg | The message that was signed. |
| Byte[] | signature | The signature to verify. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | An asynchronous Task<TResult> that resolves to true if the message is valid, otherwise false. |
Remarks
If the wallet specified in the wallet
parameter contains a
verkey associated with the DID provided in the did
parameter and the
value has not expired this verkey will be used to verify the signature.
On the other hand, if the verkey value in the wallet has expired or the verkey was not
stored in the wallet then the verkey is read from the ledger in the node pool specified in the
pool
parameter and the wallet will be updated with the new verkey if required.
For further information on registering a verkey for a DID see the StoreTheirDidAsync(Wallet, String) method and for information on the expiry of values in a wallet see the CreateWalletAsync(String, String, String, String, String) and OpenWalletAsync(String, String, String) methods.


Toggle navigation
Menu
Home
About
Contact
WhySoCurious..
Relevance Search
×
Select Languages for relevance
English
Hindi
German
Russian
Turkish
Filter Tweets
Language
English
Hindi
German
Russian
Turkish
Date
From:
To:
Location
Sort Tweets
Date
Popularity
Apply
Clear all


RHYTHATOM
RHYTHM
@include(fader_row.inc "label": "BPM", "key":"bpm", "min":30, "max":220, "default":120, "step":1, "places": 0)
@include(fader_row.inc "label": "PERCUSSION", "key":"percussion_vol", "min":0, "max":1, "default":"0.20", "step":0.01, "places": 2)
| RESOLUTION |
|
|
|
PLAY |
RST |
|
EXPRESSION
@include(fader_row.inc "label": "STRUM QN", "key":"strum_qn", "min":0, "max":1, "default":0, "step":0.01, "places": 2)
@include(fader_row.inc "label": "SUSTAIN QN", "key":"sustain", "min":0, "max":1, "default":"0.50", "step":0.01, "places": 2)
| STRUM |
|
|
| WAVEFORM |
|
|
CHORDS
| BEATS | DEGREE | ACC | QUALITY | OCTAVE |
@include(chord_row.inc "row_num":0)
@include(chord_row.inc "row_num":1)
@include(chord_row.inc "row_num":2)
@include(chord_row.inc "row_num":3)
@include(chord_row.inc "row_num":4)
@include(chord_row.inc "row_num":5)
(C) 2017 ASHER BLUM


|
Knight's Tour Generator
Tourneys and the Fast Generation and Obfuscation of Closed Knight's Tours
|
A rail. More...
#include <Rail.h>
Public Member Functions | |
| CRail (int src0, int dest0, int src1, int dest1, UINT w) | |
| Constructor. More... | |
| void | GetEdge0 (int &src, int &dest) |
| Get first edge. More... | |
| void | GetEdge1 (int &src, int &dest) |
| Get second edge. More... | |
Private Member Functions | |
| bool | IsKnightMove (int i, int j) |
| Knight's move test. More... | |
Private Attributes | |
| int | m_nSrc0 = UNUSED |
| Index of cell at one end of first edge. | |
| int | m_nDest0 = UNUSED |
| Index of cell at the other end of first edge. | |
| int | m_nSrc1 = UNUSED |
| Index of cell at one end of second edge. | |
| int | m_nDest1 = UNUSED |
| Index of cell at the other end of second edge. | |
| int | m_nWidth = 0 |
| Width of chessboard. | |
A rail consists of two knight's moves in which the pair of source vertices and the pair of destination vertices are both separated by a knight's move. There are 12 types of rail, shown in the image below (the rail edges are shown in black and the knight's moves between their end points are shown in gray).
| CRail::CRail | ( | int | src0, |
| int | dest0, | ||
| int | src1, | ||
| int | dest1, | ||
| UINT | w | ||
| ) |
The rail constructor stores the indexes of the source and destination cells of two knight's moves in which the two source cells are separated by a knight's move and the two destination are separated by a knight's move. If the parameters fail these constraints then all four indices are set to UNUSED.
| src0 | Index of cell at source end of first move. |
| dest0 | Index of cell at destination end of first move. |
| src1 | Index of cell at source end of second move. |
| dest1 | Index of cell at the destination end of second move. |
| w | Board width. |
| void CRail::GetEdge0 | ( | int & | src, |
| int & | dest | ||
| ) |
| void CRail::GetEdge1 | ( | int & | src, |
| int & | dest | ||
| ) |
|
private |


Gogglebox's Giles Wood divides viewers with 'sexist' joke about female plumbers
What do you think?
by Natasha RiglerGogglebox's Giles Wood has split opinion among viewers after being accused of making a "sexist" joke about female plumbers.
Giles was chatting to wife and fellow Gogglebox star Mary Killen during Friday night's show when he made the controversial gag.
Sitting at home in Wiltshire, Giles began: "What I think we might do, Nutty, is employ a lady plumber.
Read more: Duchess of Cambridge Kate Middleton teaming up with Mary Berry for Christmas TV special
"Do you think they'd be as good as a man plumber? Could we pay them half?

Although she initially said it would be "funny", Mary did go on to defend female plumbers.
She told him: "[The female plumber] would probably say no we charge twice what a man would charge.
"I bet you anything those women plumbers do everything to make sure they're just as good as the men, if not better."
But Giles, who suggested lady plumbers were only for "female divorcees" to hire, simply replied: "Do you think they make cups of tea as well?
Read more: McMuffin fans rejoice as fast-food giant McDonald's extends its breakfast hours
"Because being women, you wouldn't offer a woman a cup of tea if she could make it herself. You don't want men in the kitchen do you."
Unsurprisingly, Giles' so-called quip caused quite a stir online, with many tweeting their fury at both him and Channel 4.
One blasted: "@Channel4 get Giles off gogglebox.... Sexist pig!!!!"
Another raged: "What an [bleep] Giles is from Gogglebox. With those sexist comments about women plumbers.
"I am disgusted that Channel 4 even let that be aired! Vile! #GoggleboxFriday #channel4 #sexistpig."

However, there was plenty of support for the Gogglebox star too.
Jumping to Giles' defence, one viewer tweeted: "People having a meltdown over Giles' words. Pretty sure they were tongue in cheek #gogglebox."
Another fan raved: "#gilesandmary on fine form. Giles is such a wind up merchant. #gogglebox."
Branding the critics "snowflakes", one even said: "The amount of people getting upset at what Giles was saying on Gogglebox. Calm down snowflakes, was obvious he was having a bit of fun."
Giles and Mary joined Gogglebox in 2015 and are known for their quirky and eccentric views and opinions.
The pair often refer to each other as 'nutty' when appearing on the Channel 4 show.
What do you think of Giles' joke? Leave us a comment on our Facebook page @EntertainmentDailyFix and let us know.


As with every job search, heavy emphasis is placed on the “Why Me” aspect. Since I am applying to jobs that do not align completely to my degree programs, but rather to the interests that I developed while studying, my cover letters and “Anschreibungen” require much more emphasis on what I have to offer. This, however, does not mean I do not take a great interest in the companies I am applying to! Here I decided to create a short pros and cons list to explain important aspects I look for.
Pros
Response to Employee Reviews and Complaints
- As a company, it is probably easy to respond to positive reviews. While I take these reviews into account, I find it much more important to see how a company responds to criticism. A company (more specifically, their PR or HR person) should be equipped to deal with complaints from current and ex-employees. Though there may be nothing they can do to improve the situation, it is important to acknowledge the differences in opinion, and develop improvements or resolutions when possible. A company that can respond respectfully and productively emphasizes their ability to adjust and improve themselves.
Opportunities and Encouragement for Employees to Improve Themselves
- As I look for a career, I do not imagine myself completing the same tasks each day without improvement. I am too curious to give up on learning simply because I am no longer “required” to. My ideal job will allow me to evolve my skills and encourage self-improvement that benefits the company as well.
Individualized Trainee Programs
- While this may seem like a trivial aspect of a company, employers who value and respect the different talents and learning speeds of their employees stand out to me. I find it very discouraging to spend hours being trained in something where I might have specialized skills due to a standardized training process. By avoiding unproductive activities, I can spend more time imroving weak points or developing projects that might be useful in the future.
Cons
Dishonest Company Reviews
- For me, these are a HUGE red flag. I have completed an application to the very last step, where I simply needed to click the submit button, and then abandoned it completely. Why? The company had a reputation of creating fake reviews to bolster their ratings. When I glanced through the reviews again, some stood out as fishy, much like the unverified product reviews on Amazon that claim “Amazing product” and then give a 1-star review
-
Disrespectful Responses on Public Platforms
- Similar to dishonest practices, blatant disrespect to previous employees or customers demonstrates a lack of professionalism and a possibility of a hostile work environment. We have all seen reviews that are absurd or disrespectful themselves, but a company’s responses should remain within an acceptable spectrum of being civil.
Disorganized Websites
- When trying to apply to a company, I like to visit their website and get a broad idea of who they are, what they do, if they value innovation, etc. If I cannot navigate their website in a reasonable amount of time, or I cannot decipher the companies values through the clutter, I will most likely not continue with the application process. While not all companies are tech companies, a clean and organized website is a valuable asset. If I click through their entire website and still have no idea what they have to offer, it does not leave me with a good impression about how well the internal structure of the company is organized.
This list is strictly my own opinions that I have developed during my most recent job search.


If instead of one apple falling on the head of Sir Isaac Newton a heavenly orchard had let tumble a rain of fruit, one of the greatest of men would have been overwhelmed and then buried. Anyone examining the situation afterwards in a properly scientific spirit, clearing the apples layer by layer, would be able to deduce certain facts. He would be able to prove that the man was there before the apples. Furthermore, that the blushing Beauty of Bath found immediately over and round Sir Isaac fell longer ago than the small swarthy russets that lay above them. If, on top of all this, snow had fallen, then the observer, even if he came from Mars where they are not familiar with these things, would know that apple time came before snow time.
Relative ages are not enough, the observer would want an absolute date, and that is where Sir Isaac comes in again. An examination of his clothes, the long-skirted coat, the loose breeches and the negligent cut of his linen, the long, square-toed shoes pointing so forlornly up to the sky, would date the man to the seventeenth century. Here would be a clue to the age of the apples and the snow.
Jacquetta Hawkes, A Land (1951). There is an interesting piece about the book here.


Stony Brook tops Texas Rio Grande Valley 69-58
by Associated PressCORPUS CHRISTI, Texas (AP) — Elijah Olaniyi had 20 points and six rebounds as Stony Brook defeated Texas Rio Grande Valley 69-58 on Saturday.
Andrew Garcia added 16 points, five rebounds and four steals for Stony Brook (3-2). Makale Foreman chipped in 14 points.
Jordan Jackson had 15 points, four assists and four steals for the Vaqueros (1-3). Uche Dibiamaka added 11 points. Chris Freeman had 10 points.
Stony Brook plays North Dakota State on Sunday. Texas Rio Grande Valley faces Texas A&M-Corpus Christi on the road on Sunday.
___
For more AP college basketball coverage: https://apnews.com/Collegebasketball and http://twitter.com/AP_Top25
___
This was generated by Automated Insights, http://www.automatedinsights.com/ap, using data from STATS LLC, https://www.stats.com


UN Group Formed to Protect Afghan Women’s Rights
The group was formed to support the role of women in all aspects of life in Afghanistan.
by TOLOnews.comThe Afghan Mission to the UN has formed “Group of Friends”, co-chaired by the United Kingdom and comprised of women representatives to the United Nations and its senior officials.
The group will highlight the importance of protecting and enhancing women’s rights and the role that women can play across society and government, including in peace efforts, the UN’s mission in Afghanistan (UNAMA) said in a press release on Monday.
The statement said that this Group of Friends aims to safeguard the important shared gains made for women’s rights since 2001 and to ensure that any prospective outcomes in the peace process recognize, protect and promote the role of women in all spheres of life.
The initiative will also support the joint commitment of the Afghan Government and the international community towards the full implementation of UNSCR 1325 on “Women Peace and Security,” the statement said.
“It is an important time in our political history where our gains matter more than ever, and our investment in Afghan women must continue to be strengthened,” Adela Raz, Afghanistan’s Permanent Representative to the UN, said at a ceremony inaugurating the group.
“The Security Council affirmed through the adoption of UNSCR 1325 peace and security efforts are more sustainable when women are equal partners in the prevention of violent conflict, the delivery of relief and recovery efforts and in the forging of lasting peace. I look forward to co-chairing the Group of Friends of Women in Afghanistan and supporting the role of women in all aspects of life in Afghanistan,” the Permanent Representative of the United Kingdom, Karen Pierce, said at the ceremony.
According to the statement, representatives from Australia, Canada, France, Greece, Hungary, Ireland, Italy, Kyrgyzstan, Lebanon, Lithuania, Norway, Poland, Qatar, Sri Lanka, Saint Vincent, Turkmenistan, UAE, and the African Union have already joined this Group of Friends.


--- layout: page title: Calendario de los Talleres Microservices MX permalink: /calendar/ --- {% comment %} Based in great example from https://www.raymondcamden.com/2017/02/24/an-example-of-a-static-site-with-a-dynamic-calendar And solution for jQuery conficts with: https://stackoverflow.com/a/43026994 {% endcomment %}


Defines operations common to several Java RDD implementations.
Defines operations common to several Java RDD implementations.
This trait is not intended to be implemented by user code.
A Java-friendly version of org.apache.spark.SparkContext that returns org.apache.spark.api.java.JavaRDDs and works with Java collections instead of Scala ones.
A Java-friendly version of org.apache.spark.SparkContext that returns org.apache.spark.api.java.JavaRDDs and works with Java collections instead of Scala ones.
Only one SparkContext may be active per JVM. You must stop()
the active SparkContext before
creating a new one. This limitation may eventually be removed; see SPARK-2243 for more details.
Low-level status reporting APIs for monitoring job and stage progress.
Low-level status reporting APIs for monitoring job and stage progress.
These APIs intentionally provide very weak consistency semantics; consumers of these APIs should
be prepared to handle empty / missing information. For example, a job's stage ids may be known
but the status API may not have any information about the details of those stages, so
getStageInfo
could potentially return null
for a valid stage id.
To limit memory usage, these APIs only provide information on recent jobs / stages. These APIs
will provide information for the last spark.ui.retainedStages
stages and
spark.ui.retainedJobs
jobs.
This class's constructor should be considered private and may be subject to change.
Set of interfaces to represent functions in Spark's Java API.
Set of interfaces to represent functions in Spark's Java API. Users create implementations of these interfaces to pass functions to various Java API methods for Spark. Please visit Spark's Java programming guide for more details.
Spark Java programming APIs.


{{extend "layout.html"}}
{{=T("The")}} {{=module_name}} {{=T("allows for creation and management of surveys to assess the damage following a natural disaster.")}}


HOME
DISCOVER
@NEU
Algorithms
Distributed System
Computer System
Databse
Web Development
Skills
Programming
Cloud
Database
Project Managment
Fun
Previous
Next
Contact Me


The Tao of Steve (2000) 3 stars out of 4. Starring Donal Logue, Greer Goodman, Kimo Wills, Ayelet Kaznelson, David Aaron Baker and Nina Jaroslaw. Written by Duncan North with Grerr Goodman and Jenniphr Goodman. Dirrected by Jenniphr Goodman.
"The Tao of Steve "is a different type of romantic comedy in as much as its protagonist is a character for whom you have very little respect and whom - at least at the outset - I considered an immature, selfish, perpetual adolescent.
We first meet Dex (Donal Logue) at his 10-year college reunion. Once big man on campus, Dex is now almost as large as a college campus. He teaches kindergarten, is single and lives by a philosophy that is a conglomeration of Eastern practices and self-created b.s.
Basically, Dex's philosophy is this: Be cool and indifferent around women, don't chase them, let them chase you. Women love to be the hunters. You will get more women into bed if you be the prey and let them be the pursuer.
This is Dex's mantra. And it seems to work for the overweight, out-of-shape, pot smoking, underachiever. He is in the midst of an affair with Beth (Ayelet Kaznelson), the wife of one of his closest friends, and he seems to have bedded half the women in Santa Fe.
Then he meets up with Syd (Greer Goodman), a gorgeous young woman who rides motorcycles and designs sets for the Santa Fe opera. Dex is smitten, but fights valiantly to maintain his credo.
Yet at the same time Dex is falling in love with Syd, she appears unimpressed by his charms. Later, we learn she has good reason for her disdain.
And when Dex discovers her secret, he begins to repute all things Steve.
In a sense, "The Tao of Steve," written by Duncan North with Greer Goodman and Jenniphr Goodman, though based on North's life, is actually a feminist fantasy in which the love of a good woman rehabilitates an otherwise unredeemable semi-slacker.
However, the method in which the trio of screenwriters attain their goal is intriguing to watch.
Dex's journey to a new understanding is interesting to observe. We see his doubts, his defense mechanism and his final acceptance of the truth.
Logue has a very expressive face. It's part smirk, part hurt puppy with a bit of false bravado tossed in for good measure. In public he feigns a non-interest in Syd that is meant to keep her off balance. In private, he pines for her.
Greer Goodman's Syd could undo any red-blooded man's mantra. She is lovely, intelligent, self-sufficient; not afraid to speak her mind. She uses wisecracks to cover the hurt Dex unknowingly caused years before and, like Dex, she feigns an indifference on the subject of the pair committing to a meaningful relationship.
Yet Syd is a vulnerable and caring woman, who cannot explain - even to herself - her growing attraction to and affection for Dex.
"The Tao of Steve" is one of those independent movies that is a 90-minute character study. There is a lot of dialogue - much of it witty, especially a poker-game sequence where Dex and his cronies explain the coolness of Steves, i.e., McQueen, McGarrett (Hawaii 5-0) and Austin (The Six Million Dollar Man).
Articulate and interesting movies such as this are rare. So, take a chance. You may surprise yourself - and, guys, you may even see something of yourself in "The Tao of Steve."
Bob Bloom is the film critic at the Journal and Courier in Lafayette, IN. He can be reached by e-mail at<EMAIL_ADDRESS>or at<EMAIL_ADDRESS>Reviews by Bloom can be found on the Internet Movie Database at: http://www.imdb.com/M/reviews_by?Bob+Bloom
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


The following is a summary approximate number of lines to be ported
Table 1. The aggregate result of the difficulty level
| - | High | Medium | Low2 | Low1 | Unknown Difficulty | Total |
|---|---|---|---|---|---|---|
| Version up of the Strut1 framework | ||||||
| Migration of the SpringMVC framework |
| Note | |
|---|---|
|
Difficulty legend
|
Table 2. The aggregate result of the porting factor(In parentheses is the number of search results)
| Porting Factor | Porting Factor Detal | Approximate number of lines to be ported |
|---|---|---|
| Factor1 | Migration Items related to porting of Model function | |
| Factor2 | Migration Items related to porting of View function | |
| Factor3 | Migration Items related to porting of Controller function | |
| Factor4 | Specific features of the MVC framework(Non-Backward-Compatible) | |
| Factor5 | Specific features of the MVC framework(Backward-Compatible) |
Figure 1. Comparison of the approximate number that need to be ported
| Important | |
|---|---|
|
In the figure 1, the number of the lines about the migration items related to porting of controller function is not intentionally included in a graph of the version up to Struts 2. the controller is reusable,if you use the Struts1 Plugin that are provided with Struts2. In struts version up on the above figure1, excluded factor3. If you do not want to use the Struts1 plugin , it is necessary to porting the Controller, please appropriately adjusted . Struts1 PluginSpringMVC migration on the above figure1, total porting line of migrating items(factor 3) based on the number of class defined action in actionMapping, is calculated by the number of classes * 100 lines. |
The following is a summary of each file and migration items that need to be ported
Table 1. Summary of each file (Approximate number that need to be ported)
| - | Version up of the Strut1 framework< | Migration of the SpringMVC framework |
|---|---|---|
| Java | ||
| Jsp | ||
| Xml | ||
| Properties |
Table 2. Summary of migration items that need to be ported
| Major Item | Minor Item | Porting Difficulty | Porting Factor | Reference to the migration guide | Hit Count | Line Basic | Total approximate number of lines to be ported | description(Visual Check Status) |
|---|
The following is a summary of the Error is not available in your environment after the migration
Table 1. Summary of each file (Sum of error that are not available in the environment of the after the migration)
| - | Error total |
|---|---|
| Java | |
| Jsp | |
| Xml |
The following is a summary of the API is not available in your environment after the migration
Table 1. Summary of the API is not available in your environment after the migration
| Package name | Error | description |
|---|


A common function of testbenches is to compare streams of transactions for equivalence.
The UVM “Transaction Recording Database” classes are an abstract representation of the backend tool which is recording information for the user.
The uvm_link_base class, and its extensions, are provided as a mechanism to allow for compile-time safety when trying to establish links between records within a uvm_tr_database.


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/guards.html ---
There's no syntax for guards in pattern matching (as in https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-460003.13), is there?
Pretty sure I remember someone saying "no" a while back.
I remember uttering that "no" a while back
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Welcome Home
It's never been easier to join or start a room with your friends.
Select an option below to get started
Received an invite link or an invite code for a room? Enter it here
Need a room where you can watch anything with your friends? This is the place to go


Java is a high-level programming language, released in 1995 by Sun Microsystems. The company has since been purchased by Oracle. Java is an Object Oriented programming language, based on the concepts of Inheritance, Polymorphism, and Encapsulation. These three concepts make up the foundation of Core Java. Those concepts are beyond the scope of this documentation, as this covers basic programming concepts utilizing Java. Please click here for further information regarding Java Object Oriented Programming
As mentioned above, Java is an object oriented language, meaning it can easily be extended because it is based on the object model. Java programming is also based on the concept of write once, run anywhere (WORA) meaning it can run on many processors, and multiple platforms without the need to alter the source code. This is because unlike languages like C and C++, which are compiled into platform specific machine code, Java code is compiled into platform independent byte code. This code is distributed on the web and interpreted by the Java Virtual Machine (JVM) on whichever platform it is running on. It is also worth noting that Java is architecture neutral. The Java compiler generates an architecture neutral file format. This allows the code the be executable on many processors with the presence of the Java runtime system.
This documentation assumes that you are already somewhat familiar with the following concepts:
- Basic Programming Concepts
- You already have the Java Development Kit installed (if not please do so here)
The focus of this article is to be utilized by someone who is somewhat experienced with programming, and wishes to familiarize themselves with Java as a new language. It is not intended to be a "ground up" programming course for beginners.
Below is a list of notable features of Java:
- Object Oriented - Everything is an object in Java. Java can be esily extended because it is based on the object model.
- Simple - Java is designed to be easy to understand. If you understand basic OOP concepts, you should be able to easily adapt to using Java.
- High Performance - Modern JVMs use a technique called "Just-in-Time" (JIT) compilation to compile the bytecode into native instructions on the fly at runtime, which can be understood by hardware CPU.
- Platform Independent - Java is compiled into platform independent bytecode, which is interpreted by the JVM on whichever platform it runs on.
It is usually customary to start learning a new language by creating a Hello World program. In this section we will simply create a program that prints "Hello World!" to the console. Take a look at the code block below:
public class HelloWorld {
public static void main(String[] args) {
System.out.print(“Hello World!”);
}
}
Next we will need to save, compile, and run the above code in order to see the output.
Java is an Object-Oriented language, and supports the following OOP fundamental concepts:
- Encapsulation - in Java this refers to the process of wrapping data together into a single unit. A fully encapsulated class can be created in Java by making all of the data members of the class private.
- Inheritance - in Java this is the process by which one class inherits the properties (fields and methods) of another class. This is referred to as having a super class and sub class, or a parent and child class.
- Polymorphism - polymorphism means "many forms" and in Java it commonly occurs when many classes are related to each other through inheritance. For instance you might have a superclass Person with a method work(). Subclasses of Person could be Doctor, Lawyer, Programmer, Chef, Mechanic, Athlete, and so on. All of the classes would have their own implementation of the method work().
- Abstraction - Data Abstraction refers to the process of hiding some details, and showing only essential information and data to users. In Java this can be achieved through the use of abstract classes, and interfaces.
Objects in Java represent data that has both states and behaviors. For example a Person could have states like name, age, language. A Person could also have behaviors like walk(), work(), eat(), sleep() and so on.
Classes are a blueprint or template from which individual objects are created. It is a way to bundle the fields and methods related to creating a specific object together. Below is a simple example of a class.
Public class Person {
String name;
int age;
String language;
void eat() {
}
void sleep() {
}
void walk() {
}
void work() {
}
}
Classes can contain any of the following:
- Instance Variables - variables inside a class, but outside of the class methods. These are initialized when the class is instantiated.
- Local Variables - variables located inside of a method, constructor, or block of that particular class.
- Class Variables - these variables are declared inside a class, outside of an method, and utilize the static keyword.
Another important sub-topic of classes are Contructors. All classes have constructors. If we do not explicitly write a constructor, then Java will build a default constructor for that class. Every time a new object is created within a program, at least one constructor will be used. A class can have more than one constructor. A rule in Java is that the constructor must have the same name as the class. Below is an example of using a constructor.
public class Person {
String name;
int age;
String language;
public Person(String name, int age, String language) {
this.name = name;
this.age = age;
this.language = language
}
}
In this example we created a constructor which we can use to build an instance of the class Person, and assign values for name, age, and language.
Variables are used to represent reserved space in memory. When you create a variable, you are actually creating a reference to a location in memory where you want to store the value of that variable. Based on the type of data being stored, the operating system will allocate memory, and decide what can be stored there. In Java there are two types of data. The Primitive Data types and Reference/Object Data types.
Primitive Data Types
There are eight primitive data types supported by Java, listed below.
byte
- 8-bit signed two's compliment integer
- Minimum value: -128 (-2^7)
- Maximum value: 127 (2^7 - 1) inclusive
- often used in place of an integer to save space in large arrays, because a byte is four times smaller than an integer.
short
- 16-bit signed two's compliment integer
- Minimum value: -32,768 (-2^15)
- Maximum value: 32,767 (2^15 - 1) inclusive
- often used in place of an integer to save space in large arrays, because a short is two times smaller than an integer.
int
- 32-bit signed two's compliment integer
- Minimum value: - 2,147,483,648 (-2^31)
- Maximum value: 2,147,483,647 (2^31 - 1) inclusive
- used often as default data type for integers unless memory space is a concern.
long
- 64-bit signed two's compliment integer
- Minimum value: -9,223,372,036,854,775,808(-2^63)
- Maximum value: 9,223,372,036,854,775,807 (2^63 - 1) inclusive
- used when greater range is needed than int can provide
float
- single-precision 32-bit IEEE 754 floating point
- used to save memory in large arrays of floating point numbers.
- float is never used for precise values
double
- double-precision 64-bit IEEE 754 floating point
- generally used as the default for decimal values.
- should never be used for precise values
boolean
- represents one bit of information
- only has two possible values: true and false
- used as a way to track values of true and false conditions.
- default value is false.
char
- single 16-bit Unicode character
- Minimum value: -'\u0000' (or 0)
- Maximum value: '\uffff' (or 65,535) inclusive
Reference Data Types which are also referred to as non-primitive data types, are created using constructors. They are used to reference objects. Strings, arrays, and classes are all fall under reference data types.
Java Literals is a variable represented in source code with a fixed value. These can be assigned any primitive data type. For example:
char a = ‘A’;
int x = 15;
boolean bool = true;
String literals can be expressed similar to other languages, by simply enclosing the string in double quotes, and assigning it to a variable.
String hello = “Hello World!”;
String myString = “This is a string literal”;
Variables give us name storage which our programs can manipulate. Variables in Java have a specific type, which determines the size and layout of the variable's memory, the range of values thay can be stores, and a set of operations that can be applied to it. You must declare a variable before it can be used. The basic form for declaring a variable in Java is as follows:
[Data Type] [variable name] = [value];
Here "Data Type" represents one of Java's data types, "variable name" represents the name you choose to be associated with the location in memory where you want to store data, and "value" represents the data to be stored. Below are a few examples of acceptable ways to declare variables in Java. int x = 250;
int a, b, c;
int d = 10, e = 15, f = 20;
double y = 3.216;
char g = ‘G’;
String bob = “Bob”;
Modifiers are keywords that you add to definitions. The most commonly used modifiers are Access Modifiers and Non-Access Modifiers. To use a modifier you must include the keyword at the beginning of the definition for the class, method, or variable being modified.
Access Modifiers
Java has access modifiers which can be used to set the access levels for classes, methods, and variables. There are four types of access modifiers.
- default - visible to the package, and no modifier is needed. This is the default if no modifier is provided.
- public - visible to everyone
- private - visible only to the class which contains it.
- protected - visible to the package, and all sub-classes.
Here is an example of using access modifiers: public class MyClass {
private int age;
protected boolean bool = true;
public void myMethod() {
}
}
Non-Access Modifiers
Java provides non-access modifiers to add functionality to classes, methods, and variables. A few common non-access modifiers are:
- static - The static modifier describes how an object is managed in memory. It means that the static object belongs to the class, and not an instance of that class. When there is a need for a variable to be common among all the instances of a class, then the static modifier should be used.
- final - the final modifier is commonly used to create a constant variable. Once a variable is declared with the final keyword, it's value cannot be modified.
- abstract - the abstract modifier can only be applied to classes and methods, it cannot be applied to variables. A class with the abstract modifier cannot itself be instantiated, but must be sub-classed. A method with the abstract modifier means that it does not have an implementation in the class, but must be implemented in the subclass.
- synchronized and volatile - modifiers which are used for threads.
An example of using non-access modifiers: private final int WIDTH = 163;
public static void main(String[] args) {
}
public static final double pi = 3.14159;
Java provides a large number of operators that can be used to manipulate variables. All of the operators in Java can be divided into the following groups:
There are times when you might need a certain block of code to execute a number of times. For instance imagine your program is a "Guess The Number Game", where players are asked to guess integers between 0 and 100 until they guess the right answer. You're game will probably consist of having the program randomly choose a number between 0 and 100, and then having the player enter numbers in that range until the guess the correct answer. Your program would loop through the process of:
- Guess a number
- evaluate guess
- Declare Winner OR Guess Again
To make this simple for a programmer, Java provised Loop Control features. Below is a list of the types of loops available in Java:
- while loopRepeats a statement or group of statements until a condition is true. The condition is tested before entering the loop.
while (x < 5) {
System.out.println(x);
x += 1;
}
- for loop - executes a statement or group of statements multiple times, and abbreviates the code needed for the loop.
for (int x = 0; x < 10; x++;) {
System.out.println(“This is a loop”);
}
- do-while loop - similar to a while loop, except that it checks the condition at the end of the loop body.
int i = 0;
do {
System.out.println(“This is a do while loop”);
i++;
} while (i < 10);
Decision Making structures in Java consists of one or more conditions to be evaluated, along with a set of instructions that are to be executed is the condition is true. Optionally you can also include instructions for if the statement is false. Java provides the following types of decision making statements:
- if statement - an if statement consists of a boolean expression followed by one or more statements.
int x = 2;
int y = 4;
if (x < y) {
print(“This statement is true”);
}
- else statement - an if statement can be followed by an optional else statement, which executes when the boolean expression is false.
int x = 2;
int y = 4;
if (x < y) {
System.out.println(“This condition x < y is true”);
} else {
System.out.println(“This condition x < y is false”);
}
- else if - an else if statement allows additional options if the original if statement is false. If statements are ALWAYS evaluated, even if the previous if statement is true. On the other hand, and else if statement is only evaluated when the original if statement is false. You can have as many else if statements as you want.
int number = 16;
int guess = 32;
if (number > guess) {
System.out.println(“Your guess is too low!);
}
else if (number < guess) {
System.out.println(“You’re guess is too high!”);
}
else {
System.out.println(“You guessed the number!”);
}
- switch statement - allows a variable to be tested against a list of values.
int age = 21;
switch (user) {
case 18:
System.out.println(“You’re 18!”);
break;
case 19:
System.out.println(“You’re 19!”);
break;
case 20:
System.out.println(You’re 20!);
break;
case 21:
System.out.println(You’re 21!);
break;
default:
System.out.println(“I do not have a response for your age”);
}
The String data type is extensively used in Java, and deserves it's own section beyond the scope of what was covered in the Data Types section. Strings are a sequence of characters, and are treated as objects. Java provides the String class to create and manipulate strings.
Creating Strings
The most direct way to create a string is by using a string literal.
String myString = "Hello";
Whenever a string literal is encountered in your code, the compiler will create a with it's value. The String class has eleven constructors that allow you to provide the initial value of the string using different sources, such as an array of characters
char[] myArray = { ‘H’, ‘E’, ‘L’, ‘L’, ‘O’ };
String hello = new String(myArray);
System.out.println(hello);
The above code will produce the output: "HELLO", because the String constructor allows you to pass a character array as an argument. Strings are a very broad subject, and much more information on the methods supported by the String class can be found here
Arrays are a data structure provided by Java, that allows you to store fixed-size sequential collections of elements of the same data type. Arrays are used to store collections of data, but it is much easier to think of them as a collection of variables of the same type. In order to use an array, you must declare a variable to reference the array, and a type of array that the variable can reference. Below is an example of how to declare an array in Java.
int[] myArray; // declare array
myArray = new int[100]; // initialize array
int[] myArray = new int[100]; // declare and initialize array at the same time
The above code creates an array of type int that has a length of 100, meaning 100 seperate values can be stored, each with their own index. Arrays are indexed starting at 0, so in the case of the array above, the index range is from 0 - 99. This is not to be confused with the length of the array, which refers to the actual size. The length of the array in this case is 100, and the highest index is 99.
For processing an array, we normally will use a for loop or a foreach loop, because the elements in the array are of the same type, and the size is known. Here is an example of how to process an array with each.
int[] myArray = {1, 2, 3, 4, 5};
// iterates through the array and prints each element using a for loop
for (int i = 0; i < myList.length; i++) {
System.out.println(myList[i] + “ “);
}
// iterates through the array and prints each element using a foreach loop
for (int num : myArray) {
System.out.println(num);
}
In Java, a group of statements that are grouped together to perform an operation are known as methods. Some languages will also refer to them as a function. System.out.println() is an example of a Java method. When you type System.out.println("Hello World!"); you are calling a Java method, that takes a String as an argument, and prints that string to the console. Java has many built in methods, however you can also create your own. Below is the basic format for creating a custom method and calling that method.
public int myMethod(int a, int b) {
return a + b;
}
int x = myMethod(6, 12);
In the above code, we are creating a method call myMethod. If a method is to return something, you must specify the data type to be returned. In this case our method returns the sum of the two integers provided, so it is prefixed with int. The method takes two arguments both of type int (methods can take in multple different data types, but can only return one). It sums those numbers together using the addition operator, and returns the sum. If a method does not return anything (for instance if a methods only purpose is to print something), then you should use void as the return type. Here is an example of a method with the void return type.
public void myMethod(String message) {
System.out.println(message);
}
As you can see, the method takes in a String, and then calls the System.out.println() method to print that string to the console. It does not actually return anything, and so it uses the void return type.


WITNESS LIST Higher Education Committee May 7, 2002-11:00A Interim Charge Five For: Brassard, Dr. Richard G. (Texas Chiropractic College) Clayton, Mr. Bill (Parker College of Chiropractic) Dalrymple, Dr. Chris G. (Texas Chiropractic Association) Elliott, Dr. Shelby (Texas Chiropractic College) Huff, Dr. Lew (Texas Chiropractic College) Mooney, Ms. Sandra (Texas Chiropractic College) On: Boutwell, Dr. Ken (MGT of America, Inc.) Flack, Ms. Teri (Texas Higher Education Coordinating Board) Vaughn, Dr. Cynthia (Texas Board of Chiropractic Examiners) Interim Charge Four On: Diebel, Mr. Phil (The University of North Texas System) Green, Mr. Kelton M. (State Auditor's Office) Harris, Mr. Randy (The University of Houston System) Jackson, Mr. Ronald W. (Texas Cooperative Extension and Texas Wildlife Damage Management Service) Kale, Mr. Tom (The Texas A&M University System) Kennedy, Mr. Kerry (The University of Texas System Administration) Lynch, Mr. Steve (The University of Texas Health Science Center at San Antonio) McCalland, Mr. Mike (Texas Agricultural Experiment Station) Revill, Mr. Lawrence E. (The University of Texas Medical Branch at Galveston) Rose, Mr. Tony (State Auditor's Office) Slade, President Priscilla (Texas Southern University) Urbanovsky, Chancellor Lamar (Texas State University System) Wiggins, Mr. Quintin (Texas Southern University)


| 1 | /* | |
| 2 | * Copyright 2014 ZXing authors | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | ||
| 17 | package com.google.zxing.web; | |
| 18 | ||
| 19 | import javax.servlet.FilterChain; | |
| 20 | import javax.servlet.ServletRequest; | |
| 21 | import javax.servlet.ServletResponse; | |
| 22 | import javax.servlet.annotation.WebFilter; | |
| 23 | ||
| 24 | /** | |
| 25 | * Handles redirects to the app landing page. | |
| 26 | */ | |
| 27 | @WebFilter({"/", "/index.jspx", "/w/", "/w/index.jspx"}) | |
| 28 | public final class WelcomeFilter extends AbstractFilter { | |
| 29 | ||
| 30 | @Override | |
| 31 | public void doFilter(ServletRequest servletRequest, | |
| 32 | ServletResponse servletResponse, | |
| 33 | FilterChain filterChain) { | |
| 34 |
1
1. doFilter : removed call to com/google/zxing/web/WelcomeFilter::redirect → KILLED |
redirect(servletResponse, "/w/decode.jspx"); |
| 35 | } | |
| 36 | ||
| 37 | } | |
Mutations | ||
| 34 |
1.1 |


PageObjects enable you to take a group or collection of elements on a page that share some commonality and group them together. In general, a PageObject can be any web page, but can also be broken down into more precise PageObjects. If a Page has elements and services–or some repeated group of elements and services–that can logically be grouped together, those elements and services can be modeled as PageObjects.
A PageObject can be thought of in the context of a full Page or grouped objects on a Page. Here’s what Selenium has to say about them:
“The PageObject pattern represents the screens of your web app as a series of objects … PageObjects can be thought of as facing in two directions simultaneously. Facing towards the developer of a test, they represent the services offered by a particular page. Facing away from the developer, they should be the only thing that has a deep knowledge of the structure of the HTML of a page (or part of a page).
It’s simplest to think of the methods on a PageObject as offering the “services” that a page offers rather than exposing the details and mechanics of the page. Because we’re encouraging the developer of a test to try and think about the services that they’re interacting with rather than the implementation, PageObjects should seldom expose the underlying WebDriver instance. To facilitate this, methods on the PageObject should return other PageObjects. This means that we can effectively model the user’s journey through our application.”
– Selenium
At Gilt, we’ve adopted the practice of breaking a Page into smaller parts that can be modeled as PageObjects. We’ve done this to generate fewer lines of code and to make PageObjects easier to understand and analyze.
A PageObject should be an object; otherwise, it should be a class with constructor params that provide the context. For example:
package com.giltgroupe.repository.page.foo
/**
* Foo PageObject.
*/
object Foo extends FooActions with FooAssertions{
def doSomethings
(implicit eventType: EventType, driver: WebDriver): Foo.type = {
clickSomething
triggerSomething
selectSomething
this
}
}
package com.giltgroupe.repository.page.foo
/**
* Foo PageObject.
*/
case class Foo(foo: String) extends FooActions with FooAssertions{
def doSomethings(foo: String)
(implicit eventType: EventType, driver: WebDriver): Foo.type = {
clickSomething(foo)
triggerSomething
selectSomething
this
}
}
Here, the PageObject Foo can extend Actions. It can also be mixed with Assertions and even Rich Actions.
More on Actions
Actions can either be simple or rich.
Simple Actions:
- Provide a PageObject return type.
- Are located in an Actions trait.
- Should simulate user actions e.g., clickSomething, triggerSomething, selectSomething. Should not make any Assertions. In other words, an Action does one thing well.
- Assertions should happen as part of the test and should not be included in the Action. If there is an Assertion that is reusable, it should be located in an Assertions trait for the PageObject.
- Rich Actions: Are located in the PageObject Can be a number of grouped simple actions which are commonly used. Simple vs. Rich Actions A rich action is made up of a number of Simple Actions. clickSomething is a simple action described above. triggerSomething and selectSomething are also simple actions. Calling them together makes a it a rich action. Here’s an example of a simple action:
private[foo] trait FooActions extends BrowserAction {
def locators = FooLocators
def clickSomething(foo: String)
(implicit eventType: EventType, driver: WebDriver): Foo.type = {
click(locators.myDefLocator(foo))
this
}
def goFooUrl(url: String)
(implicit driver: WebDriver): Foo.type = {
go to url
}
And here is a Rich Action:
def doSomethings(foo: String)
(implicit eventType: EventType, driver: WebDriver): Foo.type = {
clickSomething(foo)
triggerSomething
selectSomething
Foo
}
The Gilt engineering team has been discussing the value of rich vs. simple action terminology. We haven’t yet decided if locating the rich actions in the PageObject is valid, or if rich and simple actions should just be actions because they all live inside the Actions trait.
BrowserAction
Gilt’s Selenium automation is built around the ScalaTest Framework. The WebBrowser trait, which we can see in the following code example, can be found here. BrowserAction is a wrapper for Selenium WebDriver that removes much of the required boilerplate. We’ve been using BrowserAction so that engineers who aren’t familiar with Selenium can still write cool end-to-end tests (instead of copying and pasting code):
/**
* Click on a WebElement by using native or synthetic event simulation.
*
* @param query : WebBrowser#Query to define the webElement
* @param eventType : Native or Synthetic.
*/
def click(query: WebBrowser#Query)(implicit eventType: EventType, driver: WebDriver) {
WaitTool.waitForElementClickable(query)
eventType match {
case Native => query.webElement.click()
case Synthetic => JQueryHelper.click(query)
}
JQueryHelper.pageIsLoadedAndAjaxIsCompleted()
}
The click action is based on the implicit event type passed to it by the test, and waits for an element to become clickable before it carries out the action.
The code above shows a simple action, which performs a mouse click on the page on the element. This is subsequently passed as an argument to the function click. There is an implicit, EventType
, which defines how the browser should behave–either Native
or Synthetic
.
The Gilt team has developed a library called WaitTool, which handles implicit waits and expected conditions. The click action uses WaitTool, which hides the complexity of making sure that the element–which was passed to the click function–can be clicked. As soon as the element becomes clickable by Selenium WebDriver, a mouse click is performed (dependent on the EventType
). The last step of the action click is to wait for page to load, and also wait for all Ajax calls to complete.
The click action nicely shows how you can hide some of Selenium’s complexity behind a simple action. As a result, people who lack Selenium WebDriver expertise or a full understanding of what goes on under the hood can write a test and get a clear API (click function) to use.
With WaitTool, upon entry into an action we can wait for expected conditions to be true, then carry out an action:
/**
* Wait for the element to clickable in the DOM.
*
* Returns an Option of the first WebElement using the given method.
*
* @param query selector to find the element
* @param timeOutInSeconds time to wait until returning None
* @return an Option of the first WebElement using the given method, or (None if the timeout is reached)
*/
def waitForElementClickable(query: WebBrowser#Query,
timeOutInSeconds: Int = DefaultWaitTimeForElement)
(implicit driver: WebDriver): Option[WebElement] = {
try {
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS)
val element = {
val wait = new WebDriverWait(driver, timeOutInSeconds)
wait.until(ExpectedConditions.elementToBeClickable(query.by))
}
driver.manage().timeouts().implicitlyWait(DefaultWaitTimeForElement,
TimeUnit.SECONDS)
Some(element)
} catch {
case e: Exception => None
}
}
To ensure we can exit the action correctly we then wait for the DOM or page to be loaded, and for all Ajax calls and other actions to be completed, before returning control to the caller or carrying out the next called Selenium action. This enables us to instantly and easily see how our work flow is naturally progressing. Without such a library, test cases look muddy, unclear and unreadable.
/**
* Ensure the page is loaded and AJAX calls are completed using jQuery.
*/
def pageIsLoadedAndAjaxIsCompleted()(implicit driver: WebDriver) {
eventually {
withClue("Ajax calls may not have completed within time specified") {
executeScript("return jQuery.active")
.asInstanceOf[Long] shouldBe (0)
}
}
eventually {
withClue("Document ready state was not [complete] within time
specified by eventually clause.") {
executeScript("return document.readyState")
.asInstanceOf[String] shouldEqual ("complete")
}
}
}
Locators
Locators should be objects, not traits. As objects, locators are naturally namespaced and give compile-time checking. You can’t mix in two locator traits and, without knowing it, have selectors overridden. e.g., FooLocators.myLazyLocator
. Selectors that require parameters are defs; otherwise, they are lazy vals.
object FooLocators extends WebBrowser {
lazy val myLazyLocator: Query = cssSelector("[data-gilt-test=’foo’]")
def myDefLocator(foo: String): Query = cssSelector(s"[data-gilt-test=’$foo’]")
}
Assertions
Assertions are generally located with tests, but commonly used assertions can be implemented as an assertions trait in the PageObject.
trait CartAssertions extends WebBrowser with Checkpoints with Matchers {
self: Foo.type =>
def assertSomething()(implicit eventType: EventType, driver: WebDriver): Foo.type ={
val cp = new Checkpoint
cp { assertSomething should be(something) }
cp { assertAnotherThing should be(anotehrThing) }
cp.reportAll
Foo
}
ScalaTest offers a really useful feature called checkpoints, which enables multiple assertions to be performed within a test. Any failures are accumulated and reported together at the end of the test.
Using PageObjects in Tests
Now with our newly created Foo PageObject we can write tests like this:
/**
* Test Using PageObject.
*
*/
@Selenium
class MyFooTest extends FunSpecTestBase {
describe("Test using Foo PageObject") {
it("should test stuff") {
withFixture() {
fixture =>
Foo
.goFooUrl(fixture.url)
.doSomethings(fixture.foo)
.assertSomething
}
}
}
}
We can also include additional PageObjects in tests:
/**
* Test Using PageObject.
*
*/
@Selenium
class MyFooTest extends FunSpecTestBase {
describe("Test using Foo PageObject") {
it("should test stuff") {
withFixture() {
fixture =>
Foo
.goFooUrl(fixture.url)
.doSomethings(fixture.foo)
.assertSomething
Foo2
.clickSomeStuff
.assertSomeStuff
}
}
}
}
And if Foo has an action getFoo2
, with a return type of Foo2
, we can chain actions together:
/**
* Test Using PageObject.
*
*/
@Selenium
class MyFooTest extends FunSpecTestBase {
describe("Test using Foo PageObject") {
it("should test stuff") {
withFixture() {
fixture =>
Foo
.goFooUrl(fixture.url)
.doSomethings(fixture.foo)
.assertSomething
.getFoo2
.clickSomeStuff
.assertSomeStuff
}
}
}
}
Take, for example, Gilt’s Sale Listing page:
The Sale Listing page serves several elements to users, such as breadcrumbs, sale end times, sale titles, and filters. Each Sale Listing page also features n product looks, also known as Listing Looks, that contain product names, brand names and prices. We can now logically abstract the Listing Look as a function or factor of the page. In other words, the Listing Look has a number of related elements and actions that are uniquely identifiable as belonging to a Listing Look. Each Listing Look can be its own PageObject and resolve to a Quick Add Modal, which in turn can resolve to a Cart modal based on user interactions.
As we can break down and describe the services on the page into unique, logical groupings, we can start to define PageObjects for the page. According to our team’s interpretation of PageObjects, we regard PageObjects not as an Object of the entire page, but rather as a number of easily defined services, elements, and actions that can be grouped together to model the page. With PageObjects broken down into these component parts, we can create PageObjects for each element.
For a Sale Listing page, we can have four PageObjects:
SaleListing -> ListingLook -> QuickAdd -> Cart
We can also have a CartItems
PageObject, as a Cart can have n items (up to five user selections).
Show me some real code, dude!
At Gilt, we’ve set up a repository for our Sale Listing code. We’ve also created a Selenium folder that has its own project structure:
With this setup, we can export a PageObject listed under the src/main
folder in web-search-selenium
as its own jar, import it into another project, and use it in that project’s tests. To port tests from the repository to a global/integration regression, we tag a test so that it can be called and included from within an integration execution job. Let’s look at a test:
abstract class QuickAddToCartTestOnSaleListing extends FunSpecTestBase
with SkuFixture
with SaleHelper
with BeforeAndAfterEach
{
implicit val eventType = Synthetic
override protected def beforeEach() { registerAUser() }
override protected def afterEach() { logoutAndCloseBrowser }
protected def skuFilter(sku: Sku): Boolean
describe("Sale listing") {
it("should add available sku to cart using quick add") {
withActiveSku(filter = skuFilter, lock = true) { sku =>
Given(s"a sku[$sku.getSkuId]")
val sale = getSale(sku)
val productLook = sku.getProductLook
And(s"its sale[$sale.getSaleId]")
Then("go to the sale listing")
SaleListing
.goToSaleListing(sale.getRelativeUrl
.asScala
.getOrElse(cancel("Sale did not have a relativeUrl")))
//SaleListing action which returns a ListingLook PageObject.
.getListingLook(productLook.getProductLookId)
//ListingLook rich action which selects a size and click add to cart.
.triggerQuickAdd
//QuickAdd action which returns a Cart.
.addToCart(sku.getSize.asScala.map(_.getLabel.toLowerCase))
//Cart action which returns a CartItem.
.getCartItem(sku.getSkuId)
//CarItem Assertion
.assertCartItem(sku.getProductLook.getProduct.getName,
sku.getProductLook.getProduct.getBrand.getName)
Cart.clearCart()
.assertCartEmpty
.assertContinueShoppingIsDisplayedWhenCartIsEmpty
}
}
}
Because the test steps are located in an abstract class, we can reuse the code to create brand-new tests and check other functionalities, based on the SKU and its attributes (which are passed into the test via the fixture).
/**
* Tests for Quick Add on Search-Listing Page
*/
@Selenium
class QuickAddToCartTestOnSaleListingSkuHasSize
extends QuickAddToCartTestOnSaleListing
with SearchHelper {
//Use filters to find a specific sku to test with.
override def skuFilter(sku: Sku): Boolean =
SkuFilters.hasSearchBaseFilters(sku) &&
SkuFilters.hasSizeAttribute(sku) &&
isOnFirstPageLoad(sku)
}
Let’s dig deeper:
//ListingLook rich action which selects a size and click add to cart.
.triggerQuickAdd
//QuickAdd action which returns a Cart.
.addToCart(sku.getSize.asScala.map(_.getLabel.toLowerCase))
//Cart action which returns a CartItem.
.getCartItem(sku.getSkuId)
.triggerQuickAdd.
This action is a ListingLook
Simple Action that performs a mouseEnter
on a productName
element Listing Look and returns a QuickAdd
PageObject.
def locators = ListingLookLocators
def triggerQuickAdd()
(implicit eventType: EventType, driver: WebDriver): QuickAdd = {
mouseEnter(locators.productName(this.productLookId))
QuickAdd(productLookId)
}
.mouseEnter
/**
* Move Mouse into Element Position.
*
* @param query : WebBrowser#Query to define the webElement
* @param eventType : Native or Synthetic
*/
def mouseEnter(query: WebBrowser#Query)
(implicit eventType: EventType, driver: WebDriver) {
WaitTool.waitForElementIsDisplayed(query)
eventType match {
case Native => {
val builder = new Actions(driver)
builder.moveToElement(query.webElement).build().perform()
}
case Synthetic => JQueryHelper.mouseEnter(query)
}
JQueryHelper.pageIsLoadedAndAjaxIsCompleted()
}
This action is located in our commons-selenium
library and will execute a Selenium action or a jQuery action based on the eventType
. This action is wrapped to perform:
- - on enter : ensure the element is displayed
- - on exit : ensure, all Ajax calls are completed and the DOM is in a
readyState
of “complete”.
.addToCart
is a rich action comprised of a number of simple actions. It calls the Cart PageObject waitForCartDisplayed action
, which returns a Cart PageObject:
/**
* Selects (if necessary) the size and adds it to the cart,
* asserting that the cart opens successfully.
*/
def addToCart(sizeOpt: Option[String])
(implicit eventType: EventType, driver: WebDriver): Cart.type = {
selectSize(sizeOpt)
clickAddToCartButton()
Cart.waitForCartDisplayed()
}
.getCartItem(sku.getSkuId)
is a Cart action that returns a CartItem
PageObject based on the skuId. .assertCartItemDisplayed()
and ensures that the CartItem
is actually in the cart:
def getCartItem(skuId: Long)
(implicit eventType: EventType, driver: WebDriver): CartItem = {
CartItem(skuId).assertCartItemDisplayed()
}
A CartItem
is a function of the Cart, so it is a PageObject, as you can have n items on a cart.
Wrap-up
With PageObjects, we’ve eliminated a lot of the flakiness associated with testing. Breaking PageObjects down into smaller logically grouped constituent parts works just as well for small projects as for bigger ones. And because we’re using BrowserAction and more of the wrapping, we can more easily follow our work flow from one step to the next. The motivation for this work is to drive more voluntary adoption of Selenium within teams at Gilt.


Example: find all issues for metric since 2015/06/01 with step = 1 week
Metric using in example: total count of created issues in the "CD" project
1. In the field "Jira filter for period" type jql query for search issues (paying attention on dates)
project = CD and created >= "2015/06/01"
2. In "Handler field" select field to group issues by
created // cause we group created issues
3. In "Step (in days)" type the step to group issues
7 // cause we group with step = 1 week
4. Grouped issues are handled by function "Total count"
If you don't want to find issues for period, leave all fields empty.


{% extends "layout.html" %} {% block content %} {% from "_macros.html" import render_form, render_field %}
Already registered? Click here to login.
Forgot your password? Click here to reset it.


Retinopathy of Prematurity (ROP) is a growing epidemic found in many places around the world. The Introduction of the Economic Model is to show the Monitary and Societal benefits of the treatment of ROP. This application seeks to arm ophthmalogist with a cost-to-benefit anaylsis of the treatment of ROP. If you want to learn more about ROP or the importance of the Econmic Model please continue to the research tab found on the top navigation bar, it will lead you many resources on the topic as well as contact information to some of the researchers leading the initiative.
| Date Opened | Date Modified | Full Name of Model | Status |
|---|---|---|---|
| 3/7/2016 | 3/7/2016 | Test Model | incomplete |
| 9/9/2017 | 9/9/2017 | Venezuala Partial | complete |
| 8/29/2017 | 9/17/2017 | Venezuala Verified | verified |