Class that represents the group and value of a sample.
Object containing the test results for the chi-squared hypothesis test.
Object containing the test results for the chi-squared hypothesis test.
Object containing the test results for the Kolmogorov-Smirnov test.
Object containing the test results for the Kolmogorov-Smirnov test.
Performs online 2-sample significance testing for a stream of (Boolean, Double) pairs.
Performs online 2-sample significance testing for a stream of (Boolean, Double) pairs. The Boolean identifies which sample each observation comes from, and the Double is the numeric value of the observation.
To address novelty affects, the peacePeriod
specifies a set number of initial
org.apache.spark.rdd.RDD batches of the DStream
to be dropped from significance testing.
The windowSize
sets the number of batches each significance test is to be performed over. The
window is sliding with a stride length of 1 batch. Setting windowSize to 0 will perform
cumulative processing, using all batches seen so far.
Different tests may be used for assessing statistical significance depending on assumptions
satisfied by data. For more details, see StreamingTestMethod. The testMethod
specifies
which test will be used.
Use a builder pattern to construct a streaming test in an application, for example:
val model = new StreamingTest() .setPeacePeriod(10) .setWindowSize(0) .setTestMethod("welch") .registerStream(DStream)
Trait for hypothesis test results.
Trait for hypothesis test results.
Return type of degreesOfFreedom
.
Class that represents the group and value of a sample.
if the sample is of the experiment group.
numeric value of the observation.


"PETHAHIAH "loosed of the Lord. (1.) The chief of one of the priestly courses (the nineteenth) in the time of David (1 Chronicles 24:16). (2.) A Levite (Ezra 10:23). (3.) Nehemiah 9:5. (4.) A descendant of Judah who had some office at the court of Persia (Nehemiah 11:24).
"PETHAHIAH "loosed of the Lord. (1.) The chief of one of the priestly courses (the nineteenth) in the time of David (1 Chronicles 24:16). (2.) A Levite (Ezra 10:23). (3.) Nehemiah 9:5. (4.) A descendant of Judah who had some office at the court of Persia (Nehemiah 11:24).


I no longer use generic repositories. I have instead switched to Composable repositories which are well worth a look as they allow for better reuse. This is really the logical conclusion of extension methods to add functionality. However if you are interested specifically in the generic repository pattern read on :)
There are mixed opinions around the usefulness of generic repositories, some call it an anti-pattern. I personally find them useful so in this article I will explore what I like about the Generic Repository abstraction and how I solve some of the common criticisms of the pattern.
Why are generic repositories controversial?
I have read several articles on generic repositories which prompted this post, probably the most prominent was Greg Young’s post DDD: The Generic Repository. In this post Young raises a number of issues with generic repositories. Including the following:
- What happens if you don’t want all CRUD operations available
- It encourages persistence logic in the domain (you want to be able to unit test without persistence)
- Specific contracts are an important pointer to specifically what the application requires of the data store.
Young concludes his article by stating that there is a place for generic repositories but they should not be exposed outside of the data tier, that is they should be used to compose other repositories which can be surfaced to the application.
What is to gain by using a generic repository?
A personalized grammar
For me the most important benefit of using repositories is data-tier isolation; that is to provide a clear boundary between your data access layer and your main application. By creating a repository the effect is to constrain the way your application talks about data to a grammar (language) which you define and control. This in turn acts as a barrier to help reduce data concerns leaking into other layers of your application.
A centralized contract
By defining a generic repository what you are actually doing is defining a contract for what your application requires from a persistence layer. This gives key insight into what functions our persistence layers must provide. For example if our application uses LINQ to query our data tiers our generic repositories will expose this requirement so that you understand that any alternate persistence layers must also support LINQ. If a persistence layer can provide all of the functions described by our generic repository it could be a suitable alternative to your current persistence technology.
An interception point
By having the interception point of a generic repository you can perform what-if scenarios, for example what if I upgrade to the latest persistence technology?, or what if I stored this particular entity in XML on disk instead of a database?. By having that generic replacement point you can try these scenarios out much more simply than you perhaps could if there were more places accessing the persistence layer.
A Generic Repository is an interception point to your data tier for actions you want to happen globally, caching and auditing are great examples of where this can be a particularly useful.
When not to use a generic repository
As with any abstraction there are scenarios when your requirements are no longer going to fit and you need to do something a little bit special. Performance is a great example of a reason for which its often necessary to step away from such a pattern.
For example sometimes its necessary to hand-craft the SQL which you are using to access your data. When you get to this point you are diverging from a generic pattern, that logic can only really run on a SQL server. At this point your implementation is very specific and coupled tightly to the technology so a much more specific abstraction is appropriate.
I recommend understanding how your repositories work on the inside. This will help you understand when you need to (or don’t need to) depart from this pattern and chose something more specialized. My generic repository implementation is available on GitHub but I would encourage you to read through and understand it and possibly even modify it to make it your own.
How do they work in practice?
I’ve spent quite a bit of this article talking through why I like to use generic repositories, perhaps more important is how I use them.
Dependency Injection
I use generic repositories in conjunction with dependency injection. This allows implementations of the repository to easily be bound in specific scenarios.
Bind<DbContext>().To<BlogContext>().InRequestScope();
Bind(typeof(IRepositoryDataSource<>)).To(typeof(DbContextRepositoryDataSource<>));
Bind(typeof(IRepository<>)).To(typeof(SimpleRepository<>));
What makes this approach so powerful is that when you need more than the stock repository you can flip it out for something a little more specific by binding over the top of the generic binding.
Rebind<IRepository<Data.Post>>().To<CachedPostRepository>();
In the above example you bind in a custom repository which is going to cache all our posts in memory so that they are nice and quick when you retrieve them. What is nice about this method is that when you are consuming this in our application it doesn’t actually concern us if this information is retrieved from a cache or directly from the database so long as you are able to work with it in an IRepository<>
way.
Extension Methods
With any application you will implement a lot of logic around how you access your applications data. I use extension methods to implement my application specific data logic. This method works really well and I find it keeps application data logic clean and tidy. Its also not limited to to a generic repository scenario, and you can use this style of code in many with many other data access methodologies.
In my blog engine for example the concept of published posts is important and is used everywhere, so I have the following extension method:
public static IQueryable<Post> PublishedPosts(this IRepository<Post> repo)
{
return repo.GetAll().Where(p => p.Status == PostStatus.Published);
}
I often need something more specific than just published posts though, for example if you go to http://blog.staticvoid.co.nz it will forward you to the latest published post, so I have:
public static Post LatestPublishedPost(this IRepository<Post> repo)
{
return repo.PublishedPosts().OrderByDescending(p=>p.Posted).FirstOrDefault();
}
I then use this in my controller to redirect the request to the latest post.
public ActionResult Index()
{
var post = _postRepository.LatestPublishedPost();
if(post== null)
throw new HttpException((int)HttpStatusCode.NotFound, "No posts have been published");
return Redirect("/" + post.Path);
}
As you can see this lets you chain data logic concepts together into simple readable bites.
Because all of these extension methods are built on top of a generic concept the logic is separated from the specific Entity Framework implementation I use and any implementation which fulfills my IRepository<>
contract (such as my caching repository) will now work in my application.
Unit Testing
Allowing us to switch out that generic implementation becomes even more valuable when you want to test our code. At this point you can switch our actual implementation out for an in memory repository so you don’t have to actually query a database and can maintain our state a little more tightly. Below are the tests for post redirection:
[TestMethod]
[ExpectedException(typeof(HttpException))]
public void RedirectToLatestPostWithNoPostsTest()
{
IRepository<Post> postRepo = new SimpleRepository<Post>(new InMemoryRepositoryDataSource<Post>());
PostController sut = new PostController(postRepo);
try
{
sut.Index();
}
catch(HttpException ex)
{
Assert.AreEqual((int)HttpStatusCode.NotFound, ex.GetHttpCode());
throw;
}
}
[TestMethod]
[ExpectedException(typeof(HttpException))]
public void RedirectToLatestPostWithNoPublishedPostsTest()
{
IRepository<Post> postRepo = new SimpleRepository<Post>(new InMemoryRepositoryDataSource<Post>(
new List<Post> {
new Post { Status = PostStatus.Draft},
new Post { Status = PostStatus.Unpublished}
}));
PostController sut = new PostController(postRepo);
try
{
sut.Index();
}
catch (HttpException ex)
{
Assert.AreEqual((int)HttpStatusCode.NotFound, ex.GetHttpCode());
throw;
}
}
[TestMethod]
public void RedirectToLatestPostWithOnePublishedPostsTest()
{
IRepository<Post> postRepo = new SimpleRepository<Post>(new InMemoryRepositoryDataSource<Post>(
new List<Post> {
new Post {
Status = PostStatus.Published,
Path ="2013/04/14/some-post",
Posted = new DateTime(2013,4,14) }
}));
PostController sut = new PostController(postRepo);
var result = sut.Index();
Assert.AreEqual("/2013/04/14/some-post", ((RedirectResult)result).Url);
}
[TestMethod]
public void RedirectToLatestPostWithMultiplePublishedPostsTest()
{
IRepository<Post> postRepo = new SimpleRepository<Post>(new InMemoryRepositoryDataSource<Post>(
new List<Post> {
new Post {
Status = PostStatus.Published,
Path ="2013/04/10/some-other-post",
Posted = new DateTime(2013,4,10) },
new Post {
Status = PostStatus.Published,
Path ="2013/04/14/some-post",
Posted = new DateTime(2013,4,14) }
}));
PostController sut = new PostController(postRepo);
var result = sut.Index();
Assert.AreEqual("/2013/04/14/some-post", ((RedirectResult)result).Url);
}
What is great about this is that you can test right to the edges of our system and ensure that you are producing the intended result for this controller, eg that its going to redirect us to the URL of the latest post without the fragility of testing with a database in the mix.
Summing up
I find generic repositories to be a very useful pattern which allows you to write more change agile code. They provide a key touch point for being able to work with data in different scenarios. While they are not the right abstraction in all scenarios they provide a useful abstraction for a wide range of applications, especially when combined with a dependency injection framework.


Recording date: December 6, 2020
Download at Apple Podcasts, Google Podcasts, Spotify, iHeartRadio, Spreaker or wherever you get your podcasts.
Nick thinks it is the stuff we put off in favor of things we want to do*, while Chris quotes Ward Cunningham and Martin Fowler, summarizing that technical debt is basically the quick and dirty fixes that incur interest payments, and using the concepts of tech debt to describe problems faced over time.
A chat about “shift left” or moving earlier in the SDLC, which boils down to the human factors of tech debt accrual.
Nick mentions a collection of moments in which decisions are made to do the scalable thing or do the fun thing. Chris points out these concepts apply to both Waterfall and Agile approaches, and invokes Paul Downey in his discussion of when decisions get made and how they are addressed.
When should it be addressed? Why do organizations schedule huge tech debt burndowns as opposed to building in TDB to every sprint (Nick quotes, but forgets to credit, Ian Amit, and this quote is covered in Episode 2), and Nick quotes Phil Venables who tweeted that we should measure tech debt in the terms of what percentage of dev time is spent on this.
Which leads Chris to ask about what metrics are right. How do you calibrate information about doing it quick versus doing it right?
From engineering time to executive buy in, these are critical issues. We can’t tell you the monetary value of not scaling a thing, and that is a huge issue.
Chris mentions that one if the issues that arises is what kinds of tech debt do we face? One of the ones he likes to focus on is policy debt, which is a fundamental type organizations face.
This raises the issue of policy over time: in FinServ, most policies were written in the days of the moat and the gate, and they don’t address contemporary, cloud native architectures.
This brings in some of the human decisions we make.
How do we answer questions about the interplay between policy and regulation, like the “should we reset our passwords every 90 days” question.
Chris summarizes the three different global approaches to regulation.
Singaporean: very prescriptive.
Anglo-American: Principle based, broad brush of expectations and relying on audit companies
Swiss: More comparative: an expectation of participants in the marketplace to reach a certain standards.
Nick describes how US auditors are asking more about technical debt management, but they’re not getting highly specific enough to differentiate betwen tech debt and the underlying policy debt which might drive it.
When we told auditors that our main goals in security was to get rid of tech debt and the auditor asked whether I meant ‘security tech debt’ or just plain old ‘tech debt’ - what’s the difference?
Chris then discusses the CIA triad and talks about how we in Information Security seem to have abdicated the ‘Availability’ part, then referred to a 2006 report called Milk or Wine: Does Software Security Improve With Age which is very pertinent.
The discussion moves to tests: is there a vulnerability in the code, but the bigger aspects of debt include such paralysis that they can’t change anything, because they don’t have the test coverage to know whether a fix here will affect something unintended there?
So test coverage and testability must be part of a strategy to address tech debt.
We in the industry are constantly talking “secure by design,” “shift left,” and the like, but what does this mean in practicality? So, if we are starting a software project today, what are we going to do differently now from last year?
Nick describes his firm’s Squad Security Liaison program, which is designed to foster inter-disciplinary teamwork by making introductions between engineers and security people on a regular basis, to encourage interaction and collaboration. It means they know one another before problems exist, so relationships are there when something goes wrong.
This podcast is all about learning!
* Wendy Nather disagrees with “want”.
Chris is a frequent speaker on topics such as serverless, DevOps, cloud, containers, security, networking and the Internet of Things. He’s also a cloud editor for InfoQ and a contributor to open source projects such as Docker, CoreOS and DXC’s Online DevOps Dojo.
Nick is Chief Security Officer at a financial technology firm, and was formerly an NYPD Intelligence Bureau apparatchik. He is co-author of many books, including Cyber Attack Survival Manual; In Context: Understanding Police Killings of Unarmed Civilians and Blackhatonomics: An Inside Look at the Economics of Cybercrime.


An implementation of RFC 3987, Internationalized Resource Identifiers, and of related standards.
Use an IRIFactory to parse Strings as IRI objects which:
An IRIFactory allows:
The easiest way to use this package is to use one of the preconfigured factories, implementing RFC 3987 or RFC 3986 or a combination implementation appropriate for Semantic Web applications. See the documentation for IRIFactory for more information.
This implementation is limited to 16bits, and hence approximately Unicode 2.1 support. While the Unicode 4.1 code charts are used, all characters from these greater than \uFFFF are ignored. Behaviour with Unicode 4.1 IRIs in Java 1.5, using characters greater than \uFFFF is undefined. This limitation will not be reviewed until Java 1.6 is fully released, and Jena migrates from supporting Java 1.4 and 1.5 to supporting Java 1.5 and 1.6.


wrap-words
npm install wrap-words
A word wrapping utility which correctly handles graphemes and ANSI escape codes.
wrap-words
is a little different from other word wrapping utilities in that it treats all passed in whitespace as collapsible (like HTML). This means is can also be used to re-wrap a string that had previously been wrapped.


# -*- coding: utf8
"""Random Projection transformers
Random Projections are a simple and computationally efficient way to
reduce the dimensionality of the data by trading a controlled amount
of accuracy (as additional variance) for faster processing times and
smaller model sizes.
The dimensions and distribution of Random Projections matrices are
controlled so as to preserve the pairwise distances between any two
samples of the dataset.
The main theoretical result behind the efficiency of random projection is the
`Johnson-Lindenstrauss lemma (quoting Wikipedia)
<https://en.wikipedia.org/wiki/Johnson%E2%80%93Lindenstrauss_lemma>`_:
In mathematics, the Johnson-Lindenstrauss lemma is a result
concerning low-distortion embeddings of points from high-dimensional
into low-dimensional Euclidean space. The lemma states that a small set
of points in a high-dimensional space can be embedded into a space of
much lower dimension in such a way that distances between the points are
nearly preserved. The map used for the embedding is at least Lipschitz,
and can even be taken to be an orthogonal projection.
"""
# Authors: Olivier Grisel<EMAIL_ADDRESS># Arnaud Joly<EMAIL_ADDRESS># License: BSD 3 clause
from __future__ import division
import warnings
from abc import ABCMeta, abstractmethod
import numpy as np
from numpy.testing import assert_equal
import scipy.sparse as sp
from .base import BaseEstimator, TransformerMixin
from .externals import six
from .externals.six.moves import xrange
from .utils import check_random_state
from .utils.extmath import safe_sparse_dot
from .utils.random import sample_without_replacement
from .utils.validation import check_array, check_is_fitted
from .exceptions import DataDimensionalityWarning
__all__ = ["SparseRandomProjection",
"GaussianRandomProjection",
"johnson_lindenstrauss_min_dim"]
def johnson_lindenstrauss_min_dim(n_samples, eps=0.1):
"""Find a 'safe' number of components to randomly project to
The distortion introduced by a random projection `p` only changes the
distance between two points by a factor (1 +- eps) in an euclidean space
with good probability. The projection `p` is an eps-embedding as defined
by:
(1 - eps) ||u - v||^2 < ||p(u) - p(v)||^2 < (1 + eps) ||u - v||^2
Where u and v are any rows taken from a dataset of shape [n_samples,
n_features], eps is in ]0, 1[ and p is a projection by a random Gaussian
N(0, 1) matrix with shape [n_components, n_features] (or a sparse
Achlioptas matrix).
The minimum number of components to guarantee the eps-embedding is
given by:
n_components >= 4 log(n_samples) / (eps^2 / 2 - eps^3 / 3)
Note that the number of dimensions is independent of the original
number of features but instead depends on the size of the dataset:
the larger the dataset, the higher is the minimal dimensionality of
an eps-embedding.
Read more in the :ref:`User Guide <johnson_lindenstrauss>`.
Parameters
----------
n_samples : int or numpy array of int greater than 0,
Number of samples. If an array is given, it will compute
a safe number of components array-wise.
eps : float or numpy array of float in ]0,1[, optional (default=0.1)
Maximum distortion rate as defined by the Johnson-Lindenstrauss lemma.
If an array is given, it will compute a safe number of components
array-wise.
Returns
-------
n_components : int or numpy array of int,
The minimal number of components to guarantee with good probability
an eps-embedding with n_samples.
Examples
--------
>>> johnson_lindenstrauss_min_dim(1e6, eps=0.5)
663
>>> johnson_lindenstrauss_min_dim(1e6, eps=[0.5, 0.1, 0.01])
array([ 663, 11841, 1112658])
>>> johnson_lindenstrauss_min_dim([1e4, 1e5, 1e6], eps=0.1)
array([ 7894, 9868, 11841])
References
----------
.. [1] https://en.wikipedia.org/wiki/Johnson%E2%80%93Lindenstrauss_lemma
.. [2] Sanjoy Dasgupta and Anupam Gupta, 1999,
"An elementary proof of the Johnson-Lindenstrauss Lemma."
http://citeseer.ist.psu.edu/viewdoc/summary?doi=<IP_ADDRESS>.3654
"""
eps = np.asarray(eps)
n_samples = np.asarray(n_samples)
if np.any(eps <= 0.0) or np.any(eps >= 1):
raise ValueError(
"The JL bound is defined for eps in ]0, 1[, got %r" % eps)
if np.any(n_samples) <= 0:
raise ValueError(
"The JL bound is defined for n_samples greater than zero, got %r"
% n_samples)
denominator = (eps ** 2 / 2) - (eps ** 3 / 3)
return (4 * np.log(n_samples) / denominator).astype(np.int)
def _check_density(density, n_features):
"""Factorize density check according to Li et al."""
if density == 'auto':
density = 1 / np.sqrt(n_features)
elif density <= 0 or density > 1:
raise ValueError("Expected density in range ]0, 1], got: %r"
% density)
return density
def _check_input_size(n_components, n_features):
"""Factorize argument checking for random matrix generation"""
if n_components <= 0:
raise ValueError("n_components must be strictly positive, got %d" %
n_components)
if n_features <= 0:
raise ValueError("n_features must be strictly positive, got %d" %
n_components)
def gaussian_random_matrix(n_components, n_features, random_state=None):
"""Generate a dense Gaussian random matrix.
The components of the random matrix are drawn from
N(0, 1.0 / n_components).
Read more in the :ref:`User Guide <gaussian_random_matrix>`.
Parameters
----------
n_components : int,
Dimensionality of the target projection space.
n_features : int,
Dimensionality of the original source space.
random_state : int, RandomState instance or None, optional (default=None)
Control the pseudo random number generator used to generate the matrix
at fit time. If int, random_state is the seed used by the random
number generator; If RandomState instance, random_state is the random
number generator; If None, the random number generator is the
RandomState instance used by `np.random`.
Returns
-------
components : numpy array of shape [n_components, n_features]
The generated Gaussian random matrix.
See Also
--------
GaussianRandomProjection
sparse_random_matrix
"""
_check_input_size(n_components, n_features)
rng = check_random_state(random_state)
components = rng.normal(loc=0.0,
scale=1.0 / np.sqrt(n_components),
size=(n_components, n_features))
return components
def sparse_random_matrix(n_components, n_features, density='auto',
random_state=None):
"""Generalized Achlioptas random sparse matrix for random projection
Setting density to 1 / 3 will yield the original matrix by Dimitris
Achlioptas while setting a lower value will yield the generalization
by Ping Li et al.
If we note :math:`s = 1 / density`, the components of the random matrix are
drawn from:
- -sqrt(s) / sqrt(n_components) with probability 1 / 2s
- 0 with probability 1 - 1 / s
- +sqrt(s) / sqrt(n_components) with probability 1 / 2s
Read more in the :ref:`User Guide <sparse_random_matrix>`.
Parameters
----------
n_components : int,
Dimensionality of the target projection space.
n_features : int,
Dimensionality of the original source space.
density : float in range ]0, 1] or 'auto', optional (default='auto')
Ratio of non-zero component in the random projection matrix.
If density = 'auto', the value is set to the minimum density
as recommended by Ping Li et al.: 1 / sqrt(n_features).
Use density = 1 / 3.0 if you want to reproduce the results from
Achlioptas, 2001.
random_state : int, RandomState instance or None, optional (default=None)
Control the pseudo random number generator used to generate the matrix
at fit time. If int, random_state is the seed used by the random
number generator; If RandomState instance, random_state is the random
number generator; If None, the random number generator is the
RandomState instance used by `np.random`.
Returns
-------
components : array or CSR matrix with shape [n_components, n_features]
The generated Gaussian random matrix.
See Also
--------
SparseRandomProjection
gaussian_random_matrix
References
----------
.. [1] Ping Li, T. Hastie and K. W. Church, 2006,
"Very Sparse Random Projections".
http://web.stanford.edu/~hastie/Papers/Ping/KDD06_rp.pdf
.. [2] D. Achlioptas, 2001, "Database-friendly random projections",
http://www.cs.ucsc.edu/~optas/papers/jl.pdf
"""
_check_input_size(n_components, n_features)
density = _check_density(density, n_features)
rng = check_random_state(random_state)
if density == 1:
# skip index generation if totally dense
components = rng.binomial(1, 0.5, (n_components, n_features)) * 2 - 1
return 1 / np.sqrt(n_components) * components
else:
# Generate location of non zero elements
indices = []
offset = 0
indptr = [offset]
for i in xrange(n_components):
# find the indices of the non-zero components for row i
n_nonzero_i = rng.binomial(n_features, density)
indices_i = sample_without_replacement(n_features, n_nonzero_i,
random_state=rng)
indices.append(indices_i)
offset += n_nonzero_i
indptr.append(offset)
indices = np.concatenate(indices)
# Among non zero components the probability of the sign is 50%/50%
data = rng.binomial(1, 0.5, size=np.size(indices)) * 2 - 1
# build the CSR structure by concatenating the rows
components = sp.csr_matrix((data, indices, indptr),
shape=(n_components, n_features))
return np.sqrt(1 / density) / np.sqrt(n_components) * components
class BaseRandomProjection(six.with_metaclass(ABCMeta, BaseEstimator,
TransformerMixin)):
"""Base class for random projections.
Warning: This class should not be used directly.
Use derived classes instead.
"""
@abstractmethod
def __init__(self, n_components='auto', eps=0.1, dense_output=False,
random_state=None):
self.n_components = n_components
self.eps = eps
self.dense_output = dense_output
self.random_state = random_state
@abstractmethod
def _make_random_matrix(self, n_components, n_features):
""" Generate the random projection matrix
Parameters
----------
n_components : int,
Dimensionality of the target projection space.
n_features : int,
Dimensionality of the original source space.
Returns
-------
components : numpy array or CSR matrix [n_components, n_features]
The generated random matrix.
"""
def fit(self, X, y=None):
"""Generate a sparse random projection matrix
Parameters
----------
X : numpy array or scipy.sparse of shape [n_samples, n_features]
Training set: only the shape is used to find optimal random
matrix dimensions based on the theory referenced in the
afore mentioned papers.
y : is not used: placeholder to allow for usage in a Pipeline.
Returns
-------
self
"""
X = check_array(X, accept_sparse=['csr', 'csc'])
n_samples, n_features = X.shape
if self.n_components == 'auto':
self.n_components_ = johnson_lindenstrauss_min_dim(
n_samples=n_samples, eps=self.eps)
if self.n_components_ <= 0:
raise ValueError(
'eps=%f and n_samples=%d lead to a target dimension of '
'%d which is invalid' % (
self.eps, n_samples, self.n_components_))
elif self.n_components_ > n_features:
raise ValueError(
'eps=%f and n_samples=%d lead to a target dimension of '
'%d which is larger than the original space with '
'n_features=%d' % (self.eps, n_samples, self.n_components_,
n_features))
else:
if self.n_components <= 0:
raise ValueError("n_components must be greater than 0, got %s"
% self.n_components)
elif self.n_components > n_features:
warnings.warn(
"The number of components is higher than the number of"
" features: n_features < n_components (%s < %s)."
"The dimensionality of the problem will not be reduced."
% (n_features, self.n_components),
DataDimensionalityWarning)
self.n_components_ = self.n_components
# Generate a projection matrix of size [n_components, n_features]
self.components_ = self._make_random_matrix(self.n_components_,
n_features)
# Check contract
assert_equal(
self.components_.shape,
(self.n_components_, n_features),
err_msg=('An error has occurred the self.components_ matrix has '
' not the proper shape.'))
return self
def transform(self, X):
"""Project the data by using matrix product with the random matrix
Parameters
----------
X : numpy array or scipy.sparse of shape [n_samples, n_features]
The input data to project into a smaller dimensional space.
Returns
-------
X_new : numpy array or scipy sparse of shape [n_samples, n_components]
Projected array.
"""
X = check_array(X, accept_sparse=['csr', 'csc'])
check_is_fitted(self, 'components_')
if X.shape[1] != self.components_.shape[1]:
raise ValueError(
'Impossible to perform projection:'
'X at fit stage had a different number of features. '
'(%s != %s)' % (X.shape[1], self.components_.shape[1]))
X_new = safe_sparse_dot(X, self.components_.T,
dense_output=self.dense_output)
return X_new
class GaussianRandomProjection(BaseRandomProjection):
"""Reduce dimensionality through Gaussian random projection
The components of the random matrix are drawn from N(0, 1 / n_components).
Read more in the :ref:`User Guide <gaussian_random_matrix>`.
Parameters
----------
n_components : int or 'auto', optional (default = 'auto')
Dimensionality of the target projection space.
n_components can be automatically adjusted according to the
number of samples in the dataset and the bound given by the
Johnson-Lindenstrauss lemma. In that case the quality of the
embedding is controlled by the ``eps`` parameter.
It should be noted that Johnson-Lindenstrauss lemma can yield
very conservative estimated of the required number of components
as it makes no assumption on the structure of the dataset.
eps : strictly positive float, optional (default=0.1)
Parameter to control the quality of the embedding according to
the Johnson-Lindenstrauss lemma when n_components is set to
'auto'.
Smaller values lead to better embedding and higher number of
dimensions (n_components) in the target projection space.
random_state : int, RandomState instance or None, optional (default=None)
Control the pseudo random number generator used to generate the matrix
at fit time. If int, random_state is the seed used by the random
number generator; If RandomState instance, random_state is the random
number generator; If None, the random number generator is the
RandomState instance used by `np.random`.
Attributes
----------
n_component_ : int
Concrete number of components computed when n_components="auto".
components_ : numpy array of shape [n_components, n_features]
Random matrix used for the projection.
See Also
--------
SparseRandomProjection
"""
def __init__(self, n_components='auto', eps=0.1, random_state=None):
super(GaussianRandomProjection, self).__init__(
n_components=n_components,
eps=eps,
dense_output=True,
random_state=random_state)
def _make_random_matrix(self, n_components, n_features):
""" Generate the random projection matrix
Parameters
----------
n_components : int,
Dimensionality of the target projection space.
n_features : int,
Dimensionality of the original source space.
Returns
-------
components : numpy array or CSR matrix [n_components, n_features]
The generated random matrix.
"""
random_state = check_random_state(self.random_state)
return gaussian_random_matrix(n_components,
n_features,
random_state=random_state)
class SparseRandomProjection(BaseRandomProjection):
"""Reduce dimensionality through sparse random projection
Sparse random matrix is an alternative to dense random
projection matrix that guarantees similar embedding quality while being
much more memory efficient and allowing faster computation of the
projected data.
If we note `s = 1 / density` the components of the random matrix are
drawn from:
- -sqrt(s) / sqrt(n_components) with probability 1 / 2s
- 0 with probability 1 - 1 / s
- +sqrt(s) / sqrt(n_components) with probability 1 / 2s
Read more in the :ref:`User Guide <sparse_random_matrix>`.
Parameters
----------
n_components : int or 'auto', optional (default = 'auto')
Dimensionality of the target projection space.
n_components can be automatically adjusted according to the
number of samples in the dataset and the bound given by the
Johnson-Lindenstrauss lemma. In that case the quality of the
embedding is controlled by the ``eps`` parameter.
It should be noted that Johnson-Lindenstrauss lemma can yield
very conservative estimated of the required number of components
as it makes no assumption on the structure of the dataset.
density : float in range ]0, 1], optional (default='auto')
Ratio of non-zero component in the random projection matrix.
If density = 'auto', the value is set to the minimum density
as recommended by Ping Li et al.: 1 / sqrt(n_features).
Use density = 1 / 3.0 if you want to reproduce the results from
Achlioptas, 2001.
eps : strictly positive float, optional, (default=0.1)
Parameter to control the quality of the embedding according to
the Johnson-Lindenstrauss lemma when n_components is set to
'auto'.
Smaller values lead to better embedding and higher number of
dimensions (n_components) in the target projection space.
dense_output : boolean, optional (default=False)
If True, ensure that the output of the random projection is a
dense numpy array even if the input and random projection matrix
are both sparse. In practice, if the number of components is
small the number of zero components in the projected data will
be very small and it will be more CPU and memory efficient to
use a dense representation.
If False, the projected data uses a sparse representation if
the input is sparse.
random_state : int, RandomState instance or None, optional (default=None)
Control the pseudo random number generator used to generate the matrix
at fit time. If int, random_state is the seed used by the random
number generator; If RandomState instance, random_state is the random
number generator; If None, the random number generator is the
RandomState instance used by `np.random`.
Attributes
----------
n_component_ : int
Concrete number of components computed when n_components="auto".
components_ : CSR matrix with shape [n_components, n_features]
Random matrix used for the projection.
density_ : float in range 0.0 - 1.0
Concrete density computed from when density = "auto".
See Also
--------
GaussianRandomProjection
References
----------
.. [1] Ping Li, T. Hastie and K. W. Church, 2006,
"Very Sparse Random Projections".
http://web.stanford.edu/~hastie/Papers/Ping/KDD06_rp.pdf
.. [2] D. Achlioptas, 2001, "Database-friendly random projections",
https://users.soe.ucsc.edu/~optas/papers/jl.pdf
"""
def __init__(self, n_components='auto', density='auto', eps=0.1,
dense_output=False, random_state=None):
super(SparseRandomProjection, self).__init__(
n_components=n_components,
eps=eps,
dense_output=dense_output,
random_state=random_state)
self.density = density
def _make_random_matrix(self, n_components, n_features):
""" Generate the random projection matrix
Parameters
----------
n_components : int,
Dimensionality of the target projection space.
n_features : int,
Dimensionality of the original source space.
Returns
-------
components : numpy array or CSR matrix [n_components, n_features]
The generated random matrix.
"""
random_state = check_random_state(self.random_state)
self.density_ = _check_density(self.density, n_features)
return sparse_random_matrix(n_components,
n_features,
density=self.density_,
random_state=random_state)


Some have plans, but for many, the events of the fall are uncertain. Andrew Ryker, the director of opera, said that the university and professors are taking cautions when starting vocal music programs again in the fall.
“Our opera rehearsal room is going to have plexiglass barriers that the singers will be behind, and then the singer will have a mask on, and then the singer will have a face shield on,” Ryker said. “Then the singer, the pianist and the director will be at all opposite sides of the room.”
Ryker said that he and his fellow professors have spent the summer researching and planning the safest and most effective ways to proceed for the fall.
“We have had meeting after meeting after meeting reading all of the science and all of the articles, trying to get ready for fall and trying to make this an amazing experience for students and not feel like they're being cheated,” Ryker said.
Ryker has adapted his own curriculum to the pandemic by swapping out large ensemble performances for duets during the fall semester, then possibly doing shows with small casts in the spring.
To be able to perform these types of shows and pieces, Ryker said his students will be learning pieces that they may not have previously been familiar with, which has both pros and cons.
“That's a good thing in some ways, with students getting to learn pieces that they've never heard of,” Ryker said. “They might be preparing a role that they'll never do again, which is not typical in opera. We often work on the Magic Flute and then we do the Magic Flute 30 more times in our careers.”
Although these shows may not be like what the students typically do, Ryker said it still has benefits, like having more one-on-one time with him, and more opportunity to dive into their performances.
Ryker said that although he originally had the majority of his curriculum planned out, he was worried more about the health and wellbeing of his students.
A lot of students in the performing arts are nervous to go back to campus in the fall, like Oliver Runyon, a sophomore studying musical theatre, who said that he believes students shouldn’t return to campus.
“We're going to pay the deposit and we're going to be sent right back,” Oliver said.
Runyon said that he is interested in seeing how the performing arts happen this semester though, as meeting virtually presented unique challenges.
“We had to do acting and movement in our houses with our parents watching us, basically. They're working from home too, and it was just super awkward.”—Oliver Runyon, a sophomore studying musical theatre
“We had to do acting and movement in our houses with our parents watching us, basically,” Runyon said. “They're working from home too, and it was just super awkward.”
Runyon said he expects to be outside a lot and that he is going to be in a lot of hybrid classes. Like many students, he said online classes are tougher to focus on, especially because he has Attention Deficit Disorder.
For performances, an outside stage is being built to be shared by the various performing arts departments at OU, Runyon said.
Other performing arts organizations in the Athens area, like ABC Players, a local community theatre company, are struggling with plans and ways for performances to happen.
Their show, Sister Act was set to be performed the week after lockdown, and the show was forced to be cancelled.
“We've kind of hit pause a little bit,” Jodi MacNeal, the president of ABC Players, said. “We were planning to do it in September. That looks like that's probably not going to be a thing. So we're working with the company to get the dates changed for that.”
Although they have already picked shows for next season, and voted to continue the shows from the previous season that were already in the works, MacNeal said they are not sure when their usual performance venue, Stuart’s Opera House, will be able to host shows again.
There is the issue of not only protecting the audience, MacNeal said, but the cast and crew.
“It will depend on the opera house’s regulation and government regulation, and then we'll have to go from there,” MacNeal said. “We don't really have an answer for that yet.”
In the meantime, the kids of ABC Players have been meeting over Zoom for workshops, and MacNeal is looking towards what small steps and events can be taken in the future.
“It's strange for me, I'm usually going 90 miles an hour,” MacNeal said. “I feel like for me, it was almost like I didn't know how to proceed.”


Cissi’s total solar eclipse photos shot in Tiptop, Missouri, USA in 2017 were featured on the headline of Tipton Times, the cover of Space Weather Quarterly, and in online science forum, Multiverse. You may find the canvas print on the wall in her office at NCU.


Login Information
Username:
Password:
Additional information
My car:
BMW
Porche
Opel
Bugatti Veyron
+
-
*
Description:
Click Me


Video technology involves, as per the most common definition, recording and playing back moving pictures and sound. It has grown from manually rotating series of sketches around the wheel to modern digital video players with 60fps frame rate, 8K resolution playback, and lot more capabilities.
Out of many fields where video technology is being used, there is one prominent field where video technology shines the most is
Streaming Videos. And this is what I'm going to dig deep and write about in this series of posts.
Also, as an iOS Developer, I'm going to be more focused on
HLS and using it on Apple platforms.
Posts:
- Video Technology for Streaming Videos
- Streaming vs Downloading


Fit a GGE (genotype + genotype * environment) model and display the results.
gge(x, ...) # S3 method for data.frame gge(x, formula, gen.group = NULL, env.group = NULL, ggb = FALSE, ...) # S3 method for formula gge(formula, data, gen.group = NULL, env.group = NULL, ggb = FALSE, ...) # S3 method for matrix gge( x, center = TRUE, scale = TRUE, gen.group = NULL, env.group = NULL, ggb = FALSE, comps = c(1, 2), method = "svd", ... ) # S3 method for gge plot(x, main = substitute(x), ...) # S3 method for gge biplot( x, main = substitute(x), subtitle = "", xlab = "auto", ylab = "auto", cex.gen = 0.6, cex.env = 0.5, col.gen = "darkgreen", col.env = "orange3", pch.gen = 1, lab.env = TRUE, comps = 1:2, flip = "auto", origin = "auto", res.vec = TRUE, hull = FALSE, zoom.gen = 1, zoom.env = 1, ... ) biplot3d(x, ...) # S3 method for gge biplot3d( x, cex.gen = 0.6, cex.env = 0.5, col.gen = "darkgreen", col.env = "orange3", comps = 1:3, lab.env = TRUE, res.vec = TRUE, zoom.gen = 1, ... )
| x | A matrix or data.frame. |
|---|---|
| ... | Other arguments (e.g. maxiter, gramschmidt) |
| formula | A formula |
| gen.group | genotype group |
| env.group | env group |
| ggb | If TRUE, fit a GGB biplot model. |
| data | Data frame |
| center | If TRUE, center values for each environment |
| scale | If TRUE, scale values for each environment |
| comps | Principal components to use for the biplot. Default c(1,2). |
| method | method used to find principal component directions. Either "svd" or "nipals". |
| main | Title, by default the name of the data. Use NULL to suppress the title. |
| subtitle | Subtitle to put in front of options. Use NULL to suppress the subtitle. |
| xlab | Label along axis. Default "auto" shows percent of variation explained. Use NULL to suppress. |
| ylab | Label along axis. Default "auto" shows percent of variation explained. Use NULL to suppress. |
| cex.gen | Character expansion for genotypes, default 0.6. Use 0 to omit genotypes. |
| cex.env | Character expansion for environment labels. |
| col.gen | Color for genotype labels. May be a single color for all genotypes, or a vector of colors for each genotype. |
| col.env | Color for environments. May be a single color for all environments, or a vector of colors for each environment. |
| pch.gen | Plot character for genotypes |
| lab.env | Label environments if TRUE. |
| flip | If "auto" then each axis is flipped so that the genotype ordinate is positively correlated with genotype means. Can also be a vector like c(TRUE,FALSE) for manual control. |
| origin | If "auto", the plotting window is centered on genotypes, otherwise the origin is at the middle of the window. |
| res.vec | If TRUE, for each group, draw residual vectors from the mean of the locs to the individual locs. |
| hull | If TRUE, show a which-won-where polygon. |
| zoom.gen | Zoom factor for manual control of genotype xlim,ylim The default is 1. Values less than 1 may be useful if genotype names are long. |
| zoom.env | Zoom factor for manual control of environment xlim,ylim. The default is 1. Values less than 1 may be useful if environment names are long. Not used for 3D biplots. |
A list of class gge
containing:
The filled-in data
The original data
genotype coordinates
loc coordinates
block coordinates
If not NULL, use this to specify a column of the data.frame to classify genotypes into groups.
If not NULL, use this to specify a column of the data.frame to classify environments into groups.
If TRUE, create a GGB biplot
genotype means
mosaic plot data
variation explained by each PC
Data centered?
Data scaled?
Method used to calculate principal components.
Percent of x that is missing values
Maximum number of PCs
If there is replication in G*E, then the replications are averaged together before constructing the biplot.
The singular value decomposition of x
is used to calculate the
principal components for the biplot. Missing values are NOT allowed.
The argument method
can be either
'svd' for complete-data or 'nipals' for missing-data.
Jean-Louis Laffont, Kevin Wright and Mohamed Hanafi (2013). Genotype + Genotype x Block of Environments (GGB) Biplots. Crop Science, 53, 2332-2341. doi: 10.2135/cropsci2013.03.0178 .
Kroonenberg, Pieter M. (1997). Introduction to Biplots for GxE Tables, Research Report 51, Centre for Statistics, The University of Queensland, Brisbane, Australia. https://three-mode.leidenuniv.nl/document/biplot.pdf
Yan, W. and Kang, M.S. (2003). GGE Biplot Analysis. CRC Press.
Kevin Wright, Jean-Louis Laffont
Jean-Louis Laffont, Kevin Wright
# Example 1. Data is a data.frame in 'matrix' format B <- matrix(c(50, 67, 90, 98, 120, 55, 71, 93, 102, 129, 65, 76, 95, 105, 134, 50, 80, 102, 130, 138, 60, 82, 97, 135, 151, 65, 89, 106, 137, 153, 75, 95, 117, 133, 155), ncol=5, byrow=TRUE) rownames(B) <- c("G1","G2","G3","G4","G5","G6","G7") colnames(B) <- c("E1","E2","E3","E4","E5") library(gge) m1 = gge(B) plot(m1) biplot(m1, main="Example biplot") # biplot3d(m1) if(require(agridat)){ # crossa.wheat biplot # Specify env.group as column in data frame data(crossa.wheat) dat2 <- crossa.wheat m2 <- gge(yield~gen*loc, dat2, env.group=locgroup, scale=FALSE) plot(m2) biplot(m2, lab.env=TRUE, main="crossa.wheat") # biplot3d(m2) } #> Loading required package: agridat #> Please use `gge(data,formula)` instead of `gge(formula,data)`


This ReadMe outlines the system used to generate SimpleITK files using json data files in conjunction with the template .h and .cxx files
Overview
In order to create a uniform body of image filters, we use an automated code generation system to wrap existing ITK filters into SimpleITK filters. The development process consists of writing a JSON data file which specifies the information needed to fill in the fields of the template file. During compilation, all of the .json files are parsed using a lua template engine which fills in the apropriate template file from the provided fields. This ReadMe provides a detailed description of the fields that can be used in the json data files and what effect each field has on the resulting image filter. When writing your own json file, it should be saved in:
$SimpleITK_SOURCE_DIR/Code/$FILTER_DIR/json
Here $FILTER_DIR is the directory in which the code for the generated filter should live. For simple filters this is the "BasicFilters" directory.
JSON File Structure
JSON (JavaScript Object Notation) is a simple text formatting system used to specify data values. A full description of the specification can be found at http://www.json.org/. For the purposes of SimpleITK, a json file consists of a single data object (denoted by {}) which contains several string : value pairs (here value may be a list denoted by []) and sub-objects. Here is an example from LaplacianRecursiveGaussian:
{
"name" : "LaplacianRecursiveGaussian",
"template_code_filename" : "ImageFilter",
"template_test_filename" : "ImageFilter",
"doc" : "",
"pixel_types" : "BasicPixelIDTypeList",
"output_pixel_type" : "float",
"members" : [ {
"name" : "Sigma",
"type" : "double",
"default" : "1.0",
"doc" : "",
"briefdescriptionSet" : "",
"detaileddescriptionSet" : "Set Sigma value. Sigma is measured in the units of image spacing.\n"
}, {
"name" : "NormalizeAcrossScale",
"type" : "bool",
"default" : "0",
"doc" : "",
"briefdescriptionSet" : "",
"detaileddescriptionSet" : "Define which normalization factor will be used for the Gaussian\\see RecursiveGaussianImageFilter::SetNormalizeAcrossScale\n\n",
"briefdescriptionGet" : "",
"detaileddescriptionGet" : ""
} ],
"tests" : [ {
"tag" : "default",
"description" : "Simply run with default settings",
"inputA" : "Input/RA-Float.nrrd",
"settings" : [ ],
"tolerance" : 1.0E-4
} ],
"briefdescription" : "Computes the Laplacian of an image by convolution with the second derivative of a Gaussian.\n",
"detaileddescription" : "This filter is implemented using the recursive gaussian filters\n\n\\li {EdgesAndGradients/LaplacianRecursiveGaussianImageFilter,Compute the Laplacian of an image}\n\n"
}
In this example, we see that all pairs must use a string as the key, but may have any valid type as the value (string - "Abs", number - 1, list - [], object - {}).
Fields For All Templates
This section describes the minimal set of fields required to wrap an ITK filter into SimpleITK.
Top Level Fields
- name: (string) This must be the name of the ITK filter with the "ImageFilter" suffix removed
- templage_code_filename: (string) Which of the template files should be used to generate the filter. Choices are: "ImageFilter", "RegionGrowingImageFilter", "StructuringElementImageFilter", "LevelSetImageFilter", "MathematicalMorphologyImageFilter"
- template_test_filename: (string) Which of the template files should be used to generate the test for this filter. Choices are: "ImageFilter", "RegionGrowingImageFilter"
- number_of_inputs: (integer) How many input images are used for this filter. Currently, the template system only supports filters with 1 or 2 input images
- briefdescription: (string) Brief description of the class (Doxygen format). This string is automatically generated by the Utilities/BuildDocs and Utilities/GenerateDocumentation.groovy scripts. If no corresponding ITK class exists, this field will not be modified.
- detaileddescription: (string) More detailed description of the class (Doxygen format). This string is automatically generated by the Utilities/BuildDocs and Utilities/GenerateDocumentation.groovy scripts. If no corresponding ITK class exists, this field will not be modified.
- pixel_types: (string) Which of the pixel type lists should be supported for this filter. The type lists are defined in sitkPixelIDTypeLists.h
- members: (list) This list specifies all member variables that should be accessible to the user with a Get/Set mechanism and should be part of the Execute signature for the filter. Each entry in the list must be an object
- tests: (list) This list specifies all automatic tests that should be generated for the filter. Each entry in the list must be an object. If no tests are specified, a test will be generated that fails with the message that a test must be written for the filter
- [OPTIONAL] include_files: (list) This list of strings specifies additional header files to include in the cxx file for this filter.
- [OPTIONAL] custom_set_intput: (string) Code which is used to set input or multiple inputs to the filter. This overides the standard setting of the inputs.
- [OPTIONAL] output_pixel_type: (string) String representing the specific pixel type to use for the output image of the filter.
- [OPTIONAL] filter_type: (string) Explicitly sets the FilterType used. This method overides additional_template_types. Useful typedefs are InputImageType, and OutputImageType.
- [OPTIONAL] public_declarations: (string) Any c++ code written in this field will be placed into the public section of the filter's header file
- [OPTIONAL] additional_template_types: (list) The standard ITK image filter template signature is:
<InputImageType, (if 2 inputs)InputImageType, OutputImageType)>
Some filters require additional template types between the list of input image types and the output image type such as the input type of a constant. This list allows these additional parameters to be added so that the template signature looks like:
<InputImageType, (if 2 inputs)InputImageType, (ADDITIONAL TYPES), OutputImageType)>
Each type in the list is specified by an object with a only a type field which is a string specifying the type to be used.
- [OPTIONAL] custom_methods: (list) This is a list of objects specifying custom methods that should be added to the filter. The fields required for a custom method are:
- doc: (string) Documentation for this custom method
- name: (string) The name of the method
- return_type: (string) the return type of the method
- [OPTIONAL] parameters: (list) A list of of parameters for the method. Each method is specified by an object with the following fields:
- type: (string) The parameter's type
- var_name: (string) The name of the variable to be used in the body field for the custom method
- body: (string) This string is the body of the method and will be placed directly into the header file. The parameter names specified with var_name in each of the parameter obects can be used in this body
A sample custom method might look like:
{ "name" : "Foo",
"doc" : "This method checks if a string is equal to Foo"
"return_type" : "bool",
"parameters" : [
{ "type" : "std::string",
"var_name" : "inString"
}
],
"body" : "if (!strcmp(inString.c_str(), "Foo")) { return true; } else { return false; }"
}
This will translate to a custom method that looks like:
/**
* This method checks if a string is equal to Foo
*/
bool Foo( std::string inString )
{
if (!strcmp(inString.c_str(), "Foo")) { return true; } else { return false; }
}
Member Fields
A basic member object looks like:
{
"name" : "Sigma",
"type" : "double",
"default" : 1.0,
"briefdescriptionSet" : "",
"detaileddescriptionSet" : "Define which normalization factor will be used for the Gaussian\\see RecursiveGaussianImageFilter::SetNormalizeAcrossScale\n\n",
"briefdescriptionGet" : "",
"detaileddescriptionGet" : ""
}
- name: (string) The name of the member variable. A variable named "Var" will be accessible with the methods "GetVar" and "SetVar"
- type: (string) The c++ type for this member. If using a type contained in a certain namespace (itk::simple for example), this must be included in the type description. If the member variable is of type bool, the additional ${name}On, and ${name}Off member functions are added.
- default: (string or number) The default value for this member. This can be a number for numerical types or a string specifying the constructor for non-basic types (std::vector< unsigned int >() for example)
- briefdescriptionSet/briefdescriptionGet: (string) Brief Doxygen documentation for this individual parameter. The two forms (Set/Get) are used for the SetMember and GetMember functions. This field is automatically generated from ITK's Doxgen for members that mirror ITK's members. If the member if a custom, this field will not be modified.
- detaileddescriptionSet/detaileddescriptionGet: (string) Detailed Doxygen documentation for this individual parameter. The two forms (Set/Get) are used for the SetMember and GetMember functions. This field is automatically generated from ITK's Doxgen for members that mirror ITK's members. If the member if a custom, this field will not be modified.
- [OPTIONAL] no_set_method: (0 or 1) If set to 1, the filter will not have a Set method for this member
- [OPTIONAL] no_get_method: (0 or 1) If set to 1, the filter will not have a Get method for this member
- [OPTIONAL] no_print: (0 or 1) If set to 1, this member will not be printed in the ToString method
- [OPTIONAL] dim_vec: (0 or 1) If set to 1, this indicates that the member is a std::vector with size equal to the dimension of the input image. As such, it will be printed out correctly and cast to its corresponding ITK type correctly
- [OPTIONAL] set_as_scalar: (0 or 1) If parameter is a dim_vec, then this method adds an additional set member method to set the variable as a scalar so that all components are the same
- [OPTIONAL] enum: [ "enum1", "enum2", ... ] Creates a member type of the class with the array of strings with a type defined by the name of this parameter. This field makes the "type" parameter optional. It is recommended to add a test to ensure the SimpleITK values correspond to the ITK values.
- [OPTIONAL] custom_itk_cast: (string) Some non-basic types will require a custom cast before the corresponding ITK filter's member can be set. This field allows the developer to specify exactly how the ITK filter sets the member's value from the SimpleITK member's value for example:
"custom_itk_cast" :
"filter->SetObjectValue(static_cast<typename FilterType::PixelType>(this->GetObjectValue()) );"
Test Fields
A basic test object looks like:
{
"tag" : "float",
"description" : "Dilate a float image",
"inputA" : "Input/RA-Slice-Float.nrrd",
"tolerance" : 0.01,
"settings" : []
}
There are three ways of checking the resulting image: against a baseline image, a sha1 hash, or an md5 hash. At least one of these options must be used for each test.
- tag: (string) The tag to identify this specific test for the filter
- descriptoin: (string) Documentation to describe this specific test
- inputA: (string) The path from the SOURCE_DIR/Testing/Data directory for the (first) input image
- inputA_cast: (string) an sitkPixelIDEnum, after inputA is read the CastImageFilter is run, to covert the image type.
- [OPTIONAL] inputB: (string) If number_of_inputs is 2, this specifies the path from SOURCE_DIR/Testing/Data to the second input image
- [OPTIONAL] tolerance: (float) An error tolerance fo be used when comparing the resulting image to the baseline. This is used to specify that the result should be checked against a baseline image
- [OPTIONAL] md5hash: (string) An md5 hash value to compare the resulting image against.
- [OPTIONAL] sha1hash: (string) A sha1 hash value to compare the resulting image against.
- [OPTIONAL] settings: (list) A list of any specific parameters values for this test. Each entry is an object of the form:
{ "parameter" : "Sigma",
"value" : 1.0
}
- Settings Options:
- parameter: (string) The name of the parameter. This must match the name used when creating the filter
- value: (string or number) The value to assign to the parameter. This can be a number for numerical types or a string representing the constructor for more complex types
- [OPTIONAL] python_value: (string) For types that require a different syntax for setting the value in python, this will override the string in value
- [OPTIONAL] lua_value: (string) For types that require a different syntax for setting the value in lua, this will override the string in value
- [OPTIONAL] ruby_value: (string) For types that require a different syntax for setting the value in ruby, this will override the string in value
- [OPTIONAL] java_value: (string) For types that require a different syntax for setting the value in java, this will override the string in value
- [OPTIONAL] tcl_value: (string) For types that require a different syntax for setting the value in tcl, this will override the string in value
- [OPTIONAL] R_value: (string) For types that require a different syntax for setting the value in R, this will override the string in value
- [OPTIONAL] dim_vec: (0 or 1): Use this flag if this parameter is a std::vector. If set to 1, the type option must also be set
- [OPTIONAL] no_get_method: (0 or 1). Set to 1 when the filter does not have a get method, so that this method will not be tested.
- [OPTIONAL] type: (string): What type the vector should be. Due to constraints with java, this should only be a primitive type. For unsigned types, the java test will convert to the signed equivalent. An example for a dim_vec parameter is:
{ "parameter" : "Size",
"dim_vec" : 1,
"type" : "unsigned int"
"value" : "{1,2}",
"java_value" : "{1,2}",
"tcl_value" : "[list 1 2]",
"python_value" : "[1,2]",
"lua_value" : "{1,2}",
"ruby_value" : "[1,2]"
}
Directory Structure
The code generation system is designed to be agnostic of what subdirectory is being parsed. An example of this is BasicFilters. Here will just refer to $FILTER_DIR
There are four important subdirectores in $SimpleITK_SOURCE_DIR/Code/$FILTER_DIR:
- include: Manually written header files
- src: Manually written c++ files
- json: The input json files used to generate new filters at build time
- templates: The code templates that can be used to generate filters for this directory
When a filter is generated, it produces a .h and a .cxx file that are placed in $SimpleITK_BUILD_DIR/Code/$FILTER_DIR/include and $SimpleITK_BUILD_DIR/Code/$FILTER_DIR/src respectively.
It is also worth noting that the template files in the templates directory are comprised of a combination of c++ code, lua template expansion directives, and $(include xxx) statements. These include statements each pull in a section of template code from a file in $SimpleITK_SOURCE_DIR/ExpandTemplateGenerator/Components. These component files represent pieces of templates that are shared by multiple unique filter template types.
Specialized Templates
The standard template is ImageFilter. This section describes the differences for each of the other template types.
- Region Growing Image Filters: The region growing filters support an additional set of methods for manipulating the seed list. Each region growing filter has the SetSeed, AddSeed, and ClearSeeds methods. See sitkConnectedThresholdImageFilter.h for details.
- Kernel Image Filters: The kernel image filters use a KernelType and have an external enum which allows the user to select which kernel to use. See sitkErodeObjectMorphologyImageFilter.h for details.
- Dual Image Filter: The dual image filter template's usage should be avoided because it instantiates the combination of two pixel type lists.


Salmon cookie
home
sales
contact
this place will make your family life easier , you can find anything related to fishes here
avaliable items
buy
buy
buy
buy
buy
buy


Open Modal
×
GoGreen
Welcome to GoGreen, signup to our newsletter to receive upadtes and discount on our products
Enter Email
Sign Up
No, I'm not interested.


FAC Tracker
Username:
Password:
Submit
Your login information is not valid. Please check your username and password.


Jerky jowl pork chop tongue, kielbasa shank venison.  Capicola fatback venison shank kielbasa, drumstick ribeye landjaeger beef kevin tail meatball pastrami prosciutto pancetta. Tail kevin spare ribs ground round ham ham hock brisket shoulder. Corned beef tri-tip leberkas flank sausage ham hock filet mignon beef ribs pancetta turkey.
Bacon ipsum dolor sit amet landjaeger sausage brisket, jerky drumstick fatback boudin.
Bacon ipsum dolor sit amet landjaeger sausage brisket, jerky drumstick fatback boudin.
Jerky jowl pork chop tongue, kielbasa shank venison.  Capicola fatback venison shank kielbasa, drumstick ribeye landjaeger beef kevin tail meatball pastrami prosciutto pancetta. Tail kevin spare ribs ground round ham ham hock brisket shoulder. Corned beef tri-tip leberkas flank sausage ham hock filet mignon beef ribs pancetta turkey.
Jerky jowl pork chop tongue, kielbasa shank venison.  Capicola fatback venison shank kielbasa, drumstick ribeye landjaeger beef kevin tail meatball pastrami prosciutto pancetta. Tail kevin spare ribs ground round ham ham hock brisket shoulder. Corned beef tri-tip leberkas flank sausage ham hock filet mignon beef ribs pancetta turkey.
Bacon ipsum dolor sit amet landjaeger sausage brisket, jerky drumstick fatback boudin.
Bacon ipsum dolor sit amet landjaeger sausage brisket, jerky drumstick fatback boudin.
Jerky jowl pork chop tongue, kielbasa shank venison.  Capicola fatback venison shank kielbasa, drumstick ribeye landjaeger beef kevin tail meatball pastrami prosciutto pancetta. Tail kevin spare ribs ground round ham ham hock brisket shoulder. Corned beef tri-tip leberkas flank sausage ham hock filet mignon beef ribs pancetta turkey.


By submitting this form I agree to the KonfHub and Red Hat privacy policies.
On a scale of 1-5, with 5 being the best, please rate the tracks you attended. Select NA if you did not attend a track.
Please provide your input here
THANK YOU!


Giuliani Says Biden Documents to Be Released ‘If I Disappear’
by Ros Krasny(Bloomberg) -- Rudy Giuliani, a focus of the impeachment inquiry into President Donald Trump’s foreign policy dealings in Ukraine, suggested on Twitter that he has dirt on the Biden family that would be released were he to get into trouble.
Giuliani, Trump’s personal lawyer, also described as “sarcastic” a statement he made recently about having “an insurance policy” should he fall out of favor with the president.
That followed an interview with Fox News during which he was asked whether Trump might soon conclude that Giuliani is a liability, and throw him “under the bus.”
“This is ridiculous,” Giuliani, 75, said. “We are very good friends.
Without offering proof, Giuliani tweeted that he had “files in my safe about the Biden Family’s 4 decade monetizing” of the former vice president and senator’s office. “If I disappear, it will immediately appear.”
Giuliani’s tweet also referred to his “RICO chart.” Mentioning the Racketeer Influenced and Corrupt Organizations Act, the federal law aimed at prosecuting organized crime, may imply Giuliani still has information that’s not been released publicly from his days as a U.S. Attorney.
Also on Saturday Giuliani, a former federal prosecutor, said on Twitter that “the Mafia couldn’t kill me so NO, I am not worried about the swamp press.”
It was a busy day on social media for the former New York City mayor, who’s said to be under investigation for possible campaign finance violations and a failure to register as a foreign agent. He said, again without elaborating, that he “plans to bring out a massive pay-for-play scheme under the Obama administration that will devastate the Democrat Party.”
During two weeks of impeachment hearings Giuliani was mentioned multiple times by State Department officials testifying on whether Trump improperly withheld military aid to Ukraine. Two of Giuliani’s associates, Lev Parnas and Igor Fruman, were charged in October in a campaign finance scheme.
To contact the reporter on this story: Ros Krasny in Washington at<EMAIL_ADDRESS>To contact the editors responsible for this story: Matthew G. Miller at<EMAIL_ADDRESS>Ian Fisher, Virginia Van Natta
For more articles like this, please visit us at bloomberg.com
©2019 Bloomberg L.P.


Nomensa
The Profile Spend enables the entry of planned project costs for section of the proposed project. The profile spend should not be developed in isolation, but developed collaboratively with the project partners. Your profile spend has been developed from the information provided in the initial application and finalised with InnovateUK during your finance check.
Finance overview
| Summary | Amount |
|---|---|
| Total cost | 200,000 |
| Grant rate | 50% |
| Funding granted | 90,0000 |
Profile spend
This is the project cost taken form funding grant that has been approved by InnovateUK. Initially set as a flat profile spend, for review. This profile spend can edited to suit the project requirements and timeline
| Year 1 | Year 2 | Funding granted | Funding claimed | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Period | Q1 | Q2 | Q3 | Q4 | Total | Q1 | Q2 | Q3 | Q4 | Total | ||
| Total | 27,000 | 27,000 | 27,000 | 27,000 | 108,000 | 27,000 | 27,000 | 27,000 | 27,000 | 108,000 | 216,000 | 195,000 |
| Labour | 12,500 | 12,500 | 12,500 | 12,500 | 50,000 | 12,500 | 12,500 | 12,500 | 12,500 | 50,000 | 100,000 | 100,000 |
| Labour | 50,000 | 50,000 | 100,000 | 100,000 | ||||||||
| Admin support costs | 2,500 | 2,500 | 2,500 | 2,500 | 10,000 | 2,500 | 2,500 | 2,500 | 2,500 | 10,000 | 20,000 | 20,000 |
| Admin support costs | 10,000 | 10,000 | 20,000 | 20,000 | ||||||||
| Materials | 3,000 | 3,000 | 3,000 | 3,000 | 12,000 | 3,000 | 3,000 | 3,000 | 3,000 | 12,000 | 24,000 | 24,000 |
| Materials | 12,000 | 12,000 | 24,000 | 24,000 | ||||||||
| Capital usage | 3,000 | 3,000 | 3,000 | 3,000 | 12,000 | 3,000 | 3,000 | 3,000 | 3,000 | 12,000 | 24,000 | 24,000 |
| Capital usage | 12,000 | 12,000 | 24,000 | 24,000 | ||||||||
| Sub-contracting costs | 3,000 | 3,000 | 3,000 | 3,000 | 12,000 | 3,000 | 3,000 | 3,000 | 3,000 | 12,000 | 24,000 | 24,000 |
| Sub-contracting costs | 12,000 | 12,000 | 24,000 | 24,000 | ||||||||
| Other costs | 3,000 | 3,000 | 3,000 | 3,000 | 12,000 | 3,000 | 3,000 | 3,000 | 3,000 | 12,000 | 24,000 | 24,000 |
| Other costs | 12,000 | 12,000 | 24,000 | 24,000 |
When you are satisfied with the profile spend 'Submitting', will allow the project lead to review your project costs, ensuring partner costs align with their project plan before they are submitted to InnovateUK.
Depending on review by the lead or by InnovateUK the profile spend submitted may need to be modified. If you are requested to modify costs dased on review by InnovateUK you will also be supplied with feedback.


juicy jerry
home
recipes
about
contact
why get thinner when you can have more dinner
Spinach, ricotta, parmesan & lemon ravioli with butter, sage & garlic sauce
Chorizo carbonara
Pea, bacon and ricotta ravioli
Salmon and cream cheese on beetroot blinis
Butternut squash and ricotta filled tortellini on fresh basil pesto


Ex-Ashley Madison blah blah
Raja Bhatia's lawyer says that he merely "noticed" an "inadequacy" but did not exploit it.
Read more stories


"git init" is the first command for getting started with your very own repository. When you type in this command in your command line interface you will create a repository in the directory you are currently in when pressing enter.
To get started, type:git init
This will create a hidden file(.git) with all the basic information about your git repository will be stored. You are now ready to start adding files to your repository.


RxRestClient
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
- iOS 10.0+
- Swift 5.1+
- Xcode 11+
Migration Guides
Installation
CocoaPods
RxRestClient is available through CocoaPods. To install it, simply add the following line to your Podfile
:
pod 'RxRestClient'
Swift Package Manager
You can use The Swift Package Manager to install RxRestClient
by adding the proper description to your Package.swift
file:
import PackageDescription
let package = Package(
name: "YOUR_PROJECT_NAME",
targets: [],
dependencies: [
.package(url: "https://github.com/STDevTM/RxRestClient.git", from: "2.1.0")
]
)
Next, add RxRestClient
to your targets dependencies like so:
.target(
name: "YOUR_TARGET_NAME",
dependencies: [
"RxRestClient",
]
),
Then run swift package update
.
Features
- Simple way to do requests
- Simple way to have response state in reactive way
- Ability to customization
- Retry on any error
- Handle network reachability status
- Retry on become reachable
- Ability to use absolute and relative urls
- Swift Codable protocol support
- Use custom SessionManager
- Pagination support
- Complete Documentation
- more coming soon
How to use
First of all you need to create struct
of your response state and implement ResponseState
protocol.
struct RepositoriesState: ResponseState {
typealias Body = Data
var state: BaseState?
var data: [Repository]?
private init() {
state = nil
}
init(state: BaseState) {
self.state = state
}
init(response: (HTTPURLResponse, Data?)) {
if response.0.statusCode == 200, let body = response.1 {
self.data = try? JSONDecoder().decode(RepositoryResponse.self, from: body).items
}
}
static let empty = RepositoriesState()
}
It is required to mention expected Body type (String
or Data
).
After that you need to create request model:
struct RepositoryQuery: Encodable {
let q: String
}
Then you can do the request to get repositories:
import RxSwift
import RxRestClient
protocol RepositoriesServiceProtocol {
func get(query: RepositoryQuery) -> Observable<RepositoriesState>
}
final class RepositoriesService: RepositoriesServiceProtocol {
private let client = RxRestClient()
func get(query: RepositoryQuery) -> Observable<RepositoriesState> {
return client.get("https://api.github.com/search/repositories", query: query)
}
}
In order to customize client you can use RxRestClientOptions
:
var options = RxRestClientOptions.default
options.addHeader(key: "x-apikey", value: "<API_KEY>")
client = RxRestClient(baseUrl: <BASE _URL>), options: options)
Relative vs absolute url
In order to use relative url you need to give <BASE_URL>
when initializing client object.
let client = RxRestClient(baseURL: <BASE_URL>)
When calling any request you can provide either String
endpoint or absolute URL
. If you will String
it will be appended to baseURL
.
client.get("rest/contacts")
If baseURL
is nil
then it will try to convert provided String
to URL
.
In order to use absolute url even when your client has baseURL
you can provide URL
like this:
if let url = URL(string: "https://api.github.com/search/repositories") {
client.get(url: url, query: ["q": search])
}
Pagination
Pagination support is working only for GET
requests. In order to have pagination (or infinite scrolling) feature you need to implement following protocols for query and response models:
For query model you need to implement PagingQueryProtocol
:
struct RepositoryQuery: PagingQueryProtocol {
let q: String
var page: Int
init(q: String) {
self.q = q
self.page = 1
}
func nextPage() -> RepositoryQuery {
var new = self
new.page += 1
return new
}
}
For response model you need to implement PagingResponseProtocol
:
struct RepositoryResponse: PagingResponseProtocol {
let totalCount: Int
var repositories: [Repository]
private enum CodingKeys: String, CodingKey {
case totalCount = "total_count"
case repositories = "items"
}
// MARK: - PagingResponseProtocol
typealias Item = Repository
static var decoder: JSONDecoder {
return .init()
}
var canLoadMore: Bool {
return totalCount > items.count
}
var items: [Repository] {
get {
return repositories
}
set(newValue) {
repositories = newValue
}
}
}
For response states you need to use PagingState
class or custom subclass:
final class RepositoriesState: PagingState<RepositoryResponse> {
...
}
After having all necessary models you can do your request:
client.get("https://api.github.com/search/repositories", query: query, loadNextPageTrigger: loadNextPageTrigger)
loadNextPageTrigger
is an Observable
with Void
type in order to trigger client to do request for next page using new query model generated using nextPage()
function.
Author
Tigran Hambardzumyan<EMAIL_ADDRESS>Support
Feel free to open issues with any suggestions, bug reports, feature requests, questions.
Let us know!
We’d be really happy if you sent us links to your projects where you use our component. Just send an email to<EMAIL_ADDRESS>and do let us know if you have any questions or suggestion.
License
RxRestClient is available under the MIT license. See the LICENSE file for more info.


KM = None
KC = None
try:
import feather
feather
with_feather = True
except ImportError:
with_feather = False
@contextmanager
def sos_kernel():
Context manager for the global kernel instance
Should be used for most kernel tests
res = get_result(iopub)
self.assertEqual(res["a"], "$100")
if __name__ == "__main__":
unittest.main()


The syn_probe attribute inserts probe points for the testing and debugging of internal signals. The probed signals appear as ports at the top level of the design.
| Value | Description |
|---|---|
| 1 | Generates probe names according to the net name. |
| portName | Specifies the probe port name. If the signal is a bus slice, the port name is also the portName value. |
| portname[ ] | Specifies the probe port name assigned to portName and indexed to the net names. |
For detailed information about this attribute, use the Help button in the attribute wizard or the online help in the synthesis tool.
For other questions and issues, contact support at http://solvnet.synopsys.com.


Focus on building your Angular application, we've got your back(end). Get up and running in minutes, without writing server-side code or configuring databases. Just include & configure GoAngular, instantiate, initialize, and your Angular application is multi-user!
To use GoAngular, you must be a member of GoInstant. Get started for free! Sign Up
Help us make GoAngular exactly what you need by sending your feedback to<EMAIL_ADDRESS>Need help getting up and running? Join our mailing list or join us on IRC: freenode/#goinstant
Quickly add data-synchronization and collaboration features to your Angular app
A simple, powerful data model crafted for Angular and the real-time web
An open-source, full-tested, community driven integration


The pious Ishgardian clergy guide the flock, and the devout knights protect the weak. Yet even the holiest of men succumb to the darkest of temptations. None dare to administer justice to these sacrosanct elite residing outside the reach of the law. Who, then, defends the feeble from the transgressions of those meant to guide and protect them? A valiant few take up arms to defend the downtrodden, and not even the holy priests and knights can escape their judgment. Pariahs in their own land, they are known by many as “dark knights.” These sentinels bear no shields declaring their allegiance. Instead, their greatswords act as beacons to guide the meek through darkness.
Mechanics & Strategy
Ply.dialog({
"intro": {
ui: "confirm",
data: {
text: "You want to win?",
ok: "Yes",
cancel: "No"
},
next: "congratulations", // OK button
nextEffect: "3d-flip[180,-180]",
back: "exit", // Cancel button
backEffect: "scale"
},
"congratulations": {
data: {
children: [{
tag: "img",
src: "st/you-win.gif"
}],
ok: "Okay"
}
},
"exit": {
data: "Very vain!"
}
});
Ever has man coveted knowledge, and none more so than that of his fate. Thus did he labor to master the skill of foresight—but initial efforts bore little fruit. That is, until he looked to the stars above, which foretell the coming seasons, and learned to read the heavens. Though this gift is known today as astrology, the people of Sharalyan saw fit to not only read the stars, but to write their movements as well. By attuning their aetherial energies to that of constellations, they learned to wield magicks with heretofore unseen properties. Thus was astromancy born—a new form of magick which grants its users power over fate. Employing a star globe and divining deck in their miraculous deeds, fortune always smiles upon these masters of arcana.
Mechanics & Strategy
Ply.dialog("prompt", {
title: "Spam subscribe",
form: { email: "E-mail" }
});
The war with Dravania rages on, brutal and unrelenting. With no end in sight, the Holy See grows desperate. As her dragoons lay down their lives in defense of their home, Ishgard turns to technology to protect her sons and daughters. Great cannons and ballistae now line the city walls, plucking dragons from the sky. Following the example of Cid Garlond, who has demonstrated the potency of magitek, the Skysteel Manufactory works tirelessly on the development of advanced armaments. As new and devastating weapons are brought to the fray, a new class of champion arises to wield them―the machinist.
Mechanics & Strategy


WordRoom is an app for creating and managing personal dictionaries.
I'm John and I wrote this app. Feel free to contact me at<EMAIL_ADDRESS>My homepage is johnridesa.bike.
Like WordRoom? Want to make it better? Contribute to its repository!