| | |
- builtins.object
-
- SecureObject
-
- SecureArray
-
- SecureFiniteFieldArray
- SecureFixedPointArray
- SecureIntegerArray
- SecureNumber
-
- SecureFiniteField
- SecureFixedPoint
- SecureFloat
- SecureInteger
class SecureArray(SecureObject) |
| |
SecureArray(value=None, shape=None)
Base class for secure (secret-shared) number arrays. |
| |
- Method resolution order:
- SecureArray
- SecureObject
- builtins.object
Methods defined here:
- __abs__(self)
- Matrix absolute value.
- __add__(self, other)
- Matrix addition.
- __array_function__(self, func, types, args, kwargs)
- Redirect __array_function__ call to array class, if any.
To support calls like np.block([[secint(9), -1], [1, secint(7)]]).
- __bool__(self)
- Return True if secure array is nonempty, False otherwise.
- __eq__(self, other)
- Equality testing.
- __ge__(self, other)
- Greater-than or equal comparison.
- __getitem__(self, i)
- __gt__(self, other)
- Strictly greater-than comparison.
- __init__(self, value=None, shape=None)
- Initialize a secure array.
The given value must be None, a Future, or a finite field array of correct type.
If value is None (default) or a Future, shape must not be None.
The given shape must be a (possibly empty) tuple of nonnegative integers.
If shape is None (default), value should be a finite field array.
- __iter__(self)
- __le__(self, other)
- Less-than or equal comparison.
- __len__(self)
- __lt__(self, other)
- Strictly less-than comparison.
- __matmul__(self, other)
- Matrix multiplication.
- __mul__(self, other)
- Multiplication.
- __ne__(self, other)
- Negated equality testing.
- __neg__(self)
- Matrix negation.
- __pow__(self, other)
- Exponentiation for public integral exponent.
- __radd__ = __add__(self, other)
- __rmatmul__(self, other)
- Matrix multiplication (with reflected arguments).
- __rmul__ = __mul__(self, other)
- __rsub__(self, other)
- Matrix subtraction.
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __sub__(self, other)
- Matrix subtraction.
- __truediv__(self, other)
- Division.
- argmax(self, *args, **kwargs)
- Returns the indices of the maximum values along an axis.
If no axis is given (default), array is flattened.
By default, the indices are returned as unit vectors ...
Also, by default, the maximum values are returned (next to the indices).
NB: Different defaults for np.argmax(). Latter behaves like for NumPy arrays.
- argmin(self, *args, **kwargs)
- Returns the indices of the minimum values along an axis.
If no axis is given (default), array is flattened.
By default, the indices are returned as unit vectors ...
Also, by default, the minimum values are returned (next to the indices).
NB: Different defaults for np.argmin(). Latter behaves like for NumPy arrays.
- copy(self, order='C')
- flatten(self, order='C')
- reshape(self, *shape, order='C')
- sort(self, *args, **kwargs)
- Returns new array sorted along an axis.
By default, axis=-1.
If axis is None, the array is flattened.
- sum(self, *args, **kwargs)
- swapaxes(self, axis1, axis2)
- tolist(self)
- transpose(self, *axes)
Readonly properties defined here:
- T
- flat
- ndim
- size
Data descriptors defined here:
- shape
Data and other attributes defined here:
- __annotations__ = {'sectype': <class 'type'>}
- __hash__ = None
Methods inherited from SecureObject:
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- Delegate __array_ufunc__ call to corresponding operator call.
Provisional support for calls like np.less(secint(9), 10).
- __deepcopy__(self, memo)
- Let SecureObjects behave as immutable objects.
Introduced for github.com/meilof/oblif.
- set_share(self, value)
- Set share to the given value.
The share is set directly (or recursively, for a composite SecureObject),
using callbacks if value contains Futures that are not yet done.
Data descriptors inherited from SecureObject:
- share
Data and other attributes inherited from SecureObject:
- binary_ops = {<ufunc 'less'>: <built-in function lt>, <ufunc 'less_equal'>: <built-in function le>, <ufunc 'equal'>: <built-in function eq>, <ufunc 'not_equal'>: <built-in function ne>, <ufunc 'greater'>: <built-in function gt>, <ufunc 'greater_equal'>: <built-in function ge>, <ufunc 'add'>: <built-in function add>, <ufunc 'subtract'>: <built-in function sub>, <ufunc 'multiply'>: <built-in function mul>, <ufunc 'divide'>: <built-in function truediv>, ...}
- unary_ops = {<ufunc 'negative'>: <built-in function neg>, <ufunc 'positive'>: <built-in function pos>, <ufunc 'absolute'>: <built-in function abs>}
|
class SecureFiniteField(SecureNumber) |
| |
SecureFiniteField(value=None)
Base class for secure (secret-shared) finite field elements.
NB: bit-oriented operations will be supported for prime fields. |
| |
- Method resolution order:
- SecureFiniteField
- SecureNumber
- SecureObject
- builtins.object
Methods defined here:
- __abs__(self)
- Currently no support at all.
- __and__(self, other)
- Bitwise and for binary fields (otherwise 1-bit only).
- __divmod__(self, other)
- Currently no support at all.
- __floordiv__(self, other)
- Currently no support at all.
- __ge__(self, other)
- Currently no support at all.
- __gt__(self, other)
- Currently no support at all.
- __init__(self, value=None)
- Initialize a secure finite field element.
Value must be None, int, or correct field type.
- __invert__(self)
- Bitwise not (inversion) for binary fields (otherwise 1-bit only).
- __le__(self, other)
- Currently no support at all.
- __lshift__(self, other)
- Currently no support at all.
- __lt__(self, other)
- Currently no support at all.
- __mod__(self, other)
- Currently no support at all.
- __or__(self, other)
- Bitwise or for binary fields (otherwise 1-bit only).
- __rdivmod__(self, other)
- Currently no support at all.
- __rfloordiv__(self, other)
- Currently no support at all.
- __rlshift__(self, other)
- Currently no support at all.
- __rmod__(self, other)
- Currently no support at all.
- __rrshift__(self, other)
- Currently no support at all.
- __rshift__(self, other)
- Currently no support at all.
- __xor__(self, other)
- Bitwise exclusive-or for binary fields (otherwise 1-bit only).
Data and other attributes defined here:
- __annotations__ = {'field': <class 'type'>, 'subfield': <class 'type'>}
- frac_length = 0
Methods inherited from SecureNumber:
- __add__(self, other)
- Addition.
- __eq__(self, other)
- Equality testing.
- __mul__(self, other)
- Multiplication.
Special case: repeat of additive group operation.
- __ne__(self, other)
- Negated equality testing.
- __neg__(self)
- Negation.
- __pos__(self)
- Unary +.
- __pow__(self, other)
- Exponentiation for public integral exponent.
- __radd__ = __add__(self, other)
- __rand__ = __and__(self, other)
- Bitwise and, for now 1-bit only.
- __rmul__ = __mul__(self, other)
- __ror__ = __or__(self, other)
- Bitwise or, for now 1-bit only.
- __rpow__(self, other)
- Exponentiation (with reflected arguments) for secret exponent.
Special case: repeat of multiplicative group operation.
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __rxor__(self, other)
- Bitwise exclusive-or, for now 1-bit only.
Special case: repeat of finite group operation.
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- if_else(self, x, y)
- Use SecureNumber as condition for secure selection between x and y.
- if_swap(self, x, y)
- Use SecureNumber as condition for secure swap of x and y.
Data and other attributes inherited from SecureNumber:
- __hash__ = None
- bit_length = None
Methods inherited from SecureObject:
- __array_function__(self, func, types, args, kwargs)
- Redirect __array_function__ call to array class, if any.
To support calls like np.block([[secint(9), -1], [1, secint(7)]]).
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- Delegate __array_ufunc__ call to corresponding operator call.
Provisional support for calls like np.less(secint(9), 10).
- __bool__(self)
- Use of secret-shared objects in Boolean expressions makes no sense.
- __deepcopy__(self, memo)
- Let SecureObjects behave as immutable objects.
Introduced for github.com/meilof/oblif.
- set_share(self, value)
- Set share to the given value.
The share is set directly (or recursively, for a composite SecureObject),
using callbacks if value contains Futures that are not yet done.
Data descriptors inherited from SecureObject:
- share
Data and other attributes inherited from SecureObject:
- binary_ops = {<ufunc 'less'>: <built-in function lt>, <ufunc 'less_equal'>: <built-in function le>, <ufunc 'equal'>: <built-in function eq>, <ufunc 'not_equal'>: <built-in function ne>, <ufunc 'greater'>: <built-in function gt>, <ufunc 'greater_equal'>: <built-in function ge>, <ufunc 'add'>: <built-in function add>, <ufunc 'subtract'>: <built-in function sub>, <ufunc 'multiply'>: <built-in function mul>, <ufunc 'divide'>: <built-in function truediv>, ...}
- unary_ops = {<ufunc 'negative'>: <built-in function neg>, <ufunc 'positive'>: <built-in function pos>, <ufunc 'absolute'>: <built-in function abs>}
|
class SecureFiniteFieldArray(SecureArray) |
| |
SecureFiniteFieldArray(value=None, shape=None)
Base class for secure (secret-shared) arrays of finite field elements. |
| |
- Method resolution order:
- SecureFiniteFieldArray
- SecureArray
- SecureObject
- builtins.object
Methods defined here:
- __init__(self, value=None, shape=None)
- Initialize a secure finite field array to the given value.
If value is None (default), shape must not be None.
The given value must be array of the appropriate type (int/polynomial/finite field array).
The given shape must be a (possibly empty) tuple of nonnegative integers.
Data and other attributes defined here:
- __annotations__ = {}
- frac_length = 0
Methods inherited from SecureArray:
- __abs__(self)
- Matrix absolute value.
- __add__(self, other)
- Matrix addition.
- __array_function__(self, func, types, args, kwargs)
- Redirect __array_function__ call to array class, if any.
To support calls like np.block([[secint(9), -1], [1, secint(7)]]).
- __bool__(self)
- Return True if secure array is nonempty, False otherwise.
- __eq__(self, other)
- Equality testing.
- __ge__(self, other)
- Greater-than or equal comparison.
- __getitem__(self, i)
- __gt__(self, other)
- Strictly greater-than comparison.
- __iter__(self)
- __le__(self, other)
- Less-than or equal comparison.
- __len__(self)
- __lt__(self, other)
- Strictly less-than comparison.
- __matmul__(self, other)
- Matrix multiplication.
- __mul__(self, other)
- Multiplication.
- __ne__(self, other)
- Negated equality testing.
- __neg__(self)
- Matrix negation.
- __pow__(self, other)
- Exponentiation for public integral exponent.
- __radd__ = __add__(self, other)
- __rmatmul__(self, other)
- Matrix multiplication (with reflected arguments).
- __rmul__ = __mul__(self, other)
- __rsub__(self, other)
- Matrix subtraction.
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __sub__(self, other)
- Matrix subtraction.
- __truediv__(self, other)
- Division.
- argmax(self, *args, **kwargs)
- Returns the indices of the maximum values along an axis.
If no axis is given (default), array is flattened.
By default, the indices are returned as unit vectors ...
Also, by default, the maximum values are returned (next to the indices).
NB: Different defaults for np.argmax(). Latter behaves like for NumPy arrays.
- argmin(self, *args, **kwargs)
- Returns the indices of the minimum values along an axis.
If no axis is given (default), array is flattened.
By default, the indices are returned as unit vectors ...
Also, by default, the minimum values are returned (next to the indices).
NB: Different defaults for np.argmin(). Latter behaves like for NumPy arrays.
- copy(self, order='C')
- flatten(self, order='C')
- reshape(self, *shape, order='C')
- sort(self, *args, **kwargs)
- Returns new array sorted along an axis.
By default, axis=-1.
If axis is None, the array is flattened.
- sum(self, *args, **kwargs)
- swapaxes(self, axis1, axis2)
- tolist(self)
- transpose(self, *axes)
Readonly properties inherited from SecureArray:
- T
- flat
- ndim
- size
Data descriptors inherited from SecureArray:
- shape
Data and other attributes inherited from SecureArray:
- __hash__ = None
Methods inherited from SecureObject:
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- Delegate __array_ufunc__ call to corresponding operator call.
Provisional support for calls like np.less(secint(9), 10).
- __deepcopy__(self, memo)
- Let SecureObjects behave as immutable objects.
Introduced for github.com/meilof/oblif.
- set_share(self, value)
- Set share to the given value.
The share is set directly (or recursively, for a composite SecureObject),
using callbacks if value contains Futures that are not yet done.
Data descriptors inherited from SecureObject:
- share
Data and other attributes inherited from SecureObject:
- binary_ops = {<ufunc 'less'>: <built-in function lt>, <ufunc 'less_equal'>: <built-in function le>, <ufunc 'equal'>: <built-in function eq>, <ufunc 'not_equal'>: <built-in function ne>, <ufunc 'greater'>: <built-in function gt>, <ufunc 'greater_equal'>: <built-in function ge>, <ufunc 'add'>: <built-in function add>, <ufunc 'subtract'>: <built-in function sub>, <ufunc 'multiply'>: <built-in function mul>, <ufunc 'divide'>: <built-in function truediv>, ...}
- unary_ops = {<ufunc 'negative'>: <built-in function neg>, <ufunc 'positive'>: <built-in function pos>, <ufunc 'absolute'>: <built-in function abs>}
|
class SecureFixedPoint(SecureNumber) |
| |
SecureFixedPoint(value=None, integral=None)
Base class for secure (secret-shared) fixed-point numbers. |
| |
- Method resolution order:
- SecureFixedPoint
- SecureNumber
- SecureObject
- builtins.object
Methods defined here:
- __init__(self, value=None, integral=None)
- Initialize a secure fixed-point number.
Value must be None, int, float, or correct field type.
Boolean flag integral sets the attribute integral of the secure fixed-point number.
If integral=True or integral=False, the attribute integral is set accordingly.
Otherwise, if integral=None (not set), the attribute integral is inferred from value
(set to True if value is a whole number of type int or float).
Data descriptors defined here:
- integral
Data and other attributes defined here:
- __annotations__ = {'field': <class 'type'>}
- frac_length = 0
Methods inherited from SecureNumber:
- __abs__(self)
- Absolute value.
- __add__(self, other)
- Addition.
- __and__(self, other)
- Bitwise and, for now 1-bit only.
- __divmod__(self, other)
- Integer division with public divisor.
- __eq__(self, other)
- Equality testing.
- __floordiv__(self, other)
- Integer quotient with public divisor.
- __ge__(self, other)
- Greater-than or equal comparison.
- __gt__(self, other)
- Strictly greater-than comparison.
- __invert__(self)
- Bitwise not (inversion), for now 1-bit only.
- __le__(self, other)
- Less-than or equal comparison.
- __lshift__(self, other)
- Left shift with public integral offset.
- __lt__(self, other)
- Strictly less-than comparison.
- __mod__(self, other)
- Integer remainder with public divisor.
- __mul__(self, other)
- Multiplication.
Special case: repeat of additive group operation.
- __ne__(self, other)
- Negated equality testing.
- __neg__(self)
- Negation.
- __or__(self, other)
- Bitwise or, for now 1-bit only.
- __pos__(self)
- Unary +.
- __pow__(self, other)
- Exponentiation for public integral exponent.
- __radd__ = __add__(self, other)
- __rand__ = __and__(self, other)
- __rdivmod__(self, other)
- Integer division (with reflected arguments).
- __rfloordiv__(self, other)
- Integer quotient (with reflected arguments).
- __rlshift__(self, other)
- Left shift (with reflected arguments).
- __rmod__(self, other)
- Integer remainder (with reflected arguments).
- __rmul__ = __mul__(self, other)
- __ror__ = __or__(self, other)
- __rpow__(self, other)
- Exponentiation (with reflected arguments) for secret exponent.
Special case: repeat of multiplicative group operation.
- __rrshift__(self, other)
- Right shift (with reflected arguments).
- __rshift__(self, other)
- Right shift with public integral offset.
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __rxor__(self, other)
- Bitwise exclusive-or, for now 1-bit only.
Special case: repeat of finite group operation.
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- __xor__(self, other)
- Bitwise exclusive-or, for now 1-bit only.
- if_else(self, x, y)
- Use SecureNumber as condition for secure selection between x and y.
- if_swap(self, x, y)
- Use SecureNumber as condition for secure swap of x and y.
Data and other attributes inherited from SecureNumber:
- __hash__ = None
- bit_length = None
Methods inherited from SecureObject:
- __array_function__(self, func, types, args, kwargs)
- Redirect __array_function__ call to array class, if any.
To support calls like np.block([[secint(9), -1], [1, secint(7)]]).
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- Delegate __array_ufunc__ call to corresponding operator call.
Provisional support for calls like np.less(secint(9), 10).
- __bool__(self)
- Use of secret-shared objects in Boolean expressions makes no sense.
- __deepcopy__(self, memo)
- Let SecureObjects behave as immutable objects.
Introduced for github.com/meilof/oblif.
- set_share(self, value)
- Set share to the given value.
The share is set directly (or recursively, for a composite SecureObject),
using callbacks if value contains Futures that are not yet done.
Data descriptors inherited from SecureObject:
- share
Data and other attributes inherited from SecureObject:
- binary_ops = {<ufunc 'less'>: <built-in function lt>, <ufunc 'less_equal'>: <built-in function le>, <ufunc 'equal'>: <built-in function eq>, <ufunc 'not_equal'>: <built-in function ne>, <ufunc 'greater'>: <built-in function gt>, <ufunc 'greater_equal'>: <built-in function ge>, <ufunc 'add'>: <built-in function add>, <ufunc 'subtract'>: <built-in function sub>, <ufunc 'multiply'>: <built-in function mul>, <ufunc 'divide'>: <built-in function truediv>, ...}
- unary_ops = {<ufunc 'negative'>: <built-in function neg>, <ufunc 'positive'>: <built-in function pos>, <ufunc 'absolute'>: <built-in function abs>}
|
class SecureFixedPointArray(SecureArray) |
| |
SecureFixedPointArray(value=None, shape=None, integral=None)
Base class for secure (secret-shared) arrays of fixed-point numbers. |
| |
- Method resolution order:
- SecureFixedPointArray
- SecureArray
- SecureObject
- builtins.object
Methods defined here:
- __init__(self, value=None, shape=None, integral=None)
- Initialize a secure fixed-point array to the given value.
If value is None (default), shape must not be None.
The given value must be an array of the appropriate type (int/float/finite field array).
The given shape must be a (possibly empty) tuple of nonnegative integers.
Data descriptors defined here:
- integral
Data and other attributes defined here:
- __annotations__ = {}
- frac_length = 0
Methods inherited from SecureArray:
- __abs__(self)
- Matrix absolute value.
- __add__(self, other)
- Matrix addition.
- __array_function__(self, func, types, args, kwargs)
- Redirect __array_function__ call to array class, if any.
To support calls like np.block([[secint(9), -1], [1, secint(7)]]).
- __bool__(self)
- Return True if secure array is nonempty, False otherwise.
- __eq__(self, other)
- Equality testing.
- __ge__(self, other)
- Greater-than or equal comparison.
- __getitem__(self, i)
- __gt__(self, other)
- Strictly greater-than comparison.
- __iter__(self)
- __le__(self, other)
- Less-than or equal comparison.
- __len__(self)
- __lt__(self, other)
- Strictly less-than comparison.
- __matmul__(self, other)
- Matrix multiplication.
- __mul__(self, other)
- Multiplication.
- __ne__(self, other)
- Negated equality testing.
- __neg__(self)
- Matrix negation.
- __pow__(self, other)
- Exponentiation for public integral exponent.
- __radd__ = __add__(self, other)
- __rmatmul__(self, other)
- Matrix multiplication (with reflected arguments).
- __rmul__ = __mul__(self, other)
- __rsub__(self, other)
- Matrix subtraction.
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __sub__(self, other)
- Matrix subtraction.
- __truediv__(self, other)
- Division.
- argmax(self, *args, **kwargs)
- Returns the indices of the maximum values along an axis.
If no axis is given (default), array is flattened.
By default, the indices are returned as unit vectors ...
Also, by default, the maximum values are returned (next to the indices).
NB: Different defaults for np.argmax(). Latter behaves like for NumPy arrays.
- argmin(self, *args, **kwargs)
- Returns the indices of the minimum values along an axis.
If no axis is given (default), array is flattened.
By default, the indices are returned as unit vectors ...
Also, by default, the minimum values are returned (next to the indices).
NB: Different defaults for np.argmin(). Latter behaves like for NumPy arrays.
- copy(self, order='C')
- flatten(self, order='C')
- reshape(self, *shape, order='C')
- sort(self, *args, **kwargs)
- Returns new array sorted along an axis.
By default, axis=-1.
If axis is None, the array is flattened.
- sum(self, *args, **kwargs)
- swapaxes(self, axis1, axis2)
- tolist(self)
- transpose(self, *axes)
Readonly properties inherited from SecureArray:
- T
- flat
- ndim
- size
Data descriptors inherited from SecureArray:
- shape
Data and other attributes inherited from SecureArray:
- __hash__ = None
Methods inherited from SecureObject:
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- Delegate __array_ufunc__ call to corresponding operator call.
Provisional support for calls like np.less(secint(9), 10).
- __deepcopy__(self, memo)
- Let SecureObjects behave as immutable objects.
Introduced for github.com/meilof/oblif.
- set_share(self, value)
- Set share to the given value.
The share is set directly (or recursively, for a composite SecureObject),
using callbacks if value contains Futures that are not yet done.
Data descriptors inherited from SecureObject:
- share
Data and other attributes inherited from SecureObject:
- binary_ops = {<ufunc 'less'>: <built-in function lt>, <ufunc 'less_equal'>: <built-in function le>, <ufunc 'equal'>: <built-in function eq>, <ufunc 'not_equal'>: <built-in function ne>, <ufunc 'greater'>: <built-in function gt>, <ufunc 'greater_equal'>: <built-in function ge>, <ufunc 'add'>: <built-in function add>, <ufunc 'subtract'>: <built-in function sub>, <ufunc 'multiply'>: <built-in function mul>, <ufunc 'divide'>: <built-in function truediv>, ...}
- unary_ops = {<ufunc 'negative'>: <built-in function neg>, <ufunc 'positive'>: <built-in function pos>, <ufunc 'absolute'>: <built-in function abs>}
|
class SecureFloat(SecureNumber) |
| |
SecureFloat(value=None)
Base class for secure (secret-shared) floating-point numbers.
Basic arithmetic +,-,*,/ and comparisons <,<=,--,>,>=,!= are supported for secure floats,
as well as input()/output() and sorting operations like min()/argmax()/sorted().
Other operations like sum()/prod()/all()/any()/in_prod() are currently not supported for
secure floats.
Implementation is kept simple, representing a secure float as a pair consisting of
a secure fixed-point number for the significand and a secure integer for the exponent.
Note, however, that even basic arithmetic +,-,*,/ with secure floats is very
demanding performance-wise (due to dependence on secure bitwise operations). |
| |
- Method resolution order:
- SecureFloat
- SecureNumber
- SecureObject
- builtins.object
Methods defined here:
- __abs__(self)
- Absolute value.
- __add__(self, other)
- Addition.
- __eq__(self, other)
- Equality testing.
- __ge__(self, other)
- Greater-than or equal comparison.
- __gt__(self, other)
- Strictly greater-than comparison.
- __init__(self, value=None)
- Initialize a secure floating-point number.
Value must be None, int, or float.
- __le__(self, other)
- Less-than or equal comparison.
- __lt__(self, other)
- Strictly less-than comparison.
- __mul__(self, other)
- Multiplication.
- __ne__(self, other)
- Negated equality testing.
- __neg__(self)
- Negation.
- __pos__(self)
- Unary +.
- __radd__ = __add__(self, other)
- __rmul__ = __mul__(self, other)
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- reciprocal(self)
- Secure reciprocal (multiplicative inverse).
- set_share(self, value)
- Set share to the given value.
The share is set directly (or recursively, for a composite SecureObject),
using callbacks if value contains Futures that are not yet done.
Static methods defined here:
- is_zero_public(a)
- Called by runtime.is_zero_public().
Data and other attributes defined here:
- __annotations__ = {'exponent_type': <class 'type'>, 'significand_type': <class 'type'>}
- __hash__ = None
Methods inherited from SecureNumber:
- __and__(self, other)
- Bitwise and, for now 1-bit only.
- __divmod__(self, other)
- Integer division with public divisor.
- __floordiv__(self, other)
- Integer quotient with public divisor.
- __invert__(self)
- Bitwise not (inversion), for now 1-bit only.
- __lshift__(self, other)
- Left shift with public integral offset.
- __mod__(self, other)
- Integer remainder with public divisor.
- __or__(self, other)
- Bitwise or, for now 1-bit only.
- __pow__(self, other)
- Exponentiation for public integral exponent.
- __rand__ = __and__(self, other)
- __rdivmod__(self, other)
- Integer division (with reflected arguments).
- __rfloordiv__(self, other)
- Integer quotient (with reflected arguments).
- __rlshift__(self, other)
- Left shift (with reflected arguments).
- __rmod__(self, other)
- Integer remainder (with reflected arguments).
- __ror__ = __or__(self, other)
- __rpow__(self, other)
- Exponentiation (with reflected arguments) for secret exponent.
Special case: repeat of multiplicative group operation.
- __rrshift__(self, other)
- Right shift (with reflected arguments).
- __rshift__(self, other)
- Right shift with public integral offset.
- __rxor__(self, other)
- Bitwise exclusive-or, for now 1-bit only.
Special case: repeat of finite group operation.
- __xor__(self, other)
- Bitwise exclusive-or, for now 1-bit only.
- if_else(self, x, y)
- Use SecureNumber as condition for secure selection between x and y.
- if_swap(self, x, y)
- Use SecureNumber as condition for secure swap of x and y.
Data and other attributes inherited from SecureNumber:
- bit_length = None
Methods inherited from SecureObject:
- __array_function__(self, func, types, args, kwargs)
- Redirect __array_function__ call to array class, if any.
To support calls like np.block([[secint(9), -1], [1, secint(7)]]).
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- Delegate __array_ufunc__ call to corresponding operator call.
Provisional support for calls like np.less(secint(9), 10).
- __bool__(self)
- Use of secret-shared objects in Boolean expressions makes no sense.
- __deepcopy__(self, memo)
- Let SecureObjects behave as immutable objects.
Introduced for github.com/meilof/oblif.
Data descriptors inherited from SecureObject:
- share
Data and other attributes inherited from SecureObject:
- binary_ops = {<ufunc 'less'>: <built-in function lt>, <ufunc 'less_equal'>: <built-in function le>, <ufunc 'equal'>: <built-in function eq>, <ufunc 'not_equal'>: <built-in function ne>, <ufunc 'greater'>: <built-in function gt>, <ufunc 'greater_equal'>: <built-in function ge>, <ufunc 'add'>: <built-in function add>, <ufunc 'subtract'>: <built-in function sub>, <ufunc 'multiply'>: <built-in function mul>, <ufunc 'divide'>: <built-in function truediv>, ...}
- unary_ops = {<ufunc 'negative'>: <built-in function neg>, <ufunc 'positive'>: <built-in function pos>, <ufunc 'absolute'>: <built-in function abs>}
|
class SecureInteger(SecureNumber) |
| |
SecureInteger(value=None)
Base class for secure (secret-shared) integers. |
| |
- Method resolution order:
- SecureInteger
- SecureNumber
- SecureObject
- builtins.object
Methods defined here:
- __init__(self, value=None)
- Initialize a secure integer.
Value must be None, int, or correct field type.
Data and other attributes defined here:
- __annotations__ = {'field': <class 'type'>}
- frac_length = 0
Methods inherited from SecureNumber:
- __abs__(self)
- Absolute value.
- __add__(self, other)
- Addition.
- __and__(self, other)
- Bitwise and, for now 1-bit only.
- __divmod__(self, other)
- Integer division with public divisor.
- __eq__(self, other)
- Equality testing.
- __floordiv__(self, other)
- Integer quotient with public divisor.
- __ge__(self, other)
- Greater-than or equal comparison.
- __gt__(self, other)
- Strictly greater-than comparison.
- __invert__(self)
- Bitwise not (inversion), for now 1-bit only.
- __le__(self, other)
- Less-than or equal comparison.
- __lshift__(self, other)
- Left shift with public integral offset.
- __lt__(self, other)
- Strictly less-than comparison.
- __mod__(self, other)
- Integer remainder with public divisor.
- __mul__(self, other)
- Multiplication.
Special case: repeat of additive group operation.
- __ne__(self, other)
- Negated equality testing.
- __neg__(self)
- Negation.
- __or__(self, other)
- Bitwise or, for now 1-bit only.
- __pos__(self)
- Unary +.
- __pow__(self, other)
- Exponentiation for public integral exponent.
- __radd__ = __add__(self, other)
- __rand__ = __and__(self, other)
- __rdivmod__(self, other)
- Integer division (with reflected arguments).
- __rfloordiv__(self, other)
- Integer quotient (with reflected arguments).
- __rlshift__(self, other)
- Left shift (with reflected arguments).
- __rmod__(self, other)
- Integer remainder (with reflected arguments).
- __rmul__ = __mul__(self, other)
- __ror__ = __or__(self, other)
- __rpow__(self, other)
- Exponentiation (with reflected arguments) for secret exponent.
Special case: repeat of multiplicative group operation.
- __rrshift__(self, other)
- Right shift (with reflected arguments).
- __rshift__(self, other)
- Right shift with public integral offset.
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __rxor__(self, other)
- Bitwise exclusive-or, for now 1-bit only.
Special case: repeat of finite group operation.
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- __xor__(self, other)
- Bitwise exclusive-or, for now 1-bit only.
- if_else(self, x, y)
- Use SecureNumber as condition for secure selection between x and y.
- if_swap(self, x, y)
- Use SecureNumber as condition for secure swap of x and y.
Data and other attributes inherited from SecureNumber:
- __hash__ = None
- bit_length = None
Methods inherited from SecureObject:
- __array_function__(self, func, types, args, kwargs)
- Redirect __array_function__ call to array class, if any.
To support calls like np.block([[secint(9), -1], [1, secint(7)]]).
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- Delegate __array_ufunc__ call to corresponding operator call.
Provisional support for calls like np.less(secint(9), 10).
- __bool__(self)
- Use of secret-shared objects in Boolean expressions makes no sense.
- __deepcopy__(self, memo)
- Let SecureObjects behave as immutable objects.
Introduced for github.com/meilof/oblif.
- set_share(self, value)
- Set share to the given value.
The share is set directly (or recursively, for a composite SecureObject),
using callbacks if value contains Futures that are not yet done.
Data descriptors inherited from SecureObject:
- share
Data and other attributes inherited from SecureObject:
- binary_ops = {<ufunc 'less'>: <built-in function lt>, <ufunc 'less_equal'>: <built-in function le>, <ufunc 'equal'>: <built-in function eq>, <ufunc 'not_equal'>: <built-in function ne>, <ufunc 'greater'>: <built-in function gt>, <ufunc 'greater_equal'>: <built-in function ge>, <ufunc 'add'>: <built-in function add>, <ufunc 'subtract'>: <built-in function sub>, <ufunc 'multiply'>: <built-in function mul>, <ufunc 'divide'>: <built-in function truediv>, ...}
- unary_ops = {<ufunc 'negative'>: <built-in function neg>, <ufunc 'positive'>: <built-in function pos>, <ufunc 'absolute'>: <built-in function abs>}
|
class SecureIntegerArray(SecureArray) |
| |
SecureIntegerArray(value=None, shape=None)
Base class for secure (secret-shared) integer arrays. |
| |
- Method resolution order:
- SecureIntegerArray
- SecureArray
- SecureObject
- builtins.object
Methods defined here:
- __init__(self, value=None, shape=None)
- Initialize a secure integer array to the given value.
If value is None (default), shape must not be None.
The given value must be array of the appropriate type (int/finite field array).
The given shape must be a (possibly empty) tuple of nonnegative integers.
Data and other attributes defined here:
- __annotations__ = {}
- frac_length = 0
Methods inherited from SecureArray:
- __abs__(self)
- Matrix absolute value.
- __add__(self, other)
- Matrix addition.
- __array_function__(self, func, types, args, kwargs)
- Redirect __array_function__ call to array class, if any.
To support calls like np.block([[secint(9), -1], [1, secint(7)]]).
- __bool__(self)
- Return True if secure array is nonempty, False otherwise.
- __eq__(self, other)
- Equality testing.
- __ge__(self, other)
- Greater-than or equal comparison.
- __getitem__(self, i)
- __gt__(self, other)
- Strictly greater-than comparison.
- __iter__(self)
- __le__(self, other)
- Less-than or equal comparison.
- __len__(self)
- __lt__(self, other)
- Strictly less-than comparison.
- __matmul__(self, other)
- Matrix multiplication.
- __mul__(self, other)
- Multiplication.
- __ne__(self, other)
- Negated equality testing.
- __neg__(self)
- Matrix negation.
- __pow__(self, other)
- Exponentiation for public integral exponent.
- __radd__ = __add__(self, other)
- __rmatmul__(self, other)
- Matrix multiplication (with reflected arguments).
- __rmul__ = __mul__(self, other)
- __rsub__(self, other)
- Matrix subtraction.
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __sub__(self, other)
- Matrix subtraction.
- __truediv__(self, other)
- Division.
- argmax(self, *args, **kwargs)
- Returns the indices of the maximum values along an axis.
If no axis is given (default), array is flattened.
By default, the indices are returned as unit vectors ...
Also, by default, the maximum values are returned (next to the indices).
NB: Different defaults for np.argmax(). Latter behaves like for NumPy arrays.
- argmin(self, *args, **kwargs)
- Returns the indices of the minimum values along an axis.
If no axis is given (default), array is flattened.
By default, the indices are returned as unit vectors ...
Also, by default, the minimum values are returned (next to the indices).
NB: Different defaults for np.argmin(). Latter behaves like for NumPy arrays.
- copy(self, order='C')
- flatten(self, order='C')
- reshape(self, *shape, order='C')
- sort(self, *args, **kwargs)
- Returns new array sorted along an axis.
By default, axis=-1.
If axis is None, the array is flattened.
- sum(self, *args, **kwargs)
- swapaxes(self, axis1, axis2)
- tolist(self)
- transpose(self, *axes)
Readonly properties inherited from SecureArray:
- T
- flat
- ndim
- size
Data descriptors inherited from SecureArray:
- shape
Data and other attributes inherited from SecureArray:
- __hash__ = None
Methods inherited from SecureObject:
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- Delegate __array_ufunc__ call to corresponding operator call.
Provisional support for calls like np.less(secint(9), 10).
- __deepcopy__(self, memo)
- Let SecureObjects behave as immutable objects.
Introduced for github.com/meilof/oblif.
- set_share(self, value)
- Set share to the given value.
The share is set directly (or recursively, for a composite SecureObject),
using callbacks if value contains Futures that are not yet done.
Data descriptors inherited from SecureObject:
- share
Data and other attributes inherited from SecureObject:
- binary_ops = {<ufunc 'less'>: <built-in function lt>, <ufunc 'less_equal'>: <built-in function le>, <ufunc 'equal'>: <built-in function eq>, <ufunc 'not_equal'>: <built-in function ne>, <ufunc 'greater'>: <built-in function gt>, <ufunc 'greater_equal'>: <built-in function ge>, <ufunc 'add'>: <built-in function add>, <ufunc 'subtract'>: <built-in function sub>, <ufunc 'multiply'>: <built-in function mul>, <ufunc 'divide'>: <built-in function truediv>, ...}
- unary_ops = {<ufunc 'negative'>: <built-in function neg>, <ufunc 'positive'>: <built-in function pos>, <ufunc 'absolute'>: <built-in function abs>}
|
class SecureNumber(SecureObject) |
| |
SecureNumber(value=None)
Base class for secure (secret-shared) numbers. |
| |
- Method resolution order:
- SecureNumber
- SecureObject
- builtins.object
Methods defined here:
- __abs__(self)
- Absolute value.
- __add__(self, other)
- Addition.
- __and__(self, other)
- Bitwise and, for now 1-bit only.
- __divmod__(self, other)
- Integer division with public divisor.
- __eq__(self, other)
- Equality testing.
- __floordiv__(self, other)
- Integer quotient with public divisor.
- __ge__(self, other)
- Greater-than or equal comparison.
- __gt__(self, other)
- Strictly greater-than comparison.
- __invert__(self)
- Bitwise not (inversion), for now 1-bit only.
- __le__(self, other)
- Less-than or equal comparison.
- __lshift__(self, other)
- Left shift with public integral offset.
- __lt__(self, other)
- Strictly less-than comparison.
- __mod__(self, other)
- Integer remainder with public divisor.
- __mul__(self, other)
- Multiplication.
Special case: repeat of additive group operation.
- __ne__(self, other)
- Negated equality testing.
- __neg__(self)
- Negation.
- __or__(self, other)
- Bitwise or, for now 1-bit only.
- __pos__(self)
- Unary +.
- __pow__(self, other)
- Exponentiation for public integral exponent.
- __radd__ = __add__(self, other)
- __rand__ = __and__(self, other)
- __rdivmod__(self, other)
- Integer division (with reflected arguments).
- __rfloordiv__(self, other)
- Integer quotient (with reflected arguments).
- __rlshift__(self, other)
- Left shift (with reflected arguments).
- __rmod__(self, other)
- Integer remainder (with reflected arguments).
- __rmul__ = __mul__(self, other)
- __ror__ = __or__(self, other)
- __rpow__(self, other)
- Exponentiation (with reflected arguments) for secret exponent.
Special case: repeat of multiplicative group operation.
- __rrshift__(self, other)
- Right shift (with reflected arguments).
- __rshift__(self, other)
- Right shift with public integral offset.
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __rxor__(self, other)
- Bitwise exclusive-or, for now 1-bit only.
Special case: repeat of finite group operation.
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- __xor__(self, other)
- Bitwise exclusive-or, for now 1-bit only.
- if_else(self, x, y)
- Use SecureNumber as condition for secure selection between x and y.
- if_swap(self, x, y)
- Use SecureNumber as condition for secure swap of x and y.
Data and other attributes defined here:
- __annotations__ = {}
- __hash__ = None
- bit_length = None
Methods inherited from SecureObject:
- __array_function__(self, func, types, args, kwargs)
- Redirect __array_function__ call to array class, if any.
To support calls like np.block([[secint(9), -1], [1, secint(7)]]).
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- Delegate __array_ufunc__ call to corresponding operator call.
Provisional support for calls like np.less(secint(9), 10).
- __bool__(self)
- Use of secret-shared objects in Boolean expressions makes no sense.
- __deepcopy__(self, memo)
- Let SecureObjects behave as immutable objects.
Introduced for github.com/meilof/oblif.
- __init__(self, value=None)
- Initialize share.
If value is None (default), the SecureObject starts out as an empty
placeholder (implemented as a Future).
- set_share(self, value)
- Set share to the given value.
The share is set directly (or recursively, for a composite SecureObject),
using callbacks if value contains Futures that are not yet done.
Data descriptors inherited from SecureObject:
- share
Data and other attributes inherited from SecureObject:
- binary_ops = {<ufunc 'less'>: <built-in function lt>, <ufunc 'less_equal'>: <built-in function le>, <ufunc 'equal'>: <built-in function eq>, <ufunc 'not_equal'>: <built-in function ne>, <ufunc 'greater'>: <built-in function gt>, <ufunc 'greater_equal'>: <built-in function ge>, <ufunc 'add'>: <built-in function add>, <ufunc 'subtract'>: <built-in function sub>, <ufunc 'multiply'>: <built-in function mul>, <ufunc 'divide'>: <built-in function truediv>, ...}
- unary_ops = {<ufunc 'negative'>: <built-in function neg>, <ufunc 'positive'>: <built-in function pos>, <ufunc 'absolute'>: <built-in function abs>}
|
class SecureObject(builtins.object) |
| |
SecureObject(value=None)
A secret-shared object.
An MPC protocol operates on secret-shared objects of type SecureObject.
The basic Python operators are overloaded by SecureObject classes.
An expression like a * b will create a new SecureObject, which will
eventually contain the product of a and b. The product is computed
asynchronously, using an instance of a specific cryptographic protocol. |
| |
Methods defined here:
- __array_function__(self, func, types, args, kwargs)
- Redirect __array_function__ call to array class, if any.
To support calls like np.block([[secint(9), -1], [1, secint(7)]]).
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- Delegate __array_ufunc__ call to corresponding operator call.
Provisional support for calls like np.less(secint(9), 10).
- __bool__(self)
- Use of secret-shared objects in Boolean expressions makes no sense.
- __deepcopy__(self, memo)
- Let SecureObjects behave as immutable objects.
Introduced for github.com/meilof/oblif.
- __init__(self, value=None)
- Initialize share.
If value is None (default), the SecureObject starts out as an empty
placeholder (implemented as a Future).
- set_share(self, value)
- Set share to the given value.
The share is set directly (or recursively, for a composite SecureObject),
using callbacks if value contains Futures that are not yet done.
Data descriptors defined here:
- share
Data and other attributes defined here:
- __annotations__ = {}
- binary_ops = {<ufunc 'less'>: <built-in function lt>, <ufunc 'less_equal'>: <built-in function le>, <ufunc 'equal'>: <built-in function eq>, <ufunc 'not_equal'>: <built-in function ne>, <ufunc 'greater'>: <built-in function gt>, <ufunc 'greater_equal'>: <built-in function ge>, <ufunc 'add'>: <built-in function add>, <ufunc 'subtract'>: <built-in function sub>, <ufunc 'multiply'>: <built-in function mul>, <ufunc 'divide'>: <built-in function truediv>, ...}
- unary_ops = {<ufunc 'negative'>: <built-in function neg>, <ufunc 'positive'>: <built-in function pos>, <ufunc 'absolute'>: <built-in function abs>}
| |


The Objects component allows for inserting arbitrary SVG elements (or groups) in the chart using the data
coordinates or absolute coordinates of the widget. In this example we encoded the different parameters in the
color and shape of the objects. When adding a random object:
- Color denotes order: foreground (green) or background (red) or outside the plot area (blue).
- Shape denotes position: floating (circle) or fixed (rectangle) position.
Note that when the chart is updated, inserted elements are not resized, only their position is updated if they are
floating objects.
This example shows the available methods for the component and demonstrates its behavior when various properties of
the chart are changed.


Zaniolo's mother fumes at sexist comments
by BeSoccerIn an interview with 'Radio Capital', Zaniolo's mum has once again given her opinion on sexist chanting and has compared them to racist chanting which has been seen recently in the stadiums.
Zaniolo's mother has been insulted in some stadiums. In a match between Parma and Roma, some supporters chanted "Zaniolo's mum is a b***h."
On social media, where she is very popular, Francesca Costa has given her opinion on people who usre this type of sexist language. She has analysed the situation more in depth in a radio interview.
"I hear sexist insults in the same way as racist chanting. There are sexist insults which are the same as racial discrimination. The majority of those responsible are adult men in the stadium, but those that do it on social media are 14 or 15.
Featured links
- Ballon d'Or winner already been decided
- The latest football transfers news and rumours
- Possible 'Clasico' in the Spanish Supercup final
- Who has the most free-kicks goals: Messi or Cristiano?
Francesca Costa admitted that it is a situation which makes her uncomfortable and that she finds worrying for the future and for other women: "I'm a mother and I'm worried that this attitude could be used by them in the future against their girlfriend, wife or any other woman. We must not think that these comments are a joke."
To close, Zaniolo's mother talked about discrimination against women in football.
"Is the footballing world sexist? The fact many men say that women don't know about football means they consider women as second class..," Zaniolo concluded.


The main idea of this project is to show what are the possibilities, to give an idea what we could do to solve our issues. Rest of the details is open for discussion.
If we see economic systems as a way of resource distribution, it is clear that the existing system can be improved dramatically. Good news is that the technology is getting better at an accelerated speed, so our chances of creating new solutions.
It should be mentioned that we already have two important tools to improve the current system;
Both serves for the benefit of the society and even if we don't develop applications like this one, these tools will be improving the system in the long run; competition will allow us to have better organizations in time and by increasing the awareness, consumers will have better knowledge about the organizations, so they will choose the right ones.
However this still would be an unnecessarily slow process. If an organization has a clear advantage for the society, the system could be modified in such a way that it could support this benefit automatically.
The main issue in the current system is that it leaves the whole responsibility to the consumers; every consumer must know every detail about the products and their organizations before making any single purchase, therefore allocating the resources. The amount of information has to be collected and processed by each consumer is simply massive and expecting consumers to fulfill this task is an impractical one.
In today's system, this knowledge gap is closed by marketing; the consumers make their choices not based on facts but based on advertisements, packages and colors. Marketing is a powerful tool and will always play a role but influencing the consumers at such level and shaping the outcome is not our best interest.
We need complex applications to be able to manage our resources, in order to have healthier and more productive society. Creating such solution is a long shot and this project is just a small step. There are many parts to be studied and it will take time to create something solid. However, developing a such solution could play a vital role on solving some of society's long term issues.
Therefore we are on this journey. Would you like to support us?


European tech investor Balderton launches US$400 million start-up fund
LONDON: European venture capital firm Balderton Capital is launching a US$400 million fund to invest in technology start-ups, bringing its total funds under management to US$3 billion, it said on Tuesday.
Total venture capital funding in European start-ups hit a record high of 24.6 billion euros (US$27.11 billion) in 2018, Balderton said in a statement.
"Europe has the potential to build the next generation of technology giants...we are seeing more and more exceptional founders," said Bernaud Liautaud, managing partner at Balderton.
Balderton's current portfolio includes Healx, which uses artificial intelligence to accelerate treatments for rare diseases, and digital account provider Revolut.
(Reporting by Carolyn Cohn, editing by Louise Heavens)


Quellcode für qiskit._util
# -*- coding: utf-8 -*-
# Copyright 2017, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
# pylint: disable=too-many-ancestors
"""Common utilities for QISKit."""
import logging
import re
import sys
import warnings
from collections import UserDict
API_NAME = 'IBMQuantumExperience'
logger = logging.getLogger(__name__)
FIRST_CAP_RE = re.compile('(.)([A-Z][a-z]+)')
ALL_CAP_RE = re.compile('([a-z0-9])([A-Z])')
[Doku]def _check_python_version():
"""Check for Python version 3.5+
"""
if sys.version_info < (3, 5):
raise Exception('QISKit requires Python version 3.5 or greater.')
[Doku]def _check_ibmqx_version():
"""Check if the available IBMQuantumExperience version is the required one.
Check that the installed "IBMQuantumExperience" package version matches the
version required by the package, emitting a warning if it is not present.
Note:
The check is only performed when `qiskit` is installed via `pip`
(available under `pkg_resources.working_set`). For other configurations
(such as local development, etc), the check is skipped silently.
"""
try:
# Use a local import, as in very specific environments setuptools
# might not be available or updated (conda with specific setup).
import pkg_resources
working_set = pkg_resources.working_set
qiskit_pkg = working_set.by_key['qiskit']
except (ImportError, KeyError):
# If 'qiskit' was not found among the installed packages, silently
# return.
return
# Find the IBMQuantumExperience version specified in this release of qiskit
# based on pkg_resources (in turn, based on setup.py::install_requires).
ibmqx_require = next(r for r in qiskit_pkg.requires() if
r.name == API_NAME)
# Finally, compare the versions.
try:
# First try to use IBMQuantumExperience.__version__ directly.
from IBMQuantumExperience import __version__ as ibmqx_version
if ibmqx_version in ibmqx_require:
return
except ImportError:
# __version__ was not available, so try to compare using the
# working_set. This assumes IBMQuantumExperience is installed as a
# library (using pip, etc).
try:
working_set.require(str(ibmqx_require))
return
except pkg_resources.DistributionNotFound:
# IBMQuantumExperience was not found among the installed libraries.
# The warning is not printed, assuming the user is using a local
# version and takes responsibility of handling the versions.
return
except pkg_resources.VersionConflict:
pass
logger.warning('The installed IBMQuantumExperience package does '
'not match the required version - some features might '
'not work as intended. Please install %s.',
str(ibmqx_require))
[Doku]def _enable_deprecation_warnings():
"""
Force the `DeprecationWarning` warnings to be displayed for the qiskit
module, overriding the system configuration as they are ignored by default
[1] for end-users.
TODO: on Python 3.7, this might not be needed due to PEP-0565 [2].
[1] https://docs.python.org/3/library/warnings.html#default-warning-filters
[2] https://www.python.org/dev/peps/pep-0565/
"""
# pylint: disable=invalid-name
deprecation_filter = ('always', None, DeprecationWarning,
re.compile(r'^qiskit\.*', re.UNICODE), 0)
# Instead of using warnings.simple_filter() directly, the internal
# _add_filter() function is used for being able to match against the
# module.
try:
warnings._add_filter(*deprecation_filter, append=False)
except AttributeError:
# ._add_filter is internal and not available in some Python versions.
pass
[Doku]def _camel_case_to_snake_case(identifier):
"""Return a `snake_case` string from a `camelCase` string.
Args:
identifier (str): a `camelCase` string.
Returns:
str: a `snake_case` string.
"""
string_1 = FIRST_CAP_RE.sub(r'\1_\2', identifier)
return ALL_CAP_RE.sub(r'\1_\2', string_1).lower()
_check_python_version()
_check_ibmqx_version()
_enable_deprecation_warnings()
[Doku]class AvailableToOperationalDict(UserDict):
"""
TEMPORARY class for transitioning from `status['available']` to
`status['operational']`.
FIXME: Remove this class as soon as the API is updated, please.
"""
def __getitem__(self, key):
if key == 'available':
warnings.warn(
"status['available'] has been renamed to status['operational'] "
" since 0.5.5. Please use status['operational'] accordingly.",
DeprecationWarning)
return super(AvailableToOperationalDict, self).__getitem__(key)


Biographical Sketch of Harry
Francis Dougherty
Henry Francis Dougherty
Source: MONROE COUNTY [OHIO] DOUGHERTY CLAN, by
James McKitrick, 1989, p 173
Harry Francis was born on 9 June 1923, in Parkersburg, West
Virginia. Francis attended Jefferson
Elementary School and graduated from Parkersburg High School. Harry entered the US Army during WWII seeing
action in the Pacific Theater and the South Pacific. Francis served with the 11th Airborne and fought in the
Phillippines, Okinawa, and Japan operations.
He was with the first Airborne flown into Japan. Francis was discharged from the service in
1947. Francis chose Reba Fern Stanley
as his wife, marrying her on 19 June 1947.
Reba was born in Parkersburg and graduated from Parkersburg High School
shortly before her wedding. Francis
wanted to follow in his family's footsteps and work in the law enforcement
field, spending 36 years on the Parkersburg Police Department. He became Chief of Police in 1976. He served as Chief until 1978. Reba spent a number of years working in the
Ohio Valley College Library. Francis
and Reba are life long members of the Church of Christ, attending the Marrtown
Church.
Provided by Betty Latta Kitchen
-- e-mail: Betty Kitchen
Click here for the Short-Cut Table of Contents


Devtalks are held during most Code@Nights, and are short presentations on a technology, concept, company, project, etc. given by anyone interested in talking about a topic they're passionate about!
Workshops are longer sessions with fewer participants, and more of a typical lab or classroom. The workshop is more interactive, and the presenter takes questions throughout and helps students work through a problem or create a project live with the class. There are also usually assistants walking around helping out students that need it.
Below are a list of our previous workshops and devtalks, along with any other tools/resources we used during the presentations.


Gecode::Support::Symbol Class Reference
List of all members.
Detailed Description
Immutable Symbols.
Definition at line 49 of file symbol.icc.
Constructor & Destructor Documentation
| Gecode::Support::Symbol::Symbol |
( |
void |
|
) |
|
| Gecode::Support::Symbol::Symbol |
( |
const char * |
s0, |
|
|
bool |
copy = false | |
|
) |
| | |
Construct Symbol from s0, make a copy if copy is true.
Definition at line 129 of file symbol.cc.
| Gecode::Support::Symbol::Symbol |
( |
int |
i |
) |
|
| Gecode::Support::Symbol::Symbol |
( |
unsigned int |
i |
) |
|
| Gecode::Support::Symbol::Symbol |
( |
const Symbol & |
s0 |
) |
|
| Gecode::Support::Symbol::~Symbol |
( |
void |
|
) |
|
Member Function Documentation
| const Symbol & Gecode::Support::Symbol::operator= |
( |
const Symbol & |
s0 |
) |
|
Assignment operator.
Definition at line 155 of file symbol.cc.
| bool Gecode::Support::Symbol::operator== |
( |
const Symbol & |
s0 |
) |
const |
| bool Gecode::Support::Symbol::operator== |
( |
const char * |
s0 |
) |
const |
| bool Gecode::Support::Symbol::empty |
( |
void |
|
) |
const |
| Symbol Gecode::Support::Symbol::copy |
( |
void |
|
) |
const |
| Symbol & Gecode::Support::Symbol::operator+= |
( |
const Symbol & |
s |
) |
|
Concatenate with s.
Definition at line 187 of file symbol.cc.
| int Gecode::Support::Symbol::hash |
( |
int |
m |
) |
const |
Hash value according to modulo M.
Definition at line 199 of file symbol.cc.
| std::ostream & Gecode::Support::Symbol::print |
( |
std::ostream & |
os |
) |
const |
| std::string Gecode::Support::Symbol::toString |
( |
void |
|
) |
const |
The documentation for this class was generated from the following files:


Before Change
r, _ = get_dimensions(X)
predictions = []
for i in range(r):
votes = self.get_votes_for_instance(X[i])
if votes == {}:
// Tree is empty, all target_values equal, default to zero
predictions.append([0])
else:
After Change
r, _ = get_dimensions(X)
predictions = []
for i in range(r):
votes = self.get_votes_for_instance(X[i]).copy()
if votes == {}:
// Tree is empty, all target_values equal, default to zero
predictions.append([0])
else:
if sum(votes.values()) != 0:
normalize_values_in_dict(votes)
y_proba = [0] * (int(max(votes.keys())) + 1)
for key, value in votes.items():
y_proba[int(key)] = value
predictions.append(y_proba)
return predictions
@property


CDK stepper provides a foundation upon which more concrete stepper varieties can be built. A stepper is a wizard-like workflow that divides content into logical steps
CDK 步进器（stepper）提供了一个基础，可以在此基础上构建具体的步进器变体。步进器是一种类似向导的工作流，可以把内容划分为一些逻辑步骤
The base CDK version of the stepper primarily manages which step is active. This includes handling keyboard interactions and exposing an API for advancing or rewinding through the workflow.
步进器的 CDK 基础版本主要用来管理哪一步处于活动状态。这包括处理键盘交互，并暴露一个用来在工作流程中前进或后退的 API。
A stepper marked as linear
requires the user to complete previous steps before proceeding.
For each step, the stepControl
attribute can be set to the top level AbstractControl
that
is used to check the validity of the step.
标记为 linear
的步进器要求用户在继续下一步之前完成前面的步骤。对于每一个步骤来说，其 stepControl
属性都可以设置为顶级的 AbstractControl
，用于检查该步骤的有效性。
There are two possible approaches. One is using a single form for stepper, and the other is using a different form for each step.
有两种可能的方式。一种是使用单一表单进行步进，另一种是使用不同的表单进行步进。
Alternatively, if you don't want to use the Angular forms, you can pass in the completed
property
to each of the steps which won't allow the user to continue until it becomes true
. Note that if
both completed
and stepControl
are set, the stepControl
will take precedence.
或者，如果你不想使用 Angular 表单，也可以把 completed
属性传入每个步骤，这些步骤会阻止用户继续，直到这个属性变为 true
。注意，如果同时设置了 completed
和 stepControl
，则 stepControl
优先。
When using a single form for the stepper, any intermediate next/previous buttons within the steps
must be set to type="button"
in order to prevent submission of the form before all steps are
complete.
在步进器中使用单一表单时，所有中间步骤的"下一个"/"上一个"按钮都必须设置为 type="button"
，以防止在完成所有步骤之前提交表单。
When using a form for each step, the workflow is advanced whenever one of the forms is submitted.
当每个步骤各自使用一个表单时，只要提交了一个表单，工作流就会向前推进。
If completion of a step in linear stepper is not required, then the optional
attribute can be set
on CdkStep
in a linear
stepper.
如果线性步进器中的不要求某个步骤必须完成，那么可以在 linear
步进器中的这个 CdkStep
上设置 optional
属性。
By default, steps are editable, which means users can return to previously completed steps and
edit their responses. editable="false"
can be set on CdkStep
to change the default.
默认情况下，步骤是可编辑的，这意味着用户可以返回之前已完成的步骤并重新编辑他们的响应。可以在 CdkStep
上设置 editable="true"
来修改默认行为。
By default, the completed
attribute of a step returns true
if the step is valid (in case of
linear stepper) and the user has interacted with the step. The user, however, can also override
this default completed
behavior by setting the completed
attribute as needed.
默认情况下，如果步骤有效（在线性步进器的情况下）并且用户已经与该步骤交互过，则该步骤的 completed
属性会返回 true
。但是，用户也可以按需设置 completed
属性来覆盖默认的 completed
行为。
There are two button directives to support navigation between different steps:
CdkStepperNext
and CdkStepperPrevious
. When placed inside of a step, these will automatically
add click handlers to advance or rewind the workflow, respectively.
有两个按钮指令可以支持不同步骤之间的导航： CdkStepperNext
和 CdkStepperPrevious
。当放置在某个步骤中时，它们会自动添加点击处理器来分别推进或回退此工作流。
If you want to reset a stepper to its initial state, you can use the reset
method. Note that
resetting it will call reset
on the underlying form control which clears the value.
如果要将步进器重置为初始状态，可以使用 reset
方法。注意，重置它会在底层表单控件上调用 reset
来清除这个值。
LEFT_ARROW: Focuses the previous step header
LEFT_ARROW
：焦点移到上一步的标题
RIGHT_ARROW: Focuses the next step header
RIGHT_ARROW
：焦点移到下一步的标题
ENTER, SPACE: Selects the step that the focus is currently on
ENTER
、SPACE
：选取具有焦点的当前步骤
TAB: Focuses the next tabbable element
TAB
：焦点移到下一个 tabbable 元素
SHIFT+TAB: Focuses the previous tabbable element
TAB
+ SHIFT
：焦点移到上一个 tabbable 元素
The CDK stepper is treated as a tabbed view for accessibility purposes, so it is given
role="tablist"
by default. The header of step that can be clicked to select the step
is given role="tab"
, and the content that can be expanded upon selection is given
role="tabpanel"
. aria-selected
attribute of step header and aria-expanded
attribute of
step content is automatically set based on step selection change.
出于无障碍性的目的，CDK 的 stepper 被视为标签视图，所以默认情况下它被赋予 role="tablist"
。在步骤标题中可以单击，以选取 role="tab"
的步骤，并展开每个带有 role="tabpanel"
的步骤内容。步骤标题上的 aria-selected
属性和步骤内容上的 aria-expanded
属性是根据所选步骤的变化自动设置的。
The stepper and each step should be given a meaningful label via aria-label
or aria-labelledby
.
步进器及其中的每个步骤都应该通过 aria-label
或者 aria-labelledby
给出一个有意义的标签。


Huge update! Small selection of updates:
- Loadout builder is MUCH faster!
- Settings menu has an option to export weapons/armor
- New items are marked with a "shiny" animation
- Item icon size may be adjusted in the settings
- Vault always takes up as much space as possible
Our full changelog is available if you would like to know more about this release.
Follow us on:


{% extends "base.html" %} {% block title %}frc{{team.team_number}} - TBA Admin{% endblock %} {% block content %}
| Name | {{ team.name }} |
| Nickname | {{ team.nickname }} |
| Rookie Year | {{ team.rookie_year }} |
| Motto | {{ team.motto }} |
| Address | {{ team.address }} |
| Website | {{ team.website }} |
| FIRST TPID, year | {{ team.first_tpid }}, {{ team.first_tpid_year }} |
| Events | {{event_teams|length}} Events - {% for event_team in event_teams %}{{event_team.event.id}}, {% endfor %} |
| Robots |
{% for robot in robots %}
{{ robot.year }}: {{ robot.robot_name }}
{% if not forloop.last %} {% endif %} {% endfor %} |
| Districts | {% for district_team in district_teams %} {{district_team.key.id}} {% if not forloop.last %}, {% endif %} {% endfor %} |
Teams are currently uneditable. They are updated via TIMS scraping.
Team info is on FIRST at http://www.usfirst.org/whatsgoingon


--- title: Need help? short: Support id: 11 layout: page color: lightgreen kind: page ---
Unfortunately we aren’t able to answer all of your questions. We wish we could reply to everyone but we haven’t got enough resources to do this. We are just a tiny group of people working on this. Feel free to make a donation, one day we might have a support-guy in our team
The forum is the main place where we and others share project developments and hacks. If you have any questions, ideas or suggestion post them there. Other members or some of us can help you out. This helps to improve the knowledge database and avoid double questions.


Change Placement Sites Dialog
This dialog allows you to edit the placement sites associated with the entity class specified in the dialog’s title bar. These are the map locations where a faction may place entities of that class.
- Map View
- Allow Default Sites
- Site List
- Selected Site
- Drag the vertical splitter between Map View and Site List to adjust their respective share of the current dialog width.
- Choose OK or press Enter when the focus is not on another button to accept any changes made and dismiss the dialog.
- Choose Cancel or press Escape to discard any changes made and dismiss the dialog. Closing the window using X (Close) or Alt+F4 has the same effect.
- Choose Help or press F1 to show this help page.
Remarks
1. You may define placement sites that are initially unowned, or not owned by the faction that would build entities of this class. In that case, the faction will have to capture (or otherwise acquire) that map site before it can place entities there.
2. Changing the Allow Default Sites option marks the Entities section as changed. However, changing the Site List marks the Areas section as changed because all map locations are stored in that section.
The left side of this dialog is taken up by a map view. If the Site List is not empty, the site corresponding to its first entry is initially centered and selected.
- Highlighted sites indicate placement sites. Each highlighted site corresponds to one entry in the Site List.
- Left-click on a site to select it. If the site is highlighted, its corresponding entry is also selected in the Site List.
- Double-click on a site to toggle its status.
- Highlighted sites are removed from the Site List, as with the Remove Site button. The site is no longer highlighted.
- Other sites are added to the Site List, as with the Add Site button. The site is now highlighted.
If the Allow Default Sites (Alt+D) option is checked, entities of the specified class may be placed on any default sites defined by Hexkit Game or by the rule script, in addition to any sites defined in the Site List.
If this option is unchecked, only the placement sites defined in the Site List are valid, and all default sites are ignored. If this option is unchecked and the Site List is empty, entities of the specified class cannot be placed.
This list shows the map coordinates of all placement sites that are currently defined for this entity class.
- Column Owner shows the unique internal identifier of the faction that owns each site, or “(unowned)” if the site has no owner.
- Left-click on an entry to select it. The corresponding site is also selected in the Map View, and scrolled into view if necessary.
This box shows information on the selected site, if any. Click on a site in the Map View to select it. You can also click on its corresponding entry in the Site List.
- Site (in the box title) shows the map coordinates of the selected site.
- Owner shows the unique internal identifiers of the faction that owns the selected site, or “(unowned)” if the site has no owner.
- Units Can Capture shows a check mark if the selected site contains at least one terrain with the Capture ability.
- Choose Add Site (Alt+A) to add the coordinates of the selected site to the Site List. This button is disabled if the selected site is already in the list.
- Choose Remove Site (Alt+R) to remove the selected site from the Site List. This button is disabled if the coordinates of the selected site are not in the list.


Kazuki Kazama Burns Opponents in ‘Samurai Shodown’ November 18
by Mike WilsonSNK has announced that the release date for Samurai Shodown‘s next DLC character, Kazuki Kazama, will launch on November 18. Kazuki Kazama can be purchased individually for $5.99, or as part of the $19.99 Season Pass. Kazuki’s brother, Sogetsu, was accidentally leaked last month, but he has no release date as of yet.
Samurai Shodown is available now for PlayStation 4 and Xbox One worldwide, with a Google Stadia version being available on November 19th. A PC release is also being planned, while a Switch version is due out on December 12 in Japan.


--- layout: post title: Modeling with a Purpose, and Coexisting Models in Bounded Contexts (14 minutes) date: 2012-01-16 22:32:58.000000000 -07:00 type: post published: true status: publish categories: - Learning DDD - Library - Strategic Design - Video tags: [] meta: _gcid: '1189' _gcuser: Vladimir Gitlevich content_type: embedded_video Video URL: '2' _bitly_trim: http://dddcommunity.org/?p=122 _edit_last: '3110' _dependencies: s:6:"a:0:{}"; _custom_background: a:5:{s:3:"url";s:0:"";s:16:"background-color";s:0:"";s:17:"background-repeat";s:6:"repeat";s:21:"background-attachment";s:6:"scroll";s:19:"background-position";s:8:"left top";} _intro_text: default _intro_custom_banner: a:1:{s:3:"url";s:0:"";} custom_permalink: library/evans_2011/ U_S_C_message: '' author: login: Vladimir Gitlevich email<EMAIL_ADDRESS>display_name: Vladimir Gitlevich first_name: Vladimir Gitlevich last_name: '' ---
In this 14 minute video, Eric Evans explains the purpose of modeling in Domain-Driven Design, why we have coexisting models of the domain, and how Bounded Contexts keep that coherent.
This video was excerpted from a presentation at the DDD-NYC meetup in August 2011, recorded and edited by Alex Hung.


I have been working on a personal rendering engine these days. Although there are lots needed to deal with and it is really just a beginning, finally here comes the first tease!
Features
Features currently supported:
-
PBR
real time physics base rendering algorithm and HDR. -
render queue
a node based render queue, that contributes to performance by reducing api calls. -
render pass
separated render pass, such as G-buffer, effect, lighting, shadow, making the whole process more controllable and also contributing to rendering performance. -
frustum culling
cull everything that is not inside the camera. -
shadow mapping
real time shader based shadow mapping. -
SSAO
real time screen-space SSAO. -
particles system
better looking and performance, easy to implement. -
instance object
implement of OpenGL instance draw feature. -
ECS
Entity Component & GameObject System just like Unity Engine. -
motion blending
bone animation blending, supporting all the animations from mixamo.com. -
third person controller
player-camera controller just like all the third person game, supporting PS4 controller. -
import blender file
blender is an awesome software. All the stages were edited in blender.
And some new features are one the way, such like baked shadow and lighting
LUT filter
bloom and blur
.
Download
- Source code available on GitHub (without assets).
- Download this demo here. (required: OSX 10.13 or later, PS4 controller).
Frameworks
-
OpenGL ES 3.2 & GLM
Core graphic api and core math library. -
Assimp
Although I have wrote some model loader program by myself, Assimp is more professional library and can handle more complex situations. Open Asset Import Library (short name: Assimp) is a portable Open Source library to import various well-known 3D model formats in a uniform manner. -
stb
Public domain C image loading library by nothings.
Assets
- Character and animation from mixamo.
- Model by SilverTm from UE4 Marketplace.
Bibliography
- Background: Physics and Math of Shading by Naty Hoffmann.
- Real shading in Unreal Engine 4.
- Frustum Culling LegacyOpenGL.
- Unity User Manual.
- MipMap Texturing.
- Deferred vs Forward+ Rendering with DirectX 113D Game Engine Programming.
- Forward+: Bringing Deferred Lighting to the Next Level.
- Google I/O 2011: WebGL Techniques and Performance.
- Efficient Gaussian blur with linear sampling.
- How to do good bloom for HDR rendering.
- Transparency Sorting.
- Learn OpenGL, extensive tutorial resource for learning Modern OpenGL.


- onClosed() - Method in interface thobe.logfileviewer.plugin.api.IPluginUIComponent
-
Called whenever this component was closed.
- onClosed() - Method in interface thobe.logfileviewer.plugin.source.logstream.ILogStreamStateListener
-
Called whenever a new LogStream
/ log-file was closed.
- onClosing() - Method in interface thobe.logfileviewer.plugin.api.IPluginUIComponent
-
Called whenever this component is about to be closed.
- onEOFReached() - Method in interface thobe.logfileviewer.plugin.source.logstream.ILogStreamStateListener
-
Called whenever the end of the LogStream
/ log-file (EOF) was reached.
- onLogStreamAvailable(ILogStreamAccess) - Method in interface thobe.logfileviewer.plugin.api.IPlugin
-
HIDDEN-Method: This method has not to be implemented by a specific
IPlugin
.
- onLogStreamClosed() - Method in interface thobe.logfileviewer.plugin.api.IPlugin
-
Life-cycle of Plugin
: ##### Step 3c CLOSE LS #####
The LogStream
was closed.
- onLogStreamLeavingScope() - Method in interface thobe.logfileviewer.plugin.api.IPlugin
-
HIDDEN-Method: This method has not to be implemented by a specific
IPlugin
.
- onLogStreamOpened() - Method in interface thobe.logfileviewer.plugin.api.IPlugin
-
Life-cycle of Plugin
: ##### Step 2b OPEN LS #####
A new LogStream
was opened.
- onNewBlock(List<String>) - Method in interface thobe.logfileviewer.plugin.source.logstream.IInternalLogStreamReaderListener
-
Called whenever a new block of lines is available (was read from the stream).
- onNewBlockOfLines(List<ILogLine>) - Method in interface thobe.logfileviewer.plugin.source.logstream.ILogStreamDataListener
-
Called whenever a new list/block of log-lines matching the
Pattern
returned by
getLineFilter()
is available.
- onOpened() - Method in interface thobe.logfileviewer.plugin.source.logstream.ILogStreamStateListener
-
Called whenever a new LogStream
/ log-file was opened.
- onPrepareCloseLogStream() - Method in interface thobe.logfileviewer.plugin.api.IPlugin
-
Life-cycle of Plugin
: ##### Step 3a PREPARE CLOSE LS #####
The currently open LogStream
will be closed.
- onRegistered(IPluginAccess) - Method in interface thobe.logfileviewer.plugin.api.IPlugin
-
Life-cycle of Plugin
: ##### Step 2 REGISTER #####
All Plugin
s are registered and running.
- onStarted() - Method in interface thobe.logfileviewer.plugin.api.IPlugin
-
Life-cycle of Plugin
: ##### Step 1 START #####
All Plugin
s are started (run-method entered for the first time) but not registered.
- onStopped() - Method in interface thobe.logfileviewer.plugin.api.IPlugin
-
Life-cycle of Plugin
: ##### Step 5 STOP #####
The Plugin
is stopped --> it has to guarantee to leave its run-method as quick as possible:
Use Plugin.isQuitRequested()
to check if the run-method should be left.
- onUnRegistered() - Method in interface thobe.logfileviewer.plugin.api.IPlugin
-
Life-cycle of Plugin
: ##### Step 4 UNREGISTER #####
All Plugin
s are unregistered (not available any more) but still running.


- Lesson 0: Hello World
- Lesson 1: Greetings
- Lesson 2: FizzBuzz
- Lesson 3: Calculator
- Lesson 4: Temperature
- Lesson 5: Pig Latin
- Lesson 6: Books
- Lesson 7: Anagrams
- Lesson 0: Hello World
- Lesson 1: Greetings
- Lesson 2: FizzBuzz
- Lesson 3: Calculator
- Lesson 4: Temperature
- Lesson 5: Pig Latin
- Lesson 6: Books
- Lesson 7: Anagrams
Basic Calculator
In this lesson you'll build a basic calculator script that has the following functions:
add
accepts two integers and returns the sum of those integerssubtract
accepts two integers and returns the first minus the secondtotal_sum
accepts a list of integers and returns the sum of all integers in the list.
Lesson objectives
- Perform basic mathematical operations
- Learn to interact with list elements
- Create a python file containing multiple functions
- Read some Python documentation!
Challenge Rules:
add
- The function should accept two integers
- The function should return one integer equal to the sum of the two inputs
- The function should work for positive and negative integers
subtract
- The function should accept two integers
- The function should return one integer equal to the first integer minus the second
- The function should work for positive and negative integers
total_sum
- The function should accept a list of integers
- The function should return one integer equal to the sum of all the list elements
- The function should work for a list of any size
- The function should work for positive and negative integers
- Edge case:
- If the function receives an empty list, return 0
Working with iterables!
The total_sum
function probably requires some additional Python
concepts you might
not be familiar with yet. You'll need to learn to move through each element of a list, or iterate
over the contents of the list.
In previous lessons, the lesson's index.html
file has walked you
through everything
you need
to know in order to accomplish the challenge goals. This time, however, you'll need to take a
peek at
the Python documentation on for
loops.
See if you can find the information you need in the linked documentation. If you still need help, I recommend googling your question (or even googling your error message!). Learning to ask the right questions and hunt for answers is one of the most important skills you can learn as a developer.
Example
add
add(2, 3) #=> 5
add(-2, 3) #=> 1
add(-10, -3) #=> -7
subtract
subtract(5, 3) #=> 2
subtract(10, -3) #=> 13
subtract(-12, -2) #=> -10
total_sum
total_sum([1, 2, 3]) #=> 6
total_sum([2, 3]) #=> 5
total_sum([8, 4, -2]) #=> 10
total_sum([]) #=> 0
total_sum([0]) #=> 0


Reader Forum: They're no longer doubting Maximum Security
by Ryan DickeyAt Horse Racing Nation, we have a wonderful community of readers who share their opinions and insights on all things horse racing. So we figured it's about time we more prominently share some of that feedback.
On a weekly basis, we'll look to highlight top comments on major races, popular horses, handicapping and industry issues seen throughout the site.
Want your comment to be featured in a future edition of "Reader Forum"? Sign up here, and begin by offering your thoughts on all things racing below this article.
Last weekend, Maximum Security continued a likely ascent to 3-year old champion male status by capturing the Cigar Mile. Here's a glance at some of the HRN reader reaction.
Responding to an assertion that Spun to Run would get to the lead early based off of recent workouts, leo r respectfully disagreed, stating he felt Maximum Security, though the high weight, could carry his speed and would win in gate-to-wire fashion.
After the race, user Chris Miskell opined that he had plenty of doubts about Maximum Security in the past, but the Cigar Mile victory changed all of that.
One of the nearly 900 comments following the Cigar Mile victory for Maximum Security, user Pebbles offered congratulations to the winner and his connections after a rollercoaster season.
And finally, user MaiyaDay provided some insight on the Beyer Speed Figure attached to the Cigar Mile victor as well as tough luck second place finisher Spun to Run, who tracked Maximum Security for the entirety of the race.


--- layout: post title: Accessing audit and error messages in NServiceBus v4.0 date: 2013-06-17 12:56:03.000000000 +02:00 categories: - NServiceBus tags: [] status: publish type: post published: true meta: dsq_thread_id: '1407268495' _edit_last: '1' author: login: andreas.ohlund email<EMAIL_ADDRESS>display_name: Andreas Öhlund first_name: Andreas last_name: "Öhlund" ---
NServiceBus has always supported centralized audit and error handling by allowing you to specify centralized queues where successfully and failed messages ends up. NServiceBus will guarantee that each message you send/publish will end up in one of those queues, hopefully the audit queue:). Earlier versions of NServiceBus had some rudimentary support for managing errors but for audit messages it was up to you as a user to make something useful with all that data. This has now changed with the introduction of ServiceInsight.
ServiceInsight gives you a graphical view of your messages flows, insight into why a given message has failed and also a way to issue retries for those messages. Since queues are not really that great for longtime storage of data we needed a way to process all those message in order to make it easier to query and manipulate them from the UI. We also decided to not limit access to just our own tools but instead make all data and operations on it available to you via a REST'ish api.
The api is still early days but we hope to keep on expanding it to help you build management extensions for NServiceBus for your tool of choice.
Official documentation is coming soon but I don't expect much to change from what's mentioned below.
The api backend is installed automatically when you run the NServiceBus or the ServiceInsight installers. The backend is just a regular NServiceBus host that gets installed as a windows service. Once that is done it will continuously import messages from your audit and error queues and making the data available over http. By default the api will respond on http://localhost:33333/api but the installers will allow you to tweak the uri to your liking. If you forgot where it got installed you can always consult the following regkey:
HKEY_LOCAL_MACHINE\SOFTWARE\ParticularSoftware\ServiceBus\Management
Once installed the endpoint will import and index all error and audit messages.
The management endpoint will import all errors into our internal storage and leave a copy in a queue called {name or your error q}.log so in your case it will most likely be in error.log.
This means that you can still run tool like QueueExplorer, ReturnToSourceQueue.exe etc to manage your errors in the same way as before if you don't have access to ServiceInsight.
The API is heavily inspired by the GitHub api guidelines for urls, paging, sorting etc
At the time of writing the following calls are supported:
GET /audit - lists all messages successfully processed
GET /endpoints/:name/audit - lists all messages successfully processed for the given endpoint
GET /messages/:id - Gets the given message
GET /messages/search/:criteria - Does a free text search with the given lucene query
GET /endpoints - Lists all the known endpoints
GET /endpoints/:name/messages - Lists all messages (including failed ones) for the given endpoint
GET /conversations/:id- Gets all message for the given conversation id. (I'll talk more about conversations in a follow up post)
POST /errors/:id/retry - Issues as retry for the given message. Returns Http Accepted (202) if successful since the actual retry is performed async.
The is no explicit security in place at the moment and the service is expected to run on a secured server that only authorized personnel has access to.
I've created a few ScriptCs scripts to show the usage of some of the above calls.
Please take it for a spin and tell me what you think!
You can use the Video store sample that comes with NServiceBus to generate some test data if you don't have a v4 system up and running!
What is missing?
Which tools would you build NServiceBus plugins for?
Comments are most welcome!
Limitations:
* The first drop only supports the MSMQ transport but support for the others is our top priority so expect support for all other transports in the very near future