|
POWER Vector Library Manual
1.0.4
|
Header package containing a collection of 128-bit SIMD operations over 4x32-bit floating point elements. More...
Go to the source code of this file.
Typedefs | |
| typedef vf32_t | __vbinary32 |
| typedef __vbinary32 to vector of 4 xfloat elements. | |
Functions | |
| static vf32_t | vec_absf32 (vf32_t vf32x) |
| Vector float absolute value. More... | |
| static int | vec_all_isfinitef32 (vf32_t vf32) |
| Return true if all 4x32-bit vector float values are Finite (Not NaN nor Inf). More... | |
| static int | vec_all_isinff32 (vf32_t vf32) |
| Return true if all 4x32-bit vector float values are infinity. More... | |
| static int | vec_all_isnanf32 (vf32_t vf32) |
| Return true if all of 4x32-bit vector float values are NaN. More... | |
| static int | vec_all_isnormalf32 (vf32_t vf32) |
| Return true if all of 4x32-bit vector float values are normal (Not NaN, Inf, denormal, or zero). More... | |
| static int | vec_all_issubnormalf32 (vf32_t vf32) |
| Return true if all of 4x32-bit vector float values is subnormal (denormal). More... | |
| static int | vec_all_iszerof32 (vf32_t vf32) |
| Return true if all of 4x32-bit vector float values are +-0.0. More... | |
| static int | vec_any_isfinitef32 (vf32_t vf32) |
| Return true if any 4x32-bit vector float values are Finite (Not NaN nor Inf). More... | |
| static int | vec_any_isinff32 (vf32_t vf32) |
| Return true if any 4x32-bit vector float values are infinity. More... | |
| static int | vec_any_isnanf32 (vf32_t vf32) |
| Return true if any of 4x32-bit vector float values are NaN. More... | |
| static int | vec_any_isnormalf32 (vf32_t vf32) |
| Return true if any of 4x32-bit vector float values are normal (Not NaN, Inf, denormal, or zero). More... | |
| static int | vec_any_issubnormalf32 (vf32_t vf32) |
| Return true if any of 4x32-bit vector float values is subnormal (denormal). More... | |
| static int | vec_any_iszerof32 (vf32_t vf32) |
| Return true if any of 4x32-bit vector float values are +-0.0. More... | |
| static vf32_t | vec_copysignf32 (vf32_t vf32x, vf32_t vf32y) |
| Copy the sign bit from vf32x merged with magnitude from vf32y and return the resulting vector float values. More... | |
| static vb32_t | vec_isfinitef32 (vf32_t vf32) |
| Return 4x32-bit vector boolean true values for each float element that is Finite (Not NaN nor Inf). More... | |
| static vb32_t | vec_isinff32 (vf32_t vf32) |
| Return 4x32-bit vector boolean true values for each float, if infinity. More... | |
| static vb32_t | vec_isnanf32 (vf32_t vf32) |
| Return 4x32-bit vector boolean true values, for each float NaN value. More... | |
| static vb32_t | vec_isnormalf32 (vf32_t vf32) |
| Return 4x32-bit vector boolean true values, for each float value, if normal (Not NaN, Inf, denormal, or zero). More... | |
| static vb32_t | vec_issubnormalf32 (vf32_t vf32) |
| Return 4x32-bit vector boolean true values, for each float value that is subnormal (denormal). More... | |
| static vb32_t | vec_iszerof32 (vf32_t vf32) |
| Return 4x32-bit vector boolean true values, for each float value that is +-0.0. More... | |
| static vb32_t | vec_setb_sp (vf32_t vra) |
| Vector Set Bool from Sign, Single Precision. More... | |
| static vf32_t | vec_vgl4fsso (float *array, const long long offset0, const long long offset1, const long long offset2, const long long offset3) |
| Vector Gather-Load 4 Words from scalar Offsets. More... | |
| static vf32_t | vec_vgl4fswo (float *array, vi32_t vra) |
| Vector Gather-Load 4 Words from Vector Word Offsets. More... | |
| static vf32_t | vec_vgl4fswsx (float *array, vi32_t vra, const unsigned char scale) |
| Vector Gather-Load 4 Words from Vector Word Scaled Indexes. More... | |
| static vf32_t | vec_vgl4fswx (float *array, vi32_t vra) |
| Vector Gather-Load 4 Words from Vector Word Indexes. More... | |
| static vf64_t | vec_vglfsdo (float *array, vi64_t vra) |
| Vector Gather-Load Single Floats from Vector Doubleword Offsets. More... | |
| static vf64_t | vec_vglfsdsx (float *array, vi64_t vra, const unsigned char scale) |
| Vector Gather-Load Single Floats from Vector Doubleword Scaled Indexes. More... | |
| static vf64_t | vec_vglfsdx (float *array, vi64_t vra) |
| Vector Gather-Load Single Floats from Vector Doubleword Indexes. More... | |
| static vf64_t | vec_vglfsso (float *array, const long long offset0, const long long offset1) |
| Vector Gather-Load Float Single from scalar Offsets. More... | |
| static vf64_t | vec_vlxsspx (const signed long long ra, const float *rb) |
| Vector Load Scalar Single Float Indexed. More... | |
| static void | vec_vsst4fsso (vf32_t xs, float *array, const long long offset0, const long long offset1, const long long offset2, const long long offset3) |
| Vector Scatter-Store 4 Float Singles to Scalar Offsets. More... | |
| static void | vec_vsst4fswo (vf32_t xs, float *array, vi32_t vra) |
| Vector Scatter-Store 4 Float Singles to Vector Word Offsets. More... | |
| static void | vec_vsst4fswsx (vf32_t xs, float *array, vi32_t vra, const unsigned char scale) |
| Vector Scatter-Store 4 Float Singles to Vector Word Indexes. More... | |
| static void | vec_vsst4fswx (vf32_t xs, float *array, vi32_t vra) |
| Vector Scatter-Store 4 Float Singles to Vector Word Indexes. More... | |
| static void | vec_vsstfsdo (vf64_t xs, float *array, vi64_t vra) |
| Vector Scatter-Store Floats Singles to Vector Doubleword Offsets. More... | |
| static void | vec_vsstfsdsx (vf64_t xs, float *array, vi64_t vra, const unsigned char scale) |
| Vector Scatter-Store Words to Vector Doubleword Scaled Indexes. More... | |
| static void | vec_vsstfsdx (vf64_t xs, float *array, vi64_t vra) |
| Vector Scatter-Store Words to Vector Doubleword Indexes. More... | |
| static void | vec_vsstfsso (vf64_t xs, float *array, const long long offset0, const long long offset1) |
| Vector Scatter-Store Float Singles to Scalar Offsets. More... | |
| static void | vec_vstxsspx (vf64_t xs, const signed long long ra, float *rb) |
| Vector Store Scalar Single Float Indexed. More... | |
| static vf32_t | vec_xviexpsp (vui32_t sig, vui32_t exp) |
| Vector Insert Exponent Single-Precision. More... | |
| static vui32_t | vec_xvxexpsp (vf32_t vrb) |
| Vector Extract Exponent Single-Precision. More... | |
| static vui32_t | vec_xvxsigsp (vf32_t vrb) |
| Vector Extract Significand Single-Precision. More... | |
Header package containing a collection of 128-bit SIMD operations over 4x32-bit floating point elements.
Most vector float (32-bit float) operations are implemented with PowerISA VMX instructions either defined by the original VMX (a.k.a. Altivec) or added to later versions of the PowerISA. POWER8 added the Vector Scalar Extended (VSX) with access to additional vector registers (64 total) and operations. Most of these operations (compiler built-ins, or intrinsics) are defined in <altivec.h> and described in the compiler documentation.
Most of these operations are implemented in a single instruction on newer (POWER8/POWER9) processors. This header serves to fill in functional gaps for older (POWER7, POWER8) processors and provides an inline assembler implementation for older compilers that do not provide the built-ins.
POWER9 adds useful vector float operations, including: test data class, extract exponent, extract significand, and insert exponent. These operations are common in math library implementations.
So it is reasonable for this header to provide vector forms of the floating point classification functions (isnormal/subnormal/finite/inf/nan/zero, etc.). These functions can be implemented directly using (one or more) POWER9 instructions, or a few vector logical and integer compare instructions for POWER7/8. Each is comfortably small enough to be in-lined and inherently faster than the equivalent POSIX or compiler built-in runtime scalar functions.
This header covers operations that are any of the following:
For example: using the the classification functions for implementing the math library function sine and cosine. The POSIX specification requires that special input values are processed without raising extraneous floating point exceptions and return specific floating point values in response. For example the sin() function.
The following code example uses functions from this header to address the POSIX requirements for special values input to for a vectorized sinf():
The code generated for this fragment runs between 24 (-mcpu=power9) and 40 (-mcpu=power8) instructions. The normal execution path is 14 to 25 instructions respectively.
Another example the cos() function.
The following code example uses functions from this header to address the POSIX requirements for special values input to vectorized cosf():
Neither example raises floating point exceptions or sets errno, as appropriate for a vector math library.
High level performance estimates are provided as an aid to function selection when evaluating algorithms. For background on how Latency and Throughput are derived see: Performance data.
Vector float absolute value.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-7 | 2/cycle |
| power9 | 2 | 2/cycle |
| vf32x | vector float values containing the magnitudes. |
|
inlinestatic |
Return true if all 4x32-bit vector float values are Finite (Not NaN nor Inf).
A IEEE Binary32 finite value has an exponent between 0x000 and 0x7f0 (a 0x7f8 indicates NaN or Inf). The significand can be any value. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 4-20 | 2/cycle |
| power9 | 6 | 1/cycle |
| vf32 | a vector of __binary32 values. |
|
inlinestatic |
Return true if all 4x32-bit vector float values are infinity.
A IEEE Binary32 infinity has a exponent of 0x7f8 and significand of all zeros. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-20 | 2/cycle |
| power9 | 6 | 1/cycle |
| vf32 | a vector of __binary32 values. |
|
inlinestatic |
Return true if all of 4x32-bit vector float values are NaN.
A IEEE Binary32 NaN value has an exponent between 0x7f8 and the significand is nonzero. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-20 | 2/cycle |
| power9 | 6 | 1/cycle |
| vf32 | a vector of __binary32 values. |
|
inlinestatic |
Return true if all of 4x32-bit vector float values are normal (Not NaN, Inf, denormal, or zero).
A IEEE Binary32 normal value has an exponent between 0x008 and 0x7f (a 0x7f8 indicates NaN or Inf). The significand can be any value (expect 0 if the exponent is zero). The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-20 | 1/cycle |
| power9 | 6 | 1/cycle |
| vf32 | a vector of __binary32 values. |
|
inlinestatic |
Return true if all of 4x32-bit vector float values is subnormal (denormal).
A IEEE Binary32 subnormal has an exponent of 0x000 and a nonzero significand. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 10-30 | 1/cycle |
| power9 | 6 | 1/cycle |
| vf32 | a vector of __binary32 values. |
|
inlinestatic |
Return true if all of 4x32-bit vector float values are +-0.0.
A IEEE Binary32 zero has an exponent of 0x000 and a zero significand. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-20 | 2/cycle |
| power9 | 6 | 1/cycle |
| vf32 | a vector of __binary32 values. |
|
inlinestatic |
Return true if any 4x32-bit vector float values are Finite (Not NaN nor Inf).
A IEEE Binary32 finite value has an exponent between 0x000 and 0x7f0 (a 0x7f8 indicates NaN or Inf). The significand can be any value. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 4-20 | 2/cycle |
| power9 | 6 | 1/cycle |
| vf32 | a vector of __binary32 values. |
|
inlinestatic |
Return true if any 4x32-bit vector float values are infinity.
A IEEE Binary32 infinity has a exponent of 0x7f8 and significand of all zeros.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-20 | 2/cycle |
| power9 | 6 | 2/cycle |
| vf32 | a vector of __binary32 values. |
|
inlinestatic |
Return true if any of 4x32-bit vector float values are NaN.
A IEEE Binary32 NaN value has an exponent between 0x7f8 and the significand is nonzero. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-20 | 2/cycle |
| power9 | 6 | 2/cycle |
| vf32 | a vector of __binary32 values. |
|
inlinestatic |
Return true if any of 4x32-bit vector float values are normal (Not NaN, Inf, denormal, or zero).
A IEEE Binary32 normal value has an exponent between 0x008 and 0x7f (a 0x7f8 indicates NaN or Inf). The significand can be any value (expect 0 if the exponent is zero). The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 10-24 | 1/cycle |
| power9 | 6 | 1/cycle |
| vf32 | a vector of __binary32 values. |
|
inlinestatic |
Return true if any of 4x32-bit vector float values is subnormal (denormal).
A IEEE Binary32 subnormal has an exponent of 0x000 and a nonzero significand. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 10-18 | 1/cycle |
| power9 | 6 | 1/cycle |
| vf32 | a vector of __binary32 values. |
|
inlinestatic |
Return true if any of 4x32-bit vector float values are +-0.0.
A IEEE Binary32 zero has an exponent of 0x000 and a zero significand. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-20 | 2/cycle |
| power9 | 6 | 1/cycle |
| vf32 | a vector of __binary32 values. |
Copy the sign bit from vf32x merged with magnitude from vf32y and return the resulting vector float values.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-7 | 2/cycle |
| power9 | 2 | 2/cycle |
| vf32x | vector float values containing the sign bits. |
| vf32y | vector float values containing the magnitudes. |
Return 4x32-bit vector boolean true values for each float element that is Finite (Not NaN nor Inf).
A IEEE Binary32 finite value has an exponent between 0x000 and 0x7f0 (a 0x7f8 indicates NaN or Inf). The significand can be any value. Using the vec_cmpeq conditional to generate the predicate mask for NaN / Inf and then invert this for the finite condition. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-15 | 2/cycle |
| power9 | 5 | 2/cycle |
| vf32 | a vector of __binary32 values. |
Return 4x32-bit vector boolean true values for each float, if infinity.
A IEEE Binary32 infinity has a exponent of 0x7f8 and significand of all zeros.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 4-13 | 2/cycle |
| power9 | 3 | 2/cycle |
| vf32 | a vector of __binary32 values. |
Return 4x32-bit vector boolean true values, for each float NaN value.
A IEEE Binary32 NaN value has an exponent between 0x7f8 and the significand is nonzero. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 4-13 | 2/cycle |
| power9 | 3 | 2/cycle |
| vf32 | a vector of __binary32 values. |
Return 4x32-bit vector boolean true values, for each float value, if normal (Not NaN, Inf, denormal, or zero).
A IEEE Binary32 normal value has an exponent between 0x008 and 0x7f (a 0x7f8 indicates NaN or Inf). The significand can be any value (expect 0 if the exponent is zero). The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-15 | 1/cycle |
| power9 | 5 | 1/cycle |
| vf32 | a vector of __binary32 values. |
Return 4x32-bit vector boolean true values, for each float value that is subnormal (denormal).
A IEEE Binary32 subnormal has an exponent of 0x000 and a nonzero significand. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-16 | 1/cycle |
| power9 | 3 | 1/cycle |
| vf32 | a vector of __binary32 values. |
Return 4x32-bit vector boolean true values, for each float value that is +-0.0.
A IEEE Binary32 zero has an exponent of 0x000 and a zero significand. The sign bit is ignored.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 4-13 | 2/cycle |
| power9 | 5 | 2/cycle |
| vf32 | a vector of __binary32 values. |
Vector Set Bool from Sign, Single Precision.
For each float, propagate the sign bit to all 32-bits of that word. The result is vector bool int reflecting the sign bit of each 32-bit float.
The resulting mask can be used in masking and select operations.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 2-9 | 2/cycle |
| power9 | 2-8 | 2/cycle |
| vra | Vector float. |
|
inlinestatic |
Vector Gather-Load 4 Words from scalar Offsets.
For each scalar offset[0,1,2,3], load the word from the effective address formed by *(char*)array+offset[0-3]. Merge resulting float single word elements [0,1,2,3] and return the resulting vector.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 10 | 1/cycle |
| power9 | 11 | 1/cycle |
| array | Pointer to array of integer words. |
| offset0 | Scalar (64-bit) byte offset from &array. |
| offset1 | Scalar (64-bit) byte offset from &array. |
| offset2 | Scalar (64-bit) byte offset from &array. |
| offset3 | Scalar (64-bit) byte offset from &array. |
Vector Gather-Load 4 Words from Vector Word Offsets.
For each signed word element [i] of vra, load the float single word element at *(char*)array+vra[i]. Merge those word elements [0-3] and return the resulting vector.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 14 | 1/cycle |
| power9 | 15 | 1/cycle |
| array | Pointer to array of integer words. |
| vra | Vector of signed word (32-bit) byte offsets from &array. |
Vector Gather-Load 4 Words from Vector Word Scaled Indexes.
For each signed word element [i] of vra, load the float single word element at array[vra[i] << scale]. Merge those word elements [0-3] and return the resulting vector.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 16-25 | 1/cycle |
| power9 | 18-27 | 1/cycle |
| array | Pointer to array of integer words. |
| vra | Vector of signed word (32-bit) indexes. |
| scale | 8-bit integer. Indexes are multiplying by 2scale. |
Vector Gather-Load 4 Words from Vector Word Indexes.
For word element [i] of vra, load the float single word element at array[vra[i]]. Merge those word elements [0-3] and return the resulting vector.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 16-25 | 1/cycle |
| power9 | 18-27 | 1/cycle |
| array | Pointer to array of integer words. |
| vra | Vector of signed word (32-bit) indexes. |
Vector Gather-Load Single Floats from Vector Doubleword Offsets.
For each doubleword element [0-1] of vra, load the float single word element at *(char*)array+vra[i] expanding them to float double format. Merge doubleword elements [0,1] and return the resulting vector.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 12 | 1/cycle |
| power9 | 11 | 1/cycle |
| array | Pointer to array of float singles. |
| vra | Vector of doubleword (64-bit) byte offsets from &array. |
Vector Gather-Load Single Floats from Vector Doubleword Scaled Indexes.
For each doubleword element [0-1] of vra, load the float single word element at array[vra[i] << scale)]. Merge doubleword elements [0,1] and return the resulting vector.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 14-23 | 1/cycle |
| power9 | 13-22 | 1/cycle |
| array | Pointer to array of float. |
| vra | Vector of doubleword indexes from &array. |
| scale | 8-bit integer. Indexes are multiplying by 2scale. |
Vector Gather-Load Single Floats from Vector Doubleword Indexes.
For each doubleword element [0-1] of vra, load the float single word element at array[vra[i]]. Merge doubleword elements [0,1] and return the resulting vector.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 14-23 | 1/cycle |
| power9 | 13-22 | 1/cycle |
| array | Pointer to array of float. |
| vra | Vector of doubleword indexes from &array. |
|
inlinestatic |
Vector Gather-Load Float Single from scalar Offsets.
For each scalar offset[0|1], load the float single element at *(char*)array+offset[0|1] expanding them to float double format. Merge doubleword elements [0,1] and return the resulting vector.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 7 | 2/cycle |
| power9 | 11 | 2/cycle |
| array | Pointer to array of floats. |
| offset0 | Scalar (64-bit) byte offsets from &array. |
| offset1 | Scalar (64-bit) byte offsets from &array. |
|
inlinestatic |
Vector Load Scalar Single Float Indexed.
Load doubleword[0] of vector xt as a scalar (double float formatted) single float word from the effective address formed by rb+ra. The operand rb is a pointer to an array of float words. The operand ra is a doubleword integer byte offset from rb. The result xt is returned as a vf64_t vector. For best performance rb and ra should be word aligned (integer multiple of 4).
This operation is an alternate form of Vector Load Element (vec_lde), with the added simplification that data is always left justified in the vector. Another advantage for Power8 and later, the lxsspx instruction can load directly into any of the 64 VSRs, while expanding the single float word value into float double format, in a single operation. Both simplify merging elements for gather operations.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 5 | 2/cycle |
| power9 | 8 | 2/cycle |
| ra | const doubleword index (offset/displacement). |
| rb | const pointer to an array of floats. |
|
inlinestatic |
Vector Scatter-Store 4 Float Singles to Scalar Offsets.
For each float word element [0-3] of xs, store the float element xs[i] at *(char*)array+offset[i].
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6 | 1/cycle |
| power9 | 4 | 2/cycle |
| xs | Vector float elements to scatter store. |
| array | Pointer to array of float words. |
| offset0 | Scalar (64-bit) byte offset from &array. |
| offset1 | Scalar (64-bit) byte offset from &array. |
| offset2 | Scalar (64-bit) byte offset from &array. |
| offset3 | Scalar (64-bit) byte offset from &array. |
Vector Scatter-Store 4 Float Singles to Vector Word Offsets.
For each float word element [0-3] of xs, store the float element xs[i] at *(char*)array+vra[i].
| processor | Latency | Throughput |
|---|---|---|
| power8 | 10 | 1/cycle |
| power9 | 12 | 2/cycle |
| xs | Vector float elements to scatter store. |
| array | Pointer to array of float words. |
| vra | Vector of signed word (32-bit) byte offsets from &array. |
|
inlinestatic |
Vector Scatter-Store 4 Float Singles to Vector Word Indexes.
For each float word element [0-4] of xs, store the float element xs[i] at *(char*)array[vra[i]<<scale].
| processor | Latency | Throughput |
|---|---|---|
| power8 | 12-21 | 1/cycle |
| power9 | 15-24 | 2/cycle |
| xs | Vector float elements to scatter store. |
| array | Pointer to array of float words. |
| vra | Vector of signed word (32-bit) indexes from array. |
| scale | 8-bit integer. Indexes are multiplying by 2scale. |
Vector Scatter-Store 4 Float Singles to Vector Word Indexes.
For each float word element [0-3] of xs, store the float element xs[i] at *(char*)array[vra[i]].
| processor | Latency | Throughput |
|---|---|---|
| power8 | 12-21 | 1/cycle |
| power9 | 15-24 | 2/cycle |
| xs | Vector float elements to scatter store. |
| array | Pointer to array of float words. |
| vra | Vector of signed word (32-bit) indexes from array. |
Vector Scatter-Store Floats Singles to Vector Doubleword Offsets.
For each doubleword element [0-1] of vra, store the doubleword float element xs[i], converted to float single word format, at *(char*)array+vra[i].
| processor | Latency | Throughput |
|---|---|---|
| power8 | 8 | 1/cycle |
| power9 | 9 | 2/cycle |
| xs | Vector doubleword elements to scatter store as float single words. |
| array | Pointer to array of float words. |
| vra | Vector of doubleword (64-bit) byte offsets from &array. |
|
inlinestatic |
Vector Scatter-Store Words to Vector Doubleword Scaled Indexes.
For each doubleword element [0-1] of vra, store the doubleword float element xs[i], converted to float single word format, at array[vra[i]<<scale].
| processor | Latency | Throughput |
|---|---|---|
| power8 | 10-19 | 1/cycle |
| power9 | 10-19 | 1/cycle |
| xs | Vector doubleword elements to scatter store as float single words. |
| array | Pointer to array of float words. |
| vra | Vector of doubleword (64-bit) indexes from &array. |
| scale | 8-bit integer. Indexes are multiplying by 2scale. |
Vector Scatter-Store Words to Vector Doubleword Indexes.
For each doubleword element [0-1] of vra, store the doubleword float element xs[i], converted to float single word format, at array[vra[i]].
| processor | Latency | Throughput |
|---|---|---|
| power8 | 10-19 | 1/cycle |
| power9 | 10-19 | 1/cycle |
| xs | Vector doubleword elements to scatter store as float single words. |
| array | Pointer to array of float words. |
| vra | Vector of doubleword (64-bit) indexes from &array. |
|
inlinestatic |
Vector Scatter-Store Float Singles to Scalar Offsets.
For each scalar offset[0-1], Store the doubleword element xs[i], converted to float single word format, at *(char*)array+offset[0|1].
| processor | Latency | Throughput |
|---|---|---|
| power8 | 3 | 1/cycle |
| power9 | 3 | 2/cycle |
| xs | Vector doubleword elements to scatter store as float single words. |
| array | Pointer to array of float words. |
| offset0 | Scalar (64-bit) byte offset from &array. |
| offset1 | Scalar (64-bit) byte offset from &array. |
|
inlinestatic |
Vector Store Scalar Single Float Indexed.
Stores doubleword float element 0 of vector xs as a scalar float word at the effective address formed by rb+ra. The operand rb is a pointer to an array of float. The operand ra is a doubleword integer byte offset from rb. For best performance rb and ra should be word aligned (integer multiple of 4).
This operation is an alternate form of vector store element (vec_ste), with the added simplification that data is always left justified in the vector. Another advantage for Power8 and later, the stxsspx instruction can load directly into any of the 64 VSRs. Both simplify scatter operations.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 0 - 2 | 2/cycle |
| power9 | 0 - 2 | 4/cycle |
| xs | vector doubleword element 0 to be stored as single float. |
| ra | const doubleword index (offset/displacement). |
| rb | const pointer to an array of floats. |
Vector Insert Exponent Single-Precision.
For each word of sig and exp, merge the sign (bit 0) and significand (bits 9:31) from sig with the 8-bit exponent from exp (bits 24:31). The exponent is merged into bits 1:8 of the final result. The result is returned as a Vector Single-Precision floating point value.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-15 | 2/cycle |
| power9 | 2 | 4/cycle |
| sig | Vector unsigned int containing the Sign Bit and 23-bit significand. |
| exp | Vector unsigned int containing the 8-bit exponent. |
Vector Extract Exponent Single-Precision.
For each word of vrb, Extract the single-precision exponent (bits 1:8) and right justify it to (bits 24:31 of) of the result vector word. The result is returned as vector unsigned integer value.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 6-15 | 2/cycle |
| power9 | 2 | 4/cycle |
| vrb | vector double value. |
Vector Extract Significand Single-Precision.
For each word of vrb, Extract the single-precision significand (bits 0:31) and restore the implied (hidden) bit (bit 8) if the single-precision value is normal (not zero, subnormal, Infinity or NaN). The result is return as vector unsigned int value with up to 24 bits of significance.
| processor | Latency | Throughput |
|---|---|---|
| power8 | 8-17 | 1/cycle |
| power9 | 3 | 2/cycle |
| vrb | vector double value. |


ArtNet input/output plugin
Introduction
QLC+ supports the ArtNet protocol through an input/output plugin
that receives and transmits packets on the network.
No extra requirements are needed, since QLC+ has a native implementation of the ArtNet protocol
that works on Linux, Windows and OSX systems.
Configuration
The ArtNet plugin can be configured to send and receive packets from multiple network cards, virtual addresses
and multiple universes per network card.
The desired configuration can be achieved quite easily by opening the plugin configuration panel.
The dialog will show all the possible choices depending on the network interfaces that QLC+ detects
when opened.
The dialog will display two lists:
- The available networks and universes. Just click on the corresponding checkbox to enable
the one you are going to use and it will be listed in QLC+ input/output manager.
Networks and universes are displayed in the following form:
- Network 1 - Universe 0
- Network 1 - Universe 1
- Network 1 - Universe 2
- Network 1 - Universe 3
- Network 2 - Universe 0
- ...
- Network 2 - Universe 3
- ...
- A simple node inspector that will display the available ArtNet nodes
discovered on the network
Networks are displayed as the IP addresses of your network interfaces. It means
that ArtNet packets will be sent from those addresses, to the corresponding broadcast addresses.
For example if your network card has IP address <IP_ADDRESS>, all the ArtNet packets will
be sent to the network to the address <IP_ADDRESS>.
Compatibility
QLC+ has been tested with the following ArtNet softwares/devices:


Semester Project
Introduction
The objectives of this Project is to made the device like:Our semester project is to design and build a portable blood pressure monitor device that can measures the user's blood pressure using hand cuff. Blood pressure monitor is biomedical instrument which has tremendous use daily life. It is used in hospitals,clinics and homes to measure the blood pressure. The device we made is portable and we can take in pocket for blood pressure meaurement. For doing so we require a pressure sensor, microcontroller device, Nokia 5110 LCD and by using the code device display the the final result. We have been worked on this project for 4 to 5 months and finally it is in working condition.
This project is made by Talha Abdul Rehman and Saeed Akbar Khan.
The generic product we intend to have at the end of this semester would look like this.
Distribution of Tasks
Basically, we worked together regardless of who has done how much work but keeping report requirement here is the list in which we have written about tasks.| Topics | Talha Abdul Rehman | Saeed Akbar Khan |
| Review of literature/datasheets | ✔ | ✔ |
| Selection of components | ✔ | X |
| Design of Electrical Circuit and PCB layout | ✔ | X |
| Soldering of Components on PCB | X | ✔ |
| CAD Solidworks Design | X | ✔ |
| Design of finished product | ✔ | X |
| Writing firmware | ✔ | X |
| Testing/Debugging of hardware software and final Assembly | X | ✔ |
The project implmentation plan is presented in the form of Gantt Chart is as follows:
High Level Design
This section includes the high level design for connection and working of our project components.This is the diagram of our project layout which we use to design in our project.
Principle of Operations
Execution of the program is very simple and easy to understand. It starts By inflating the air in the cuff and the air tube is connected with pressure sensor which gives blood pressure in high-level analog output in mili-volts that is proportional to the applied pressure and that analog output is given to micro-controller uno in which I have burned the program which caculates blood pressure in systolic and dysystolic and then the calculated result is displayed on the Nokia LCD.- Power supply
- The Micro-controller
- Pressure Sensor
- Nokia LCD (5110)
- Inflating Cuff
- Other Discrete Components
We used 9v battery supply given to header and give supply to voltage regulator which inturn converts 9VDC to 5VDC, which is the requirement for our project to work properly. .
We used ATMEGA328P IC for storing program and display output. It consists of the 32 pins. From these pins, we use 5 digital pins for displaying LCD and 1 analog pin to take input from pressure sensor
We used a differential pressure sensor (MPX4250DP) which gives blood pressure output signal in mili-volts. This sensor meaures the value of pressure by using hand cuff. It's output is given on the A0 pin of ATMEGA328P. It's pressure range is 0-250 kPa. It's input voltage range is 4.86-5.35V.
We used NOkia LCD which has 8 pin connector to display the output.
Manually inflating cuff is commonly available. It is tightly placed on arm to get pressure for the pressure sensor.
1) Resistors
2) Capacitors
3) Potentiometer
4) Headers
Circuit Design Process
Before started the design process with basic prototype of the system on breadboard to validate our designThe blood pressure meaurement of our class fellow and his blood pressure meaurement picture is there.
PCB Designing Process
In this, we design the circuit on the eagle software which is use for PCB. The eagle work is given below.Electrical schematic
This is electrical schematic of the project on eagle software.Once the design was verified, the circuit schematic was prepared in Eagle.
Shematic description
This is electrical schematic consists of two main circuits. First is the basic circuit to operate ATMEGA328P, while the other is connection of pressure sensor with ATMEGA328P and LCD connection with ATMEGA328P.
PCB Routing
PCB routing picture on Eagle software.The circuit diagram with trace, pads, drills & package layers visible.
Description
The main point in PCB designing is to minimize the foot print of the circuit. With help of our mentor we managed to bring down the size of our circuit to almost 2 x 1.67 inches.Challenges Faced in Routing
First we faced some problems in designing, which we mostly take help from our mentor and made the design which is shown above. The main problem is that the routing/path decision for the components is very difficult.Bill of Material
The components used in project are written on the page and there DIP components are placed in front of them.PCB Layout
descriptionPopulated Circuited Board
descriptionFrom this exercise we gained first hand experience of soldering SMD and DIP components on the circuit board.
Description
This PCB circuit includes the places for the components and holes for header connections. We soldered all the components on the board. From our bitter experience we learnt that keeping solder iron on maximum temperature can easily peal away the traces.The populated PCB pic is also added which give the strcuture of components we add later.
Challenges faced during Soldering
We first solder all components but we faced many problems in that circuit. The main problem we faced is that the connection on PCB are short and for that we desolder the components. The solution to this problem is that when a component is solder check its connectivity. Other problem that we faced is that component are losely solder which shows the connection when we test through the multimeter but the circuit not operate. So, we rectify this problem by discussing with Sir Nadir and he give the solution that we solder the components carefully again. This solution work well for us.Procedure to Burn Bootloder
By using the FTDI cable we boot the PCB. Bootloder is uploaded to program the ATMEGA328P. There are placed pin on PCB where we connect FTDI.Problems In Bootloading
First we faced problem in boot loading the PCB the problem is that the Pins are not soldered well. Also, we check all the connection by using DMM to check connectivity. We spent about 5 hours to rectify the problem by taking helping hand from our instructor.
Working Prototype
Software Development
Description
The code was borrowed from the website which is given in the refrence. The code we used is given asFirst pic contain the code which intiallized the nokia LCD. The dimension of the LCD is given there.The global variables are also decleared there.
The dimension of the LCD is decleared in code. In the loop, the meauring of the pressure is done. This is code that actually calculates the pressures.
We created an array of the output voltages using a for loop. The loop is set to run 50 times with a delay of .25s. This number of values corresponds to about 12.5s. Cuff inflation after this amount of time was too tight for our "patient." You can adjust these values as you see fit. Since Arduino is a 10bit system, the analogRead function returns an integer within the rang [0,1023]. volt is calculated by converting this integer value into its corresponding voltage. The for loop also stores the maximum voltage as data is collected by the Arduino. We subtracted 2.5V from this volt due to the 2.5V offset that the Pressure sensor has when both ports are exposed to atmospheric pressure.
In the second picture, there is main code for blood pressure meaurement. The applied pressure (pressure) is calculated using the equation on the Pressure sensor's data sheet. However, we used a differential Pressure Sensor which mean the pressure we calculated is actually the difference between Ports 1 and 2. MAP is the pressure at Port 2 and is calculated by subtracting the pressure from atmospheric pressure which is 14.7 psi. This value is multiplied by 51.7 to give MAP in units of mmHg. There is an additional term in the equation for MAP.
Design of Enclosure Casing
As the enclosure design of our project is given as:The design we choose is of heart shape. The reason for choosing this design is that we work with blood pressure which is basically of medical field and some how our project is related with the heart. We choose this design after discussing with the teacher.
CAD Design
The CAD design is done in form of heart. The dimension of the PCB is meaured first which is 46mm*50mm. Also the dimension of LCD is meaured which is 34mm*40mm. Also we meaured the dimension of all the components.
The cad file is pasted in the appendix.
Results
The video of the working blood pressure mointoring system is given which shows the blood pressure of our fellow.Conclusions
As this subject is Project based subject and we do our project in this whole semester. As this is our first big project in which we learn a lot of things. We learn how to tackle with the problems as we faced in project.The routing problem and how to tackle these problems. We come through some problems which are very difficult to tackle and some are very ordinery problems. This thing build us for final year project and how we can bulid good project.Intellectual Properties and Ethics Considerations
We design the circuit by using datasheets of the components and by taking instructions from the professer. The topologies of the circuits are mentioned in books. Although, We searched different sites for our work. We take the blood pressure meauring code from one site where the code is already placed and we use some of his circuit design but mainly circuit is designed by us.The site we used for our work is open source which everyone can use. We change the code, which we took from site, for our requirement. Thus, we are sure that we do not violate any intellectual property of the existing design.
The site from where we copy the code is www.instructables.com
Commercialization Aspects
The project we made is not a commercial grade but it is low cost blood preesure monitoring system with some works which can be commercialized. For commercialization, we can implement heart beat and temperature meaurement in this project by using simple sensor which is going to be very impressive in market.Reference
The website we follow are as:1- www.instructables.com
2- IJraset
3- Cornell University
4- IJ PDF
Appendix
All the files which we used in our project are given below in zip fileIn the below table We write the apporximate cost of each component which we used in our project.
| Components | Quantity | Cost |
| Pressure sensor | 1 | PKR 1800 |
| Hand Cuff | 1 | 250 |
| PCB | 1 | 800 |
| Nokia LCD | 1 | 450 |
| Resistors | 6 | 70 |
| Capacitors | 9 | 100 |
| LED | 2 | 50 |
| Potentiometer | 1 | 30 |
| Rechargable Battery | 1 | 120 |
| Voltage Regulator | 1 | 20 |
| Headers | 6 | 50 |
| Switches | 1 | 10 |


April 13th - 15th
Sure, you should definitely attend! Whether you have written lots of code or just have a creative soul, this hackathon needs you! In true hackathon spirit all students are very friendly and willing to help each other out.
Yes, we’re not kidding you. Thanks to our sponsors we will provide free food, swag, snacks, drinks and a place for you to sleep at the hackathon. Plus, there will be mentors, talks and judges only for the sake of YOU.
You have the fantastic opportunity to learn new stuff, try out your skills and make new friends. Isn't that just great? Everyone will be a winner!... Okay, we will also have some awesome prices.
No. That's not fair. You can come up with ideas, but not build them. You are of course allowed to use libraries, frameworks and templates for your hacks.
AUHack has been home to a wide variety of projects, from amazing hardware projects to the coolest VR Games and the most useful services and apps.
We always have a wide spectrum of hardware available, provided by our sponsors and happily administered by our knowledgeable wizards. A detailed list will be available as we get closer to the event!
No. You are more than welcome to make a team before the hackathon, but loads of people come without a team. We will help everyone find a team Friday night. We recommend groups of 4-5 persons, but anything is allowed.
You must fill out the application form. After completing the form, the AUHack team will send you an e-mail confirmation.
You might think that a hackathon is for programmers only, but that’s not true. Technology and code is one thing – creative minds, bright insights and strategic eyes are another. So, as long as you are a student above 18 years old, you are more than welcome – no matter what university or study program you attend. Actually, we believe that the more different people we are, the better.
Need to have: Laptop, cellphone and chargers.
Nice to have: A sleeping bag, pillow, toiletries, clothes and a well-rested and open mind. If you want to hack on hardware, you might need to bring it yourself.
What you won't need to bring is a pre-determined team, an idea for a hack, nor food and drinks. Also, there is absolutely no reason to bring bad mood.
AUHack will start in the evening of Friday at 18.30 and end Sunday at 16.00. All work eligible for prizes must be worked on and completed during this period of time and can't be prepared from home. Throughout the hackathon inspiring events, talks and mentoring sessions will be hosted. For a more detailed schedule see below.
There will be rooms to sleep in. You will have to bring your own bedroll, sleeping bag and pillows though.
Please take a look at auhack.org/travel. We have written down some options for you.
The address is:
Finlandsgade 21, 8200 Aarhus N
The streets around the venue should provide suitable parking for all participants. Additionally there is a parking lot near the venue.
Send an email to:
<EMAIL_ADDRESS>If you'd like to be a part of AUHack but don't want to hack, we also need spirited volunteers to help bring the event to life. Shoot us an e-mail at:
<EMAIL_ADDRESS>We're still working on making a schedule that's packed with hacking, learning and fun events for the best weekend of the year!
If you are interested in becoming a sponsor:
Email us at<EMAIL_ADDRESS>or Click here to see the sponsor page!


Off-Site Gateway Checkout
Overview
The Off-Site Gateway API is a way to seamlessly pay for goods or services online utilizing Dwolla's API. Using a Dwolla-provided checkout experience, customers can authenticate and authorize payment of a purchase order utilizing Dwolla as the processing platform. Currently, there are two available checkout flows which provide (slightly) different user experiences, the pay now flow, or the pay later flow. For the purpose of this guide we will only cover the pay now flow, which is a checkout flow that can be initiated via one of the follow methods:
- Direct submission: Submit a form that contains the checkout details (products, amount, total, etc) directly from the client to the Dwolla server.
- Server-to server submission: Create a checkout session by communicating the checkout information from your server to the Dwolla server directly.
Using the Dwolla Libraries
The Dwolla libraries available on GitHub have implemented the server-to-server checkout flow. The code samples below are designed to help get you started immediately. In order to customize data sent and used by the library, use the server-to-server specification and follow the pay now flow.
<?php
/**
* The following is a quick-start example for the Checkouts class,
* which encapsulates methods for all offsite-gateway related endpoints.
*/
// We need the Checkouts class in order to do anything
require '../lib/checkouts.php';
$Checkouts = new Dwolla\Checkouts();
/**
* Optional: DwollaPHP has a very rudimentary shopping-cart
* function. You can "make" your own cart and the
* library will automatically calculate totals for you.
* For the purpose of this example, we will add two
* cups of coffee to our cart.
*/
$Checkouts->addToCart("Coffee 1", "Mmm, fresh!", 2.25, 1);
$Checkouts->addToCart("Coffee 2", "Another coffee!", 2.25, 1);
/**
* Step 1: Create a checkout session with the cart you have just created.
* The array passed in contains members of the
* `purchaseOrder` parameter. The second array marks this as a
* `test` in order to...well...test.
*/
$test = $Checkouts->create(
[ 'destinationId' => '812-111-7219' ],
[ 'redirect' => 'http://requestb.in/1fglpx81' ]
);
print_r($test);
/**
* Step 2: Verify gateway signature
*/
print_r($Checkouts->verify('YOUR SIGNATURE HERE', 'YOUR CHECKOUT ID HERE', 4.50));
?>
# Include the Dwolla gem
require 'rubygems'
require 'pp'
require 'dwolla'
# Include any required keys
require './_keys.rb'
# Instantiate a new Dwolla User client
Dwolla::api_key = @api_key
Dwolla::api_secret = @api_secret
# Clear out any previous session data
Dwolla::OffsiteGateway.clear_session
# Optional Settings
Dwolla::OffsiteGateway.redirect = 'http://dwolla.com/payment_redirect'
Dwolla::OffsiteGateway.callback = 'http://dwolla.com/payment_callback'
Dwolla::OffsiteGateway.set_customer_info('Michael', 'Schonfeld'<EMAIL_ADDRESS>'New York', 'NY', '10001')
Dwolla::OffsiteGateway.discount = 4.95
Dwolla::OffsiteGateway.notes = 'This is just an offsite gateway test...'
# Add products
Dwolla::OffsiteGateway.add_product('Macbook Air', '13" Macbook Air; Model #0001', 499.99, 1)
# Generate a checkout sesssion
pp Dwolla::OffsiteGateway.get_checkout_url('812-734-7288')
# Verify and parse gateway callback
data = Dwolla::OffsiteGateway.read_callback('{"Amount":0.01,"OrderId":null,"Status":"Completed","Error":null,"TransactionId":3396300,"CheckoutId":"51f9dfaa-20ed-41a7-8874-00a47c19c655","Signature":"8be03dfd0e95c567b2855f5876acfc98992f6402","TestMode":"false","ClearingDate":"7/22/2013 8:42:18 PM"}')
pp data
from dwolla import checkouts
# Step 1: Create checkout session with items from
# http://docs.dwolla.com/#checkouts
test = checkouts.create({
'orderItems': {
frozenset({
'name': 'Prime Rib Sandwich',
'description': 'A somewhat tasty non-vegetarian sandwich',
'quantity': '1',
'price': '15.00'
})
},
'destinationId': '812-740-4294',
'total': 15.00,
'notes': 'blahhh',
'metadata': frozenset({
'key1': 'something',
'key2': 'another thing'
})})
# Step 2: Verify the recently created checkout
checkouts.get(test['CheckoutId'])
# Step 3: Complete the checkout
checkouts.complete('Order ID here')
# Step 4: Verify gateway signature
checkouts.verify('YOUR SIGNATURE HERE', 'YOUR CHECKOUT ID HERE', 4.50)
var cfg = require('./_config') // Include any required keys
, dwolla = require('dwolla-node')(cfg.apiKey, cfg.apiSecret) // Include the Dwolla REST Client
, $ = require('seq')
, express = require('express')
, app = express()
, util = require('util')
;
// Some constants...
var redirect_uri = 'http://localhost:3000/redirect';
// Use Dwolla Sandbox API
dwolla.sandbox = true;
/**
* EXAMPLE 1: (simple example)
* Create a new standard offsite gateway checkout
**/
app.get('/', function(req, res) {
var purchaseOrder = {
destinationId: '812-740-4294',
total: '5.00'
};
var params = {
allowFundingSources: true,
orderId: 'blah',
};
dwolla.createCheckout(redirect_uri, purchaseOrder, params, function(err, checkout) {
if (err) console.log(err);
// example checkout result:
// { checkoutURL: 'https://uat.dwolla.com/payment/checkout/d0429a55-c338-4139-b273-48d2f8c45693',
// checkoutId: 'd0429a55-c338-4139-b273-48d2f8c45693' }
res.send(util.format('Checkout created. Click to continue: %s', checkout.checkoutURL, checkout.checkoutURL));
});
});
User experience
Pay Immediately
Unlike the Pay Later flow, the checkout process is completed when the user clicks "Submit Payment" on the Gateway and the payment is sent immediately to the merchant. This flow does not require any action after the user is returned from the gateway to the merchant site.
User is prompted to create a Dwolla Direct account (If
allowGuestCheckout
andAllowFundingSources
were enabled in the request), or they will log in using existing account.If the user is already has a Dwolla account, they will be prompted to log in providing their email and password. Once the user successfully authenticates, they will be presented with the purchase order provided during the request.
If the user clicks the 'Cancel' button rather than logging in, they're redirected to the redirect URL with an error. If no redirect parameter was provided & no default Payment Redirect URL was set for the consumer application, they're redirected to dwolla.com.
User checks out/places order.
- The user will then need to provide their PIN number and click the 'Submit' button to complete the checkout. The payment is sent immediately to the merchant. If there are any errors, the payment will cancel and no funds will be transferred.
Transaction completion, server callback, and user redirect.
If the callback URL was provided during the request, the transaction details will be POSTed to the URL in a JSON-encoded string (Described below, in submission methods). This is completely transparent to the customer.
Direct submission
This option is great for cases where there is only one item that needs to be purchased. Common use cases are: donation purposes, paying a one-time subscription fee, or buying a single product. In order to initiate direct submission, a form must be directly submitted to the off-site gateway endpoint payment/pay
with all required checkout information. The user will be redirected to Dwolla where the checkout process will be completed. If checkoutWithApi
is marked true
, the Pay Later flow will be used, otherwise, it defaults to false
and Pay Immediately (this happens if the parameter isn't passed as it is optional).
Endpoint
https://www.dwolla.com/payment/pay
Request Parameters
| Required | Parameter | Description |
|---|---|---|
| Yes | key | Application Key |
| Yes | signature | HMAC-SHA1 hex hash of the app key, timestamp, and order ID. |
| Yes | timestamp | Timestamp of the generated purchase order. Represented as the UNIX epoch time. |
| Yes | destinationId | Dwolla ID of the account receiving the funds. Format will always match 812-xxx-xxxx . |
| Yes | amount | Amount of order. Must be at least $0.01. |
| Yes | name | Name of the item (100 character limit) |
| Yes | description | Description of the item (200 character limit) |
| No | callback | URL to POST the transaction response to after the user authorizes the purchase. If not provided, will default to the Payment Callback URL set for the consumer application. If a URL could not be found in the application settings and this parameter is not set, a postback error will be induced. Only applies if checkoutWithApi is false (Pay Later flow). |
| No | redirect | URL to return the user to after they authorize or cancel a purchase. If not provided, the URL will default to the Payment Redirect URL set in the application's settings. If no URL could be found, an error will be induced. |
| No | assumeCosts | Deprecated |
| No | allowFundingSources | Defaults to false , set to true to enable guest checkout and bank-funded payments. This would allow users without a Dwolla account to pass through the checkout flow. |
| No | checkoutWithApi | Defaults to false (and the Pay Now flow), set to true to use the Pay Later flow. |
| No | orderId | Optional string to identify the transaction (255 character limit). |
| No | test | Defaults to false , set to true to flag the PO for testing. Does not affect account balances nor are any e-mails sent. The transaction ID returned from a PO with test flagged will always be 1 . |
| No | tax | Tax applied to the order. Must be $0 or greater. |
| No | shipping | Shipping total for the order. Must be $0.00 or more. |
| No | facilitatorAmount | Amount of the facilitator fee (will override the amount in the application's settings). If set to 0 , the fee will be disabled. Must not exceed 25% of the transaction total. |
| No | notes | Note to attach to transaction (250 character limit). |
| No | metadata | A JSON object of maximum 10 key-value pairs with which to store metadata in. Keys and values must be strings of max length 255. |
HMAC-SHA1 Hashing - Required
The hexadecimal hash is generated from the ampersand delimited text of the consumer key, Unix timestamp, and orderId, even if an order ID is not provided. The text is then hashed using the consumer secret for the application as the hash key. The signature must be unique per request, so a new timestamp will need to be provided for each request. Below are examples on how to generate HMAC-SHA1 hashes in languages commonly used with web-stack development:
<?php
$key = "YOUR_APPLICATION_KEY";
$secret = "YOUR_APPLICATION_SECRET";
$timestamp = time(); // example:<PHONE_NUMBER>
$order_id = 1;
$signature = hash_hmac('sha1', "{$key}&{$timestamp}&{$order_id}", $secret);
?>
require 'rubygems'
require 'base64'
require 'cgi'
require 'hmac-sha1'
key = 'YOUR_APPLICATION_KEY'
secret = 'YOUR_APPLICATION_SECRET'
timestamp = Time.now.to_i
order_id = 1
signature = "#{key}&#{timestamp}&#{order_id}"
hmac = HMAC::SHA1.new(secret)
hmac.update(signature)
hash = CGI.escape(Base64.encode64("#{hmac.digest}\n"))
def sign_request():
from hashlib import sha1
import hmac
import binascii
import time
key = 'YOUR_APPLICATION_KEY'
secret = 'YOUR_APPLICATION_SECRET'
timestamp = int(time.time())
order_id = 1
text = key + '&' + timestamp + '&' + order_id
hash = hmac.new(secret, text, sha1)
# We format the string to exclude the last character which is a newline delimiter.
return binascii.b2a_base64(hashed.digest())[:-1]
var crypto = require('crypto')
, key = 'abcdeg'
, secret = 'YOUR_APPLICAITON_SECRET'
, order_id = 1
, timestamp = (new Date).getTime()
, text = key + '&' + timestamp + '&' + order_id
, hash;
hash = crypto.createHmac('sha1', secret).update(text).digest('hex');
Example form
HTML
<form accept-charset="UTF-8" action="https://www.dwolla.com/payment/pay" method="post">
<input id="key" name="key" type="hidden" value="abcdefg" />
<input id="signature" name="signature" type="hidden" value="abcd" />
<input id="timestamp" name="timestamp" type="hidden" value="1323302400" />
<input id="callback" name="callback" type="hidden" value="http://www.mywebsite.com/callback.aspx" />
<input id="redirect" name="redirect" type="hidden" value="http://www.mywebsite.com/redirect.aspx" />
<input id="test" name="test" type="hidden" value="false" />
<input id="name" name="name" type="hidden" value="Purchase" />
<input id="description" name="description" type="hidden" value="Description" />
<input id="destinationid" name="destinationid" type="hidden" value="812-713-9234" />
<input id="amount" name="amount" type="hidden" value="1.00" />
<input id="shipping" name="shipping" type="hidden" value="0.00" />
<input id="tax" name="tax" type="hidden" value="0.00" />
<input id="orderid" name="orderid" type="hidden" value="188375" />
<button type="submit">Submit Order</button>
</form>
Depending on the checkout flow utilized, the user will be redirected to the redirect
URL with either completed transaction details or a confirmation page on the merchant's webpage wherein they will complete their transaction.
If any errors incur, they will be passed as parameters to the redirect URL:
URL Example
Format: https://www.myurl.com/redirect?signature={}&orderId={}&amount={}&checkoutId={}&status={}&clearingDate={}&transaction={}&postback={}
Example: https://www.myurl.com/redirect?signature=c50e4b2a4c50ad795c3ee31370aec1a563565aa4&orderId=&amount=0.01&checkoutId=f32b1e55-9612-4b6d-90f9-1c1519e588da&status=Completed&clearingDate=8/28/2012%203:17:18%20PM&transaction=1312616&postback=success
Format: https://www.myurl.com/redirect?checkoutId={}&error=failure&error_description={}
Example: https://www.myurl.com/redirect?checkoutId=694e6bcb-349f-451d-bf5d-8aa16530c960&error=failure&error_description=There+are+insufficient+funds+for+this+transaction
Possible error_descriptions:
"Payment has already been generated for application, timestamp, and order ID."
"Invalid callback URL"
"Invalid application signature."
"Invalid timestamp."
"Invalid application credentials."
"There are insufficient funds for this transaction."
"User Cancelled"
"Invalid destination user."
Example Return
<?php
// First, check for any errors
if (array_key_exists("error", $_GET)) {
// find out what happened:
$error_description = $_GET['error_description']; // "User Cancelled"
exit($error_description);
}
// Create a function that verifies offsite-gateway signature hash against server-provided hash.
function verifyGatewaySignature($proposedSignature, $checkoutId, $amount) {
global $secret;
$key = "Your key here";
$secret = "Your secret here";
$amount = number_format($amount, 2);
$signature = hash_hmac("sha1", "{$checkoutId}&{$amount}", $secret);
return $signature == $proposedSignature;
}
// Second, extract the checkoutId, amount, and signature of the checkout:
$checkoutId = $_GET['checkoutId'];
$amount = $_GET['amount'];
$signature = $_GET['signature'];
// Third, validate the signature before you do anything with the data.
$signatureValid = verifyGatewaySignature($signature, $checkoutId, $amount);
if (!$signatureValid) {
exit("Signature is not valid!");
}
$status = $_GET['status'];
if ($status == "Completed") {
// do something useful with the checkout results:
echo $status;
}
?>
Server-to-server submission
In order to initialize server-to-server submission, the merchant website must POST a request to the Off-Site Gateway API providing a JSON formatted purchase order placed in the body of the request.
Only requests with Content-Type: application/json
will be accepted.
Creating a request
Request URL
https://www.dwolla.com/oauth/rest/offsitegateway/checkouts
Request Parameters
| Required | Parameter | Description |
|---|---|---|
| Yes | client_id | Application Key. |
| Yes | client_secret | Application Secret. |
| Yes | purchaseOrder | JSON object with purchase order information. |
| Yes | --> total | Total of the order. Must be $1 or more, calculated as (item cost * quantity) + tax + shipping + discount . |
| Yes | --> destinationId | Dwolla ID of the account receiving funds. Format must match 812-xxx-xxxx . |
| No | --> customerInfo | JSON object with customer's contact information. If allowFundingSources is true , information from this array will be filled in the gateway and editable. |
| ----> firstName | Customer's first name. | |
| ----> lastName | Customer's last name. | |
| Customer's e-mail address. | ||
| ----> city | Customer's city. | |
| ----> state | Customer's state (two letter abbreviation from ISO-3166:2 standard). | |
| ----> zip | Customer's zip code. | |
| No | --> discount | Discount applied to the order. Cannot exceed order total. Should be negative to remove amount from total. |
| No | --> shipping | Shipping total of the order. Must be $0 or greater. |
| No | --> tax | Tax applied to the order. Must be $0 or greater. |
| No | --> facilitatorAmount | Amount of the facilitator fee (will override the amount in the application's settings). If set to 0 , the fee will be disabled. Must not exceed 25% of the transaction total. |
| No | --> notes | Note to attach to transaction (250 character limit). |
| No | --> metadata | A JSON object of maximum 10 key-value pairs with which to store metadata in. Keys and values must be strings of max length 255. |
| No | --> orderItems | Array of line items for the purchase order to display to the user. Optional; if omitted, no purchase order breakdown is shown. |
| ----> name | Name of item (100 character limit). | |
| ----> description | Description of item (200 character limit). | |
| ----> price | Price of item ($0 or more). | |
| ----> quantity | Quantity of item (1 or more). |
Request and Response
An example request and success/fail response(s) are below:
HTTP Request, JSON object responses.
POST /oauth/rest/offsitegateway/checkouts
Content-Type: application/json
{
"client_id": "JCGQXLrlfuOqdUYdTcLz3rBiCZQDRvdWIUPkw++GMuGhkem9Bo",
"client_secret": "g7QLwvO37aN2HoKx1amekWi8a2g7AIuPbD5C/JSLqXIcDOxfTr",
"callback": "http://www.something.com/callback",
"redirect": "http://www.something.com/return",
"allowGuestCheckout": "true",
"checkoutWithApi": "false",
"orderId": "foo123",
"allowFundingSources": "true",
"additionalFundingSources": "true",
"purchaseOrder": {
"orderItems": [
{
"name": "T-Shirt",
"description": "Size: Large - Graphic Tee",
"quantity": "1",
"price": "15.00"
}
],
"destinationId": "812-740-4294",
"total": 15.00,
"tax": 1.00,
"shipping": 3.00,
"discount": -4.00,
"notes": "blahhh",
"facilitatorAmount": 0,
"metadata": {
"orderNum": "363498639",
"category": "thing2"
}
}
}
{
"Success": true,
"Message": "Success",
"Response": {
"CheckoutId": "a1472cfc-3dc7-4928-904b-65bd41d57525"
}
}
{
"Success": false,
"Message": "Invalid total.",
"Response": null
}
Finishing Checkout
Request URL
https://www.dwolla.com/payment/checkout/{CheckoutId}
The merchant's website will now need to redirect the user to the checkout endpoint providing the unique checkoutID
within 5 minutes. After 5 minutes, the checkout ID will expire and a new request will need to be generated. Depending on the checkout flow used, the user will either complete the transaction on the Dwolla gateway and be redirected to a confirmation page on the merchant's site, or will be redirected to the merchant's site in order to complete the order and fulfill payment.
Implementing Checkout Flows
Implementation is dependent on which checkout flow is used. We're going to walk you through what you need to do to get started with the pay now flow. For more information on the pay later flow, navigate here.
Pay Now Flow
With the Pay Now flow, the user logs in and proceeds to complete the transaction on the Dwolla gateway.
1. Handling callback
.
If callback
is set with a callback URL, Dwolla will POST an application/json
request to your URL with some information:
| Parameter | Description |
|---|---|
| Amount | Total amount of purchase formatted to two decimal places. |
| CheckoutID | Unique purchase order ID generated by the off-site gateway. |
| ClearingDate | Date and time in which the funds are to be cleared into the destination account. |
| NOTE: As of As of 8/4/2014 09:00 EST, ClearingDate will return a ISO-8601 formatted timestamp. Read more here. | |
| Error | Any error(s) that occurred during checkout. |
| OrderId | Order ID provided during the request. |
| Signature | HMAC-SHA1 hexadecimal hash of the checkoutId and amount ampersand separated using the consumer secret of the application as the hash key. |
| Status | Status of the checkout session. Possible values: Completed, and Failed. |
| TestMode | Set to 'true' if purchase order is for testing purposes only, otherwise 'false'. |
| TransactionId | Dwolla transaction ID to identify the successful transaction. If in test mode, the transaction ID has a value of 'null'. |
Example HTTP Post
POST https://www.example.com/payment_callback HTTP/1.1
Content-Type: application/json
Content-Length: 252
{
"Amount": 0.01,
"CheckoutId": "f32b1e55-9612-4b6d-90f9-1c1519e588da",
"ClearingDate": "8/28/2012 3:17:18 PM",
"Error": null,
"OrderId": null,
"Signature": "c50e4b2a4c50ad795c3ee31370aec1a563565aa4",
"Status": "Completed",
"TestMode": "false",
"TransactionId": 1312616
}
2. Handling user redirect.
When the user is redirected back to the specified merchant's website in redirect
, information will be included in the redirect URL's querystring parameters:
| Parameter | Description |
|---|---|
| checkoutId | Unique purchase order ID generated by Off-Site Gateway. |
| orderId | Order ID provided during the request. |
| test | Flagged to 'true' if purchase order is for testing purposes only, absent otherwise. |
| transaction | Dwolla transaction ID to identify the successful transaction. If in test mode, the transaction ID has a value of 'null'. |
| postback | If the callback URL provided and the postback response completed succesfully, a value of "success". If the callback URL provided is not valid and the postback response completed unsuccessfully, a value of "failed". |
| amount | Total amount of the purchase formatted to two decimal places. |
| signature | HMAC-SHA1 hexadecimal hash of the checkoutId and amount ampersand separated using the consumer secret of the application as the hash key. |
| clearingDate | Date and time in which the funds are to be cleared into the destination account. |
| NOTE: As of 8/4/2014 09:00 EST, ClearingDate will return a ISO-8601 formatted timestamp. Read more here. | |
| status | Status of the checkout session. Possible values: Completed, and Failed. |
This is what the URLs will look like in the event of success or failure:
URL Example
Format: https://www.myurl.com/redirect?signature={}&orderId={}&amount={}&checkoutId={}&status={}&clearingDate={}&transaction={}&postback={}
Example: https://www.myurl.com/redirect?signature=c50e4b2a4c50ad795c3ee31370aec1a563565aa4&orderId=&amount=0.01&checkoutId=f32b1e55-9612-4b6d-90f9-1c1519e588da&status=Completed&clearingDate=8/28/2012%203:17:18%20PM&transaction=1312616&postback=success
Format: https://www.myurl.com/redirect?checkoutId={}&error=failure&error_description={}
Example: https://www.myurl.com/redirect?checkoutId=694e6bcb-349f-451d-bf5d-8aa16530c960&error=failure&error_description=There+are+insufficient+funds+for+this+transaction
3. Handling Verification / Security
In both the user redirect querystring, and the callback POST request, Dwolla includes a signature that can be used to authenticate Dwolla's server identity. It is not required to do this, but highly recommended in order to ensure the safety of both you, the merchant, and the customer. The signature is an HMAC-SHA1 hexadecimal hash of the checkoutId and amount ampersand separated using the consumer secret of the application as the hash key.
Here's an example of a signature validation in some common languages:
Signature Verification
function verifyGatewaySignature($proposedSignature, $checkoutId, $amount) {
$amount = number_format($amount, 2);
$signature = hash_hmac("sha1", "{$checkoutId}&{$amount}", $apiSecret);
return $signature == $proposedSignature;
}
def self.valid_dwolla_signature?(proposed_signature, checkout_id, amount)
require 'base64'
require 'openssl'
raw = "#{checkout_id}&#{amount}"
digest = OpenSSL::Digest::Digest.new('sha1')
signature = OpenSSL::HMAC.hexdigest(digest, client_secret, raw)
return (signature == proposed_signature)
end
def verify_gateway_signature(proposed_signature, checkout_id, amount):
import hmac
import hashlib
raw = '%s&%.2f' % (checkout_id, amount)
signature = hmac.new(client_secret, raw, hashlib.sha1).hexdigest()
return True if (signature == proposed_signature) else False
var verifyGatewaySignature = function(proposed_signature, checkout_id, amount) {
var crypto = require('crypto')
, secret = 'API_SECRET_HERE'
, text = checkout_id + '&' + amount + '&' + order_id
, hash;
hash = crypto.createHmac('sha1', secret).update(text).digest('hex');
return proposed_signature === hash;
}


*Provider is the only service we can inject to the config function and establish an initial value. For example, if you wanted to inject your API key into your service at run time, you would have to use Provider. *The sentence below was set in the config function
Pick your Arist:
{{data.artistData}}
{{data.thingFromConfig}}


Download!
Current Release
Latest (1.0.5) [
ChangeLog
]
selenium-grid-1.0.5-bin.zip
Previous Releases
(unsupported)
Historical:
1.0.4
selenium-grid-1.0.4-bin.zip
selenium-grid-1.0.4-bin.tar.bz2
1.0.3
selenium-grid-1.0.3-bin.zip
selenium-grid-1.0.3-bin.tar.bz2
1.0.2
selenium-grid-1.0.2-bin.zip
selenium-grid-1.0.2-bin.tar.bz2
1.0.1
selenium-grid-1.0.1-bin.zip
selenium-grid-1.0.1-bin.tar.bz2


Patriots-Ravens Stats
by EndPlayBal_L.Jackson 3 run (Tucker kick), 8:13.
Bal_FG Tucker 39, 2:29.
Bal_Edwards 12 run (Tucker kick), 14:06.
NE_Sanu 4 pass from Brady (Folk kick), 12:02.
NE_FG Folk 22, 3:41.
NE_FG Folk 19, :08.
Bal_Humphrey 70 fumble return (Tucker kick), 12:21.
NE_White 1 run (Folk kick), 8:03.
Bal_Boyle 5 pass from L.Jackson (kick failed), 14:54.
Bal_L.Jackson 1 run (Tucker kick), 3:12.
A_71,157.
___
___
RUSHING_New England, White 9-38, Burkhead 4-18, Michel 4-18. Baltimore, Ingram 15-115, L.Jackson 16-61, Edwards 7-27, Hill 3-7.
PASSING_New England, Brady 30-46-1-285. Baltimore, L.Jackson 17-23-0-163.
RECEIVING_New England, Edelman 10-89, Sanu 10-81, Watson 4-28, White 2-46, Dorsett 2-13, Burkhead 1-16, Michel 1-12. Baltimore, Boyle 5-27, M.Brown 3-48, Ingram 2-29, Andrews 2-21, H.Hurst 2-15, Snead 2-15, Ricard 1-8.
MISSED FIELD GOALS_None.
First Quarter
Second Quarter
Third Quarter
Fourth Quarter
INDIVIDUAL STATISTICS


LuaSocket is a Lua extension library that is composed by two parts: a C core that provides support for the TCP and UDP transport layers, and a set of Lua modules that add support for the SMTP (sending e-mails), HTTP (WWW access) and FTP (uploading and downloading files) protocols and other functionality commonly needed by applications that deal with the Internet. This introduction is about the C core.
Communication in LuaSocket is performed via I/O objects. These can represent different network domains. Currently, support is provided for TCP and UDP, but nothing prevents other developers from implementing SSL, Local Domain, Pipes, File Descriptors etc. I/O objects provide a standard interface to I/O across different domains and operating systems.
The API design had two goals in mind. First, users experienced with the C API to sockets should feel comfortable using LuaSocket. Second, the simplicity and the feel of the Lua language should be preserved. To achieve these goals, the LuaSocket API keeps the function names and semantics the C API whenever possible, but their usage in Lua has been greatly simplified.
One of the simplifications is the receive pattern capability. Applications can read data from stream domains (such as TCP) line by line, block by block, or until the connection is closed. All I/O reads are buffered and the performance differences between different receive patterns are negligible.
Another advantage is the flexible timeout control mechanism. As in C, all I/O operations are blocking by default. For example, the send, receive and accept methods of the TCP domain will block the caller application until the operation is completed (if ever!). However, with a call to the settimeout method, an application can specify upper limits on the time it can be blocked by LuaSocket (the "total" timeout), on the time LuaSocket can internally be blocked by any OS call (the "block" timeout) or a combination of the two. Each LuaSocket call might perform several OS calls, so that the two timeout values are not equivalent.
Finally, the host name resolution is transparent, meaning that most functions and methods accept both IP addresses and host names. In case a host name is given, the library queries the system's resolver and tries the main IP address returned. Note that direct use of IP addresses is more efficient, of course. The toip and tohostname functions from the DNS module are provided to convert between host names and IP addresses.
Together, these changes make network programming in LuaSocket much simpler than it is in C, as the following sections will show.
TCP (Transfer Control Protocol) is reliable stream protocol. In other words, applications communicating through TCP can send and receive data as an error free stream of bytes. Data is split in one end and reassembled transparently on the other end. There are no boundaries in the data transfers. The library allows users to read data from the sockets in several different granularities: patterns are available for lines, arbitrary sized blocks or "read up to connection closed", all with good performance.
The library distinguishes three types of TCP sockets: master, client and server sockets.
Master sockets are newly created TCP sockets returned by the function socket.tcp. A master socket is transformed into a server socket after it is associated with a local address by a call to the bind method followed by a call to the listen. Conversely, a master socket can be changed into a client socket with the method connect, which associates it with a remote address.
On server sockets, applications can use the accept method to wait for a client connection. Once a connection is established, a client socket object is returned representing this connection. The other methods available for server socket objects are getsockname, setoption, settimeout, and close.
Client sockets are used to exchange data between two applications over the Internet. Applications can call the methods send and receive to send and receive data. The other methods available for client socket objects are getsockname, getpeername, setoption, settimeout, shutdown, and close.
Example:
A simple echo server, using LuaSocket. The program binds to an ephemeral port (one that is chosen by the operating system) on the local host and awaits client connections on that port. When a connection is established, the program reads a line from the remote end and sends it back, closing the connection immediately. You can test it using the telnet program.
-- load namespace local socket = require("socket") -- create a TCP socket and bind it to the local host, at any port local server = assert(socket.bind("*", 0)) -- find out which port the OS chose for us local ip, port = server:getsockname() -- print a message informing what's up print("Please telnet to localhost on port " .. port) print("After connecting, you have 10s to enter a line to be echoed") -- loop forever waiting for clients while 1 do -- wait for a connection from any client local client = server:accept() -- make sure we don't block waiting for this client's line client:settimeout(10) -- receive the line local line, err = client:receive() -- if there was no error, send it back to the client if not err then client:send(line .. "\n") end -- done with client, close the object client:close() end
UDP (User Datagram Protocol) is a non-reliable datagram protocol. In other words, applications communicating through UDP send and receive data as independent blocks, which are not guaranteed to reach the other end. Even when they do reach the other end, they are not guaranteed to be error free. Data transfers are atomic, one datagram at a time. Reading only part of a datagram discards the rest, so that the following read operation will act on the next datagram. The advantages are in simplicity (no connection setup) and performance (no error checking or error correction).
Note that although no guarantees are made, these days networks are so good that, under normal circumstances, few errors happen in practice.
An UDP socket object is created by the socket.udp function. UDP sockets do not need to be connected before use. The method sendto can be used immediately after creation to send a datagram to IP address and port. Host names are not allowed because performing name resolution for each packet would be forbiddingly slow. Methods receive and receivefrom can be used to retrieve datagrams, the latter returning the IP and port of the sender as extra return values (thus being slightly less efficient).
When communication is performed repeatedly with a single peer, an application should call the setpeername method to specify a permanent partner. Methods sendto and receivefrom can no longer be used, but the method send can be used to send data directly to the peer, and the method receive will only return datagrams originating from that peer. There is about 30% performance gain due to this practice.
To associate an UDP socket with a local address, an application calls the setsockname method before sending any datagrams. Otherwise, the socket is automatically bound to an ephemeral address before the first data transmission and once bound the local address cannot be changed. The other methods available for UDP sockets are getpeername, getsockname, settimeout, setoption and close.
Example:
A simple daytime client, using LuaSocket. The program connects to a remote server and tries to retrieve the daytime, printing the answer it got or an error message.
-- change here to the host an port you want to contact local host, port = "localhost", 13 -- load namespace local socket = require("socket") -- convert host name to ip address local ip = assert(socket.dns.toip(host)) -- create a new UDP object local udp = assert(socket.udp()) -- contact daytime host assert(udp:sendto("anything", ip, port)) -- retrieve the answer and print results io.write(assert(udp:receive()))
Although not covered in the introduction, LuaSocket offers much more than TCP and UDP functionality. As the library evolved, support for HTTP, FTP, and SMTP were built on top of these. These modules and many others are covered by the reference manual.


sync - common use (format must same)
using alt-field + alt-format
(readonly - real value, that send to server)


Plot Counterfactual Predictions
# S3 method for explore_df plot( x, n_use = 2, aggregate_fun = median, reorder_categories = TRUE, x_var, color_var, jitter_y = TRUE, sig_fig = 3, font_size = 11, strip_font_size = 0.85, line_width = 0.5, line_alpha = 0.7, rotate_x = FALSE, nrows = 1, title = NULL, caption, print = TRUE, ... )
| x | A explore_df object from |
|---|---|
| n_use | Number of features to vary, default = 4. If the number of
features varied in |
| aggregate_fun | Default = median. Varying features in x are mapped to the x-axis, line color, and vertical- and horizontal facets. If more than four features vary, this function is used to aggreagate across the least-important varying features. |
| reorder_categories | If TRUE (default) varying categorical features are
arranged by their median predicted outcome. If FALSE, the incoming level
orders are retained, which is alphabetical by default, but you can set your
own level orders with |
| x_var | Feature to put on the x-axis (unquoted). If not provided, the most important feature is used, with numerics prioritized if one varies |
| color_var | Feature to color lines (unquoted). If not provided, the most
important feature excluding |
| jitter_y | If TRUE (default) and a feature is mapped to color (i.e. if there is more than one varying feature), the vertical location of the lines will be jittered slightly (no more than 1 avoid overlap. |
| sig_fig | Number of significant figures (digits) to use in labels of numeric features. Default = 3; set to Inf to not truncate decimals. |
| font_size | Parent font size for the plot. Default = 11 |
| strip_font_size | Relative font size for facet strip title font. Default = 0.85 |
| line_width | Width of lines. Default = 0.5 |
| line_alpha | Opacity of lines. Default = 0.7 |
| rotate_x | If FALSE (default), x axis tick labels are positioned horizontally. If TRUE, they are rotated one quarter turn, which can be helpful when a categorical feature with long labels is mapped to x. |
| nrows | Only used when the number of varying features is three. The number of rows into which the facets will be arranged. Default = 1. NULL lets the number be determined algorithmically |
| title | Plot title |
| caption | Plot caption. Defaults to model used to make counterfactual predictions. Can be a string for custom caption or NULL for no caption. |
Print the plot? Default is FALSE. Either way, the plot is invisibly returned |
|
| ... | Not used |
ggplot object, invisibly
# First, we need a model set.seed(4956) m <- machine_learn(pima_diabetes, patient_id, outcome = pregnancies, models = "rf", tune = FALSE)#>#>#> #>#> #>#>#>#> #>#># Then we can explore our model through counterfactual predictions counterfactuals <- explore(m) # By default only the two most important varying features are plotted. This # example shows how counterfactual predictions can provide insight into how a # model maps inputs (features) to the output (outcome). This plot shows that for # this dataset, age is the most important predictor of the number of pregnancies # a woman has had, and the predicted number of pregnancies rises basically # linearly from approximately 20 to 40 and then levels off. plot(counterfactuals)#># To see the effects of more features in the model, increase the value of # `n_use`. You can also specify which of the varying features are mapped to the # x-axis and the color scale, and you can customize a variety of plot attributes plot(counterfactuals, n_use = 3, x_var = weight_class, color_var = age, font_size = 9, strip_font_size = 1, line_width = 2, line_alpha = .5, rotate_x = TRUE, nrows = 1)#># And you can further modify the plot like any other ggplot object p <- plot(counterfactuals, n_use = 1, print = FALSE)#>p + ylab("predicted number of pregnancies") + theme_classic() + theme(aspect.ratio = 1, panel.background = element_rect(fill = "slateblue"), plot.caption = element_text(face = "italic"))


About
My name is Yifan and usually go by Eileen. I am a software engineer with experiences in full-stack web development, Android mobile app development, AWS and machine learning (computer vision in particular). In my freetime, I like swimming and playing table tennis.
Software Engineer
My goal as a software engineer is to use my skills to make people's lives easier.
- Birthday: 09/13/1998
- Phone: +1<PHONE_NUMBER>
- City: San Jose, CA
- Age: 24
- Degree: Master
- Email<EMAIL_ADDRESS>I am originally from Beijing, China. I went to Boston College for undergrad and obtained duo degrees in computer science and mathematics. Currently, I am a master of computer science student at Northeastern university. I am interested in full-stack web development and cloud computing. In the summer of 2022, I did an internship at AWS and learned a lot from this experience.
Skills
I have a wide range of programming skills. Theses skills allow me to work on different kinds of projects.
Facts
I have earned two BS degrees in mathematics and computer science, and one MS degree in computer science. Besides, I have two publications in distributed systems and several projects.
BS Degrees
Publications
Hours Of Hardwork
Internships


process
Documentation
engine
kernel
resource
process
Description
Overview
Groups
Globals
Graph
Examples
Classes
Brief description
Process
Resource
process
- streamed and prepared
resource
data
.


The basic structure of the workflow playbook¶
The text structure in YAML¶
The Nunjucks templates¶
To define a task in Workflow Playbook, the filter functions are one of the three most important components.
The filter functions are kind of the most complex among the three. They are mainly used to define task arguments and batch items for a batch task. However, you’ll find out that it’s a very intuitive way to define tasks once you got the basic concept.
The basic concept of filter functions¶
A filter function can help to transform data to another, or it can do something special but not transforming data. It is used as instructions to process the information that requires by the tool.
Filter functions are mainly used in two places to define a task: batch-items and task arguments.
We need to generate a list for the batch-items. The length of this list is the number of jobs for this batch task.
For each element of a list, the element becomes the item
variable in the task-template
.
Therefore, for a n-length list, there will be n tasks with the item
variable of different values.
A fixed-content list can be directly specified like
"{{ ['value1', 'value2', 'value3'] }}"
.However, in most cases, you need to get the list items from a file or a folder. You can use filter functions like
listFromExcel
orlistFromFileGlob
to get the list, respectively. It is worth noting that elements of a list can be a sub-list or a dictionary (aka. objects, hashes, key-value pairs). You can access data in theitem
viaitem[0]
oritem['property1'] item.property1
if it is a sublist or dictionaries. In addition, you can define an item in combinations of values (string or number), lists, or dictionaries.
You can also use filter functions to set task arguments for the task-template.args
.


| Pod::Simple::HTMLBatch - convert several Pod files to several HTML files |
Pod::Simple::HTMLBatch - convert several Pod files to several HTML files
perl -MPod::Simple::HTMLBatch -e 'Pod::Simple::HTMLBatch::go' in out
This module is used for running batch-conversions of a lot of HTML documents
This class is NOT a subclass of Pod::Simple::HTML (nor of bad old Pod::Html) -- although it uses Pod::Simple::HTML for doing the conversion of each document.
The normal use of this class is like so:
use Pod::Simple::HTMLBatch;
my $batchconv = Pod::Simple::HTMLBatch->new;
$batchconv->some_option( some_value );
$batchconv->some_other_option( some_other_value );
$batchconv->batch_convert( \@search_dirs, $output_dir );
Note that this class also provides (but does not export) the function Pod::Simple::HTMLBatch::go. This is basically just a shortcut for Pod::Simple::HTMLBatch->batch_convert(@ARGV)
. It's meant to be handy for calling from the command line.
However, the shortcut requires that you specify exactly two command-line arguments, indirs
and outdir
.
Example:
% mkdir out_html
% perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go @INC out_html
(to convert the pod from Perl's @INC
files under the directory ./out_html)
(Note that the command line there contains a literal atsign-I-N-C. This is handled as a special case by batch_convert, in order to save you having to enter the odd-looking "" as the first command-line parameter when you mean "just use whatever's in @INC".)
Example:
% mkdir ../seekrut
% chmod og-rx ../seekrut
% perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go . ../seekrut
(to convert the pod under the current dir into HTML
files under the directory ./seekrut)
Example:
% perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go happydocs .
(to convert all pod from happydocs into the current directory)
This creates a new batch converter. The method doesn't take parameters. To change the converter's attributes, use the "ACCESSOR METHODS" below.
This searches the directories given in indirs and writes HTML files for each of these to a corresponding directory in outdir. The directory outdir must exist.
These two values for indirs specify that the normal Perl @INC
This specifies that the input directories are the items in the arrayref \@dirs
.
This specifies that the director "somedir" is the input. (This can be an absolute or relative path, it doesn't matter.)
A common value you might want would be just "." for the current directory:
$batchconv->batch_convert( "." , ...);
This specifies that you want the dirs "somedir", "someother", and "also" scanned, just as if you'd passed the arrayref [qw( somedir someother also)]
. Note that a ":"-separator is normal under Unix, but Under MSWin, you'll need 'somedir;someother;also'
instead, since the pathsep on MSWin is ";" instead of ":". (And that is because ":" often comes up in paths, like "c:/perl/lib"
.)
(Exactly what separator character should be used, is gotten from $Config::Config{'path_sep'}
, via the Config module.)
This specifies that you want the HTML output to go into the current directory.
(Note that a missing or undefined value means a different thing in the first slot than in the second. That's so that batch_convert()
with no arguments (or undef arguments) means "go from @INC, into the current directory.)
This specifies that you want the HTML output to go into the directory 'somedir'. (This can be an absolute or relative path, it doesn't matter.)
Note that you can also call batch_convert
as a class method, like so:
Pod::Simple::HTMLBatch->batch_convert( ... );
That is just short for this:
Pod::Simple::HTMLBatch-> new-> batch_convert(...);
That is, it runs a conversion with default options, for whatever inputdirs and output dir you specify.
The following are all accessor methods -- that is, they don't do anything on their own, but just alter the contents of the conversion object, which comprises the options for this particular batch conversion.
We show the "put" form of the accessors below (i.e., the syntax you use for setting the accessor to a specific value). But you can also call each method with no parameters to get its current value. For example, $self->contents_file()
returns the current value of the contents_file attribute.
This controls how verbose to be during batch conversion, as far as notes to STDOUT (or whatever is select
'd) about how the conversion is going. If 0, no progress information is printed. If 1 (the default value), some progress information is printed. Higher values print more information.
This controls whether or not each HTML page is liable to have a little table of contents at the top (which we call an "index" for historical reasons). This is true by default.
If set, should be the name of a file (in the output directory) to write the HTML index to. The default value is "index.html". If you set this to a false value, no contents file will be written.
This specifies what string should be put at the beginning of the contents page. The default is a string more or less like this:

<title>Perl Documentation</title>

Perl Documentation

This specifies what string should be put at the end of the contents page. The default is a string more or less like this:

Generated by
Pod::Simple::HTMLBatch v3.01 under Perl v5.008

At Fri May 14 22:26:42 2004 GMT,
which is Fri May 14 14:26:42 2004 local time.

TODO
TODO
If true (the default value), we autogenerate some CSS files in the output directory, and set our HTML files to use those. TODO: continue
If true (the default value), we autogenerate a JavaScript in the output directory, and set our HTML files to use it. Currently, the JavaScript is used only to get the browser to remember what stylesheet it prefers. TODO: continue
TODO
This sets what class is used for rendering the files. The default is "Pod::Simple::HTML". If you set it to something else, it should probably be a subclass of Pod::Simple::HTML, and you should require
or use
that class so that's it's loaded before Pod::Simple::HTMLBatch tries loading it.
This sets what class is used for searching for the files. The default is "Pod::Simple::Search". If you set it to something else, it should probably be a subclass of Pod::Simple::Search, and you should require
or use
that class so that's it's loaded before Pod::Simple::HTMLBatch tries loading it.
TODO
call add_css($someurl) to add stylesheet as alternate
call add_css($someurl,1) to add as primary stylesheet
call add_javascript
subclass Pod::Simple::HTML and set $batchconv->html_render_class to
that classname
and maybe override
$page->batch_mode_page_object_init($self, $module, $infile, $outfile, $depth)
or maybe override
$batchconv->batch_mode_page_object_init($page, $module, $infile, $outfile, $depth)
subclass Pod::Simple::Search and set $batchconv->search_class to
that classname
Pod::Simple, Pod::Simple::HTMLBatch, perlpod, perlpodspec
Questions or discussion about POD and Pod::Simple should be sent to the<EMAIL_ADDRESS>mail list. Send an empty email to<EMAIL_ADDRESS>to subscribe.
This module is managed in an open GitHub repository, https://github.com/perl-pod/pod-simple/. Feel free to fork and contribute, or to clone git://github.com/perl-pod/pod-simple.git and send patches!
Patches against Pod::Simple are welcome. Please send bug reports to<EMAIL_ADDRESS>Copyright (c) 2002 Sean M. Burke.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
Pod::Simple was created by Sean M. Burke<EMAIL_ADDRESS>But don't bother him, he's retired.
Pod::Simple is maintained by:
Allison Randal<EMAIL_ADDRESS>Hans Dieter Pearcey<EMAIL_ADDRESS>David E. Wheeler<EMAIL_ADDRESS>| Pod::Simple::HTMLBatch - convert several Pod files to several HTML files |


{% extends "base.html" %} {% block othermeta %} {% endblock %} {% block content %}
Attempt to access unauthorized page detected.
{{error}}
You will be redirected to main page in 5 seconds...


"x"
"1" "RICE,JE, MAKOWSKI,GS, HOSTED,TJ,JR AND LAVOIE,EJ, METHYLENE-BRIDGEDBAY REGION CHRYSENE AND PHENANTHRENE DERIVATIVES AND THEIR KETO ANALOGS:MUTAGENICITY IN SALMONELLA TYPHIMURIUM AND TUMOR INITIATING A __ CTIVITY ON MOUSESKIN, CANCER LETT. 27(2):199-206, 1985"


SEC orders takeover of R&L Investments
Capital Markets Integrity Corporation, the local bourse's compliance arm, is tasked to assist affected customers and submit a report for instituting criminal charges
by Ralf RivasSubscribe
Email Address
Newsletters
- Glenda Gloria's Take this Tuesday
- Huddle by Miriam Grace Go
- The Newsbreak Agenda by Chay Hofileña
- Sometimes, all you need is video by Lilibeth Frondoso


Class built with the purpose to manage configuration options or settings easily. the class will get a json file as input (or will create one for you) and all the two types of settings private and public are ket in internal private array config, when the class is removed, if something has changed the class will use his innerithed jsonSerialize to serialize the updated version of the config and store it into the JSON file. More...
Public Member Functions | |
| __construct ($configFile=false) | |
| __get ($property) | |
| __set ($property, $value) | |
| __destruct () | |
| jsonSerialize () | |
Data Fields | |
| $override = false | |
| $file = false | |
| $update = false | |
Private Attributes | |
| $config = false | |
Class built with the purpose to manage configuration options or settings easily. the class will get a json file as input (or will create one for you) and all the two types of settings private and public are ket in internal private array config, when the class is removed, if something has changed the class will use his innerithed jsonSerialize to serialize the updated version of the config and store it into the JSON file.
Definition at line 23 of file MH_Config.php.
| __construct | ( | $configFile = false | ) |
Constructor
the constructor will get as input the FULL PATH of a JSON file, if no file is provided the mh_config.json will be used, the class will try to get the content and parse the JSON if that operation is successfully the config array will be the unserialized JSON, if that operation fails the config array is initialized with the two keys private and public.
| string | boolean | $configFile | FULL PATH of a json file |
Definition at line 46 of file MH_Config.php.
| __destruct | ( | ) |
Destructor
if something has changed on the config array and the update flag is true once the destructor is called it will serialize the config array and save it over to the JSON file.
open the JSON file
please note the @ operator used, if the file path is invalid or not accessible that will raise a warning, I don't want that because the JSON must be accessible
Definition at line 149 of file MH_Config.php.
| __get | ( | $property | ) |
Getter
the getter will check the first character on the requested item, is it starts with and underscore it will check the private index of the config object for the requested item and will return it, if the string does not starts with and underscore the public index will be used. If the element is not found false is returned.
| string | $property | automatically passed the requested item. |
Definition at line 83 of file MH_Config.php.
| __set | ( | $property, | |
| $value | |||
| ) |
Setter
the setter will use the same trick of the getter to check if the requested item is public or private: if is private and the ovveride flag is false, the request will be ignored, if the flag is true the private item will be created/overwritten
if the item is public will be overwritten/create with no further checks
if one or more items are changed the update flag will change to true and the destructor will save the changed over to the JSON file
| string | $property | automatically passed the requested item. |
| string | $value | automatically passed the vaule of the new/updated item. |
Definition at line 120 of file MH_Config.php.
| jsonSerialize | ( | ) |
jsonSerialize
implement the jsonSerialize method to choose what will be serialized on the json_encode function
Definition at line 176 of file MH_Config.php.
|
private |
$config, $file, $update are used internally to alter the behavior of some functions
Definition at line 33 of file MH_Config.php.
| $file = false |
Definition at line 33 of file MH_Config.php.
| $override = false |
$override is public, the developer can choose if the private configs can be overwritten
Definition at line 28 of file MH_Config.php.
| $update = false |
Definition at line 33 of file MH_Config.php.


pvl_robustfit
Regress Y onto X using iteratively reweighted least squares
Contents
Syntax
beta = pvl_robustfit(X, Y, intercept)
Description
|pvl_robustfit| regresses Y onto X using iteratively reweighted least squares, with the Tukey bi-weight function. |pvl_robustfit| uses the Matlab function |robustfit| if the Statistics toolbox is available. Otherwise it uses the RLM function in the Python statsmodels package, which requires a Python installation.
Inputs
- * X* - a N x M matrix, where M is the number of predictors and N is the number of observations
- * Y* - a N by 1 vector
- * intercept* - an integer; 0 indicates no intercept, any other value indicates that the regression has an intercept term
Output * * beta* - a vector of coefficients, M x 1 if no intercept is specified, (M+1) x 1 if an intercept is specified. The coefficient for the intercept (if present) is beta(1).
Example
generate data with non-constant variance and outliers
X = 1:0.05:4; X = X(:); Y = 4 - 0.3*X + rand(size(X))./(0.5*X.^2); beta = pvl_robustfit(X,Y,1); beta2 = [ones(size(X)) X]\Y; % least squares regression figure plot(X,Y,'x') hold all plot(X,[ones(size(X)) X]*beta,'-') plot(X,[ones(size(X)) X]*beta2,'-') legend('Data','Robust fit','Least squares')
Copyright 2015 Sandia National Laboratories