Crystal Meth worth R5.6 million confiscated at roadblock
by Algoa FMA 27-year-old suspect is expected to appear in the Laingsburg Magistrates Court on Monday after 15 bags of crystal meth were found wrapped in recycling bags hidden in a compartment inside his vehicle.
Police spokesperson Captain FC van Wyk says the man, who was travelling from Johannesburg was pulled over during a roadblock on Saturday on the N1 near Laingsburg.
He says members stopped and searched his silver vehicle when they discovered the 15 sealed bags of tik.
The drugs weighed 16 kilograms and are estimated to be worth R5.6 million
van Wyk says it is believed that the drugs were destined for Cape Town.


"""Utility functions for geometrical entities.
Contains
========
intersection
convex_hull
closest_points
farthest_points
are_coplanar
are_similar
"""
from __future__ import division, print_function
from sympy import Function, Symbol, solve
from sympy.core.compatibility import (
is_sequence, range, string_types)
from .point import Point, Point2D
def _ordered_points(p):
"""Return the tuple of points sorted numerically according to args"""
return tuple(sorted(p, key=lambda x: x.args))
def idiff(eq, y, x, n=1):
"""Return ``dy/dx`` assuming that ``eq == 0``.
Parameters
==========
y : the dependent variable or a list of dependent variables (with y first)
x : the variable that the derivative is being taken with respect to
n : the order of the derivative (default is 1)
Examples
========
>>> from sympy.abc import x, y, a
>>> from sympy.geometry.util import idiff
>>> circ = x**2 + y**2 - 4
>>> idiff(circ, y, x)
-x/y
>>> idiff(circ, y, x, 2).simplify()
-(x**2 + y**2)/y**3
Here, ``a`` is assumed to be independent of ``x``:
>>> idiff(x + a + y, y, x)
-1
Now the x-dependence of ``a`` is made explicit by listing ``a`` after
``y`` in a list.
>>> idiff(x + a + y, [y, a], x)
-Derivative(a, x) - 1
See Also
========
sympy.core.function.Derivative: represents unevaluated derivatives
sympy.core.function.diff: explicitly differentiates wrt symbols
"""
if is_sequence(y):
dep = set(y)
y = y[0]
elif isinstance(y, Symbol):
dep = {y}
else:
raise ValueError("expecting x-dependent symbol(s) but got: %s" % y)
f = dict([(s, Function(
s.name)(x)) for s in eq.free_symbols if s != x and s in dep])
dydx = Function(y.name)(x).diff(x)
eq = eq.subs(f)
derivs = {}
for i in range(n):
yp = solve(eq.diff(x), dydx)[0].subs(derivs)
if i == n - 1:
return yp.subs([(v, k) for k, v in f.items()])
derivs[dydx] = yp
eq = dydx - yp
dydx = dydx.diff(x)
def _symbol(s, matching_symbol=None):
"""Return s if s is a Symbol, else return either a new Symbol (real=True)
with the same name s or the matching_symbol if s is a string and it matches
the name of the matching_symbol.
>>> from sympy import Symbol
>>> from sympy.geometry.util import _symbol
>>> x = Symbol('x')
>>> _symbol('y')
y
>>> _.is_real
True
>>> _symbol(x)
x
>>> _.is_real is None
True
>>> arb = Symbol('foo')
>>> _symbol('arb', arb) # arb's name is foo so foo will not be returned
arb
>>> _symbol('foo', arb) # now it will
foo
NB: the symbol here may not be the same as a symbol with the same
name defined elsewhere as a result of different assumptions.
See Also
========
sympy.core.symbol.Symbol
"""
if isinstance(s, string_types):
if matching_symbol and matching_symbol.name == s:
return matching_symbol
return Symbol(s, real=True)
elif isinstance(s, Symbol):
return s
else:
raise ValueError('symbol must be string for symbol name or Symbol')
def _uniquely_named_symbol(xname, *exprs):
"""Return a symbol which, when printed, will have a name unique
from any other already in the expressions given. The name is made
unique by prepending underscores.
"""
prefix = '%s'
x = prefix % xname
syms = set().union(*[e.free_symbols for e in exprs])
while any(x == str(s) for s in syms):
prefix = '_' + prefix
x = prefix % xname
return _symbol(x)
[docs]def intersection(*entities):
"""The intersection of a collection of GeometryEntity instances.
Parameters
==========
entities : sequence of GeometryEntity
Returns
=======
intersection : list of GeometryEntity
Raises
======
NotImplementedError
When unable to calculate intersection.
Notes
=====
The intersection of any geometrical entity with itself should return
a list with one item: the entity in question.
An intersection requires two or more entities. If only a single
entity is given then the function will return an empty list.
It is possible for `intersection` to miss intersections that one
knows exists because the required quantities were not fully
simplified internally.
Reals should be converted to Rationals, e.g. Rational(str(real_num))
or else failures due to floating point issues may result.
See Also
========
sympy.geometry.entity.GeometryEntity.intersection
Examples
========
>>> from sympy.geometry import Point, Line, Circle, intersection
>>> p1, p2, p3 = Point(0, 0), Point(1, 1), Point(-1, 5)
>>> l1, l2 = Line(p1, p2), Line(p3, p2)
>>> c = Circle(p2, 1)
>>> intersection(l1, p2)
[Point2D(1, 1)]
>>> intersection(l1, l2)
[Point2D(1, 1)]
>>> intersection(c, p2)
[]
>>> intersection(c, Point(1, 0))
[Point2D(1, 0)]
>>> intersection(c, l2)
[Point2D(-sqrt(5)/5 + 1, 2*sqrt(5)/5 + 1),
Point2D(sqrt(5)/5 + 1, -2*sqrt(5)/5 + 1)]
"""
from .entity import GeometryEntity
from .point import Point
if len(entities) <= 1:
return []
# entities may be an immutable tuple
entities = list(entities)
for i, e in enumerate(entities):
if not isinstance(e, GeometryEntity):
try:
entities[i] = Point(e)
except NotImplementedError:
raise ValueError('%s is not a GeometryEntity and cannot be made into Point' % str(e))
res = entities[0].intersection(entities[1])
for entity in entities[2:]:
newres = []
for x in res:
newres.extend(x.intersection(entity))
res = newres
return res
[docs]def convex_hull(*args, **kwargs):
"""The convex hull surrounding the Points contained in the list of entities.
Parameters
==========
args : a collection of Points, Segments and/or Polygons
Returns
=======
convex_hull : Polygon if ``polygon`` is True else as a tuple `(U, L)` where ``L`` and ``U`` are the lower and upper hulls, respectively.
Notes
=====
This can only be performed on a set of points whose coordinates can
be ordered on the number line.
References
==========
[1] http://en.wikipedia.org/wiki/Graham_scan
[2] Andrew's Monotone Chain Algorithm
(A.M. Andrew,
"Another Efficient Algorithm for Convex Hulls in Two Dimensions", 1979)
http://geomalgorithms.com/a10-_hull-1.html
See Also
========
sympy.geometry.point.Point, sympy.geometry.polygon.Polygon
Examples
========
>>> from sympy.geometry import Point, convex_hull
>>> points = [(1, 1), (1, 2), (3, 1), (-5, 2), (15, 4)]
>>> convex_hull(*points)
Polygon(Point2D(-5, 2), Point2D(1, 1), Point2D(3, 1), Point2D(15, 4))
>>> convex_hull(*points, **dict(polygon=False))
([Point2D(-5, 2), Point2D(15, 4)],
[Point2D(-5, 2), Point2D(1, 1), Point2D(3, 1), Point2D(15, 4)])
"""
from .entity import GeometryEntity
from .point import Point
from .line import Segment
from .polygon import Polygon
polygon = kwargs.get('polygon', True)
p = set()
for e in args:
if not isinstance(e, GeometryEntity):
try:
e = Point(e)
except NotImplementedError:
raise ValueError('%s is not a GeometryEntity and cannot be made into Point' % str(e))
if isinstance(e, Point):
p.add(e)
elif isinstance(e, Segment):
p.update(e.points)
elif isinstance(e, Polygon):
p.update(e.vertices)
else:
raise NotImplementedError(
'Convex hull for %s not implemented.' % type(e))
# make sure all our points are of the same dimension
if any(len(x) != 2 for x in p):
raise ValueError('Can only compute the convex hull in two dimensions')
p = list(p)
if len(p) == 1:
return p[0] if polygon else (p[0], None)
elif len(p) == 2:
s = Segment(p[0], p[1])
return s if polygon else (s, None)
def _orientation(p, q, r):
'''Return positive if p-q-r are clockwise, neg if ccw, zero if
collinear.'''
return (q.y - p.y)*(r.x - p.x) - (q.x - p.x)*(r.y - p.y)
# scan to find upper and lower convex hulls of a set of 2d points.
U = []
L = []
try:
p.sort(key=lambda x: x.args)
except TypeError:
raise ValueError("The points could not be sorted.")
for p_i in p:
while len(U) > 1 and _orientation(U[-2], U[-1], p_i) <= 0:
U.pop()
while len(L) > 1 and _orientation(L[-2], L[-1], p_i) >= 0:
L.pop()
U.append(p_i)
L.append(p_i)
U.reverse()
convexHull = tuple(L + U[1:-1])
if len(convexHull) == 2:
s = Segment(convexHull[0], convexHull[1])
return s if polygon else (s, None)
if polygon:
return Polygon(*convexHull)
else:
U.reverse()
return (U, L)
def closest_points(*args):
"""Return the subset of points from a set of points that were
the closest to each other in the 2D plane.
Parameters
==========
args : a collection of Points on 2D plane.
Notes
=====
This can only be performed on a set of points whose coordinates can
be ordered on the number line. If there are no ties then a single
pair of Points will be in the set.
References
==========
[1] http://www.cs.mcgill.ca/~cs251/ClosestPair/ClosestPairPS.html
[2] Sweep line algorithm
https://en.wikipedia.org/wiki/Sweep_line_algorithm
Examples
========
>>> from sympy.geometry import closest_points, Point2D, Triangle
>>> Triangle(sss=(3, 4, 5)).args
(Point2D(0, 0), Point2D(3, 0), Point2D(3, 4))
>>> closest_points(*_)
set([(Point2D(0, 0), Point2D(3, 0))])
"""
from collections import deque
from math import hypot, sqrt as _sqrt
from sympy.functions.elementary.miscellaneous import sqrt
p = [Point2D(i) for i in set(args)]
if len(p) < 2:
raise ValueError('At least 2 distinct points must be given.')
try:
p.sort(key=lambda x: x.args)
except TypeError:
raise ValueError("The points could not be sorted.")
if any(not i.is_Rational for j in p for i in j.args):
def hypot(x, y):
arg = x*x + y*y
if arg.is_Rational:
return _sqrt(arg)
return sqrt(arg)
rv = [(0, 1)]
best_dist = hypot(p[1].x - p[0].x, p[1].y - p[0].y)
i = 2
left = 0
box = deque([0, 1])
while i < len(p):
while left < i and p[i][0] - p[left][0] > best_dist:
box.popleft()
left += 1
for j in box:
d = hypot(p[i].x - p[j].x, p[i].y - p[j].y)
if d < best_dist:
rv = [(j, i)]
elif d == best_dist:
rv.append((j, i))
else:
continue
best_dist = d
box.append(i)
i += 1
return {tuple([p[i] for i in pair]) for pair in rv}
def farthest_points(*args):
"""Return the subset of points from a set of points that were
the furthest apart from each other in the 2D plane.
Parameters
==========
args : a collection of Points on 2D plane.
Notes
=====
This can only be performed on a set of points whose coordinates can
be ordered on the number line. If there are no ties then a single
pair of Points will be in the set.
References
==========
[1] http://code.activestate.com/recipes/117225-convex-hull-and-diameter-of-2d-point-sets/
[2] Rotating Callipers Technique
https://en.wikipedia.org/wiki/Rotating_calipers
Examples
========
>>> from sympy.geometry import farthest_points, Point2D, Triangle
>>> Triangle(sss=(3, 4, 5)).args
(Point2D(0, 0), Point2D(3, 0), Point2D(3, 4))
>>> farthest_points(*_)
set([(Point2D(0, 0), Point2D(3, 4))])
"""
from math import hypot, sqrt as _sqrt
def rotatingCalipers(Points):
U, L = convex_hull(*Points, **dict(polygon=False))
if L is None:
if isinstance(U, Point):
raise ValueError('At least two distinct points must be given.')
yield U.args
else:
i = 0
j = len(L) - 1
while i < len(U) - 1 or j > 0:
yield U[i], L[j]
# if all the way through one side of hull, advance the other side
if i == len(U) - 1:
j -= 1
elif j == 0:
i += 1
# still points left on both lists, compare slopes of next hull edges
# being careful to avoid divide-by-zero in slope calculation
elif (U[i+1].y - U[i].y) * (L[j].x - L[j-1].x) > \
(L[j].y - L[j-1].y) * (U[i+1].x - U[i].x):
i += 1
else:
j -= 1
p = [Point2D(i) for i in set(args)]
if any(not i.is_Rational for j in p for i in j.args):
def hypot(x, y):
arg = x*x + y*y
if arg.is_Rational:
return _sqrt(arg)
return sqrt(arg)
rv = []
diam = 0
for pair in rotatingCalipers(args):
h, q = _ordered_points(pair)
d = hypot(h.x - q.x, h.y - q.y)
if d > diam:
rv = [(h, q)]
elif d == diam:
rv.append((h, q))
else:
continue
diam = d
return set(rv)
def are_coplanar(*e):
""" Returns True if the given entities are coplanar otherwise False
Parameters
==========
e: entities to be checked for being coplanar
Returns
=======
Boolean
Examples
========
>>> from sympy import Point3D, Line3D
>>> from sympy.geometry.util import are_coplanar
>>> a = Line3D(Point3D(5, 0, 0), Point3D(1, -1, 1))
>>> b = Line3D(Point3D(0, -2, 0), Point3D(3, 1, 1))
>>> c = Line3D(Point3D(0, -1, 0), Point3D(5, -1, 9))
>>> are_coplanar(a, b, c)
False
"""
from sympy.geometry.line3d import LinearEntity3D
from sympy.geometry.point import Point3D
from sympy.geometry.plane import Plane
# XXX update tests for coverage
e = set(e)
# first work with a Plane if present
for i in list(e):
if isinstance(i, Plane):
e.remove(i)
return all(p.is_coplanar(i) for p in e)
if all(isinstance(i, Point3D) for i in e):
if len(e) < 3:
return False
# remove pts that are collinear with 2 pts
a, b = e.pop(), e.pop()
for i in list(e):
if Point3D.are_collinear(a, b, i):
e.remove(i)
if not e:
return False
else:
# define a plane
p = Plane(a, b, e.pop())
for i in e:
if i not in p:
return False
return True
else:
pt3d = []
for i in e:
if isinstance(i, Point3D):
pt3d.append(i)
elif isinstance(i, LinearEntity3D):
pt3d.extend(i.args)
elif isinstance(i, GeometryEntity): # XXX we should have a GeometryEntity3D class so we can tell the difference between 2D and 3D -- here we just want to deal with 2D objects; if new 3D objects are encountered that we didn't hanlde above, an error should be raised
# all 2D objects have some Point that defines them; so convert those points to 3D pts by making z=0
for p in i.args:
if isinstance(p, Point):
pt3d.append(Point3D(*(p.args + (0,))))
return are_coplanar(*pt3d)
[docs]def are_similar(e1, e2):
"""Are two geometrical entities similar.
Can one geometrical entity be uniformly scaled to the other?
Parameters
==========
e1 : GeometryEntity
e2 : GeometryEntity
Returns
=======
are_similar : boolean
Raises
======
GeometryError
When `e1` and `e2` cannot be compared.
Notes
=====
If the two objects are equal then they are similar.
See Also
========
sympy.geometry.entity.GeometryEntity.is_similar
Examples
========
>>> from sympy import Point, Circle, Triangle, are_similar
>>> c1, c2 = Circle(Point(0, 0), 4), Circle(Point(1, 4), 3)
>>> t1 = Triangle(Point(0, 0), Point(1, 0), Point(0, 1))
>>> t2 = Triangle(Point(0, 0), Point(2, 0), Point(0, 2))
>>> t3 = Triangle(Point(0, 0), Point(3, 0), Point(0, 1))
>>> are_similar(t1, t2)
True
>>> are_similar(t1, t3)
False
"""
from .exceptions import GeometryError
if e1 == e2:
return True
try:
return e1.is_similar(e2)
except AttributeError:
try:
return e2.is_similar(e1)
except AttributeError:
n1 = e1.__class__.__name__
n2 = e2.__class__.__name__
raise GeometryError(
"Cannot test similarity between %s and %s" % (n1, n2))
[docs]def centroid(*args):
"""Find the centroid (center of mass) of the collection containing only Points,
Segments or Polygons. The centroid is the weighted average of the individual centroid
where the weights are the lengths (of segments) or areas (of polygons).
Overlapping regions will add to the weight of that region.
If there are no objects (or a mixture of objects) then None is returned.
See Also
========
sympy.geometry.point.Point, sympy.geometry.line.Segment,
sympy.geometry.polygon.Polygon
Examples
========
>>> from sympy import Point, Segment, Polygon
>>> from sympy.geometry.util import centroid
>>> p = Polygon((0, 0), (10, 0), (10, 10))
>>> q = p.translate(0, 20)
>>> p.centroid, q.centroid
(Point2D(20/3, 10/3), Point2D(20/3, 70/3))
>>> centroid(p, q)
Point2D(20/3, 40/3)
>>> p, q = Segment((0, 0), (2, 0)), Segment((0, 0), (2, 2))
>>> centroid(p, q)
Point2D(1, -sqrt(2) + 2)
>>> centroid(Point(0, 0), Point(2, 0))
Point2D(1, 0)
Stacking 3 polygons on top of each other effectively triples the
weight of that polygon:
>>> p = Polygon((0, 0), (1, 0), (1, 1), (0, 1))
>>> q = Polygon((1, 0), (3, 0), (3, 1), (1, 1))
>>> centroid(p, q)
Point2D(3/2, 1/2)
>>> centroid(p, p, p, q) # centroid x-coord shifts left
Point2D(11/10, 1/2)
Stacking the squares vertically above and below p has the same
effect:
>>> centroid(p, p.translate(0, 1), p.translate(0, -1), q)
Point2D(11/10, 1/2)
"""
from sympy.geometry import Polygon, Segment, Point
if args:
if all(isinstance(g, Point) for g in args):
c = Point(0, 0)
for g in args:
c += g
den = len(args)
elif all(isinstance(g, Segment) for g in args):
c = Point(0, 0)
L = 0
for g in args:
l = g.length
c += g.midpoint*l
L += l
den = L
elif all(isinstance(g, Polygon) for g in args):
c = Point(0, 0)
A = 0
for g in args:
a = g.area
c += g.centroid*a
A += a
den = A
c /= den
return c.func(*[i.simplify() for i in c.args])


This series is going to be an introduction to writing and developing an authentication process with Phoenix and Elixir in a few parts:
- In part 1 we will cover the most basic necessities for a working authentication
- Part 2 will be cover extending this process with an email verification system
- Last but not least we will add two-factor authentication via Yubikeys
APIs provide you with resources you need or want in another part of an application, or in another application. In this case we want to provide resources through a REST API to our front-end application. When writing an interface like this, ever so often you happen to want to not give everyone access to everything. So let's protect it with a layer of authentication!
Packages and parts
Our users need to identify themselves via some kind of password/phrase, which at no point ever should be stored as cleartext. To that end, we're going to use a password hashing library: Comeonin with Argon2. For those who don't know, a password hashing library is different from a normal hashing library in that it is as slow as is sensible - depending on the system you're on.
On a testing environment however that is not necessary, so to our config/test.exs
file we can simply add:
config :argon2_elixir,
t_cost: 2,
m_cost: 12
With that we have our token storage covered. To make it a bit easier to read our data, I would suggest using BaseModel, which provides an ActiveRecord like access to your ecto schemas. It removes a lot of overhead when interacting with your data store.
JOSE, the package we're going to use for our access tokens is already included by default. So, the additions to our mix.exs
look like this so far:
{:argon2_elixir, "~> 1.2"},
{:comeonin, "~> 4.0"},
{:base_model, "~> 0.2"},
At some point in the future we may want to add other parts to our authentication system, like two-factor authentication or email confirmations, but we'll leave that for a later step and article.
What does the structure look like?
Part of any authentication are three different processes we're going to have to build:
- Registration for new users
- Login for existing users
- Verification for provided authentication tokens
We're definitely going to need to store some user information, and the way to interface to with said store is via a schema. But before we can access a store, we need to create it:
mix ecto.gen.migration create_users
I'm going to give the user a few more fields and features than just the bare-bones version, containing just an email and password field, but you can simplify or extend from that depending on your needs.
defmodule SealasSso.Repo.Migrations.CreateUsers do
use Ecto.Migration
def change do
create table(:users) do
add :email, :string
add :password, :string, null: true
add :password_hint, :string, null: true
add :active, :bool, default: false
add :activation_code, :string, size: 32, null: true
timestamps()
end
create unique_index(:users, [:email])
end
end
Let's go over these fields, to make sure we're all on the same page: For this case email
is the identification token and gets a unique_index
attached to it.
The password is just a normal text field, but will of course never store a cleartext password. It is allowed to have a null
value, because the registration in Sealas is set up as a two-step process. First you enter your email address, which you then verify and set your password. I will go into more detail about this in a later post.
This includes the reason for the active
and activation_code
fields. By default a user is deactivated and gets an activation code attached and sent out by email on creation. For simplicity's sake we'll skip this part for now, but keep the fields in as a reminder. I'll expand on this part in the next post.
With our migration set, we can go ahead and create a corresponding schema definition.
defmodule SealasSso.Accounts.User do
use BaseModel, repo: SealasSso.Repo
import Ecto.Changeset
alias SealasSso.Accounts.User
schema "users" do
field :email, :string
field :password, EctoHashedPassword
field :password_hint, :string
field :active, :boolean, default: false
field :activation_code, :string
timestamps()
end
end
At the top of the file we use BaseModel
and tell it the repo file we're using. The schema mirrors our migration file except for EctoHashedPassword
, which automatically transforms all input into its hashed form. I wrote another post explaining custom ecto types using another type as an example, so I will only add an abbreviated version here.
Custom password type
The base for our custom type will be a string, since we're going to save the hash as a string to the database. This makes the whole procedure very simple, as we're going to base our type on the string ecto type.
defmodule SealasSso.EctoHashedPasswordTest do
use SealasSso.DataCase
describe "casting custom ecto hashed password" do
test "type", do: assert EctoHashedPassword.type == :string
test "cast and verify" do
assert {:ok, hash} = EctoHashedPassword.cast("test_password")
assert EctoHashedPassword.checkpw("test_password", hash)
assert !EctoHashedPassword.checkpw("wrong_password", hash)
end
end
end
Since we inherit most functionality from ecto's native type, we can focus on testing what we would add: the cast function hashing our input and an interface to the verification function of the hash of our choice.
defmodule EctoHashedPassword do
@behaviour Ecto.Type
def type, do: :string
@doc """
Hash password with currenly used hashing algorithm
"""
def cast(password) when is_binary(password), do: {:ok, Comeonin.Argon2.hashpwsalt(password)}
def cast(_), do: :error
def load(password) when is_binary(password), do: {:ok, password}
def load(_), do: :error
def dump(password) when is_binary(password), do: {:ok, password}
def dump(_), do: :error
@doc """
Check password against hash with currently used hashing algorithm.
"""
@spec checkpw(String.t, String.t) :: boolean
def checkpw(password, hash), do: Comeonin.Argon2.checkpw(password, hash)
end
Since we use Argon2 we implement our type with that. If at any point we want to change the hashing function to something else, we have it consolidated in one place where we can then simply exchange it. Almost simply. To ensure not breaking anything, let's add a test verifying that even in case of a future hash change, our previously stored Argon2 hashes still get verified.
@argon2_hash "$argon2i$v=19$m=65536,t=6,p=1$79ljDB93b7A3W4LsbyoI2A$yiYBzrw1OaQiS86YESKTrwh8l9NnsUpbugddemKPv0w"
test "verify argon2 hash", do: assert EctoHashedPassword.checkpw("test_password", @argon2_hash)
Now that we have our migration, schema and type done, we can move on to the controller part.
Let's write some tests
to find out and define what we're going to expect our authentication to look and behave like.
defmodule SealasSso.AuthControllerTest do
use SealasSso.ConnCase
alias SealasSso.Repo
alias SealasSso.Accounts.User
@create_attrs %{email<EMAIL_ADDRESS>password: "some password", active: true}
@valid_login %{email<EMAIL_ADDRESS>password: "some password"}
@failed_login %{email<EMAIL_ADDRESS>password: "wrong password"}
def fixture(:user) do
{:ok, user} = %User{}
|> User.create_test_changeset(@create_attrs)
|> Repo.insert()
user
end
setup %{conn: conn} do
{:ok, conn: put_req_header(conn, "accept", "application/json")}
end
defp create_user(_) do
user = fixture(:user)
{:ok, user: user}
end
end
You'll notice that our passwords are very simple. The password's complexity-check happens on the frontend, in JavaScript. The frontend in its finished state will never actually send a cleartext password to the backend to perform any such test on it. This double hashing reduces the likelihood of a leak at any stage of the process.
With this we have set up some test data and setup functions for creating users to test our access with. Next we can go on and define our actual use cases.
What do we want a successful login to look like?
describe "login" do
setup [:create_user]
test "successful authentication as a user", %{conn: conn} do
conn = get conn, auth_path(conn, :index), @create_attrs
assert %{"auth" => auth_token} = json_response(conn, 201)
assert {:ok, token} = SealasSso.Router.decrypt_token(auth_token)
{:ok, token_creatd_at} = DateTime.from_unix(token.fields["created_at"])
assert DateTime.diff(DateTime.utc_now(), token_creatd_at) >= 0
conn = conn
|> recycle()
|> put_req_header("authorization", "bearer: " <> auth_token)
|> get(user_path(conn, :index))
assert json_response(conn, 200)
end
end
The most important part here is actually the first two lines of the test:
conn = get conn, auth_path(conn, :index), @valid_login
assert %{"auth" => auth_token} = json_response(conn, 201)
Accessing the auth_path
route should give us a 201 HTTP code response, which stands for "Resoure created", and give us back a token we can use to authenticate in further requests. Then we go on to validate the token with a separate function, and finally go on and try to access a protected route with it.
All that's missing is covering failure states; failed authentication because of bad credentials, and refused access for a protected route.
test "fail to authenticate with wrong password", %{conn: conn} do
conn = get conn, auth_path(conn, :index), @failed_login
assert json_response(conn, 401) == %{"error" => "auth fail"}
end
test "get 401 for protected route", %{conn: conn} do
conn = conn |> get(user_path(conn, :index))
assert json_response(conn, 401) == %{"error" => "auth fail"}
end
This covers our basic usage cases for a login, so:
Let's implement it!
Knowing what our authentication controller is supposed to do, this is pretty straight forward:
defmodule SealasSso.AuthController do
use SealasSso, :controller
alias SealasSso.Accounts.User
alias SealasSso.Repo
@spec index(Plug.Conn.t, %{email: String.t, password: String.t}) :: Plug.Conn.t
def index(conn, %{"email" => email, "password" => password}) do
user = User.first(email: email)
cond do
user && user.active && EctoHashedPassword.checkpw(password, user.password) ->
conn
|> put_status(:created) # http 201
|> render("auth.json", %{auth: generate_token(user)})
true ->
conn
|> put_status(:unauthorized) # http 401
|> render("error.json")
end
end
We only have two conditions here that will suffice our test cases: A successful login, and a catch-all unauthorized
error. If the user exists, is active and has a matching password we can go ahead and generate an authentication token.
The requirements for generating a token are documented in the JOSE docs. From that we can gather that we need to generate a key
We need at least two bits of information for a usable token: the time of creation, and which user we validated in the authentication process. Since the only external information is extracted from the user object, we can just pass that as an argument.
@spec generate_token(%User{}) :: String.t
defp generate_token(user) do
key = Application.get_env(:sealas_sso, SealasSso.Endpoint)[:token_key]
jwk = %{"kty" => "oct", "k" => :base64url.encode(key)}
jws = %{"alg" => "HS256"}
token_content = %{created_at: DateTime.to_unix(DateTime.utc_now()), id: user.id}
{%{alg: :jose_jws_alg_hmac}, token} = JOSE.JWS.compact JOSE.JWT.sign(jwk, jws, token_content)
token
end
Timing attacks?
A potential attacker will use any bit of information available; for example, the time it takes to resolve a request to a login or registration process can tell you whether a user has been found, whether the password check has been done, etc. since all of these take up a different amount of time.
The simplest solution to this problem is to delay all requests to your user/authentication system to an amount of time that is longer than any kind of request handling would take, but is still unnoticeable for the user. In this case I have set it to 200ms, which is more than enough time for any checks, yet is still fast enough for a response from an API.
Let's test for this in our authentication test suite:
@minimum_request_time 190_000
describe "sso timing" do
test "minimum request time", %{conn: conn} do
time = Time.utc_now()
get conn, auth_path(conn, :index), @failed_login
diff = Time.diff(Time.utc_now(), time, :microsecond)
assert diff >= @minimum_request_time
end
end
Now we any request to the authentication route needs to take at least amount of time in ms. This is not set to 200ms because I found that the way the test environment execution works would sometimes reduce this slightly below 200ms even if the proper wait time should be there. _request_time
In the router we can then add a plug to handle our needed time delay:
@minimum_request_time 200_000
pipeline :delayed_request do
plug :request_timer, @minimum_request_time
end
@spec request_timer(Plug.Conn.t, integer) :: Plug.Conn.t
def request_timer(conn, minimum_request_time \\ 200_000) do
time = Time.utc_now()
Conn.register_before_send(conn, fn conn ->
diff = Time.diff(Time.utc_now(), time, :microsecond)
if diff < minimum_request_time, do: :timer.sleep round((minimum_request_time - diff)/1000)
conn
end)
end
Plug.Conn.register_before_send
allows us to register a function that will execute before sending the result to the client. In our registered function we check for the time difference between when the function has been registered and before it is being executed and waits for the difference.
For this to work we plug in our plug into our desired routes.
scope "/", SealasSso do
pipe_through :delayed_request
pipe_through :api
get "/auth", AuthController, :index
end
That's it for now! Next time we'll tackle verification by email, so stay tuned.


\[ \newcommand{\epe}{\text{EPE}} \newcommand{\E}{\text{E}} \newcommand{\mse}{\text{MSE}} \newcommand{\tdata}{\mathcal{T}} \newcommand{\bias}{\text{Bias}} \newcommand{\var}{\text{Var}} \newcommand{\cov}{\text{Cov}} \newcommand{\rss}{\text{RSS}} \newcommand{\tr}{\text{tr}} \newcommand{\ridge}{\text{ridge}} \newcommand{\lasso}{\text{lasso}} \newcommand{\ls}{\text{ls}} \newcommand{\tr}{\text{tr}} \newcommand{\df}{\text{df}} \]
We discuss Least angle regression (LAR).
I should say that this part is completely new to me so I could miss out important aspect when taking the notes. And I’m sure that I may want to re-visit this topic whenever I need to.
Similar to forward stepwise regression, at each iteration, it tries to add one more variable into the active set and update the current fit including all active variables. But LAR uses different criteria to include a variable and the update rule is also different.
At first, LAR selects the variable that correlates most with the response. The fitting is not a complete fit but we carry of the coefficient of the selected variable such that the correlation between the residual and some other variables are the same as the selected one (we consider the absolute correlation). Then, we include that variable into the active set and repeat this procedure.
So, at each iteration, we make sure that the angle between the residual and all variables in the active set are the same. And such angle is descreasing as the procedure goes. The solution will converge to least squares (LS) solution when all variables are included into the active set. For completeness, I copy the algorithm of LAR below.
Let go into the details within the iteration. Suppose at step \(k\), we have active set \(A_k\) and we know the coefficient \(\beta_{A_k}\) before the update (so that there are \(k - 1\) non-zeros and one zero coefficient). We know that the the residual now is \(r_k = y - X_{A_k} \beta_{A_k}\).
First, we argue that the update direction should be \(\delta_k = (X_{A_k}'X_{A_k})^{-1} X_{A_k}' r_k\) which guaranttees that the update \(\beta_{A_k}(\alpha) = \beta_{A_k} + \alpha \cdot \delta_k\) satisfy the requirement that the correlations between \(r_k(\alpha)\) and \(X_{A_k}\) are the same for all variables. \[\begin{aligned} r_k(\alpha) &= r_k - \alpha X_{A_k} \delta_k \\ &= r_k - \alpha X_{A_k} (X_{A_k}'X_{A_k})^{-1} X_{A_k}' r_k \\ X_{A_k}' r_k(\alpha) &= X_{A_k}' r_k - \alpha X_{A_k}' r_k \\ &= (1 - \alpha) X_{A_k}' r_k \end{aligned}\] This results indicates that this update rule will shrink all correlations to residual by a factor of \(1 - \alpha\). So if they are the same before, they will be the same after the update.
Also, \(u_k = X_{A_k} \delta_k\) makes the smallest angle between all active predictors. And this is where “least angle” comes from.
And the \(\alpha\) should be determined by making sure that the maximum correlation of the updated residual and other varible matches what we have in the active set.
At each iteration, a new variable got picked up and we add \(\alpha \delta\) to the current coefficients. In the below we show how the residual correlations change as we go along the iterations (from left to right). Note that we can determine the value of \(\alpha\) at each iteration. To see this, we can use the relation as below. \[\begin{aligned} X_0' r_k(\alpha) &= X_0' r_k - \alpha X_0' X_{A_k} \delta_k \end{aligned}\] , where \(X_0\) are the variables outside active set. A naive thing could do is to go through each of the variable (see the \(p\)th) in \(X_0\) and calculate the \(\alpha\) such that \(R_{0, k}^p - \alpha (X_0^p)' u_k = (1 - \alpha) R_k\), where \(R\) represents the correlation.
Note that the lasso coefficient profile is quite similar to the LAR one. And they differ when one coefficient passes through zero. And this leads to a modification of LAR algorithm to solve lasso path. The LAR algorithm is very efficient (same order of computation as least squares for \(p\) predictors). And it always takes \(p\) steps to reach LS solution. This algorithm above is efficient to solve lasso problem as any kind especially when \(p >> N\).
Next, we want to talk a bit about why LAR path is similar to lasso path. First, let’s consider LAR at some iteration. \[x_j' (y - X\beta) = \gamma \cdot s_j~, \forall j \in A\] , where \(s_j = \{1, -1\}\) representing the sign of the correlation. And by construction \[|x_k' (y - X\beta)| \le \gamma ~,\forall k \notin A\]
OK, then consider the lasso problem which minimizes \[\frac{1}{2} \|y - X\beta\|_2^2 + \lambda \|\beta\|_1\]. Let \(B\) be the active set in this case. If the variable is differentiable (non-zero), then the stationary condition is (all active variable should satisfy this) \[x_j' (y - X\beta) = \lambda \cdot \text{sign}(\beta_j),~\forall j \in B\].
So, we can see that as long as \(s_j\) matches \(\text{sign}(\beta_j)\), the LAR matches the stationary condition of lasso. Note that \(s_j\) won’t change the sign in LAR (its magnitude will go down at each iteration). And when this variable \(j\) got initially picked up \(\beta_j\) should be consistent with \(s_j\). So that when \(\beta_j\) hits zero and changes the sign, it starts to violate the matched sign requirement. And that’s why we need to modify LAR algorithm to handle this situation.
At the end, the performance of forward stepwise, LAR, lasso, and stagewise. Here we compare the performance along the fitting profile. We can see that stepwise improves quickly but it gets overfit afterwards quickly as well and its best performance is not that great. Other approaches fits more slowly but they achieve better solution.
For a least squares problem with \(k\) independent predictors, we can say that the degree of freedom is \(k\). But if we fit a bset subset selection with \(k\) predictors, the degree of freedom is, in principle, greater than \(k\).
Here we have a more general definition of effective degree of freedom for the adaptively fitted model. We define the following. \[\begin{aligned} \df(\hat{y}) &= \frac{1}{\sigma^2} \sum_{i = 1}^N \cov(\hat{y}_i, y_i) \end{aligned}\] , where the \(\cov\) is the sampling covariance between the predicted and true outcome. For least squares and ridge regression where we have solution \(\hat{y} = H_\lambda y\), we can easily have the dof in closed form: \(\df(\hat{y}) = \tr(H_\lambda)\). The reason is that \[\cov(y_i, \hat{y}_i) = \cov(y_i, H_{i\cdot}y_i) = H_{ii} \var(y_i)\].
For the best subset selection, we need to estimate dof by simulation and no closed form could be used. But for LAR and lasso, it turns out that, after the \(k\)th step of LAR procedure, the effective degrees of freedom is exactly \(k\). For the lasso (modified LAR procedure), at any stage, the dof is approximately equal to the number of predictors. And the approximation works best at the last model in the sequence that contains \(k\) predictors.


Up: Language Binding
Next: Fortran Bindings for Point-to-Point Communication
Previous: C bindings for Environmental Inquiry
int MPI_Pcontrol(const int level, ...)
Up: Language Binding
Next: Fortran Bindings for Point-to-Point Communication
Previous: C bindings for Environmental Inquiry
Return to MPI 1.1 Standard Index
Return to MPI-2 Standard Index
Return to MPI Forum Home Page
MPI-1.1 of June 12, 1995
HTML Generated on August 6, 1997


{% extends "main.html" %} {% block body %}
Here you will find the results for the W3C SPARQL 1.1 compliance test when using the Java or Javascript Sage client.
The testing software is available on Github.
| W3C SPARQL 1.1 Test | Executable with Sage? | |
|---|---|---|
| Java client | Javascript client | |
| aggregates/agg01 | Yes | Yes |
| aggregates/agg02 | Yes | Yes |
| aggregates/agg03 | Yes | Yes |
| aggregates/agg04 | Yes | Yes |
| aggregates/agg05 | Yes | Yes |
| aggregates/agg06 | Yes | Yes |
| aggregates/agg07 | Yes | Yes |
| aggregates/agg08b | Yes | Yes |
| aggregates/agg-groupconcat-1 | Yes | Yes |
| aggregates/agg-groupconcat-2 | Yes | Yes |
| aggregates/agg-groupconcat-3 | Yes | Yes |
| aggregates/agg-avg-01 | Yes | Yes |
| aggregates/agg-avg-02 | No | No |
| aggregates/agg-min-01 | Yes | Yes |
| aggregates/agg-min-02 | No | No |
| aggregates/agg-max-01 | Yes | Yes |
| aggregates/agg-max-02 | Yes | Yes |
| aggregates/agg-sum-01 | Yes | Yes |
| aggregates/agg-sum-02 | No | No |
| aggregates/agg-sample-01 | Yes | Yes |
| aggregates/agg-err-01 | Yes | Yes |
| aggregates/agg-err-02 | No | No |
| aggregates/agg-empty-group | No | No |
| bindings/values01 | Yes | Yes |
| bindings/values02 | Yes | Yes |
| bindings/values03 | Yes | Yes |
| bindings/values04 | Yes | Yes |
| bindings/values05 | Yes | Yes |
| bindings/values06 | Yes | Yes |
| bindings/values07 | Yes | Yes |
| bindings/values08 | Yes | Yes |
| bindings/inline01 | Yes | Yes |
| bindings/inline02 | Yes | Yes |
| bind/bind01 | Yes | Yes |
| bind/bind02 | Yes | Yes |
| bind/bind03 | Yes | Yes |
| bind/bind04 | Yes | Yes |
| bind/bind05 | Yes | Yes |
| bind/bind06 | Yes | Yes |
| bind/bind07 | Yes | Yes |
| bind/bind08 | Yes | Yes |
| bind/bind10 | Yes | Yes |
| bind/bind11 | Yes | Yes |
| entailment/rdf02 | Yes | Yes |
| entailment/rdf03 | Yes | Yes |
| entailment/rdf04 | Yes | Yes |
| entailment/rdfs08 | Yes | Yes |
| entailment/rdfs11 | No | No |
| entailment/rdfs12 | Yes | Yes |
| entailment/rdfs13 | No | No |
| entailment/plainLit | Yes | Yes |
| entailment/paper-sparqldl-Q5 | No | No |
| entailment/bind01 | No | No |
| entailment/bind02 | No | No |
| entailment/bind03 | No | No |
| entailment/bind04 | No | No |
| entailment/bind05 | No | No |
| entailment/bind06 | No | No |
| entailment/bind07 | No | No |
| entailment/bind08 | No | No |
| entailment/sparqldl-01 | Yes | Yes |
| entailment/sparqldl-04 | Yes | Yes |
| entailment/sparqldl-05 | Yes | Yes |
| entailment/sparqldl-06 | Yes | Yes |
| entailment/sparqldl-07 | Yes | Yes |
| entailment/sparqldl-08 | Yes | Yes |
| entailment/sparqldl-09 | Yes | Yes |
| entailment/sparqldl-12 | Yes | Yes |
| entailment/lang | Yes | Yes |
| entailment/parent2 | Yes | Yes |
| exists/exists01 | No | No |
| exists/exists02 | Yes | Yes |
| exists/exists03 | No | No |
| exists/exists04 | Yes | Yes |
| exists/exists05 | No | No |
| functions/strdt01 | Yes | Yes |
| functions/strdt02 | Yes | Yes |
| functions/strdt03 | No | No |
| functions/strlang01 | Yes | Yes |
| functions/strlang02 | Yes | Yes |
| functions/strlang03 | No | No |
| functions/isnumeric01 | Yes | Yes |
| functions/abs01 | Yes | Yes |
| functions/ceil01 | Yes | Yes |
| functions/floor01 | Yes | Yes |
| functions/round01 | Yes | Yes |
| functions/concat01 | Yes | Yes |
| functions/concat02 | Yes | Yes |
| functions/substring01 | Yes | Yes |
| functions/substring02 | Yes | Yes |
| functions/length01 | Yes | Yes |
| functions/ucase01 | Yes | Yes |
| functions/lcase01 | Yes | Yes |
| functions/encode01 | Yes | Yes |
| functions/contains01 | Yes | Yes |
| functions/starts01 | Yes | Yes |
| functions/ends01 | Yes | Yes |
| functions/plus-1 | No | No |
| functions/plus-2 | No | No |
| functions/md5-01 | Yes | Yes |
| functions/md5-02 | Yes | Yes |
| functions/sha1-01 | Yes | Yes |
| functions/sha1-02 | Yes | Yes |
| functions/sha256-01 | Yes | Yes |
| functions/sha256-02 | Yes | Yes |
| functions/sha512-01 | Yes | Yes |
| functions/sha512-02 | Yes | Yes |
| functions/hours-01 | No | No |
| functions/minutes-01 | No | No |
| functions/seconds-01 | No | No |
| functions/year-01 | Yes | Yes |
| functions/month-01 | No | No |
| functions/day-01 | No | No |
| functions/timezone-01 | Yes | Yes |
| functions/tz-01 | Yes | Yes |
| functions/bnode01 | No | No |
| functions/in01 | Yes | Yes |
| functions/in02 | Yes | Yes |
| functions/notin01 | Yes | Yes |
| functions/notin02 | Yes | Yes |
| functions/now01 | Yes | Yes |
| functions/rand01 | Yes | Yes |
| functions/bnode02 | Yes | Yes |
| functions/iri01 | Yes | Yes |
| functions/if01 | Yes | Yes |
| functions/if02 | Yes | Yes |
| functions/coalesce01 | Yes | Yes |
| functions/strbefore01 | Yes | Yes |
| functions/strbefore01 | Yes | Yes |
| functions/strbefore02 | Yes | Yes |
| functions/strafter01 | Yes | Yes |
| functions/strafter01 | Yes | Yes |
| functions/strafter02 | Yes | Yes |
| functions/replace01 | Yes | Yes |
| functions/replace02 | Yes | Yes |
| functions/replace03 | Yes | Yes |
| functions/uuid01 | No | No |
| functions/struuid01 | No | No |
| grouping/group01 | Yes | Yes |
| grouping/group02 | Yes | Yes |
| grouping/group03 | Yes | Yes |
| grouping/group04 | Yes | Yes |
| grouping/group05 | Yes | Yes |
| negation/subsetByExcl01 | Yes | Yes |
| negation/subsetByExcl02 | Yes | Yes |
| negation/temporalProximity01 | Yes | Yes |
| negation/subset-01 | Yes | Yes |
| negation/subset-02 | Yes | Yes |
| negation/set-equals-1 | Yes | Yes |
| negation/subset-03 | Yes | Yes |
| negation/exists-01 | Yes | Yes |
| negation/exists-02 | No | No |
| negation/full-minuend | Yes | Yes |
| negation/part-minuend | Yes | Yes |
| project-expression/projexp01 | Yes | Yes |
| project-expression/projexp02 | Yes | Yes |
| project-expression/projexp03 | Yes | Yes |
| project-expression/projexp04 | Yes | Yes |
| project-expression/projexp05 | Yes | Yes |
| project-expression/projexp06 | Yes | Yes |
| project-expression/projexp07 | Yes | Yes |
| property-path/pp01 | Yes | No |
| property-path/pp02 | Yes | No |
| property-path/pp03 | Yes | No |
| property-path/pp06 | No | No |
| property-path/pp06 | No | No |
| property-path/pp08 | Yes | No |
| property-path/pp09 | Yes | No |
| property-path/pp10 | Yes | No |
| property-path/pp11 | Yes | No |
| property-path/pp12 | Yes | No |
| property-path/pp14 | Yes | No |
| property-path/pp14 | Yes | No |
| property-path/path-2-2 | Yes | No |
| property-path/path-2-2 | Yes | No |
| property-path/path-2-2 | Yes | No |
| property-path/path-p2 | Yes | No |
| property-path/path-p3 | Yes | No |
| property-path/path-p4 | Yes | No |
| property-path/path-ng-01 | No | No |
| property-path/path-ng-02 | No | No |
| property-path/pp36 | Yes | No |
| property-path/pp37 | Yes | No |
| service/service01 | Yes | Yes |
| service/service02 | Yes | Yes |
| service/service03 | Yes | Yes |
| service/service04a | Yes | Yes |
| service/service05 | Yes | Yes |
| service/service06 | Yes | Yes |
| service/service07 | Yes | Yes |
| subquery/sq11 | Yes | Yes |
| subquery/sq12 | No | No |
| subquery/sq11 | Yes | Yes |
| subquery/sq14 | No | No |
| construct/constructwhere01 | Yes | Yes |
| construct/constructwhere02 | Yes | Yes |
| construct/constructwhere03 | Yes | Yes |
| construct/constructwhere04 | Yes | Yes |
| csv-tsv-res/csvtsv01 | Yes | No |
| csv-tsv-res/csvtsv02 | Yes | No |
| csv-tsv-res/csvtsv01 | Yes | No |
| csv-tsv-res/csvtsv01 | Yes | No |
| csv-tsv-res/csvtsv02 | Yes | No |
| csv-tsv-res/csvtsv01 | Yes | No |
| json-res/jsonres01 | Yes | No |
| json-res/jsonres02 | Yes | No |
| json-res/jsonres03 | Yes | No |
| json-res/jsonres04 | Yes | No |
| subquery/sq01 | No | No |
| subquery/sq02 | No | No |
| subquery/sq03 | No | No |
| subquery/sq04 | No | No |
| subquery/sq05 | No | No |
| subquery/sq06 | No | No |
| subquery/sq07 | Yes | Yes |
| subquery/sq08 | No | No |
| subquery/sq09 | No | No |
| subquery/sq10 | No | No |
| subquery/sq13 | Yes | Yes |
| subquery/sq14 | Yes | Yes |


This F0ME faucet is to distributing f0me to users and to promoting F0ME on twitter. Anyone having a Twitter account may request funds within the permitted limit (1 f0me /day).
Side notes:
Your Twitter account will be automatically tested for being a genuine account on: Online bot test . The account must pass all test with less than 75% bot score.
We will stricten the twitter account bot score if we found more bots are using the faucet. If you are new user, you need to add friend adn tweet for a while to pass the bot test
Donations to the faucet are welcome: FUZRMukYiAxxDEpgtDgi9mJJ77MWkyqpZz
The faucet is running invisible reCaptcha protection against bots.


public class AllocationService extends AbstractComponent
AllocationService
keeps AllocationDeciders
to choose nodes
for shard allocation. This class also manages new nodes joining the cluster
and rerouting of shards.| 限定符和类型 | 类和说明 |
|---|---|
static class |
AllocationService.CommandsResult
this class is used to describe results of applying a set of
AllocationCommand |
deprecationLogger, logger, settings
| 构造器和说明 |
|---|
AllocationService(Settings settings,
AllocationDeciders allocationDeciders,
GatewayAllocator gatewayAllocator,
ShardsAllocator shardsAllocator,
ClusterInfoService clusterInfoService) |
AllocationService(Settings settings,
AllocationDeciders allocationDeciders,
ShardsAllocator shardsAllocator,
ClusterInfoService clusterInfoService) |
| 限定符和类型 | 方法和说明 |
|---|---|
ClusterState |
applyFailedShard(ClusterState clusterState,
ShardRouting failedShard) |
ClusterState |
applyFailedShards(ClusterState clusterState,
java.util.List<FailedShard> failedShards) |
ClusterState |
applyFailedShards(ClusterState clusterState,
java.util.List<FailedShard> failedShards,
java.util.List<StaleShard> staleShards)
Applies the failed shards.
|
ClusterState |
applyStartedShards(ClusterState clusterState,
java.util.List<ShardRouting> startedShards)
Applies the started shards.
|
protected ClusterState |
buildResultAndLogHealthChange(ClusterState oldState,
RoutingAllocation allocation,
java.lang.String reason) |
protected long |
currentNanoTime()
override this to control time based decisions during allocation
|
ClusterState |
deassociateDeadNodes(ClusterState clusterState,
boolean reroute,
java.lang.String reason)
unassigned an shards that are associated with nodes that are no longer part of the cluster, potentially promoting replicas
if needed.
|
AllocationService.CommandsResult |
reroute(ClusterState clusterState,
AllocationCommands commands,
boolean explain,
boolean retryFailed) |
ClusterState |
reroute(ClusterState clusterState,
java.lang.String reason)
Reroutes the routing table based on the live nodes.
|
protected ClusterState |
reroute(ClusterState clusterState,
java.lang.String reason,
boolean debug)
Reroutes the routing table based on the live nodes.
|
void |
setGatewayAllocator(GatewayAllocator gatewayAllocator) |
logDeprecatedSetting, logRemovedSetting, nodeName
public AllocationService(Settings settings, AllocationDeciders allocationDeciders, GatewayAllocator gatewayAllocator, ShardsAllocator shardsAllocator, ClusterInfoService clusterInfoService)
public AllocationService(Settings settings, AllocationDeciders allocationDeciders, ShardsAllocator shardsAllocator, ClusterInfoService clusterInfoService)
public void setGatewayAllocator(GatewayAllocator gatewayAllocator)
public ClusterState applyStartedShards(ClusterState clusterState, java.util.List<ShardRouting> startedShards)
If the same instance of the ClusterState
is returned, then no change has been made.
protected ClusterState buildResultAndLogHealthChange(ClusterState oldState, RoutingAllocation allocation, java.lang.String reason)
public ClusterState applyFailedShard(ClusterState clusterState, ShardRouting failedShard)
public ClusterState applyFailedShards(ClusterState clusterState, java.util.List<FailedShard> failedShards)
public ClusterState applyFailedShards(ClusterState clusterState, java.util.List<FailedShard> failedShards, java.util.List<StaleShard> staleShards)
If the same instance of ClusterState is returned, then no change has been made.
public ClusterState deassociateDeadNodes(ClusterState clusterState, boolean reroute, java.lang.String reason)
public AllocationService.CommandsResult reroute(ClusterState clusterState, AllocationCommands commands, boolean explain, boolean retryFailed)
public ClusterState reroute(ClusterState clusterState, java.lang.String reason)
If the same instance of ClusterState is returned, then no change has been made.
protected ClusterState reroute(ClusterState clusterState, java.lang.String reason, boolean debug)
If the same instance of ClusterState is returned, then no change has been made.
protected long currentNanoTime()


ASSIGNMENT 2
CLICK TO TOGGLE DOM MANIPULATION
CLICK TO TOGGLE ANIMATION
oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo
Enter something in the text box:
Enter a number between 0 and 10, exclusive:
Modify the color:
Select a file:


The examples below assume your InfluxDB host, organization, and token are provided by the active influx CLI configuration. If you do not have a CLI configuration set up, use the appropriate flags to provide these required credentials.
influx


Name: {{profile.name}}
Bio: {{profile.bio}}
Lookin' Goods: 0
Lookin' Goods: {{profile.lookinGood}}
Viewed: 0
Viewed: {{profile.viewed}}


ChromeVox uses the Tabs extension API in order to get information about all of the open tabs and windows. It uses this API, for example, to announce when the user has switched between tabs, or to broadcast state information from a background script to each of the content scripts.


[gecode-users] different nr of solutions with and without GIST
Tias Guns
tias.guns at cs.kuleuven.be
Fri Jan 9 16:07:29 CET 2009
Hey,
I did indeed used a custom propagator. I refactored it and now the problem
doesn't occur anymore... I guess the fault was totaly mine, sorry for the
overhead...
g,T
On Wed, 07 Jan 2009 15:00:00 +0100, Christian Schulte <cschulte at kth.se>
wrote:
> Hi Tias,
>
> what constraints are used (in particular anything you implemented
> yourself)?
> Does it happen if you switch off recomputation (passing -c-d 1 on the
> command line or setting c_d in the search options to 1)?
>
> Could you run it against 2.2.0?
>
> Otherwise, we would need your code to have a look.
>
> Cheers
> Christian
>
> --
> Christian Schulte, www.ict.kth.se/~cschulte/
>
>
> -----Original Message-----
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On
> Behalf
> Of Tias Guns
> Sent: Wednesday, January 07, 2009 2:45 PM
> To: users at gecode.org
> Subject: [gecode-users] different nr of solutions with and without GIST
>
> Hello,
>
> I am running my code against the latest SVN version (r8036) and have the
> following bizar problem:
> I am looking for all solutions that adhere to a set of constraints. The
> search happens over one array of boolean decision variables, and all the
> constraints are put on different subsets of this array.
>
> For a certain input datadaset, running the model returns 500 results. If
> I
> run the same model using GIST (-mode gist), it returns 508 results !
> After
> manual verification, there are 508 results that satisfy all the
> constraints. The 8 results that are missing form a complete branch in the
> GIST search tree.
>
> I can't create a small example to reproduce it, but it happens everytime
> on my model for that dataset... Do you have any idea how this is
> possible ?
>
>
> Greetings,
> Tias
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
More information about the gecode-users
mailing list


fashion walkthroughs
Skip
FASHION
Fashion is architecture:
it is a matter of proportions.
CONNECT WITH FACEBOOK
LOGIN
SIGN UP


Calculator
Instructions
Instructions
×
Add first number clicking on
Click operator
Add second number clicking on
Click '=' to see the result
Press 'C' to reset the values


Toggle navigation
HACKCOVID 19
Home
Startups
Vaccination
Checkout
Contact
Login
Find Vaccine
Check your nearest vaccination center and slots availability
Search By Pin:
Search
Search By District
Name
Pin code
Date
18+
45+


My Team
Renée
Manager
ID: 1
Email:
<EMAIL_ADDRESS>Office Number: 529
Renée
Engineer
ID: 1
Email:
<EMAIL_ADDRESS>GitHub: starfish123
Renée
Engineer
ID: 1
Email:
<EMAIL_ADDRESS>GitHub: starfish123
Renée
Intern
ID: 1
Email:
<EMAIL_ADDRESS>School: MSU


The Morning After: Instagram will test hiding 'Like' counts in the US next week
Will social media still be the same?
by Richard LawlerHey, good morning! You look fabulous.
Welcome to your weekend! The Engadget Podcast is diving into the streaming wars ahead of Disney+ opening its doors next week, and we've got a review of the Beats Solo Pro headphones. Also, there's a big change coming to Instagram, and we'll look at some highlight stories from the past week like the Mustang Lithium EV and Microsoft's new Office app for iOS and Android.
One big problem.
Billy Steele calls these "Beats most impressive set of headphones to date." With excellent sound, an improved design, hands-free Siri support and solid active noise cancellation, what could go wrong? Unfortunately, getting the tight seal needed was uncomfortable enough that he could only use them for about a half-hour at a time.
How much is too much?
The Engadget Podcast: The streaming wars have begun
This week on the Engadget Podcast, Devindra and Cherlynn explore why Apple, Disney and HBO are launching their own streaming services and what it all means for consumers. Are they actually worth subscribing to? Is there simply too much to watch?
Row your own gears in an EV.
This electric Mustang packs a manual transmission
Ford has partnered with Webasto on a Mustang Lithium project car (no, it's not the Mustang-like SUV) for SEMA 2019 that mates a monstrous 900-plus horsepower electric motor with a six-speed, drag-race-ready Getrag transmission.
Like the Porsche Taycan, the Mustang Lithium has an 800-volt battery system that delivers more performance (up to a megawatt of electrical discharge) even as it reduces weight and heat. You can fine-tune the output on a 10.4-inch touchscreen, too, choosing between torque settings that range from a modest "valet" through to "beast."
The only likes you can count are the ones on your own posts.
Instagram's push to hide 'Like' counts comes to the US next week
In a move that Instagram claims it's making to improve how users feel, it has been testing taking away the ability to see how many likes posts by other people have gotten. After rolling out the change in several countries around the world, Instagram head Adam Mosseri announced that next week, it is going to test the change in the US.
'I was a bag of bones. I looked like walking death, and I knew it.'
Johnny Cash's powerful voice narrates his life in YouTube's 'The Gift'
Whether it's 2005's Walk The Line or, most recently, Ken Burns' Country Music, it's not hard to find a detailed account of the career of the Man in Black. What many of them don't offer though is Cash's own perspective on his life -- both the highs and the lows. With Emmy-winning director Thom Zimny's new documentary, we get just that.
The Gift: The Journey of Johnny Cash debuts for free on YouTube on Monday, November 11th at 12PM ET. YouTube Premium subscribers will get access to bonus footage, which includes discussions of how "Walk The Line" came to be, prison shows and more.
You can try it out on Android right now.
Microsoft's new Office app for mobile combines Word, Excel and Powerpoint
Instead of grabbing separate apps for Word, Excel and Powerpoint (aka the Office Triforce), Microsoft's new Office app puts them all together. The Office app also makes better use of your phone's talents, with the ability to take a photo of a document and turn it into an editable Word file on the fly or even do the same with printed-out tables in Excel. It's available for public testing on Android, while an iOS test group is already full.
But wait, there's more...
- 'Westworld' season three teaser brings us to Big Tech and Silicon Valley
- The Apple Watch Series 4 is on sale for an all-time low
- Engadget's guide to health and fitness tech: The best workout headphones
- Microsoft archived 'Superman' on its Project Silica glass storage medium
- 'Death Stranding' is a great movie — but that doesn't make it a good game
- AirPods Pro review: Apple's latest earbuds can hang with the best
- Surface Pro X review: Gorgeous hardware marred by buggy software
- Xiaomi unveils its 108-megapixel smartphone
- Teenager solves car blind spots using a webcam and projector
The Morning After is a new daily newsletter from Engadget designed to help you fight off FOMO. Who knows what you'll miss if you don't Subscribe.
Craving even more? Like us on Facebook or Follow us on Twitter.
Have a suggestion on how we can improve The Morning After? Send us a note.


-Please write down what do you want your team members know -For example, do you need some special equipments?


- rampDown() - Method in class be.kuleuven.distrinet.scalar.core.Plugin
-
This method is called when Scalar enters the ramp down phase of a load test.
- rampUp() - Method in class be.kuleuven.distrinet.scalar.core.Plugin
-
This method is called when Scalar enters the ramp up phase of a load test.
- random() - Method in class be.kuleuven.distrinet.scalar.core.User
-
The random generator for this user.
- receive() - Method in class be.kuleuven.distrinet.scalar.plugin.SocketUserHelperPlugin
-
- receiveTimestamp - Variable in class be.kuleuven.distrinet.scalar.plugin.NtpMessage
-
This is the time at which the request arrived at the server, in seconds
since 00:00 1-Jan-1900.
- referenceIdentifier - Variable in class be.kuleuven.distrinet.scalar.plugin.NtpMessage
-
This is a 4-byte array identifying the particular reference source.
- referenceIdentifierToString(byte[], short, byte) - Static method in class be.kuleuven.distrinet.scalar.plugin.NtpMessage
-
Returns a string representation of a reference identifier according
to the rules set out in RFC 2030.
- referenceTimestamp - Variable in class be.kuleuven.distrinet.scalar.plugin.NtpMessage
-
This is the time at which the local clock was last set or corrected, in
seconds since 00:00 1-Jan-1900.
- RemoteSocketRequest - Class in be.kuleuven.distrinet.scalar.requests
-
- RemoteSocketRequest(SocketUser, boolean) - Constructor for class be.kuleuven.distrinet.scalar.requests.RemoteSocketRequest
-
- RemoteTestRequest - Class in be.kuleuven.distrinet.scalar.requests
-
- RemoteTestRequest(User) - Constructor for class be.kuleuven.distrinet.scalar.requests.RemoteTestRequest
-
- RemoteTestUser - Class in be.kuleuven.distrinet.scalar.users
-
- remove(String) - Method in class be.kuleuven.distrinet.scalar.reporting.Report
-
- replace(String, Object) - Method in class be.kuleuven.distrinet.scalar.data.DataProvider
-
Replaces the value stored under key in the chain of DataProvider instances
with the new value.
- report() - Method in class be.kuleuven.distrinet.scalar.core.housekeeping.ClusterWatcher
-
- Report - Class in be.kuleuven.distrinet.scalar.reporting
-
- Report(String) - Constructor for class be.kuleuven.distrinet.scalar.reporting.Report
-
- Request - Class in be.kuleuven.distrinet.scalar.requests
-
A Request encapsulates the interaction between a
User
and the system under test.
- Request(User, boolean) - Constructor for class be.kuleuven.distrinet.scalar.requests.Request
-
Construct a new request object created by the specified
User
usr.
- Request(User, boolean, String) - Constructor for class be.kuleuven.distrinet.scalar.requests.Request
-
Construct a new request object created by the specified
User
usr.
- request() - Method in class be.kuleuven.distrinet.scalar.testing.TimingTester
-
- requestCount() - Method in class be.kuleuven.distrinet.scalar.users.TestUser
-
- RequestData - Class in be.kuleuven.distrinet.scalar.requests
-
- RequestData(String) - Constructor for class be.kuleuven.distrinet.scalar.requests.RequestData
-
- RequestException - Exception in be.kuleuven.distrinet.scalar.exceptions
-
- RequestException(String) - Constructor for exception be.kuleuven.distrinet.scalar.exceptions.RequestException
-
- RequestException(Exception) - Constructor for exception be.kuleuven.distrinet.scalar.exceptions.RequestException
-
- RequestReporter - Class in be.kuleuven.distrinet.scalar.plugin
-
- RequestReporter() - Constructor for class be.kuleuven.distrinet.scalar.plugin.RequestReporter
-
- RequestResult - Enum in be.kuleuven.distrinet.scalar.requests
-
- requests() - Method in class be.kuleuven.distrinet.scalar.core.User
-
Returns all requests that have been created by this user object and that are kept
into account.
- requestTypes() - Method in class be.kuleuven.distrinet.scalar.experiment.Results
-
- requestTypes() - Method in class be.kuleuven.distrinet.scalar.experiment.Run
-
- reset() - Method in class be.kuleuven.distrinet.scalar.core.UserSpawner
-
- reset() - Method in class be.kuleuven.distrinet.scalar.data.TestingDataProviderConnector
-
- resetOffset() - Method in class be.kuleuven.distrinet.scalar.core.Clock
-
Resets the offset of the clock to zero.
- resetPool() - Method in class be.kuleuven.distrinet.scalar.core.UserPool
-
- resetThreadPoolSize(int) - Method in class be.kuleuven.distrinet.scalar.core.UserPool
-
- residenceTime() - Method in class be.kuleuven.distrinet.scalar.requests.RequestData
-
Returns the duration of this request, i.e., the time (in milliseconds) elapsed between calling
#startTimer()
and #stopTimer()
.
- result() - Method in class be.kuleuven.distrinet.scalar.requests.RequestData
-
The result of this request.
- Results - Class in be.kuleuven.distrinet.scalar.experiment
-
- Results(UUID, int, int, int, ArrayList<Request>, double) - Constructor for class be.kuleuven.distrinet.scalar.experiment.Results
-
- results() - Method in class be.kuleuven.distrinet.scalar.experiment.Run
-
- retainCachedRequests(double) - Method in class be.kuleuven.distrinet.scalar.experiment.Results
-
- rootDelay - Variable in class be.kuleuven.distrinet.scalar.plugin.NtpMessage
-
This value indicates the total roundtrip delay to the primary reference
source, in seconds.
- rootDispersion - Variable in class be.kuleuven.distrinet.scalar.plugin.NtpMessage
-
This value indicates the nominal error relative to the primary reference
source, in seconds.
- run() - Method in class be.kuleuven.distrinet.scalar.core.Housekeeper
-
- run() - Method in class be.kuleuven.distrinet.scalar.core.User
-
- Run - Class in be.kuleuven.distrinet.scalar.experiment
-
- Run(int, int, int, boolean) - Constructor for class be.kuleuven.distrinet.scalar.experiment.Run
-
- Run(int, int, double, boolean) - Constructor for class be.kuleuven.distrinet.scalar.experiment.Run
-
- run() - Method in class be.kuleuven.distrinet.scalar.util.Poller
-
- run() - Method in class be.kuleuven.distrinet.scalar.util.Watchdog
-
- RunComparator - Class in be.kuleuven.distrinet.scalar.experiment
-
- RunComparator() - Constructor for class be.kuleuven.distrinet.scalar.experiment.RunComparator
-


This list will be updated in %refresh% minute(s)!
[npc_%objectId%_FishingReward|Claim Prize]
Fishing King Rankings
List of Prize Items
| Ranking |
Reward Item |
Quantity |
| 1st |
%prizeItem% |
%prizeFirst% |
| 2nd |
%prizeItem% |
%prizeTwo% |
| 3rd |
%prizeItem% |
%prizeThree% |
| 4th |
%prizeItem% |
%prizeFour% |
| 5th |
%prizeItem% |
%prizeFive% |
The Fishing King Championship Tournament is currently underway! In case you haven't heard, the tournament is an event funded by members of the Fishing Guild to promote the sport of fishing. Anyone who catches a big fish during the competition will be awarded prizes.
After the event is over, those of you who appear on the winners list can claim your prize money from a Fishing Guild member. Remember, you must claim your prize no later than *one week after the event ends*!


Enumeration members
CHOPPER_GUNNER
CHOPPER_GUNNER: = "chopper_gunner"
CLUSTER_STRIKE
CLUSTER_STRIKE: = "toma_strike"
CRUISE_MISSILE
CRUISE_MISSILE: = "cruise_predator"
GUNSHIP
GUNSHIP: = "gunship"
JUGGERNAUT
JUGGERNAUT: = "juggernaut"
PRECISION_AIRSTRIKE
PRECISION_AIRSTRIKE: = "precision_airstrike"
SENTRY_GUN
SENTRY_GUN: = "sentry_gun"
SHIELD_TURRET
SHIELD_TURRET: = "manual_turret"
SUPPORT_HELO
SUPPORT_HELO: = "chopper_support"
WHEELSON
WHEELSON: = "pac_sentry"
WHITE_PHOSPHORUS
WHITE_PHOSPHORUS: = "white_phosphorus"


Hi, I'm Ilya
Web developer based in Prague. Alumnus of Omsk State University and College of Polytechnics Jihlava.
Seeking to work hard for things that are pushing further and to be surrounded by those who ready to share experience and knowledge
In love with challenges, music and running
Technologies
JavaScript
ReactJS
NodeJs
Webpack
Kotlin
Java
Apollo Server
GraphQL
GIT
Languages
Russian (Native Speaker)
English (B2)
Czech (B2)
Education
Network and Telecommunications, Ing. (OmGTU, Omsk, Russia)
Applied Informatics, Bc. (VSPJ, Jihlava, Czech Republic)
Experience
2012 - 2016, AstanaMusicStudio (Astana, Kazakhstan), IT Technician
2017 (Jan) - 2017 (Oct), Central Spot Trading (Prague, Czech Republic), IT Administrator
2017 (Oct) - 2020 (March), Trusteca SE (Prague, Czech Republic), JavaScript Developer (ReactJS)
My Story
"Only time between defeat and a new start matters"
Hey, my name is Ilya Fakhrutdinov. I grew up in Kazakhstan, but in 2015 I've decided to change my life. And in 2016, I took all my savings, bought a one-way flight ticket to Prague.
In February, 2016, I've started to learn Czech language with one goal on my mind, spend only five months to learn new language.
It was a big challenge. But I did it.
Next couple of months after language school, I spent deciding my next step. My first degree in networks field, so I decided to enhance my knowledge, but from a different side, from a software side. I choose to get a degree in applied informatics, in College of Polytechnics in Jihlava, Czech Republic. My thesis was a creation mobile application for hearing test for Android platform, and again it was a challenge for me, because I programmed it in new language for me, Kotlin.
I graduated in 2019
During my study, I found my first job as a Web Developer and it become my passion. I really like to be involved in interesting projects, where I can use and learn new technologies.
I'm a team player, passion about my work. Always learning.
Besides of developing, I like to read, play on the guitar and run.


|
The Virtual Geophysics Laboratory (VGL) is a scientific workflow portal that provides Geophysicists with access to an integrated environment that exploits eResearch tools and Cloud computing technology. It provides in one place -
|
|
Copyright
© This VGL website and its Content are protected by copyright law. Copyright in this material resides with AuScope or various other data and service providers as indicated. VGL accesses Content from many different sources. All reasonable efforts have been made to ensure that we properly acknowledge/attribute the source of the Content and obtained the necessary permissions. If however you believe that we have not properly accessed your Content please do not hesitate to contact<EMAIL_ADDRESS>and we will address your concerns. Many of the trademarks or logos displayed on the VGL website such as the AuScope or CSIRO logo or name are the registered trademarks of the corresponding organisations. The trademarks of third parties are also displayed on this website. All these trademarks cannot be used without the express written permission of AuScope or the relevant third party. |
|||||||
|
ACKNOWLEDGEMENTS
VGL is a collaboration between
AuScope, CSIRO, Geoscience Australia (GA), and the National Computational Infrastructure (NCI).
|
|||||||


Arbok
Arbok is a poisonous type Pokémon from the first generation of Pokémon. Evolves from
ekance
at level 22.


Web Designer
Front End Developer
Innovative Performace
Responsive Designs
User Experience Driven
Find Out MoreHi there! My name is Scott Beglin, I am a web designer & front-end developer from Sacramento, CA. I’ve been fortunate to spend my career crossed between the two worlds of Creative and Tech. The beauty of those two worlds colliding, was discovering my passion and love for designing code. I am available for freelancing opportunities and consultation. Feel free to use the contact form below for more information.
Ready to start your project? I would love to hear from you. Please use the contact form below or email me at<EMAIL_ADDRESS>and let's connect!


Scrawl.js
- demonstration 113
Timelines and Actions
Extensions: phrase, animation, color, block
Run
Halt
Resume
Duration:
0.5 seconds
2 seconds
4 seconds
Remove column 3
Add column 3
Seek to:
0
ms
Scenario:
text
Actions:
Known browser issues:
text
Result images:


Check your answers
Paper prescriptions
| Are you sending any paper prescriptions? | No | Change this |
FP57 forms
| Are you sending any FP57 forms? | No | Change this |
Other activities
Did you carry out any of the following:
| Appliance use reviews | No | Change this |
| Medicine use reviews | No | Change this |
| New medicine services | No | Change this |
Declaration
By submitting this I agree to the Terms of service
I certify that I am entitle to claim payment in accordance with the relevant provisions of my Terms of Service contained in the NHS (Pharmaceutical Services) Regulations 2013 and the Drug Tariff and that the information I have given on this form is correct and complete.
I consent to the disclosure of information from this form to and by the NHS Prescription Services and the NHS Protect for the purpose of verification of this claim and the investigation, prevention, detection and prosecution of fraud or other unlawful activity against for affecting the NHS.


Our furniture use the finest wood which is sourced locally. This will increase the longevity of your purchase.
We make sure you recieve your furniture as soon as we have finished making it. We also provide free returns if you are not satisfied.
For every purchase you make, we will ensure there are no damages or faults and we will check and test the pitch of your instrument.


Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Enim lobortis scelerisque fermentum dui faucibus in ornare quam viverra. Eget nunc lobortis mattis aliquam faucibus purus in.
Get Started!Experience top class, exotic apartments. We strive for your comfort
Worried about cost? You have the option to share apartment with people
With simple sign up,you can work with us. We guarantee the occupation of your building within 24 hours.
We are hiring agents! You can earn as much as ₦100,000
Ready to rent your own apartment with us? Give us a call or send us an email and we will get back to you as soon as possible!


July 14
I would not have you to be ignorant, brethren, concerning them which are asleep, that ye sorrow not, even as others which have no hope. For if we believe that Jesus died and rose again.... 1 Thessalonians 4:13
Many of us, even though we're believers, have seen grief and sorrow as such a natural part of life that we haven't even questioned them. In fact, if we're honest, we'd have to admit there are times when we actually want to feel sad and sorry for ourselves.
Why would we choose to feel sorrow? Because sorrow has an emotional kick to it. It offers a surge of feeling that, in the beginning stages, is almost intoxicating.
But grief and sorrow are dangerous things. Several years ago God showed me that they're not the innocent emotions we've thought they were. The force behind these emotions are actually spirit beings sent by the devil himself to kill, steal and destroy.
They are a part of the devastating, satanic barrage Jesus took on Himself when He died on the Cross (Is. 53). He bore grief and sorrow, so we wouldn't have to. If they come knocking on your door, remember, they are not innocent emotions. They are deadly enemies that Jesus already carried away at Calvary.
  You know that Jesus Christ died for you and rose again. That not only gives you hope where physical death is concerned, it gives you hope in every situation. Sorrow not! Scripture Reading: Isaiah 51:11-16


Freshers' fairs have been the best opportunity to get a brand in front of students. We're helping businesses across Oxford show students their great quality products and services in order to generate a new wave of loyal customers.
We’re not only providing the framework of a freshers fair for a fraction of the usual cost but you can also leverage our technology to ensure you maximise the impact of your gifts! We ensure that any students claiming a freebie will post an Instagram story giving you great authentic brand awareness (our users have 800+ followers on average).
We recently partnered with That Oxford Girl so you'll also get exposure to an Oxford following of 31.5k+ by being a part of our freshers fair.
Followers across all Nano-Influencers
Stories posted by Nano-Influencers
COVID-19 has had a large impact on the promotions we can provide but we are working hard to provide people with unique opportunities to benefit from their social media. Click the button below to checkout our range of exclusive lockdown discounts:
We've also helped set up and run helpyourhighstreet.org, which is a voluntary initiative to help community shops fight back with a cash boost!
Fill in the form below and let us know what you'd like to giveaway
Pay a small fee of £50 to feature on the platform for the first month of term
We'll send frequent reports updating you on the exposure gained from your freebies


Measure Authoring Tool
Request Your User ID
Enter the E-Mail address associated with your MAT account:
Email Address
Submit
Cancel


jQuery.fn.search
Search DOM elements by text
WAT! (that's what all the cool kids say)
Google make search easy and fast. That gets me to the web page of interest, but now I have to scan the whole page to find what I was really looking for.
What would be really great is if I could find what I was looking for
quickly use a in-page search (not unlike what cmd+f
provides).
But not just text, I want to find relevant images, sections of text, documents
or whatever.
I talking about metadata. Metadata exists as text nodes, attribute data, URLs and microdata. This plugin allows for taking advantage of common sources of metadata.
Get Started
Dependencies
Download
No Official Release Yet!
These are links to the master branch builds.Right-click and save-as
- Development Version (0.1) - 7.3K
- Production Version (0.1) - 1.4K minified, gzipped
Universal Module Definition (UMD)
This plugin supports the UMD. It can load in the CommonJS/Node environment, via AMD in the browser or as a traditional script.
API
Method Signatures
$.fn.search([options])
- An options object may be passed as the first argument to customize the search behavior.$.fn.search(pattern)
- To perform a search, a string or regexp can be passed. A regexp is used under the hood, so for more control over the search, pass in a regexp as the second parameter.
// Default $('p').search(); // Hide non-matched sections and filter by their h2 $('section').search({ effect: 'hide', filterOn: 'h2' });
Options
filter
- The filter mechnaism to use when finding matches. See more belowfilterOn
- An optional selector that will be used to filter on (it will be used within the context of the matched set of elements). See more beloweffect
- The effect to use on the matched elements or unmatched elements. See more below
// Default $('p').search(); // Hide non-matched sections and filter by their h2 $('section').search({ effect: 'hide', filterOn: 'h2' });
Filters
A filter is simply a function used by
jQuery's $(..).filter()
method to reduce the set of matched elements. The one minor
difference is that the pattern
is passed in as the
first argument to the filter function.
The filter
option can take a string (built-in) or
a function (custom).
The filterOn
option can be defined with a selector
to apply the filters to these elements, but have the effects applied
the original set. Use the search on this page to see this in effect.
Each documented section is filter based on the inner text, but the
whole section is hidden if there is no match.
Built-in Filters
text
- performs a literal pattern match with all inner text (using$(..).text()
).
// Already the default $('p').search({ filter: 'text' }); // Use a custom function for images.. there is no inner text to // search, so we rely on attribute metadata $('img').search({ filter: function(pattern, regexp, index) { // get the contents of the data-search attribute on the element var keywords = $(this).data('search'); // case insensitive match on the search keywords return keywords && keywords.search(regexp) >= 0; } });
Effects
After filtering occurs, there are two sets of elements: hits and misses. To visually make this result useful, effects can be applied to either set to differentiate itself from the other. This could be highlighting the hits or greying out the misses.
An effect is an object with two functions on
and
off
that takes pattern
, hits
,
misses
, and options
as arguments. The
options
object is the original object passed in during
initialization.
The effect
option can take a string (built-in),
an object (custom), or an array of either.
Built-in Effects
fade
- Reduces the opacity of themisses
relative to thefadeOpacity
option. This is a default effect with and opacity of 0.3.hide
- Instantly hides themisses
highlight
- Wraps any text matched by thepattern
with aspan
element and class secified by thehighlightClass
option.


DNN Enterprise is for organizations with a sophisticated IT infrastructure and multiple content contributors that deploy DNN in critical web applications. The Microsoft SharePoint Connector enables organizations to leverage the power of the SharePoint Enterprise Content Management (ECM) solution and the flexibility of the DNN Web Content Management System (CMS). Organizations can securely, cost effectively publish documents stored in their SharePoint document repository to a public web site, extranet or intranet powered by DNN. The connector ensures that only the current version of documents is exposed, ensuring adherence to governance rules and best business practices.
The SharePoint Connector module enables SuperUsers and Administrators to synchronize files between a SharePoint site and a DNN site. Files that are maintained on SharePoint are the 'master' files that are then 'pushed' to your DNN site.
The SharePoint Connector module is located on both the Host > Advanced Settings > SharePoint Connector page and the Admin > Advanced Settings > SharePoint Connector pages and can also be added to site pages.
Features:
The SharePoint Connector


This protocol is designed as a walk-through tour of popular functional enrichment analysis tools and describes the use of three functional enrichment tools:
This tour can be used with a set of example data, including a dataset originally from TCGA, and a published dataset from Voineagu et al., 2011.
For the TCGA data, it was processed as follows:
Finally, the Voineagu et al. data was downloaded from Expression Atlas and contains data for all genes measured with the following comma-separated columns:
This input is used for ORA and GSEA analysis in the
The Enrichr tool offers an easy-to-use interface for basic Over-Representation Analysis (ORA) for a large number of gene set libraries.
Before starting analysis, you can browse the available gene sets under
Enrichr includes over 200 gene set libraries, including Gene Ontology terms, pathways, disease-associated sets, cell type markers etc.
You can also search for gene sets either by the term name under
Analysis is started by simply copying the list of genes from an input text file into the input box on the right of the
Note that this corresponds to the example data file containing up-regulated genes.
The results are displayed as a grid of libraries for each functional category (at the top), the image below shows the results in the
Clicking on one of the squares will show the detailed results for that library:
Looking at the results for a specific library in detail, the gene sets are sorted by p-value ranking by default. Clicking on any of the bars representing gene sets re-sorts the bar graph by the different score.
To download an image of the bar chart, click either of the
In addition to the default bar chart, results are also available as a table under
At the bottom of the table there is a link to
WebGestalt offers more advanced analysis options for a smaller number of gene set libraries. Using WebGestalt, it is possible to run either Over-Representation Analysis (ORA), Gene Set Enrichment Analysis (GSEA) or Network Topology-based Analysis (TNA).
WebGestalt data sources are listed under
To start analysis, the
The input data is defined in the
Clicking
The top of the results page includes a job summary and a link to download the full results.
Results are displayed as a bar chart by default. Right-clicking on the bar chart lets you download in either
Clicking on the bars updates the pathway-specific display at the bottom of the page.
The results specific to a gene set (pathway in this case) include the scoring statistics calculated for the enrichment, including the enrichment score, a sortable table and the enrichment plot.
The enrichment plot is described in detail here. Briefly, the plot in the upper half represents the running enrichment score (ES), as the analysis walks down the ranked list of genes (bottom section), starting at the most highly ranked gene. When a gene in the pathway is in the ranked list, the score goes up, and when it’s not it goes down. The corresponding overlap between the ranked list and the gene set is indicated by a line in the middle section. The top score in the enrichment map plot is the score reported for the particular gene set.
For WikiPathways results, the link in the upper left is clickable and will open a pathway view with the overlapping/leading edge genes highlighted.
In addition to the bar chart, the main results overview can also be visualized as a table or volcano plot by clicking the
The volcano plot has options for customized downloads available, as well as pan/zoom controls.
Interactive Enrichment Analysis is a user-friendly interactive tool to perform enrichment analysis for multiple datasets across multiple public databases. This tool can run both Over-Representation Analysis(ORA) and Gene Set Enrichment Analysis (GSEA).
A set of public database collections is provided in the drop-down in the
Once a database collection is selected, the specific databases contained in the collection will be displayed.
Datasets are selected in the
The tool will display a preview of the first few rows of the first chosen dataset along with the required and optional columns that were detected.
When
Once analysis is started, the initial set of panels will collapse and a
Analysis results can be viewed by clicking
In the results app, the
The input data is visualized in a volcano plot, which plots genes by statistical significance, p.value, versus magnitude of change, fold.change. Genes are highlighted based on the p.value and fold-change cutoffs selected during setup. Selected genes are labeled; select genes either by top n genes, or by selection by name.
A bar plot of your input data is also available (via a drop-down), highlighting positive and negative fold-change values for a subset of genes, either top n genes or genes selected by name.
The
The table and plots can all be downloaded.
Using the left side panel, one can navigate between GSEA and ORA methods while viewing the results for a particular database to explore hits in common (and unique) to the different methods. Here we are comparing the ORA and GSEA results for the WikiPathways database, note the differences in the table and dot plot.
A
Several plot types are available for visualizing the gene overlap between results.
For each result in the results table, results-specific plots are available based on the database the results is from and the analysis method used. For example, for GSEA analysis, the GSEA Enrichment Score plot is available. As described earlier, the plot in the upper half represents the running enrichment score (ES), as the analysis walks down the ranked list of genes. The middle section shows where the members of the gene set appear in the ranked list of genes. The top score in the enrichment map plot is the score reported for the particular gene set.
Some database-specific visualizations are also available, for example WikiPathways visualizations of the data on models from the WikiPathways database. Genes that met the criteria for fold change and p value cutoff are highlighted in the pathway (orange for up, blue for down). The WikiPathways button will take you to the pathway model at WikiPathways.
Opening the pathway in a new window gives you access to a larger, interactive format of the pathway.
Once you have completed exploring your data and results in either of these tools, there are several options for continued analysis and exploration:


--- title: Prokaryotic Genome Size subtitle: Calculation of summary statistics based upon the 11,710 RefSeq representative prokaryotic genomes summary: In this blogpost, I examine genome size among the 11,710 RefSeq representative prokaryotic genomes. author: John Christian Gaby date: '2020-08-31' slug: prokaryotic-genome-size categories: ['genome calculations'] tags: ['genomics', 'genome size', 'refseq', 'CDS'] authors: [John Christian Gaby] lastmod: '2020-08-31T15:21:30+02:00' featured: no # Featured image # To use, add an image named `featured.jpg/png` to your page's folder. # Focal points: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight. image: caption: '' focal_point: '' preview_only: no # Projects (optional). # Associate this post with one or more of your projects. # Simply enter your project's folder or file name without extension. # E.g. `projects = ["internal-project"]` references `content/project/deep-learning/index.md`. # Otherwise, set `projects = []`. projects: [] draft: false ---
Prokaryotic genomes encompass a range of sizes whereby larger genomes may encode more genes that allow for the organism to respond to their environment and smaller, streamlined genomes may indicate adaptation to a less varying, host environment. I will use the table of RefSeq representative genomes downloaded from the NCBI Prokaryotic Genomes page to derive summary statistics and figures that describe the distribution of prokaryotic genome sizes.
As a frame of reference, the familiar laboratory workhorse Escherichia coli K12 has a genome size of 4.64 Mb.
On August 31, 2020, I downloaded a list of the NCBI RefSeq Prokaryotic Genomes. The list included statistics such as genome length for each genome.
The list was downloaded from NCBI as a csv file, and I have made this file available for download. Let’s import the csv file and calculate some statistics for prokaryotic genome size.
library(tidyverse)
# Read the table into a tibble.
prokaryote.genomes.table <- read_csv(file = "prokaryotes.csv")
# Display the first few lines of the data frame.
head(prokaryote.genomes.table)
## # A tibble: 6 x 16
## `#Organism Name` `Organism Group… Strain BioSample BioProject Assembly Level
## <chr> <chr> <chr> <chr> <chr> <chr> <chr>
## 1 Pseudomonas flu… Bacteria;Proteo… DR397 SAMN1397… PRJNA6044… GCA_010… Comp…
## 2 Xanthomonas cam… Bacteria;Proteo… MAFF1… SAMN1534… PRJNA6412… GCA_013… Comp…
## 3 Yersinia pestis… Bacteria;Proteo… A1122 SAMN0260… PRJNA67155 GCA_000… Comp…
## 4 Staphylococcus … Bacteria;Terrab… ATCC … SAMN1073… PRJNA5153… GCA_006… Comp…
## 5 Lactococcus lac… Bacteria;Terrab… WFLU12 SAMN0821… PRJNA4231… GCA_002… Cont…
## 6 Bacillus cereus Bacteria;Terrab… FDAAR… SAMN1105… PRJNA2312… GCA_013… Comp…
## # … with 9 more variables: `Size(Mb)` <dbl>, `GC%` <dbl>, Replicons <chr>,
## # WGS <chr>, Scaffolds <dbl>, CDS <dbl>, `Release Date` <dttm>, `GenBank
## # FTP` <chr>, `RefSeq FTP` <chr>
# How many genomes have data for length?
length(prokaryote.genomes.table$`Size(Mb)`)
## [1] 11710
# Display the minimum, maximum, mean, median, and 1st and 3rd quartiles for the genome sizes.
summary(prokaryote.genomes.table$`Size(Mb)`)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.185 2.992 4.051 4.372 5.279 16.041
Let’s look at the summary statistics for genome size:
There is well over an order of magnitude variation in the size of prokaryotic genomes, ranging from 0.185014 to 16.0407. The largest genome among the refseq genomes belongs to Minicystis rosea whereas the smallest genome belongs to Metaprevotella massiliensis. It is notable that the smallest genome is classified as a Scaffold and thus may not be accurate.
Let’s also take a look at the distribution:
library(ggplot2)
qplot(data = prokaryote.genomes.table,
x = `Size(Mb)`,
binwidth = 1)
Let’s see how many genomes are available for each phylum in this dataset:
library(tidyr)
# Split the Organism Groups column into new columns named according to their respective taxonomy level
prokaryote.genomes.table.split <- separate(data=prokaryote.genomes.table,
col = `Organism Groups`,
sep = ";",
into = c("Domain", "Phylum", "Class"))
summary(factor(prokaryote.genomes.table.split$Phylum))
## Acidobacteria Aquificae
## 29 21
## Bacteria incertae sedis Caldiserica/Cryosericota group
## 4 1
## Calditrichaeota Chrysiogenetes
## 1 2
## Coprothermobacterota Deferribacteres
## 2 8
## Dictyoglomi Elusimicrobia
## 2 2
## Euryarchaeota FCB group
## 346 1329
## Fusobacteria Nitrospinae/Tectomicrobia group
## 38 1
## Nitrospirae Proteobacteria
## 10 4592
## PVC group Spirochaetes
## 98 141
## Synergistetes TACK group
## 19 62
## Terrabacteria group Thermodesulfobacteria
## 4950 12
## Thermotogae
## 40
It looks like there are only a few phyla that have enough genomes to make a reliable histogram, so lets create a new dataset with only those phyla having > 90 genomes.
Let’s break the distribution down into separate density plots for each of the 6 phyla with over 90 genomes:
library(ggplot2)
phyla.subset.names <- names(which(summary(factor(prokaryote.genomes.table.split$Phylum)) > 90))
prokaryote.genomes.table.split.reduced <- prokaryote.genomes.table.split[prokaryote.genomes.table.split$Phylum == phyla.subset.names[1] |
prokaryote.genomes.table.split$Phylum == phyla.subset.names[2] |
prokaryote.genomes.table.split$Phylum == phyla.subset.names[3] |
prokaryote.genomes.table.split$Phylum == phyla.subset.names[4] |
prokaryote.genomes.table.split$Phylum == phyla.subset.names[5] |
prokaryote.genomes.table.split$Phylum == phyla.subset.names[6],]
qplot(data=prokaryote.genomes.table.split.reduced,
x = `Size(Mb)`,
geom = "density",
color = Phylum,
fill = Phylum,
alpha = I(0.2))
We can see that there is considerable variation in the genome size distribution for each phylum. Let’s get a clearer view by using facets to separate out each phylum:
library(ggplot2)
qplot(data=prokaryote.genomes.table.split.reduced,
x = `Size(Mb)`,
geom = "density",
color = Phylum,
fill = Phylum,
facets = Phylum ~ .)
Based upon the separated density plots, it looks as if the genome size varies by phylum. Let’s see how much mean genome size varies by phylum:
Thus, it appears that phylum-dependent, mean genome size ranges from 3.2 to 5.3 Mb.
The prokaryotic genomes table from NCBI also indicates the number of coding sequences (CDS) in each genome. By creating a scatterplot of genome size vs. CDS, we may examine the relationship between genome size and number of CDS.
library(ggplot2)
qplot(data = prokaryote.genomes.table.split,
x = `Size(Mb)`,
y = CDS,
color = Domain,
alpha = I(0.2))
Genome size is strongly and positively correlated with the number of CDS in the genome; put another way, larger genomes have more genes. There are outliers, though, and while those with zero CDS values may be attributable to missing CDS annotation, those with higher than expected CDS should be further explored. Archaea appear to follow a trend similar to Bacteria.
Let’s check to see if the outliers are associated with a single finishing level:
library(ggplot2)
qplot(data = prokaryote.genomes.table.split,
x = `Size(Mb)`,
y = CDS,
color = Level,
alpha = I(0.4))
It appears that the outliers with zero CDS are mixed, but most of those with abnormally high CDS for their genome size are labeled as “Chromosome”. In further work, the taxonomic identity of these outliers may be explored.
The genome sizes in this set of 11710 RefSeq representative prokaryotes vary by phylum and span nearly two orders of magnitude from the smallest at 0.185014 Mb to the largest at 16.0407 Mb. The median genome size was determined to be 4.050955 Mb and is a useful approximation that may be used to estimate, for instance, the number of genome equivalents in a given quantity of DNA, or in determining the number of genome equivalents required by a sequencing library preparation, or in determining the number of genome equivalents in the output of a DNA sequencing run.
This webpage was composed using R Markdown, and the Rmd file is available for download and may be viewed as a plain text file or by opening the file within RStudio.


Sudoku Technique No.7
Fitting In - Expert Level
If we have Double Pointers, do we have Double Fitters? Absolutely yes, this post is the Expert level of Fitting In technique, Angel's Wings with Double Fitters.
See the board below, angel's two wings are at 41 and 67. Click the board to see how it works.
As you can see, number 6 in 66 can fit in two cells of box 4: 41 and 49, and number 8 can fit in two cells of row 6: 49 and 67. Cell 41, 47 and 67 form a chain that linked the two wings. Think of the two possibilities of number 6:
- If 6 goes to 41 then 61 must be 9 in row 4;
- If 6 goes to 47 then 8 goes to 67 then 61 must be 9 in box 6.
Try number 8 you have the same result, either way leads to solution 619.
If you find a chain that can link the two wings - you find the angel!
The chain can be longer, in the board below, Double Fitters of 4, 1 and 5 form a chain 89, 87, 27 and 28, linked the two wings of the angel 89 and 28, the angel is 298.
The chain can be formed by same number Double Fitters, in the board below, Double Fitter of 7 in box 7 and box 8 form a chain 76, 71, 83 and 89, linked the two wings of the angel 76 and 89, revealing the angel 6 at 85. Note here that since it's the same number chain, 71 and 83 are linked by 'seeing each other'.
Double Pointing Out and Double Fitting In can work together. In the board below, one of the wing, 85, is pointed out by Double Pointer of 7 in 76 and 43, then Double Fitter of 9 fits into 43 and 43 and 51, finally Double Fitter of 8 fits into 51 and the other wing, 59, reveal the angel 7 at 58.
There you have it, exclusively from Touch Sudoku, the Angel's Wings technique, so beautiful so powerful yet easy to spot, it will downgrade puzzles used to be considered diabolical.
Enjoy.
The puzzles in this post are from http://school.maths.uwa.edu.au/~gordon/sudokumin.php The work is licensed under a Creative Commons Attribution 2.5 License. Attribution goes to Gordon Royle and The University of Western Australia.