"""Geometrical Points.
Contains
========
Point
Point2D
Point3D
When methods of Point require 1 or more points as arguments, they
can be passed as a sequence of coordinates or Points:
>>> from sympy.geometry.point import Point
>>> Point(1, 1).is_collinear((2, 2), (3, 4))
False
>>> Point(1, 1).is_collinear(Point(2, 2), Point(3, 4))
False
"""
from __future__ import division, print_function
import warnings
from sympy.core import S, sympify, Expr
from sympy.core.numbers import Number
from sympy.core.compatibility import iterable, is_sequence, as_int
from sympy.core.containers import Tuple
from sympy.simplify import nsimplify, simplify
from sympy.geometry.exceptions import GeometryError
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.functions.elementary.complexes import im
from sympy.matrices import Matrix
from sympy.core.relational import Eq
from sympy.core.numbers import Float
from sympy.core.evaluate import global_evaluate
from sympy.core.add import Add
from sympy.sets import FiniteSet
from sympy.utilities.iterables import uniq
from sympy.utilities.misc import filldedent, func_name, Undecidable
from .entity import GeometryEntity
[docs]class Point(GeometryEntity):
"""A point in a n-dimensional Euclidean space.
Parameters
==========
coords : sequence of n-coordinate values. In the special
case where n=2 or 3, a Point2D or Point3D will be created
as appropriate.
evaluate : if `True` (default), all floats are turn into
exact types.
dim : number of coordinates the point should have. If coordinates
are unspecified, they are padded with zeros.
on_morph : indicates what should happen when the number of
coordinates of a point need to be changed by adding or
removing zeros. Possible values are `'warn'`, `'error'`, or
`ignore` (default). No warning or error is given when `*args`
is empty and `dim` is given. An error is always raised when
trying to remove nonzero coordinates.
Attributes
==========
length
origin: A `Point` representing the origin of the
appropriately-dimensioned space.
Raises
======
TypeError : When instantiating with anything but a Point or sequence
ValueError : when instantiating with a sequence with length < 2 or
when trying to reduce dimensions if keyword `on_morph='error'` is
set.
See Also
========
sympy.geometry.line.Segment : Connects two Points
Examples
========
>>> from sympy.geometry import Point
>>> from sympy.abc import x
>>> Point(1, 2, 3)
Point3D(1, 2, 3)
>>> Point([1, 2])
Point2D(1, 2)
>>> Point(0, x)
Point2D(0, x)
>>> Point(dim=4)
Point(0, 0, 0, 0)
Floats are automatically converted to Rational unless the
evaluate flag is False:
>>> Point(0.5, 0.25)
Point2D(1/2, 1/4)
>>> Point(0.5, 0.25, evaluate=False)
Point2D(0.5, 0.25)
"""
is_Point = True
def __new__(cls, *args, **kwargs):
evaluate = kwargs.get('evaluate', global_evaluate[0])
on_morph = kwargs.get('on_morph', 'ignore')
# unpack into coords
coords = args[0] if len(args) == 1 else args
# A point where only `dim` is specified is initialized
# to zeros.
if len(coords) == 0 and kwargs.get('dim', None):
coords = (S.Zero,)*kwargs.get('dim')
# check args and handle quickly handle Point instances
if isinstance(coords, Point):
# even if we're mutating the dimension of a point, we
# don't reevaluate its coordinates
evaluate = False
if len(coords) == kwargs.get('dim', len(coords)):
return coords
if not is_sequence(coords):
raise TypeError(filldedent('''
Expecting sequence of coordinates, not `{}`'''
.format(func_name(coords))))
coords = Tuple(*coords)
dim = kwargs.get('dim', len(coords))
if len(coords) < 2:
raise ValueError(filldedent('''
Point requires 2 or more coordinates or
keyword `dim` > 1.'''))
if len(coords) != dim:
message = ("Dimension of {} needs to be changed"
"from {} to {}.").format(coords, len(coords), dim)
if on_morph == 'ignore':
pass
elif on_morph == "error":
raise ValueError(message)
elif on_morph == 'warn':
warnings.warn(message)
else:
raise ValueError(filldedent('''
on_morph value should be 'error',
'warn' or 'ignore'.'''))
if any(i for i in coords[dim:]):
raise ValueError('Nonzero coordinates cannot be removed.')
if any(a.is_number and im(a) for a in coords):
raise ValueError('Imaginary coordinates are not permitted.')
if not all(isinstance(a, Expr) for a in coords):
raise TypeError('Coordinates must be valid SymPy expressions.')
# pad with zeros appropriately
coords = coords[:dim] + (S.Zero,)*(dim - len(coords))
# Turn any Floats into rationals and simplify
# any expressions before we instantiate
if evaluate:
coords = coords.xreplace(dict(
[(f, simplify(nsimplify(f, rational=True)))
for f in coords.atoms(Float)]))
# return 2D or 3D instances
if len(coords) == 2:
kwargs['_nocheck'] = True
return Point2D(*coords, **kwargs)
elif len(coords) == 3:
kwargs['_nocheck'] = True
return Point3D(*coords, **kwargs)
# the general Point
return GeometryEntity.__new__(cls, *coords)
def __abs__(self):
"""Returns the distance between this point and the origin."""
origin = Point([0]*len(self))
return Point.distance(origin, self)
def __add__(self, other):
"""Add other to self by incrementing self's coordinates by
those of other.
Notes
=====
>>> from sympy.geometry.point import Point
When sequences of coordinates are passed to Point methods, they
are converted to a Point internally. This __add__ method does
not do that so if floating point values are used, a floating
point result (in terms of SymPy Floats) will be returned.
>>> Point(1, 2) + (.1, .2)
Point2D(1.1, 2.2)
If this is not desired, the `translate` method can be used or
another Point can be added:
>>> Point(1, 2).translate(.1, .2)
Point2D(11/10, 11/5)
>>> Point(1, 2) + Point(.1, .2)
Point2D(11/10, 11/5)
See Also
========
sympy.geometry.point.Point.translate
"""
try:
s, o = Point._normalize_dimension(self, Point(other, evaluate=False))
except TypeError:
raise GeometryError("Don't know how to add {} and a Point object".format(other))
coords = [simplify(a + b) for a, b in zip(s, o)]
return Point(coords, evaluate=False)
def __contains__(self, item):
return item in self.args
def __div__(self, divisor):
"""Divide point's coordinates by a factor."""
divisor = sympify(divisor)
coords = [simplify(x/divisor) for x in self.args]
return Point(coords, evaluate=False)
def __eq__(self, other):
if not isinstance(other, Point) or len(self.args) != len(other.args):
return False
return self.args == other.args
def __getitem__(self, key):
return self.args[key]
def __hash__(self):
return hash(self.args)
def __iter__(self):
return self.args.__iter__()
def __len__(self):
return len(self.args)
def __mul__(self, factor):
"""Multiply point's coordinates by a factor.
Notes
=====
>>> from sympy.geometry.point import Point
When multiplying a Point by a floating point number,
the coordinates of the Point will be changed to Floats:
>>> Point(1, 2)*0.1
Point2D(0.1, 0.2)
If this is not desired, the `scale` method can be used or
else only multiply or divide by integers:
>>> Point(1, 2).scale(1.1, 1.1)
Point2D(11/10, 11/5)
>>> Point(1, 2)*11/10
Point2D(11/10, 11/5)
See Also
========
sympy.geometry.point.Point.scale
"""
factor = sympify(factor)
coords = [simplify(x*factor) for x in self.args]
return Point(coords, evaluate=False)
def __neg__(self):
"""Negate the point."""
coords = [-x for x in self.args]
return Point(coords, evaluate=False)
def __sub__(self, other):
"""Subtract two points, or subtract a factor from this point's
coordinates."""
return self + [-x for x in other]
@classmethod
def _normalize_dimension(cls, *points, **kwargs):
"""Ensure that points have the same dimension.
By default `on_morph='warn'` is passed to the
`Point` constructor."""
# if we have a built-in ambient dimension, use it
dim = getattr(cls, '_ambient_dimension', None)
# override if we specified it
dim = kwargs.get('dim', dim)
# if no dim was given, use the highest dimensional point
if dim is None:
dim = max(i.ambient_dimension for i in points)
if all(i.ambient_dimension == dim for i in points):
return list(points)
kwargs['dim'] = dim
kwargs['on_morph'] = kwargs.get('on_morph', 'warn')
return [Point(i, **kwargs) for i in points]
[docs] @staticmethod
def affine_rank(*args):
"""The affine rank of a set of points is the dimension
of the smallest affine space containing all the points.
For example, if the points lie on a line (and are not all
the same) their affine rank is 1. If the points lie on a plane
but not a line, their affine rank is 2. By convention, the empty
set has affine rank -1."""
if len(args) == 0:
return -1
# make sure we're genuinely points
# and translate every point to the origin
points = Point._normalize_dimension(*[Point(i) for i in args])
origin = points[0]
points = [i - origin for i in points[1:]]
m = Matrix([i.args for i in points])
return m.rank()
@property
def ambient_dimension(self):
"""Number of components this point has."""
return getattr(self, '_ambient_dimension', len(self))
[docs] @classmethod
def are_coplanar(cls, *points):
"""Return True if there exists a plane in which all the points
lie. A trivial True value is returned if `len(points) < 3` or
all Points are 2-dimensional.
Parameters
==========
A set of points
Raises
======
ValueError : if less than 3 unique points are given
Returns
=======
boolean
Examples
========
>>> from sympy import Point3D
>>> p1 = Point3D(1, 2, 2)
>>> p2 = Point3D(2, 7, 2)
>>> p3 = Point3D(0, 0, 2)
>>> p4 = Point3D(1, 1, 2)
>>> Point3D.are_coplanar(p1, p2, p3, p4)
True
>>> p5 = Point3D(0, 1, 3)
>>> Point3D.are_coplanar(p1, p2, p3, p5)
False
"""
if len(points) <= 1:
return True
points = cls._normalize_dimension(*[Point(i) for i in points])
# quick exit if we are in 2D
if points[0].ambient_dimension == 2:
return True
points = list(uniq(points))
return Point.affine_rank(*points) <= 2
[docs] def distance(self, p):
"""The Euclidean distance from self to point p.
Parameters
==========
p : Point
Returns
=======
distance : number or symbolic expression.
See Also
========
sympy.geometry.line.Segment.length
sympy.geometry.point.Point.taxicab_distance
Examples
========
>>> from sympy.geometry import Point
>>> p1, p2 = Point(1, 1), Point(4, 5)
>>> p1.distance(p2)
5
>>> from sympy.abc import x, y
>>> p3 = Point(x, y)
>>> p3.distance(Point(0, 0))
sqrt(x**2 + y**2)
"""
s, p = Point._normalize_dimension(self, Point(p))
return sqrt(Add(*((a - b)**2 for a, b in zip(s, p))))
[docs] def dot(self, p):
"""Return dot product of self with another Point."""
if not is_sequence(p):
p = Point(p) # raise the error via Point
return Add(*(a*b for a, b in zip(self, p)))
[docs] def equals(self, other):
"""Returns whether the coordinates of self and other agree."""
# a point is equal to another point if all its components are equal
if not isinstance(other, Point) or len(self) != len(other):
return False
return all(a.equals(b) for a,b in zip(self, other))
[docs] def evalf(self, prec=None, **options):
"""Evaluate the coordinates of the point.
This method will, where possible, create and return a new Point
where the coordinates are evaluated as floating point numbers to
the precision indicated (default=15).
Parameters
==========
prec : int
Returns
=======
point : Point
Examples
========
>>> from sympy import Point, Rational
>>> p1 = Point(Rational(1, 2), Rational(3, 2))
>>> p1
Point2D(1/2, 3/2)
>>> p1.evalf()
Point2D(0.5, 1.5)
"""
coords = [x.evalf(prec, **options) for x in self.args]
return Point(*coords, evaluate=False)
[docs] def intersection(self, other):
"""The intersection between this point and another GeometryEntity.
Parameters
==========
other : Point
Returns
=======
intersection : list of Points
Notes
=====
The return value will either be an empty list if there is no
intersection, otherwise it will contain this point.
Examples
========
>>> from sympy import Point
>>> p1, p2, p3 = Point(0, 0), Point(1, 1), Point(0, 0)
>>> p1.intersection(p2)
[]
>>> p1.intersection(p3)
[Point2D(0, 0)]
"""
if not isinstance(other, GeometryEntity):
other = Point(other)
if isinstance(other, Point):
if self == other:
return [self]
p1, p2 = Point._normalize_dimension(self, other)
if p1 == self and p1 == p2:
return [self]
return []
return other.intersection(self)
[docs] def is_collinear(self, *args):
"""Returns `True` if there exists a line
that contains `self` and `points`. Returns `False` otherwise.
A trivially True value is returned if no points are given.
Parameters
==========
args : sequence of Points
Returns
=======
is_collinear : boolean
See Also
========
sympy.geometry.line.Line
Examples
========
>>> from sympy import Point
>>> from sympy.abc import x
>>> p1, p2 = Point(0, 0), Point(1, 1)
>>> p3, p4, p5 = Point(2, 2), Point(x, x), Point(1, 2)
>>> Point.is_collinear(p1, p2, p3, p4)
True
>>> Point.is_collinear(p1, p2, p3, p5)
False
"""
points = (self,) + args
points = Point._normalize_dimension(*[Point(i) for i in points])
points = list(uniq(points))
return Point.affine_rank(*points) <= 1
[docs] def is_concyclic(self, *args):
"""Do `self` and the given sequence of points lie in a circle?
Returns True if the set of points are concyclic and
False otherwise. A trivial value of True is returned
if there are fewer than 2 other points.
Parameters
==========
args : sequence of Points
Returns
=======
is_concyclic : boolean
Examples
========
>>> from sympy import Point
Define 4 points that are on the unit circle:
>>> p1, p2, p3, p4 = Point(1, 0), (0, 1), (-1, 0), (0, -1)
>>> p1.is_concyclic() == p1.is_concyclic(p2, p3, p4) == True
True
Define a point not on that circle:
>>> p = Point(1, 1)
>>> p.is_concyclic(p1, p2, p3)
False
"""
points = (self,) + args
points = Point._normalize_dimension(*[Point(i) for i in points])
points = list(uniq(points))
if not Point.affine_rank(*points) <= 2:
return False
origin = points[0]
points = [p - origin for p in points]
# points are concyclic if they are coplanar and
# there is a point c so that ||p_i-c|| == ||p_j-c|| for all
# i and j. Rearranging this equation gives us the following
# condition: the matrix `mat` must not a pivot in the last
# column.
mat = Matrix([list(i) + [i.dot(i)] for i in points])
rref, pivots = mat.rref()
if len(origin) not in pivots:
return True
return False
@property
def is_nonzero(self):
"""True if any coordinate is nonzero, False if every coordinate is zero,
and None if it cannot be determined."""
is_zero = self.is_zero
if is_zero is None:
return None
return not is_zero
[docs] def is_scalar_multiple(self, p):
"""Returns whether each coordinate of `self` is a scalar
multiple of the corresponding coordinate in point p.
"""
s, o = Point._normalize_dimension(self, Point(p))
# 2d points happen a lot, so optimize this function call
if s.ambient_dimension == 2:
(x1, y1), (x2, y2) = s.args, o.args
rv = (x1*y2 - x2*y1).equals(0)
if rv is None:
raise Undecidable(filldedent(
'''can't determine if %s is a scalar multiple of
%s''' % (s, o)))
# if the vectors p1 and p2 are linearly dependent, then they must
# be scalar multiples of each other
m = Matrix([s.args, o.args])
return m.rank() < 2
@property
def is_zero(self):
"""True if every coordinate is zero, False if any coordinate is not zero,
and None if it cannot be determined."""
nonzero = [x.is_nonzero for x in self.args]
if any(nonzero):
return False
if any(x is None for x in nonzero):
return None
return True
@property
def length(self):
"""
Treating a Point as a Line, this returns 0 for the length of a Point.
Examples
========
>>> from sympy import Point
>>> p = Point(0, 1)
>>> p.length
0
"""
return S.Zero
[docs] def midpoint(self, p):
"""The midpoint between self and point p.
Parameters
==========
p : Point
Returns
=======
midpoint : Point
See Also
========
sympy.geometry.line.Segment.midpoint
Examples
========
>>> from sympy.geometry import Point
>>> p1, p2 = Point(1, 1), Point(13, 5)
>>> p1.midpoint(p2)
Point2D(7, 3)
"""
s, p = Point._normalize_dimension(self, Point(p))
return Point([simplify((a + b)*S.Half) for a, b in zip(s, p)])
@property
def origin(self):
"""A point of all zeros of the same ambient dimension
as the current point"""
return Point([0]*len(self), evaluate=False)
@property
def orthogonal_direction(self):
"""Returns a non-zero point that is orthogonal to the
line containing `self` and the origin.
Examples
========
>>> from sympy.geometry import Line, Point
>>> a = Point(1, 2, 3)
>>> a.orthogonal_direction
Point3D(-2, 1, 0)
>>> b = _
>>> Line(b, b.origin).is_perpendicular(Line(a, a.origin))
True
"""
dim = self.ambient_dimension
# if a coordinate is zero, we can put a 1 there and zeros elsewhere
if self[0] == S.Zero:
return Point([1] + (dim - 1)*[0])
if self[1] == S.Zero:
return Point([0,1] + (dim - 2)*[0])
# if the first two coordinates aren't zero, we can create a non-zero
# orthogonal vector by swapping them, negating one, and padding with zeros
return Point([-self[1], self[0]] + (dim - 2)*[0])
[docs] @staticmethod
def project(a, b):
"""Project the point `a` onto the line between the origin
and point `b` along the normal direction.
Parameters
==========
a : Point
b : Point
Returns
=======
p : Point
See Also
========
sympy.geometry.line.LinearEntity.projection
Examples
========
>>> from sympy.geometry import Line, Point
>>> a = Point(1, 2)
>>> b = Point(2, 5)
>>> z = a.origin
>>> p = Point.project(a, b)
>>> Line(p, a).is_perpendicular(Line(p, b))
True
>>> Point.is_collinear(z, p, b)
True
"""
a, b = Point._normalize_dimension(Point(a), Point(b))
if b.is_zero:
raise ValueError("Cannot project to the zero vector.")
return b*(a.dot(b) / b.dot(b))
[docs] def taxicab_distance(self, p):
"""The Taxicab Distance from self to point p.
Returns the sum of the horizontal and vertical distances to point p.
Parameters
==========
p : Point
Returns
=======
taxicab_distance : The sum of the horizontal
and vertical distances to point p.
See Also
========
sympy.geometry.point.Point.distance
Examples
========
>>> from sympy.geometry import Point
>>> p1, p2 = Point(1, 1), Point(4, 5)
>>> p1.taxicab_distance(p2)
7
"""
s, p = Point._normalize_dimension(self, Point(p))
return Add(*(abs(a - b) for a, b in zip(s, p)))
[docs] def canberra_distance(self, p):
"""The Canberra Distance from self to point p.
Returns the weighted sum of horizontal and vertical distances to
point p.
Parameters
==========
p : Point
Returns
=======
canberra_distance : The weighted sum of horizontal and vertical
distances to point p. The weight used is the sum of absolute values
of the coordinates.
See Also
========
sympy.geometry.point.Point.distance
Examples
========
>>> from sympy.geometry import Point
>>> p1, p2 = Point(1, 1), Point(3, 3)
>>> p1.canberra_distance(p2)
1
>>> p1, p2 = Point(0, 0), Point(3, 3)
>>> p1.canberra_distance(p2)
2
Raises
======
ValueError when both vectors are zero.
See Also
========
sympy.geometry.point.Point.distance
"""
s, p = Point._normalize_dimension(self, Point(p))
if self.is_zero and p.is_zero:
raise ValueError("Cannot project to the zero vector.")
return Add(*((abs(a - b)/(abs(a) + abs(b))) for a, b in zip(s, p)))
@property
def unit(self):
"""Return the Point that is in the same direction as `self`
and a distance of 1 from the origin"""
return self / abs(self)
n = evalf
__truediv__ = __div__
[docs]class Point2D(Point):
"""A point in a 2-dimensional Euclidean space.
Parameters
==========
coords : sequence of 2 coordinate values.
Attributes
==========
x
y
length
Raises
======
TypeError
When trying to add or subtract points with different dimensions.
When trying to create a point with more than two dimensions.
When `intersection` is called with object other than a Point.
See Also
========
sympy.geometry.line.Segment : Connects two Points
Examples
========
>>> from sympy.geometry import Point2D
>>> from sympy.abc import x
>>> Point2D(1, 2)
Point2D(1, 2)
>>> Point2D([1, 2])
Point2D(1, 2)
>>> Point2D(0, x)
Point2D(0, x)
Floats are automatically converted to Rational unless the
evaluate flag is False:
>>> Point2D(0.5, 0.25)
Point2D(1/2, 1/4)
>>> Point2D(0.5, 0.25, evaluate=False)
Point2D(0.5, 0.25)
"""
_ambient_dimension = 2
def __new__(cls, *args, **kwargs):
if not kwargs.pop('_nocheck', False):
kwargs['dim'] = 2
args = Point(*args, **kwargs)
return GeometryEntity.__new__(cls, *args)
def __contains__(self, item):
return item == self
@property
def bounds(self):
"""Return a tuple (xmin, ymin, xmax, ymax) representing the bounding
rectangle for the geometric figure.
"""
return (self.x, self.y, self.x, self.y)
[docs] def rotate(self, angle, pt=None):
"""Rotate ``angle`` radians counterclockwise about Point ``pt``.
See Also
========
rotate, scale
Examples
========
>>> from sympy import Point2D, pi
>>> t = Point2D(1, 0)
>>> t.rotate(pi/2)
Point2D(0, 1)
>>> t.rotate(pi/2, (2, 0))
Point2D(2, -1)
"""
from sympy import cos, sin, Point
c = cos(angle)
s = sin(angle)
rv = self
if pt is not None:
pt = Point(pt, dim=2)
rv -= pt
x, y = rv.args
rv = Point(c*x - s*y, s*x + c*y)
if pt is not None:
rv += pt
return rv
[docs] def scale(self, x=1, y=1, pt=None):
"""Scale the coordinates of the Point by multiplying by
``x`` and ``y`` after subtracting ``pt`` -- default is (0, 0) --
and then adding ``pt`` back again (i.e. ``pt`` is the point of
reference for the scaling).
See Also
========
rotate, translate
Examples
========
>>> from sympy import Point2D
>>> t = Point2D(1, 1)
>>> t.scale(2)
Point2D(2, 1)
>>> t.scale(2, 2)
Point2D(2, 2)
"""
if pt:
pt = Point(pt, dim=2)
return self.translate(*(-pt).args).scale(x, y).translate(*pt.args)
return Point(self.x*x, self.y*y)
[docs] def translate(self, x=0, y=0):
"""Shift the Point by adding x and y to the coordinates of the Point.
See Also
========
rotate, scale
Examples
========
>>> from sympy import Point2D
>>> t = Point2D(0, 1)
>>> t.translate(2)
Point2D(2, 1)
>>> t.translate(2, 2)
Point2D(2, 3)
>>> t + Point2D(2, 2)
Point2D(2, 3)
"""
return Point(self.x + x, self.y + y)
@property
def x(self):
"""
Returns the X coordinate of the Point.
Examples
========
>>> from sympy import Point2D
>>> p = Point2D(0, 1)
>>> p.x
0
"""
return self.args[0]
@property
def y(self):
"""
Returns the Y coordinate of the Point.
Examples
========
>>> from sympy import Point2D
>>> p = Point2D(0, 1)
>>> p.y
1
"""
return self.args[1]
[docs]class Point3D(Point):
"""A point in a 3-dimensional Euclidean space.
Parameters
==========
coords : sequence of 3 coordinate values.
Attributes
==========
x
y
z
length
Raises
======
TypeError
When trying to add or subtract points with different dimensions.
When `intersection` is called with object other than a Point.
Examples
========
>>> from sympy import Point3D
>>> from sympy.abc import x
>>> Point3D(1, 2, 3)
Point3D(1, 2, 3)
>>> Point3D([1, 2, 3])
Point3D(1, 2, 3)
>>> Point3D(0, x, 3)
Point3D(0, x, 3)
Floats are automatically converted to Rational unless the
evaluate flag is False:
>>> Point3D(0.5, 0.25, 2)
Point3D(1/2, 1/4, 2)
>>> Point3D(0.5, 0.25, 3, evaluate=False)
Point3D(0.5, 0.25, 3)
"""
_ambient_dimension = 3
def __new__(cls, *args, **kwargs):
if not kwargs.pop('_nocheck', False):
kwargs['dim'] = 3
args = Point(*args, **kwargs)
return GeometryEntity.__new__(cls, *args)
def __contains__(self, item):
return item == self
[docs] @staticmethod
def are_collinear(*points):
"""Is a sequence of points collinear?
Test whether or not a set of points are collinear. Returns True if
the set of points are collinear, or False otherwise.
Parameters
==========
points : sequence of Point
Returns
=======
are_collinear : boolean
See Also
========
sympy.geometry.line.Line3D
Examples
========
>>> from sympy import Point3D, Matrix
>>> from sympy.abc import x
>>> p1, p2 = Point3D(0, 0, 0), Point3D(1, 1, 1)
>>> p3, p4, p5 = Point3D(2, 2, 2), Point3D(x, x, x), Point3D(1, 2, 6)
>>> Point3D.are_collinear(p1, p2, p3, p4)
True
>>> Point3D.are_collinear(p1, p2, p3, p5)
False
"""
return Point.is_collinear(*points)
[docs] def direction_cosine(self, point):
"""
Gives the direction cosine between 2 points
Parameters
==========
p : Point3D
Returns
=======
list
Examples
========
>>> from sympy import Point3D
>>> p1 = Point3D(1, 2, 3)
>>> p1.direction_cosine(Point3D(2, 3, 5))
[sqrt(6)/6, sqrt(6)/6, sqrt(6)/3]
"""
a = self.direction_ratio(point)
b = sqrt(Add(*(i**2 for i in a)))
return [(point.x - self.x) / b,(point.y - self.y) / b,
(point.z - self.z) / b]
[docs] def direction_ratio(self, point):
"""
Gives the direction ratio between 2 points
Parameters
==========
p : Point3D
Returns
=======
list
Examples
========
>>> from sympy import Point3D
>>> p1 = Point3D(1, 2, 3)
>>> p1.direction_ratio(Point3D(2, 3, 5))
[1, 1, 2]
"""
return [(point.x - self.x),(point.y - self.y),(point.z - self.z)]
[docs] def intersection(self, other):
"""The intersection between this point and another point.
Parameters
==========
other : Point
Returns
=======
intersection : list of Points
Notes
=====
The return value will either be an empty list if there is no
intersection, otherwise it will contain this point.
Examples
========
>>> from sympy import Point3D
>>> p1, p2, p3 = Point3D(0, 0, 0), Point3D(1, 1, 1), Point3D(0, 0, 0)
>>> p1.intersection(p2)
[]
>>> p1.intersection(p3)
[Point3D(0, 0, 0)]
"""
if not isinstance(other, GeometryEntity):
other = Point(other, dim=3)
if isinstance(other, Point3D):
if self == other:
return [self]
return []
return other.intersection(self)
[docs] def scale(self, x=1, y=1, z=1, pt=None):
"""Scale the coordinates of the Point by multiplying by
``x`` and ``y`` after subtracting ``pt`` -- default is (0, 0) --
and then adding ``pt`` back again (i.e. ``pt`` is the point of
reference for the scaling).
See Also
========
translate
Examples
========
>>> from sympy import Point3D
>>> t = Point3D(1, 1, 1)
>>> t.scale(2)
Point3D(2, 1, 1)
>>> t.scale(2, 2)
Point3D(2, 2, 1)
"""
if pt:
pt = Point3D(pt)
return self.translate(*(-pt).args).scale(x, y, z).translate(*pt.args)
return Point3D(self.x*x, self.y*y, self.z*z)
[docs] def translate(self, x=0, y=0, z=0):
"""Shift the Point by adding x and y to the coordinates of the Point.
See Also
========
rotate, scale
Examples
========
>>> from sympy import Point3D
>>> t = Point3D(0, 1, 1)
>>> t.translate(2)
Point3D(2, 1, 1)
>>> t.translate(2, 2)
Point3D(2, 3, 1)
>>> t + Point3D(2, 2, 2)
Point3D(2, 3, 3)
"""
return Point3D(self.x + x, self.y + y, self.z + z)
@property
def x(self):
"""
Returns the X coordinate of the Point.
Examples
========
>>> from sympy import Point3D
>>> p = Point3D(0, 1, 3)
>>> p.x
0
"""
return self.args[0]
@property
def y(self):
"""
Returns the Y coordinate of the Point.
Examples
========
>>> from sympy import Point3D
>>> p = Point3D(0, 1, 2)
>>> p.y
1
"""
return self.args[1]
@property
def z(self):
"""
Returns the Z coordinate of the Point.
Examples
========
>>> from sympy import Point3D
>>> p = Point3D(0, 1, 1)
>>> p.z
1
"""
return self.args[2]


We adopted Sadie from the animal shelter just last summer, so her time with our family was short. But she was a really sweet dog. We all miss her terribly.
In the past, I have always identified myself as not a "dog person". When I was a kid, we had cats. Sadie was the first dog I ever owned, and her addition to our household came at the conclusion of a long series of objections from me. Initially, I described Sadie as "my wife's dog" or "the kids' dog". Over time I was surprised how attached I became.
And I am surprised at the amount of grief I am feeling now.
This entry is obviously way off-topic. Why am I posting this? It has nothing to do with software or business. Certainly there are lots of more important things happening in the world right now.
I'm posting this entry because it's about me. People often ask me how similar I am to the character I play here on ericsink.com. I'll admit that I craft my publicly persona very carefully, but I like to think that the Eric Sink you see here is a real representation of who I am.
 But this is not a little detail. This feels really big to me right now.
I lost my dog yesterday.
It hurts.
I could not credibly claim that this blog is really me if I didn't tell you.


Toggle navigation
Menu
Md Mahedi H. Rana
Home
Background
My Projects
Background
This is what my background looks like
Education
Institution:
Queens College, The City University of New York
Duration:
September 2012 - August 2016
Degree:
Bachelor of Science
Major:
Computer Science
Minor:
Mathematics
GPA:
3.8
Internship
Company:
Kidpass, Inc
Duration:
June 2016 - August 2016
Training
Institution:
New York Code and Design Academy
Program:
Tech Talent Pipeline Residency, Queens College
Duration:
May 2016 - June 2016
Volunteer Experience
Institution:
Bangladesh America Cultural Academy
Duration:
January 2013 - Present


GLADIATOR A film review by Mark R. Leeper
Capsule: The sand-and-sandal epic film returns to the screen with a tale of one of the less familiar Caesars, the Emperor Commodus. Ridley Scott plays with the genre by adding surrealistic images and annoyingly tampers with the visuals digitally to throw the viewer off balance. It is original, but the film works in spite of his enhancements rather than because of them. Rating: 8 (0 to 10), high +2 (-4 to +4) Note: some discussion of the historical accuracy follows the main review. It has spoilers.
It has been many years since we have had a film about ancient Rome of the sort we have gotten from Ridley Scott, and in some ways we have never had a film like this. This is a sort of post-modern ancient Rome. I expected to love the giant battle scenes. But they start early in the film and my eye kept rebelling at what it was seeing. Something was wrong with the images I was seeing. Scott has always played with his visual images. He used to shoot through incense to create an odd filtered effect. In GLADIATOR he was doing a lot more. I cannot authoritatively say what Scott was doing but it looked like images in the background were filmed normally, images in the foreground were moving more jerkily. I could be wrong, but it seemed that instead of the foreground images being different each frame, they were kept on the screen for a count of two or perhaps even three frames each. This is impossible to do with normal filming but it is quite possible with digital processing of images. For me the irritation is about the same as if there was a buzz on the soundtrack. I suppose Scott may have felt that it enhanced the mythic effect. Time and again images in the film felt like they had been tampered with and were somehow off-kilter. Perhaps I was over-sensitive, but it was an annoyance that just had to be ignored.
Of course, Ridley Scott does odd experiments with the visuals. In this film he frequently plays with fog or smoke. Other times he uses backgrounds that look more like postcards than reality. The film is heavy on sunrises and sunsets. Other scenes play with color.
The film covers the same historic interval and figures as THE FALL OF THE ROMAN EMPIRE (1964) and some of the incidents of this film are borrowed from that rather than history. Even the fictional character Livius in the 1964 was carried over as the hero Maximus. The emperor Marcus Aurelius (Richard Harris) is off in snowy Germania where he is in the last stages of victory over the barbarians. His general Maximus (Russell Crowe) is "unleashing hell" against the last stronghold of resistance.  The scene fully justifies the fear that most of the world at that time had of the Romans. But the most powerful position in the known world is about to change hands.
Philosopher and gentle soul Marcus Aurelius wants to restore the Republic that Julius Caesar abolished. He knows his son Commodus is too anxious for power to restore the republic so Marcus plans to name Maximus as his successor, entrusting him to return the republic. But when Marcus breaks this news to Commodus, Commodus murders his father. To complete the task he also has a contingent of men take Maximus to be murdered and another to kill his family. The general does not die so easily, however. The attempt to kill Maximus only leaves him wounded and wandering, then collected as a slave. The slave is purchased by a wise old gladiator-turned- freeman and gladiator-dealer Proximo (Oliver Reed in his last and probably best role). The gladiator, now called "the Spaniard" is sent to Rome to fight before Emperor Commodus, where he hopes he may work his revenge. Tired of the war, tired of seeing death, and disillusioned about the causes he has fought for, the gladiator is sent to Rome to fight and die in front of audiences anxious to see death.
The plot borrows from THE TEN COMMANDMENTS the ruler who creates jealousy in his son by choosing another as an heir. It borrows from BEN HUR the blood feud of old close friends. There is even a line borrowed from THE UNTOUCHABLES. Of course, there is a lot of SPARTACUS and THE FALL OF THE ROMAN EMPIRE. The major plot elements are not new. But most of what is borrowed is from films of the last generation. And some of what is new, like the Ken- Russell-style surrealistic scenes, seems far more out of place than they would seem in a film of modern setting.
Ridley Scott is a reasonable action director with a good feel for integrating actors with special visual effects. Somehow Russell Crowe seems out of place in an ancient setting. It took a while to get used to him. Joaquin Phoenix is actually a little too dignified and reserved the psychotic Commodus. For once an actor could have chewed the scenery and been more faithful to the history books. It seems almost cliche to say that an actor who died in the production gave one of his best performances, but it is true of Oliver Reed who finally has overcome the stiffness of his earlier acting. Connie Nielsen as Lucilla is appealing, though it is a little strange to see the demure actress cast in the role that in 1964 went to Sophia Loren. Derek Jacobi plays a Senator trying to preserve the Senate. The score by Hans Zimmer is not one of his most memorable. He is quick to capitalize on a minor location in Africa, probably because the LION KING composer is not known for his German or Latin musical themes.
With a few reservations for Scott's visual style this is pleasant return of a type of film we have not seen made since the 60s. I rate it an 8 on the 0 to 10 scale and a high +2 on the -4 to +4 scale.
Note on historical accuracy:
This film grossly misrepresents the Emperor Commodus whose actual wacko quotient rivaled Caligula's and Nero's. The real Commodus renamed the months of the year to be his twelve titles so that he might be worshipped each month. He renamed Rome "The Colony of Commodus." He identified himself with Hercules and he would dress for the role in lion skins and would beat prisoners to death with a large wooden club. He would fight in amphitheater as a gladiator, but would give his opponent a nearly useless lead sword. Commodus would slaughter animals in the ring, including elephants and giraffes. He would behead ostriches with arrows headed with crescent razors. All this could have been shown in GLADIATOR and would have been quite cinematic. Instead he is reserved and almost dignified. As Roman Emperors go, Commodus as portrayed in GLADIATOR might almost have been respectable.
It should be noted Commodus showed far more tolerance of Christians than his father Marcus Aurelius had. His motives are open to speculation.
Eventually those closest to him grew tired of living in the fear of his capricious displeasure and the immediate death that might follow. A conspiracy, likely headed by his mistress Marcia, poisoned his drink one day on his return from hunting. When he fell asleep rather than dying a young wrestler, Narcissus, strangled him without him resisting.
Both GLADIATOR and THE FALL OF THE ROMAN EMPIRE, however, have him die in a dramatic sword fight with the former general of the German campaign. In both that general was also a former friend of Commodus favored for emperor by Marcus Aurelius over Commodus. Actually Marcus Aurelius had publicly named Commodus his heir and there is not likely to be any historic record that Marcus favored anyone else.
As has been pointed out in the arena the signals were not thumbs up or thumbs down, it was thumb hidden in fist for life, thumb sticking out for death. But the first responsibility of the director is to communicate hat is going on. The actors are speaking English, but they have to speak the audience's language. The audience knows thumbs up and thumbs down.
So there are inaccuracies, but if one waits to the end of the credits the film clearly says that some of the characters are real but that the story is fiction. With that in mind the accuracy of this film is not at all bad.
Mark R. Leeper<EMAIL_ADDRESS>Copyright 2000 Mark R. Leeper
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


“Lock Me Out” is a more powerful version of Digital Wellbeing’s Focus Mode
by Joe FedewaLast year, we highlighted an app called “Lock Me Out” that aimed to help reduce your smartphone use. Since then, “digital wellbeing” has become a big part of every smartphone platform, and Google has even made it mandatory for OEMs to include in their software. That doesn’t make third-party alternatives useless, though, as they may still offer features that aren’t available in the stock software. That’s why Lock Me Out is still under active development and has received many updates since we first covered it, and to celebrate the latest release, the developer is offering promo codes for XDA readers.
Google recently added a “Focus Mode” to its own Digital Wellbeing app, and Lock Me Out is essentially a more powerful version of that feature. But that’s not all it does. There are three lockout modes to choose from: blocked apps, allowed apps, and lock screen only. You can also setup lockouts based on location, screen time, opened apps, and more. If you require some hardcore enforcement of lockouts, you can even require payment to get out.
The app is now on version 5.2.1, up from version 4.0.4 when we previously covered it. Here’s a highlight of the most important new features added to the app since we last covered it:
- Lockout modes: blocked apps, allowed apps, lockscreen only
- Usage statistics (total screen time, time spent in apps, app opens, unlocks, DND time, averages)
- Lockout based on location
- Set DND/silent ringer during lockout
- Usage-based lockouts based on-screen time in specific apps, or number of times apps opened
- Multiple usage-based lockouts with enforcement schedule
- Multiple one-time lockouts
- Emergency access option during lockouts
- Paid exit option during lockouts
- Revamped UI
- Info dialogs for each section of the app
- All lockout modes are free (free version limited to 3 blocked apps / 5 allowed apps / 5 enabled lockouts)
Visit the developer’s forum thread if you have any questions or want to leave feedback. The second post in the thread has an extensive changelog for each version so you can see how the app has evolved in the past year.
The developer of Lock Me Out has given us 10 promo codes to give to XDA readers! Check the comments below to find the codes!
Update: All the codes have been used.


uncle and their four kids to arrive. The phone rang. My mom answered it, and I could tell it was her brother on the other line. I remember wondering why they were running late. Then I heard my mom say, “Oh, no. Oh, no,” over and over again. And then finally: “Oh, I’m so sorry.” My uncle and his family had arrived at their home to find their oldest son had taken his own life. He was just twenty years old.
Time stopped for me in those few seconds after the phone rang. I can remember with odd clarity the tiny details of the room, the ache and shock that I felt, and the immediate concern for my ninety-year-old grandmother, whom we’d break the news to within minutes. Our family faced a very different kind of Christmas that year, one with grief as a centerpiece, overshadowing all the plans we had made.
We often use the words “family members” to describe those who are related to us. The term members is also used to describe the parts of our body; arms and legs are members of a whole. When one member is badly hurt or even removed, the whole body goes into a kind of shock, feeling the pain of dismemberment. The same is true when those we love are taken away. Then shock and numbness give way to overwhelming pain.
Naomi’s life was torn apart when she lost everything she knew and loved. In the very first verse of the book of Ruth we learn that her homeland was rocked by such severe famine that her family was forced to evacuate, becoming refugees in the neighboring country Moab. The first loss Naomi experiences is the loss of her livelihood—her own sustenance and her ability to feed her family. This led to the loss of her home, her friends, and the familiarity of all that she knew as she and her husband fled to another country with their two boys just to survive.
If these were Naomi’s only losses we would feel sorry for her, but they were nothing compared to the losses yet to come.
Reread Ruth 1:3-5. What additional losses does Naomi experience?
All in a few verses Naomi loses the three most important people in her life—her husband and two sons. Her family is dismembered, torn apart.
How does Naomi react? Not surprisingly, she is grief-stricken, bitter, and angry at God. Her daughters-in-law are loyal to her and want to stay with her, even though they are grieving the losses of their own husbands. We’ll learn more about their reactions tomorrow, but even with their attempts to comfort her, Naomi’s reaction shows us how alone and dejected she feels.
After she returns to Bethlehem, the women in the town are so surprised to see Naomi again. They exclaim, “Can this be Naomi?” Naomi’s response speaks volumes about her emotional state:


Luton Marathon
Luton ENG
Website: www.lutonmarathon.org.uk/
Race Winners
(21 runnings)
02
Dec
2007
03
Dec
2006
04
Dec
2005
05
Dec
2004
07
Dec
2003
01
Dec
2002
02
Dec
2001
03
Dec
2000
05
Dec
1999
29
Nov
1998
30
Nov
1997
01
Dec 1996
02
Dec
1995
31
Jul
1994
18
Jul
1993
19
Jul
1992
21
Jul
1991
25
Jul
1990
Notes: 1990 was the inaugural year.
18
Nov 2012
2:42:46
Neil Aitken (ENG)
3:06:58
Sheena Logan (ENG)
20
Nov 2011
2:35:23
Tim Haughian (ENG)
3:01:27
Sally Wilder (WAL)
05 Dec 2010
---
cancelled
---
cancelled
06 Dec
2009
2:26:14
Neil Renault (ENG)
2:48:14
Samantha Amand (ENG)
07 Dec
2008
---
cancelled
---
cancelled
2:39:25
Dominic Croft (ENG)
3:06:46
Johanna Fletcher (ENG)
2:37:13
Mark Bendell (ENG)
3:07:25
Kirsty Whigham (ENG)
2:44:51
Matthew Hawcroft (ENG)
3:25:28
Zoe Lowe-3
2:36:38
Dennis Walmsley-2
2:56:16
Rosalyn Alexander (SCO)
2:35:46
Mike Boucher (ENG)
3:03:35
Claire Donald (ENG)
2:32:54
Mike Smith (ENG)
3:08:35
Lucy Townsend (ENG)
2:34:33
Simon Lund (ENG)
3:17:20
Elizabeth Walls (ENG)
2:40:08
Andrew Holt (ENG)
3:04:04
Sandra Bowers (ENG)
2:33:22
James Fitzsimmons (ENG)
2:57:37
Zoe Lowe-2
2:35:39
Stephen Moore (ENG)
2:58:18
Zoe Lowe (ENG)
2:31:37
Martin Ferguson (SCO)
3:17:53
Angela Iveson (ENG)
2:24:45
Dennis Walmsley (ENG)
3:01:01
Lesley Turner (ENG)
2:29:38
Simon Lund (ENG)
3:18:48
Sandra Brown (ENG)
2:27:27
Hugh Jones-2
2:46:13
Jackie Leak (ENG)
2:23:04
Oelof Vorster (RSA)
3:07:11
Hilary Walker-2
2:23:12
Hugh Jones (ENG)
2:56:05
Janet Kelly-2
2:19:25
Ieuan Elllis (WAL)
2:54:04
Janet Kelly (WAL)
2:24:25
Anthony Simmons (WAL)
3:02:37
Hilary Walker (ENG)
Most Wins
(1990-date)
Men 2
Hugh Jones (ENG)
1992,1994
Women 3
Zoe Lowe (ENG)
1998-99,2005
Prize Money
(ADR qualified runners)
No information on prize money has been received for this race.
Race Time Bias
(sec/km)
Insufficient data to calculate the race time bias.
Competitive Level
(1990-date)
Insufficient data to calculate the competitive level.
Quality Performances
Men <2:20 1
Women <2:48 1 <2:50 2
Last Updated on
20 Dec 2012
Contributors: Andy Milroy (1), Klaas Loonstra (3), Dave Debnam, Mick McGeoch (26)


Hello there! I'm Carlos Peña and I worked as a programmer for this project
I consider myself a person with a great spirit of work and commitment. One of my concerns in game development has always been about how visual effects work and their technical implementation.
That is the main reason why I worked as a VFX Programmer in the development of TheWitcher: A Bard's Tale.
From the beginning to the end of the development of this project, I have been part of the scrum team of Engine, in charge of our particle system.
Throughout the production I have been constantly updating and expanding the features and functionalities that the particle system can provide based on the proposals and guidelines requested by the design department.
Constant communication and feedback with designers has been crucial in order to generate the technology required to achieve remarkable game visuals.
At the beginning of the production, i have added and kept to date the particle system that I developed together with Sebi.
You can check the particle system on the Chrono Stasis Engine page.
One of the important points to prioritize from the beginning was to be able to transform the particles from their 3x3 rotation matrix.
In this way, we can get features such as "Start Angle Rotation" to provide an initial rotation to the particle or apply a frequency to its rotation matrix depending on the degrees that the user adds to the particle to be able to rotate it over the time.
Starting to be able to rotate the particle from the Z axis (the axis that points towards the camera) It was expanded to be able to rotate the particle in any axis, thus achieving to be able to orient it in the direction that the user will want.
Animation of textures was a very requested request by some designers so I focused from the beginning of production on this topic.
My approach to obtain this result was as follows:
I adapt the rendering of the particles with their color and texture using the materials implemented by Sebastián.. For this I had to reworke the buffers using the vertex array object and binde the corresponding shader that I customize to receive the color and texture as inputs
This adaptation and rework of particle painting with shaders will be great for us in the not too distant future to add HDR or bloom to the particles.
In order to get a better effect transition between Gerald animations, I implemented new functionalities that will exclusively affect the emitter of the particles instead of the whole system.
In this way, if it is intended to stop emitting more particles, its emission is paused, allowing the particles that have been previously spawned to die.
A visual example is that of Gerald's running animations, that when he starts to run, the dust particles begin to be emitted and when he stops and Gerard happens to be in an idle state, the emission is paused, allowing the particles to die.
they had been issued before the change of states. This is a point of improvement with respect to the vertical slice 1 since at the time the entire system paused making all the particles disappear at the moment when it changed states.
In order to be able to produce visual effects such as sword slashes, area of effects, projectils, etc. I took responsibility that the particles were not only painted as quads, but could represent any type of mesh within the system.
Thanks to this functionality in the particle system, it has been possible to carry out a large part of the combat vfx of Gerald, Yennefer and enemies.
Also improve and expand all the types of bilboards that the particle could use in our system.
Including especially Velocity based bilboard, which is based on obtaining the vector direction of the particle (velocity) vector Z (which always points to the camera) and make a cross product to obtain the vector latter to form the matrix 4x4 of the particle.
With this transformation, the particle is pointed at its direction of movement, always respecting its billboard to the camera. Thanks to this we can simulate physical effects
Finally, to simulate particle system events like a bonfire or antorch. We needed a light casting from the emitter of the particle system.
Take advantage of the point lights system that gmfreixas implemented to reproduce light based on a point internally from the particle system
This functionality allows both light casting only around the emitter, around each emitted particle or even both cases at the same time.
However, it is a resource that burns a lot of memory, so from the Particle Light module it can be trained to a specific number of lights, to be customized by the user.
It also has several characteristics such as sharing the same ambient and diffuse color with the color of the particle, fade in / fade out depending on the transparency of the particle, intensity over particle size, etc.
as a miscellaneous but important feature, i added the option to chose between one constant or random between two constant to randomize particle properties as their rotation like you can see in the image below.
This kind of detail give us a more natural and organic simulation of particle effects
To accomplish certain types of effects such as the dash, the idea of implementing a trail system was proposed since with the particle system we had we could not achieve the desired results.
We decided to add the trail effect and I was in charge of developing it. The component of trail is a component that leaves a trail behind the gameobject to which it is tied and has the properties of time of life, minimum distance and orientation.
My approach to handle with trail implementation was as follows
At this point, We need a logic to make the trail interactive and handle a stretch effect. We will interpret nodes as entities with a lifetime and Every frame we will check if last node is ready to die, if not we will break the loop because we don’t want to take into account next nodes until the last one is dead.
According to a selected axis of movement (X, Y, Z), OBB’s vertices are obtained to generate a trail in that direction. But we need to orient the origin and destination vertices if we want to generate a trail in the opposite direction.
To handle this, we rearrange the vertices before we input them as a uniforms flipping them to simulate the quad correctly and rematching its UV’s in the shader.
To accelerate the drawing we use frustum culling using bounding boxes.
I did the calculation of the AABB, avoiding doing it more than once per frame by gameobject and without having to review all the vertices in each calculation
Some visual effects which i made during first production stages of this project
Taking advantage of the knowledge obtained thanks to the adaptation of the painting of the particles using shaders, i was in charge to deal with some shaders like Fresnel shader to obtein the typical effect of a Fresnel Shield.
This is the final output using the fresnel shader.


--- permalink: /404.html title: "404: Page not found" layout: default sitemap: false --- 404 Oops that page could not be found!
Oops that page could not be found!


Hey There
for - loops through a block of code a number of times for/in - loops through the properties of an object for/of - loops through the values of an iterable object while - loops through a block of code while a specified condition is true do/while - also loops through a block of code while a specified condition is true
CLick for reference


I am a Front-End Javascript Developer / Designer currently residing in Tokyo, Japan.
I have a serious passion for creating beautiful, engaging, dynamic websites and mobile apps.
* learning
Created dining and health related web & ios/android apps in React Native + store interface in Nuxt + Order entry system in TypeScript & Nuxt
Position: front-end developer
2018-present


{% extends "base.html" %} {% block body_class %}details3{% endblock %} {% load static utils humanize %} {% block content %}
{{ market.dit_advisor_tip | safe }}
Find out more about selling on {{ market.name }} by visiting their website.
DIT advisers can help you get onto the marketplace. You may also be able to:
Find out more about the countries you plan to export to:
Exporting country guidesPractical advice about e-commerce:
Exporting is GREAT* Special terms are subject to eligibility. Please fill out the application form above and we will contact you.


Free sandbox
New Game
Opponent:
White
Black
Random
New Game!
Change Password
New Password:
If you forget your password, @hans and I will reset it.
Change Password
Your Games


Tari Protocol Discussion 9
Yesterday’s Tari protocol discussion covered key points highlighted in the rough GitHub documents that were presented during last discussion.
This is the TL;DR of yesterday’s conversation (full transcript included below):
-
How well could a Counterparty type model fit for instruction-transactions on the 2nd layer — where some things have to go via the base layer?
-
Will base layer primitives help if we have a second layer failure where the checkpoints are not good enough to recover the second layer state?
-
What kind of info should be on the base layer that could provide value to the second layer beyond what checkpoints provide?
Join us for our next discussion on Freenode in #tari-dev. Discussion times proposed by the Tari community:
Mondays: 8pm CAT (1pm EST)
Thursdays: 11am CAT (4am EST)
To keep up with the latest Tari developments, you can follow the project on Twitter.
Transcript of today’s discussion
3:15 AM <Hansie> Hi, anyone there?
3:16 AM <mikethetike> Hi Hansie
3:18 AM <Hansie> Hi @mikethetike
3:18 AM <Hansie> Was just thinking, with ‘181029-overview.md’ and the Tari two layers, and the 2nd layer fall back on the base layer’s security when required…
3:18 AM <Hansie> Will Merkle roots of some external information set be enough or do we need some other primitives in there as well?
3:23 AM <Hansie> So basically, how well could a Counterparty type model fit for certain types of instruction-transactions on the 2nd layer? Where some things have to go via the base layer.
3:25 AM <simian_za> So in counterparty what kind of extra meta-data do they use in a bitcoin transaction to facilitate actions on their second layer?
3:26 AM <Hansie> Some write-up here: https://tari-labs.github.io/tari-university/layer2scaling/more-landscape/landscape-update.html#a2-counterparty
3:36 AM <simian_za> So it feels like if we have a second layer failure where the checkpoints are not good enough to recover the second layer state that further base layer primitives will not help us anyway?
3:41 AM <Hansie> It is actually simple; if only checkpoint merkle roots are written into the base layer then that is the only thing the base layer can provide in case the base layer’s security is called upon.
3:42 AM <neonknight> We could introduce something like an archival node or an archival functionality on validator nodes to ensure all data is recoverable. It might help to improve data redundancy if all information is distributed between different validator nodes. Not sure how this would work..
3:44 AM <mikethetike> simian_za: I think that the second layer will have to be recoverable only via the second layer, otherwise we will lose scalability
3:45 AM <simian_za> Hansie: Yes, that makes sense. So what other kind of info were you thinking of putting on the base layer that could provide value to the second layer beyond what checkpoints provide?
3:46 AM <mikethetike> who chooses the merkle root of the checkpoint?
3:47 AM <simian_za> mikethetike: probably agreed upon by a committee of validator nodes under some kind of consensus rules?
3:47 AM <Hansie> @simian_za: Maybe transfer instructions of high value assets, as an example
3:49 AM <simian_za> Hansie: that could work, we would need to attach a hefty fee for an Asset issuer to do that though so that Asset issuers only do it if they really feel their asset is valuable
3:49 AM <simian_za> valuable enough to justify the extra security
3:51 AM <mikethetike> we don’t have any say in the value of the assets on tari, that’s entire up to the asset issuers
3:51 AM <simian_za> and I doubt asset issuers are going to sit and weigh up the risk profile of second layer vs base layer. They just want to issue assets
3:52 AM <simian_za> feels like an over-complication
3:52 AM <neonknight> Processing an “expensive” asset on the base layer will also be slow
3:53 AM <Hansie> Just as long as we understand what this means: “2nd layer fall back on the base layer’s security when required…”
3:55 AM <simian_za> Agreed, it just provides a way to confirm that a state at a given point in time (recorded fully on the second layer only) can be confirmed as true, not reconstructed without the second layer
3:56 AM <simian_za> confirmed as true meaning that it can be compared to the base layer checkpoint which cannot be altered once its in the PoW chain
3:57 AM <Hansie> Bye for now


# Digital Fabrication
This is a collection of my notes, practicals, presentations on Digital Fabrication.
### EP1000 Digital Fabrication Fundamentals
This is the landing page for [EP1000 Digital Fabrication Fundamentals](https://rdorville.github.io/EP1000), an elective module.
You will find all sorts of stuff there.
Here is the [LINK](https://rdorville.github.io/EP1000)
### [Presentations](presentations/presentations.html)
This is where most of my presentations are kept.
### [Practicals](practicals/practicals.html)
This holds the various practicals that I have written to supplement work/labs/practicals in Digital Fabrication.
### [Examples](examples/examples.html)
Mainly examples of student's work
Enjoy!
[Rodney<EMAIL_ADDRESS>### Credits
This site is built using [Markdown](https://www.markdownguide.org/), but with the help of online Javascript functions which translate Markdown to HTML.
- [Strapdown](https://ndossougbe.github.io/strapdown/#strapdown) by ndossougbe a very simple and elegant converter.
- [Strapdown.js](https://strapdownjs.com/) the original strapdown by r2r with themes


Select a test
Example 1: Find elements
Example 2: Attributes
Example 3: Classes
Example 4: Contents
Example 6: Sizes
Open the Debugger Console (Ctrl + Shift + J) to see the results.


CSGO TEAM
CSGO SOLO/SEMI-TEAM
VALORANT
5v5
CSGO
and
VALORANT
tournaments by
SOLIS|GAMING
Counter Strike: Global Offensive
Register in teams of five in the form link below
Registrations begin: 24th June, 2021
Registrations close: 11th July, 2021
Fixtures and further announcements: 13th July, 2021
Register Team
Register Solo/Semi-Team
Discord
Valorant
Register in teams of five in the form link below
Registrations begin: 24th June, 2021
Registrations close: 11th July, 2021
Fixtures and further announcements: 13th July, 2021
Register


Lois is Peter's wife, a stay-at-home mom with no patience for her family's antics.  Rounding out the Griffin household is Brian the family dog and a ladies' man who is one step away from AA.


This text is displayed if your browser does not support HTML5 Canvas.
{{ word }}
Just {{ name }} Type
Toggle navigation
Difficulty:
EASY
WPM: 47


Introduction¶
Documentation on the rationale, Waf, and more background is at http://hmgaudecker.github.io/econ-project-templates/
The Python version of the template uses a modified version of Stachurski’s and Sargent’s code accompanying their Online Course [2] for Schelling’s (1969, [1]) segregation model as the running exmaple.
Getting started¶
This assumes you have completed the steps in the README.md file and everything worked.
The logic of the project template works by step of the analysis:
- Data management
- The actual estimations / simulations / ?
- Visualisation and results formatting (e.g. exporting of LaTeX tables)
- Research paper and presentations.
It can be useful to have code and model parameters available to more than one of these steps, in that case see sections Model specifications, Model code, and Code library.
First of all, think about whether this structure fits your needs – if it does not, you need to adjust (delete/add/rename) directories and files in the following locations:
- Directories in src/;
- The list of included wscript files in src/wscript;
- The documentation source files in src/documentation/ (Note: These should follow the directories in src exactly);
- The list of included documentation source files in src/documentation/index.rst
Later adjustments should be painlessly possible, so things won’t be set in stone.
Once you have done that, move your source data to src/original_data/ and start filling up the actual steps of the project workflow (data management, analysis, final steps, paper). All you should need to worry about is to call the correct task generators in the wscript files. Always specify the actions in the wscript that lives in the same directory as your main source file. Make sure you understand how the paths work in Waf and how to use the auto-generated files in the language you are using particular language (see the section Project paths below).
Project paths¶
A variety of project paths are defined in the top-level wscript file. These are exported to header files in other languages. So in case you require different paths (e.g. if you have many different datasets, you may want to have one path to each of them), adjust them in the top-level wscript file.
The following is taken from the top-level wscript file. Modify any project-wide path settings there.
def set_project_paths(ctx):
"""Return a dictionary with project paths represented by Waf nodes."""
pp = OrderedDict()
pp["PROJECT_ROOT"] = "."
pp["IN_DATA"] = "src/original_data/"
pp["LIBRARY"] = "src/library"
pp["BLD"] = ""
pp["OUT_DATA"] = f"{out}/out/data"
pp["OUT_ANALYSIS"] = f"{out}/out/analysis"
pp["OUT_FINAL"] = f"{out}/out/final"
pp["OUT_FIGURES"] = f"{out}/out/figures"
As should be evident from the similarity of the names, the paths follow the steps of the analysis in the src
directory:
- data_management → OUT_DATA
- analysis → OUT_ANALYSIS
- final → OUT_FINAL, OUT_FIGURES, OUT_TABLES
These will re-appear in automatically generated header files by calling the write_project_paths
task generator (just use an output file with the correct extension for the language you need – .py
, .r
, .m
, .do
)
By default, these header files are generated in the top-level build directory, i.e. bld
. The Python version defines a dictionary project_paths
and a couple of convencience functions documented below. You can access these by adding a line:
from bld.project_paths import XXX
at the top of you Python-scripts. Here is the documentation of the module:
bld.project_paths
Define a dictionary project_paths with path definitions for the entire project.
This module is automatically generated by Waf, never change it!
If paths need adjustment, change them in the root wscript file.


Test API Server for the eat@home project
Use the following endpoints to access the fake data:
GET
Companies
Users
Other
POST
Adding a User:
POST, with body:
- /api/users
- username (string)
- email (string)
Adding a Save:
POST, with body:
- /api/saves
- user_id (integer)
- company_id (integer)
Adding a Review:
POST, with body (note: content of 'reviews' should be text of the review):
- /api/reviews
- reviews (string)
- user_id (integer)
- company_id (integer)
Adding a Rating:
POST, with body:
- /api/ratings
- user_id (string)
- company_id (integer)
- rating (integer)
PUT
Updating a User:
PUT, with body:
- /api/users/:id
- username (string)
- email (string)
- NOTE: The database currently has firstName and lastName, rather than username.


| Number of Classes | Line Coverage | Mutation Coverage | Test Strength |
|---|---|---|---|
| 6 | 90% | 0% | 0% |
| Name | Line Coverage | Mutation Coverage | Test Strength |
|---|---|---|---|
| Alphabet.java | 96% |
0% |
0% |
| NumberingPlanIndicator.java | 95% |
0% |
0% |
| SimpleAddress.java | 100% |
0% |
0% |
| SimpleCommand.java | 0% |
0% |
0% |
| Tag.java | 100% |
0% |
0% |
| TypeOfNumber.java | 94% |
0% |
0% |


Richardson, TX |<PHONE_NUMBER> |<EMAIL_ADDRESS>Currently a computer science student at the University of Texas at Dallas, I aspire to expand my knowledge and build a strong network. Please feel free to contact me if you have any questions or interest.


| {{created_at}} | {{#with purchaseItem}} {{title}} {{/with}} | {{expected_payment_amount}} {{expected_payment_currency}} |
| {{updated_at}} | {{#with purchaseItem}} {{title}} {{/with}} | {{expected_payment_amount}} {{expected_payment_currency}} | View purchase |
| {{updated_at}} | {{#with purchaseItem}} {{title}} {{/with}} | {{expected_payment_amount}} {{expected_payment_currency}} |


frappe.model.naming._set_amended_name (doc)
No docs
frappe.model.naming.append_number_if_name_exists (doc)
No docs
frappe.model.naming.de_duplicate (doctype, name)
No docs
frappe.model.naming.get_default_naming_series (doctype)
get default value for naming_series
property
frappe.model.naming.getseries (key, digits, doctype=)
No docs
frappe.model.naming.make_autoname (key, doctype=)
Creates an autoname from the given key:
Autoname rules:
* The key is separated by '.'
* '####' represents a series. The string before this part becomes the prefix:
Example: ABC.#### creates a series ABC0001, ABC0002 etc
* 'MM' represents the current month
* 'YY' and 'YYYY' represent the current year
Example:
* DE/./.YY./.MM./.##### will create a series like
DE/09/01/0001 where 09 is the year, 01 is the month and 0001 is the series
frappe.model.naming.revert_series_if_last (key, name)
No docs
frappe.model.naming.set_name_by_naming_series (doc)
Sets name by the naming_series
property
frappe.model.naming.set_new_name (doc)
Sets the `name`` property for the document based on various rules.
autoname
method is declared, then call it.autoname
property is set in the DocType (meta
), then build it using the autoname
property.name
is already defined, use that nameParameters:
doc
- Document to be named.frappe.model.naming.validate_name (doctype, name, case=None, merge=False)
No docs


Contributing¶
Contributions of any kind are greatly appreciated!
Contributing¶
If you are able to contribute changes yourself, just fork the source code on GitHub, make changes and file a pull request. All contributions are welcome, no matter how big or small.
Quick guide to contributing¶
`Fork the Cocktail-Shaker repository on GitHub`_, then clone your fork to your local machine:
git clone https://github.com/<username>/Cocktail-Shaker.git
Install the development requirements:
cd Cocktail-Shaker pip install -r requirements/development.txt
Create a new branch for your changes:
git checkout -b <name-for-changes>
Make your changes or additions. Ideally add some tests and ensure they pass.
Commit your changes and push to your fork on GitHub:
git add . git commit -m "<description-of-changes>" git push origin <name-for-changes>
Tips¶
- Follow the PEP8 style guide.
- Include docstrings as described in PEP257.
- Try and include tests that cover your changes.
- Try to write good commit messages.
- Consider squashing your commits with rebase.
- Read the GitHub help page on Using pull requests.


Can You Identify Me
Below are several pictures of people who have not
been identified. The subjects are probably
members of the Stacey, Eikleberry or Hensel family line. If you can identify any of these people,
please contact Marlene Batdorf and/or the
webmaster, Dick Harrington. Refer to the number on the picture you
identify.
Unknown # 3
Unknown # 4
Unknown # 5
Unknown # 6


In what was once Texcoco lake, birthplace of pre-Hispanic civilizations, lies the Ciudat de los Palacios(City of Palaces) that is today, Mexico City.
Mexico City offers visitors a great many different interesting sites to visit, from pre-Columbian Mexico to modern and cosmopolitan 21st century Mexico.


|
Wyatt
0.0.1
|
Public Member Functions | |
| EncoderAdapter (int channelA, int channelB, int ticksPerRev, Hardware hardware) | |
| ~EncoderAdapter () override | |
| void * | run () override |
| long | getCount () |
| void | resetCount () |
| double | getSpeedRPM () |
| std::list< IMessage * > * | read () override |
| void | write (IMessage *message) override |
| Public Member Functions inherited from Thread | |
| int | start () |
| int | join () |
| int | detach () |
| void | signal (int signal) |
| pthread_t | self () |
| Public Member Functions inherited from IHardwareInterface | |
| virtual | ~IHardwareInterface () |
Additional Inherited Members | |
| Protected Attributes inherited from Thread | |
| std::atomic< int > | m_signal |
Definition at line 17 of file EncoderAdapter.h.
| EncoderAdapter::EncoderAdapter | ( | int | channelA, |
| int | channelB, | ||
| int | ticksPerRev, | ||
| Hardware | hardware | ||
| ) |
Counts a two-channel encoder.
| channelA | WiringPi Pin for channel A. |
| channelB | WiringPi Pin for channel B. |
| ticksPerRev | Number of ticks per revolution on this encoder. |
Definition at line 4 of file EncoderAdapter.cpp.
|
override |
Destructs the encoder counter.
Definition at line 19 of file EncoderAdapter.cpp.
| long EncoderAdapter::getCount | ( | ) |
Get the current count from the encoder.
Definition at line 62 of file EncoderAdapter.cpp.
| double EncoderAdapter::getSpeedRPM | ( | ) |
Get the encoder current speed in RPM.
Definition at line 81 of file EncoderAdapter.cpp.
|
overridevirtual |
Read a list containing a message with the current encoder count for this encoder, and a message with the current speed.
Implements IHardwareInterface.
Definition at line 72 of file EncoderAdapter.cpp.
| void EncoderAdapter::resetCount | ( | ) |
Reset the encoder count to 0.
Definition at line 67 of file EncoderAdapter.cpp.
|
overridevirtual |
Runs the encoder counter worker thread.
Implements Thread.
Definition at line 24 of file EncoderAdapter.cpp.
|
inlineoverridevirtual |
Write a message to the peripheral. Deletes the message pointer.
| msg | A Message to be sent |
Implements IHardwareInterface.
Definition at line 58 of file EncoderAdapter.h.


General support queries. User Guides: https://support.komodoplatform.com/ Support staff: Angelina#6231 gcharang#6833. If you want to ask JL777 a question, use the #ask-jl777 channel.
100 messages
Before 05-Dec-19 12:00 AM
TShell13-Nov-18 06:40 AM
Hi, I use native mode. After upgrading from 0.2.41d to 0.2.43d , it takes too long to be fully synced, more than 1 day. Is this normal?
TonyL13-Nov-18 07:11 AM
Hi @TShell Are you using same hardware and operating system as before (when you synced 0.2.41d)?(edited)
Synchronisation in Native mode depends of your drive IOPS (on SSD it's much much faster) and internet connection speed (blocks downloading on your PC)
TShell13-Nov-18 07:37 AM
Yes, I use the same one. I have also used SSD. All I did is update, the result of which looks like reindexing from the scratch.
TonyL13-Nov-18 07:40 AM
Is synchronisation stuck on some height or it's going but slow?
TShell13-Nov-18 07:43 AM
I tried on two different SSDs. The first one was stuck at 94.60%, so I stopped and changed into lite mode. The second is verifying blocks slowly.
TonyL13-Nov-18 07:46 AM
Could you please open a email ticket to<EMAIL_ADDRESS>if synchronisation will stuck again? By the way which OS are you using?
TShell13-Nov-18 07:47 AM
I use Windows7 64bit.
Thank you for your time
TonyL13-Nov-18 07:54 AM
You're most welcome! Windows OS usually also adding some "slowness" if compare with Linux. There are various reasons why it's started to sync from scratch (e.g. blocks database was corrupted on starts/stops). If there some states when sync is stuck on your side it should possible to get additional information via daemon logs so please feel free to contact us to troubleshoot.
[ANN][KMD][dPoW] Komodo - Zcash Zero Knowledge Privacy Secured by Bitcoin
1
Hermes14-Nov-18 08:01 PM
Thanks @Gordon Komodo I asked him to make a ticket to avoid spamming the thread.
1
Psipherious15-Nov-18 04:21 PM
Guys is it possible to export a seed? or is it only possible to get the seed when initially creating a new wallet?
Nabob15-Nov-18 04:30 PM
You cannot export seed, only created when using new wallet. but you can export private key from Seed
gcharang15-Nov-18 04:33 PM
@Psipherious you can do it through Settings > export keys > enter pin > get seed(edited)
Psipherious15-Nov-18 04:41 PM
Okay, found that, ty
ABP brewmaster16-Nov-18 09:28 PM
@Team Admin Hi, thank you very much for your work. I am trying to setup the first atomic swap. ABP is not yet on CMC, which is causing me an issue with autoprice_my. Is it possible to by pass this?
SHossain16-Nov-18 09:29 PM
If the coin is not in CMC, you need to use manual/fixed price


§385-3 Payment of benefits. Additional unemployment benefits are payable from the fund to unemployed claimants who are eligible under this chapter. [L 1961, c 157, pt of §1; Supp, §93B-4; HRS §385-3]


This is the homepage that uses the default layout for rendering. The default layout contains a top menu and adds the Bootstrap css. The custom page will not use the layout.
The top menu item is selected automatically based on the request path.
The homepage includes a page specific script that writes a console log message.
Message source: [[#{sample.message}]]


You
Full name
Verified
You haven't added your Facebook account yet.
You haven't added your GitHub account yet.
{{ ::organization }}
{{ ::authorization.grantedTo }}
Password
Authenticator application


2020-07-24 Remove the Temporary Files (including Windows.old) on Windows 10 to Save Space via Storage Sense windows


public class Recipe
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
Recipe()
Constructor of the class that sets all attributes to default values.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Recipe r)
Check if the name of this recipe equals to already given recipe and returns true if they match and false if not.
|
int |
getAmtChocolate()
Returns amount of chocolate in recipe.
|
int |
getAmtCoffee()
Returns amount of Coffee in recipe.
|
int |
getAmtMilk()
Returns amount of Milk in recipe.
|
int |
getAmtSugar()
Reutrns amount of Sugar in recipe.
|
static sorcer.service.Context |
getContext(Recipe recipe)
Returns a context from given recipe.
|
java.lang.String |
getName()
Returns the name of recipe.
|
int |
getPrice()
Returns the price of recipe.
|
static Recipe |
getRecipe(sorcer.service.Context context)
Returns a recipe from given context.
|
void |
setAmtChocolate(int amtChocolate)
Sets amount of chocolate in recipe and it has to be greater than or equal to 0.
|
void |
setAmtCoffee(int amtCoffee)
Sets amount of Coffee in recipe and it has to be greater than or equal to 0.
|
void |
setAmtMilk(int amtMilk)
Sets amount of milk in recipe and it has to be greater than or equal to 0.
|
void |
setAmtSugar(int amtSugar)
Sets amount of Sugar in recipe.
|
void |
setName(java.lang.String name)
Sets name of recipe and it cant be null.
|
void |
setPrice(int price)
Sets the price for recipe and it has to be greater than or equal to 0.
|
java.lang.String |
toString()
Returns string name of this recipe object.
|
public Recipe()
public int getAmtChocolate()
public void setAmtChocolate(int amtChocolate)
amtChocolate
- The amtChocolate to setValue.public int getAmtCoffee()
public void setAmtCoffee(int amtCoffee)
amtCoffee
- The amtCoffee to setValue.public int getAmtMilk()
public void setAmtMilk(int amtMilk)
amtMilk
- The amtMilk to setValue.public int getAmtSugar()
public void setAmtSugar(int amtSugar)
amtSugar
- The amtSugar to setValue.public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name to setValue.public int getPrice()
public void setPrice(int price)
price
- The price to setValue.public boolean equals(Recipe r)
r
- The recipe to compare with.public java.lang.String toString()
toString
in class java.lang.Object
public static Recipe getRecipe(sorcer.service.Context context) throws sorcer.service.ContextException
context
- Context to create recipe from.sorcer.service.ContextException
public static sorcer.service.Context getContext(Recipe recipe) throws sorcer.service.ContextException
recipe
- Recipe to create context from.sorcer.service.ContextException


106 miles to Chicago
问题描述 :
In the movie “Blues Brothers”, the orphanage where Elwood and Jack were raised may be sold to the Board of Education if they do not pay 5000 dollars in taxes at the Cook Country Assessor’s Office in Chicago. After playing a gig in the Palace Hotel ballroom to earn these 5000 dollars, they have to find a way to Chicago. However, this is not so easy as it sounds, since they are chased by the Police, a country band and a group of Nazis. Moreover, it is 106 miles to Chicago, it is dark and they are wearing sunglasses.
As they are on a mission from God, you should help them find the safest way to Chicago. In this problem, the safest way is considered to be the route which maximises the probability that they are not caught.
As they are on a mission from God, you should help them find the safest way to Chicago. In this problem, the safest way is considered to be the route which maximises the probability that they are not caught.
输入:
The input contains several test cases.
Each test case starts with two integers n and m (2 <= n <= 100 , 1 <= m <= n*(n-1)/2). n is the number of intersections, m is the number of streets to be considered.
The next m lines contain the description of the streets.  Each street can be used in both directions. You may assume that there is at most one street between two end points.
The last test case is followed by a zero.
Each test case starts with two integers n and m (2 <= n <= 100 , 1 <= m <= n*(n-1)/2). n is the number of intersections, m is the number of streets to be considered.
The next m lines contain the description of the streets.  Each street can be used in both directions. You may assume that there is at most one street between two end points.
The last test case is followed by a zero.
输出:
For each test case, calculate the probability of the safest path from intersection 1 (the Palace Hotel) to intersection n (the Honorable Richard J. Daley Plaza in Chicago). You can assume that there is at least one path between intersection 1 and n.
Print the probability as a percentage with exactly 6 digits after the decimal point. The percentage value is considered correct if it differs by at most 10-6 from the judge output. Adhere to the format shown below and print one line for each test case.
Print the probability as a percentage with exactly 6 digits after the decimal point. The percentage value is considered correct if it differs by at most 10-6 from the judge output. Adhere to the format shown below and print one line for each test case.
样例输入:
5 7 5 2 100 3 5 80 2 3 70 2 1 50 3 4 90 4 1 85 3 1 70 0
样例输出:
61.200000 percent
解题代码:
//* @author: ccQ.SuperSupper import java.io.*; import java.util.*; public class Main { static int N = 100+5; static int n; static double Graph[][] = new double[N][N]; public static void init(){ int i,j; for(i=0;i< N;++i) for(j=0;j< N;++j) Graph[i][j] = 0.0; } public static void main(String args[]) throws Exception{ double temp; int i,j,u,v,m; //Scanner cin = new Scanner(new FileInputStream("input.txt")); Scanner cin = new Scanner(System.in); while(cin.hasNext()){ n = cin.nextInt(); if(n==0) break; init(); m = cin.nextInt(); for(i=0;i< m;++i){ u = cin.nextInt(); v = cin.nextInt(); temp = cin.nextDouble(); Graph[v][u] = Graph[u][v] = temp/100.0; } temp = dijkstra()*100; System.out.printf("%.6f", temp); System.out.println(" percent"); } } public static double dijkstra(){ int i,j,k; boolean flag[] = new boolean[N]; double meat[] = new double[N]; for(i=1;i<=n;++i) { meat[i] = Graph[1][i]; flag[i] = false; } flag[1] = true; for(i=0;i< n;++i){ k = -1; for(j=1;j<=n;++j) if(!flag[j]){ if(k==-1 || meat[k]< meat[j]) k = j; } if(k==-1) break; flag[k] = true; for(j=1;j<=n;++j)if(!flag[j]){ if(meat[j]< meat[k]*Graph[k][j]) meat[j] = meat[k]*Graph[k][j]; } } return meat[n]; } }
(adsbygoogle = window.adsbygoogle || []).push({});
第二块代码if(it != mp.end())应改为if(it != mp.end() && (i+1)!=(it->second +1))；因为第二种解法如果数组有重复元素 就不正确
对，这里说的最长回文子序列，非子串
如果两个序列的最后字符不匹配（即X [M-1]！= Y [N-1]）
L（X [0 .. M-1]，Y [0 .. N-1]）= MAX（L（X [0 .. M-2]，Y [0 .. N-1]），L（X [0 .. M-1]，Y [0 .. N-1]）
这里写错了吧。
学习了！！
写的很好~~
for(int i=1; i<=m; i++){
for(int j=1; j<=n; j++){
dp = dp [j-1] + 1;
if(s1.charAt(i-1) == s3.charAt(i+j-1))
dp = dp[i-1] + 1;
if(s2.charAt(j-1) == s3.charAt(i+j-1))
dp = Math.max(dp [j - 1] + 1, dp );
}
}
这里的代码似乎有点问题？ dp(i)(j) = dp(i)(j-1) + 1;这个例子System.out.println(ils.isInterleave("aa","dbbca", "aadbbcb"));返回的应该是false
C语言版本的代码好像有点问题
很好的模板
很强大啊，佩服
学算法中的数据结构学到一定程度会乐此不疲的，比如其中的2－3树，类似的红黑树，我甚至可以自己写个逻辑文件系统结构来。
swap写成内联函数会不会好一些
通不过。
文章写得挺好，就是最后的斐波那契那个没有看明白
Good task for the group. Hold it up for every yeara??s winner. This is a excellent oppotunity for a lot more enhancement. Indeed, obtaining far better and much better is constantly the crucial. Just like my pal suggests on the truth about ab muscles, he just keeps obtaining much better.


Approval Initiated Deposit Initiated Withdrawal Initiated Offer Creation Initiated Engagement Initiated Cancellation Initiated Repayment Initiated
Approval request for {{data.fspName}} to withdraw and spend {{data.token.tokenSymbol}} has been initiated. Your deposit request for {{data.tokenAmount | tokenValue:data.token.tokenAddress}} {{data.token.tokenSymbol}} has been initiated. Your withdrawal request for {{data.tokenAmount | tokenValue:data.token.tokenAddress}} {{data.token.tokenSymbol}} has been initiated. Your lending offer for {{data.tokenAmount | tokenValue:data.token.tokenAddress}} {{data.token.tokenSymbol}} has been initiated. Your borrowing offer for {{data.tokenAmount | tokenValue:data.token.tokenAddress}} {{data.token.tokenSymbol}} has been initiated. Your swap offer for {{data.tokenAmount | tokenValue:data.token.tokenAddress}} {{data.token.tokenSymbol}} has been initiated. Your loan request for {{data.tokenAmount | tokenValue:data.token.tokenAddress}} {{data.token.tokenSymbol}} has been initiated. Your lending request for {{data.tokenAmount | tokenValue:data.token.tokenAddress}} {{data.token.tokenSymbol}} has been initiated. Your swap request for {{data.tokenAmount | tokenValue:data.token.tokenAddress}} {{data.token.tokenSymbol}} has been initiated. Your cancellation request for lending offer {{data.issuanceId}} has been initiated. Your cancellation request for borrowing offer {{data.issuanceId}} has been initiated. Your cancellation request for swap offer {{data.issuanceId}} has been initiated. Principal and interests repayment {{data.tokenAmount | tokenValue:data.token.tokenAddress}} {{data.token.tokenSymbol}} has been initiated.


QScxmlExecutableContent Namespace
The QScxmlExecutableContent namespace contains various types used to interpret executable content in state machines. More...
| Header: | #include <QScxmlExecutableContent> |
| qmake: | QT += scxml |
| Since: | Qt 5.8 |
Classes
| class | AssignmentInfo |
| class | EvaluatorInfo |
| class | ForeachInfo |
| class | InvokeInfo |
| class | ParameterInfo |
Types
| typedef | ContainerId |
| typedef | EvaluatorId |
| typedef | InstructionId |
| typedef | StringId |
Detailed Description
The QScxmlExecutableContent namespace contains various types used to interpret executable content in state machines.
Classes
class AssignmentInfo
The AssingmentInfo class represents a data assignment. More...
class EvaluatorInfo
The EvaluatorInfo class represents a unit of executable content. More...
class ForeachInfo
The ForeachInfo class represents a foreach construct. More...
class InvokeInfo
The InvokeInfo class represents a service invocation. More...
class ParameterInfo
The ParameterInfo class represents a parameter to a service invocation. More...
Type Documentation
typedef QScxmlExecutableContent::ContainerId
ID for a container holding executable content.
This typedef was introduced in Qt 5.8.
typedef QScxmlExecutableContent::EvaluatorId
ID for a unit of executable content.
This typedef was introduced in Qt 5.8.
typedef QScxmlExecutableContent::InstructionId
ID for an instruction of executable content.
This typedef was introduced in Qt 5.8.
typedef QScxmlExecutableContent::StringId
ID for a string contained in executable content.
This typedef was introduced in Qt 5.8.


The board '{{board.title}}' has been closed.You can re-open it to bring it back or you can totally remove it by deleting.


Espresso
Overview:
- Grind beans
- Brew espresso
- Enjoy
Grinding Beans
Measure out about 14g (1tbsp) of beans
For stronger/weaker drinks, adjust beans accordingly.
Grinding beans
Grind beans until they have reached a fine consistency like on the right:
Tamping Espresso
- Empty espresso into portafilter
- Smooth surface with fingers
- Apply 25-35lbs of pressure directly onto mound using tamper
- Results are as follows:
Pulling Shots
- Lock portafilter into machine and brew into glass.
- After about 30 seconds, shut off machine.
- Extraction is complete with a reddish brown foaming espresso shot
- Enjoy!


Gratitude
A quick shout out to those in the community who have supported me in various forms, or who have encouraged me one way or another in this grand adventure that I now find myself in:
Dr. Donald Robertson (aka Emperor Marcus Aurelius): I saw Dr. Robertson’s post in my feed for his Patreon account and was inspired to “make the jump” in my own pursuit here.
Wojciech Nagórski: For putting out your answers on StackOverflow to get me in the right direction here.
Community Members
Recognition to the community members in my world that make a difference, at least in my world:
The Legendary Jack Bond: ‘nuff Said.
Agent Smith & The Rest of the Dark Matter: For speaking up every now and again.
MSFT Employees
Those within the empire that have my gratitude and appreciation for engaging the common user:
Other employees of mention:
David Kean: For having the patience to put up with my whining.


Rule Id
|
Evaluate Inputs
|
Add new rule
No records found!
|
Evaluate Inputs
|
Add new rule
<< Prev
|
|
Next >>
Edit Rule
Delete Rule
<< Prev
|
|
Next >>


With decades of experience working with both buyers and sellers, our team has a personal, friendly touch and a professional approach.
Freeman Realty's brokers and agents can help you buy, sell, and lease all types of real estate including residential, commercial, farms, and development.
Feel free to contact us whenever you are ready – we are waiting for your call!


Before you start, install rmarkdown
package and download “R Markdown Cheat Sheet” and “R Markdown Reference Guide” from
https://www.rstudio.com/resources/cheatsheets/
There exist many good introductions to RMarkdown:
- Producing Reports With knitr as SWC lesson
- RStudio tutorial on RMarkdown
- RMarkdown chapter in R for Data Science
- Garrett Grolemunds’s >1h webinar
Try to understand enough of RMarkdown to get through Challenge 1.
markdown
Challenge 1:
Create a new R Markdown file (File -> New File -> Document). First run “Knit” document to see HTML output. Then find or add the following formatting marks:
- bold, italics,
code-type
- headers: title, main section, sub-section, sub-sub-section (its the same symbol, just repeated multiple times)
- link to the page
- figure
options
If you look at your .Rmd
file from Challenge 1, you might realized a strange thing. For the first chunk (summary(cars)
) R code is a part of HTML report while for the second chunk (plot(pressure)
) we see only output but not R code itself. This is controlled by chunk options:
- Use
echo=FALSE
to avoid having the code itself shown. - Use
results="hide"
to avoid having any results printed. - Use
eval=FALSE
to have the code shown but not evaluated. - Use
warning=FALSE
andmessage=FALSE
to hide any warnings or messages produced. - Use
fig.height
andfig.width
to control the size of the figures produced (in inches).
If you forget a syntax you can always click on a little wheel in the chunk’s top right corner and select it in a menu. You can also run a chunk in a console after clicking on the green arrow.
If you want to set default options for all chunks, you can use knitr::opts_chunk$set
function.
Challenge 2
Add a new chunk with ggplot2 figure to your Rmd file. Use chunk options to control the size of a figure and to hide the code.
formats
RMarkdown processing consist of two steps: * knitr
package is used to run all the chunks and replace them by their output, the result is markdown (.md
) file * some other software (like pandoc
) process markdown file into final format
Challenge 3
Look at the header of your document where the output format is specified. Change it from output: html_document
to output: word_document
or output: pdf_document
to produce MS Word or PDF document.
summary
There are many other ways to use RMarkdown:
- presentation slides with xaringan package
- a blog with blogdown package - like this page
- a book with bookdown package - like R for Data Science
- a reproducible workflow with workflowr package
Once something is written in markdown format, it is quite easy to switch from HTML to PDF to slides to workflowr or blog.
Also with RMarkdown it is easier to make your analysis reproducible:


{{ _('To include a link, add the full URL (starting with https://) and it will become a clickable hyperlink. For example:') }}
{{ _('Apply now at') }} https://www.canada.ca
{{ _('Apply now at') }} https://www.canada.ca
{{ _('To embed a link in your message, use square brackets around descriptive text, followed by round brackets around the URL. Make sure links make sense out of context (avoid “click here”). For example:') }}
{{ _('[Sign in](https://www.canada.ca/sign-in)') }}
{{ _('To include a personalised link in your message, use double round brackets around the personalised link, as you would for a variable. To embed a personalised link, use square brackets around the descriptive text, followed by triple round brackets around the variable link.') }}
{{ _('Apply now at') }} (({{_('link')}}))
[{{ _('Your personalised link') }}]((({{ _('link') }})))
{{ _('Apply now at') }} https://www.canada.ca


al-Khwārizmī is free to use.
However, building and running al-Khwārizmī takes a significant amount of my time and energy. If you like al-Khwārizmī, would like more things like it in the future, and are able to do so, please support al-Khwārizmī.
Your contributions support:
- Infrastructure (hosting, bandwidth, etc)
- Time spent running al-Khwārizmī events
- More future projects
You can support al-Khwārizmī via [PayPal], [Coinbase] or a direct [Bitcoin Cash] payment.
(Amounts under $1 barely reach me after fees and will not confer a badge. Please be patient; some transactions, especially using cryptocurrencies, can take an hour or two to complete.)


This is a raw element that has no function other than drawing an icon with text.
Other than MLabel this will render as ItemStack on hover in a Text UI.
For GUI renders it behaves exactly like an MLabel
MIcon() - Constructor for class de.dosmike.sponge.megamenus.api.elements.MIcon
This is a raw element that has no function other than drawing an icon with text.
This is a special element for Text UIs that won't render as ItemStack on hover.
For GUI renders it behaves exactly like an MIcon
MLabel() - Constructor for class de.dosmike.sponge.megamenus.api.elements.MLabel


Simple Tic Tac Toe Game
Player turn:
o
x
Reset board
Game over! Winner: {{winner}}
{{cells[$index]}}


UPS Options
Enable passwords storage If this option is enabled, passwords will be stored in the data file. If encryption is disabled, passwords will be stored in plaintext.
Enable passwords encryption If this option is enabled, the user will need to enter a Master Password to securely encrypt the complele data file.
Save


View All Your Posted Cars
Red Toyota Corolla 2010
This car is solid, fresh, and robust. It still retains the new car smell :-)
₦ 2,500,000.00
Red Toyota Corolla 2010
This car is solid, fresh, and robust. It still retains the new car smell :-)
₦ 2,500,000.00
Red Toyota Corolla 2010
This car is solid, fresh, and robust. It still retains the new car smell :-)
₦ 2,500,000.00
Red Toyota Corolla 2010
This car is solid, fresh, and robust. It still retains the new car smell :-)
₦ 2,500,000.00
Red Toyota Corolla 2010
This car is solid, fresh, and robust. It still retains the new car smell :-)
₦ 2,500,000.00
Red Toyota Corolla 2010
This car is solid, fresh, and robust. It still retains the new car smell :-)
₦ 2,500,000.00
Red Toyota Corolla 2010
This car is solid, fresh, and robust. It still retains the new car smell :-)
₦ 2,500,000.00
Red Toyota Corolla 2010
This car is solid, fresh, and robust. It still retains the new car smell :-)
₦ 2,500,000.00
Red Toyota Corolla 2010
This car is solid, fresh, and robust. It still retains the new car smell :-)
₦ 2,500,000.00


Ruler
that measures
The actual dpi (pixel density) of your screen may be not known to the browser. So, it would be best if you calibrated the screen with a known reference.
Here we use a credit card to do that.
Adjust size on-screen by pinching with two fingers to zoom in (or) zoom out, (or) using the scroll up or down.


CEO John Legere Leaving T-Mobile, TMUS Stock Stays Steady
Mike Sievert will take over as CEO
T-Mobile (NYSE:TMUS) CEO John Legere is leaving the company, but his departure isn’t affecting TMUS stock on Monday.
The announcement about John Legere leaving T-Mobile notes that this change won’t happen for a few months yet. This will have him leaving behind the role as his contract expires on April 30, 2020. However, he will remain on the Board of Directors.
Here’s a statement from the CEO about his departure from T-Mobile.
“I am extremely proud of the culture and enthusiasm we have built around challenging the status quo and our ongoing commitment to putting customers first. Together, these attributes have distinguished T-Mobile in the marketplace and on Wall Street, giving us a powerful business advantage that is instilled throughout every level of T-Mobile.”
John Legere leaving T-Mobile won’t leave the company without a leader. A transition plan is already in place that will have Mike Sievert succeeding Legere as the next CEO of TMUS. Sievert is the current President and Chief Operating Officer of the company. He also holds a seat on its Board of Directors.
The stable TMUS stock price suggests that investors aren’t worried about John Legere leaving T-Mobile. Bernstein analyst Peter Supino backs up this idea as well. He points out that the company gains a “strong strategist who has been a big part of T-Mobile’s recent success,” with Sievert as its next CEO.
TMUS stock was up slightly as of Monday afternoon.
As of this writing, William White did not hold a position in any of the aforementioned securities.


Mirpur 1
| Name | Mr. Karim Choudhuri |
|<EMAIL_ADDRESS>| |
| Password | ****** |
Client Full Name
Review: Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Client Full Name
Review: Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Client Full Name
Review: Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Client Full Name
Review: Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Client Full Name
Review: Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Client Full Name
Review: Lorem ipsum dolor sit, amet consectetur adipisicing elit.
we are always ready to welcome you!


Loads up 10 products. Access the widget contexts by using the global variable: __okanjoPlacements
__okanjoPlacements


During a {{edu.type}} program, I received the {{edu.title}} ({{edu.initials}}) degree from the {{edu.instituion}}, between {{edu.from}} to {{edu.to}}.


Software Developer
A webpage containing information about a band,showing images a logo and some text about the band
Click here to view the pageAnother webpage containing a display of images listed into three categories, portrait, nature and weddings
Click here to view the pageA webpage containing list and images of about animals that can be adopted from the shelter
Click here to view the pageA webpage containing information about a hotel such as room reservation, room prices and activities carried out at the resort
Click here to view the page


EntityResource
Entity management operations as REST API. An entity is an "instance" of a Type. Entities conform to the definition of the Type they correspond with.
The following resources are applicable:
/entities
POST
Submits an entity definition (instance) corresponding to a given type.
Response Body
| element: | (custom) |
| media types: | application/json |
(no documentation provided)
GET
Gets the list of entities for a given entity type.
Parameters
| name | description | type | default |
|---|---|---|---|
| type | name of a type which is unique | query |
Response Body
| element: | (custom) |
| media types: | application/json |
(no documentation provided)
/entities/{guid}
GET
Fetch the complete definition of an entity given its GUID.
Parameters
| name | description | type | default |
|---|---|---|---|
| guid | GUID for the entity | path |
Response Body
| element: | (custom) |
| media types: | application/json |
(no documentation provided)
PUT
Adds property to the given entity id
Parameters
| name | description | type | default |
|---|---|---|---|
| guid | entity id | path | |
| property | property to add | query | |
| value | property's value | query |
Response Body
| element: | (custom) |
| media types: | application/json |
response payload as json
/entities/{guid}/traits
GET
Gets the list of trait names for a given entity represented by a guid.
Parameters
| name | description | type | default |
|---|---|---|---|
| guid | globally unique identifier for the entity | path |
Response Body
| element: | (custom) |
| media types: | application/json |
a list of trait names for the given entity guid
POST
Adds a new trait to an existing entity represented by a guid.
Parameters
| name | description | type | default |
|---|---|---|---|
| guid | globally unique identifier for the entity | path |
Response Body
| element: | (custom) |
| media types: | application/json |
(no documentation provided)
/entities/{guid}/traits/{traitName}
DELETE
Deletes a given trait from an existing entity represented by a guid.
Parameters
| name | description | type | default |
|---|---|---|---|
| guid | globally unique identifier for the entity | path | |
| traitName | name of the trait | path |
Response Body
| element: | (custom) |
| media types: | application/json |
(no documentation provided)


| Methods' Summary |
| start |
puts the job into the printer spooler.
|
| end |
notifies the printer spooler that the job is done and printing
starts.
|
| terminate |
stops the current print job.
|
| startPage |
begins with a new page.
|
| endPage |
ends the current page.
|
| Methods' Details |
start
- Description
- puts the job into the printer spooler.
This call may block the thread. So release all resources
(mutex, semaphore, etc.) before this call.
|
|
end
- Description
- notifies the printer spooler that the job is done and printing
starts.
- See also
- terminate
|
|
| terminate
|
startPage
- Description
- begins with a new page.
|
|
endPage
- Description
- ends the current page.
|
|
Top of Page
Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.