package minima
The minima
package contains classes, traits and objects for
optimization to find minima.
- Alphabetic
- By Inheritance
- minima
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
class
CheckLP
extends Error
The
CheckLP
class checks the solution to Linear Programming (LP) problems.The
CheckLP
class checks the solution to Linear Programming (LP) problems. Given a constraint matrix 'a', limit/RHS vector 'b' and cost vector 'c', determine if the values for the solution/decision vector 'x' minimizes the objective function 'f(x)', while satisfying all of the constraints, i.e.,minimize f(x) = c x subject to a x <= b, x >= 0
Check the feasibility and optimality of the solution.
-
class
ConjGradient
extends Minimizer with Error
The
ConjGradient
class implements the Polak-Ribiere Conjugate Gradient (PR-CG) Algorithm for solving Non-Linear Programming (NLP) problems.The
ConjGradient
class implements the Polak-Ribiere Conjugate Gradient (PR-CG) Algorithm for solving Non-Linear Programming (NLP) problems. PR-CG determines a search direction as a weighted combination of the steepest descent direction (-gradient) and the previous direction. The weighting is set by the beta function, which for this implementation used the Polak-Ribiere technique.dir_k = -gradient (x) + beta * dir_k-1
minimize f(x) subject to g(x) <= 0 [ optionally g(x) == 0 ]
-
class
DualSimplex
extends MinimizerLP
The
DualSimplex
class solves Linear Programming (LP) problems using a tableau based Dual Simplex Algorithm.The
DualSimplex
class solves Linear Programming (LP) problems using a tableau based Dual Simplex Algorithm. It is particularly useful when re-optimizing after a constraint has been added. The algorithm starts with an infeasible super-optimal solution and moves toward (primal) feasibility and optimality.Given a constraint matrix 'a', limit/RHS vector 'b' and cost vector 'c', find values for the solution/decision vector 'x' that minimize the objective function f(x), while satisfying all of the constraints, i.e.,
minimize f(x) = c x subject to a x <= b, x >= 0
Creates an 'MM-by-NN' simplex tableau with -- [0..M-1, 0..N-1] = a (constraint matrix) -- [0..M-1, N..M+N-1] = s (slack/surplus variable matrix) -- [0..M-1, NN-1] = b (limit/RHS vector) -- [M, 0..NN-2] = c (cost vector)
-
class
GeneticAlgorithm
extends AnyRef
The
GeneticAlgorithm
class performs local search to find minima of functions defined on integer vector domains (z^n).The
GeneticAlgorithm
class performs local search to find minima of functions defined on integer vector domains (z^n).minimize f(x) subject to g(x) <= 0, x in Z^n
-
class
GoldenSectionLS
extends LineSearch
The
GoldenSectionLS
class performs a line search on 'f(x)' to find a minimal value for 'f'.The
GoldenSectionLS
class performs a line search on 'f(x)' to find a minimal value for 'f'. It requires no derivatives and only one functional evaluation per iteration. A search is conducted from 'x1' (often 0) to 'xmax'. A guess for 'xmax' must be given, but can be made larger during the expansion phase, that occurs before the recursive golden section search is called. It works on scalar functions (seeGoldenSectionLSTest
). If starting with a vector function 'f(x)', simply define a new function 'g(y) = x0 + direction * y' (seeGoldenSectionLSTest2
). -
class
IntegerGoldenSectionLS
extends AnyRef
The
IntegerGoldenSectionLS
class performs a line search on 'f(x)' to find a minimal value for 'f'.The
IntegerGoldenSectionLS
class performs a line search on 'f(x)' to find a minimal value for 'f'. It requires no derivatives and only one functional evaluation per iteration. A search is conducted from 'x1' (often 0) to 'xmax'. A guess for 'xmax' must be given, but can be made larger during the expansion phase, that occurs before the recursive golden section search is called. It works on scalar functions- See also
IntegerGoldenSectionLSTest2.
IntegerGoldenSectionLSTest. If starting with a vector function 'f(x)', simply define a new function 'g(y) = x0 + direction * y'.
-
class
IntegerLP
extends AnyRef
The
IntegerLP
class solves Integer Linear Programming (ILP) and Mixed Integer Linear Programming (MILP) problems recursively using the Simplex algorithm.The
IntegerLP
class solves Integer Linear Programming (ILP) and Mixed Integer Linear Programming (MILP) problems recursively using the Simplex algorithm. First, an LP problem is solved. If the optimal solution vector x is entirely integer valued, the ILP is solved. If not, pick the first 'x_j' that is not integer valued. Define two new LP problems which bound 'x_j' to the integer below and above, respectively. Branch by solving each of these LP problems in turn. Prune by not exploring branches less optimal than the currently best integer solution. This technique is referred to as Branch and Bound. An exclusion set may be optionally provided for MILP problems. FIX: Use the Dual Simplex Algorithm for better performance.Given a constraint matrix 'a', limit/RHS vector 'b' and cost vector 'c', find values for the solution/decision vector 'x' that minimize the objective function 'f(x)', while satisfying all of the constraints, i.e.,
minimize f(x) = c x subject to a x <= b, x >= 0, some x_i must be integer valued
Make 'b_i' negative to indicate a '>=' constraint.
-
class
IntegerLocalSearch
extends AnyRef
The
IntegerLocalSearch
class performs local search to find minima of functions defined on integer vector domains (z^n).The
IntegerLocalSearch
class performs local search to find minima of functions defined on integer vector domains (z^n).minimize f(x) subject to g(x) <= 0, x in Z^n
-
class
IntegerNLP
extends AnyRef
This
IntegerNLP
solves Integer Non-Linear Programming (INLP) and Mixed Integer Linear Non-Programming (MINLP) problems recursively using the Simplex algorithm.This
IntegerNLP
solves Integer Non-Linear Programming (INLP) and Mixed Integer Linear Non-Programming (MINLP) problems recursively using the Simplex algorithm. First, an NLP problem is solved. If the optimal solution vector 'x' is entirely integer valued, the INLP is solved. If not, pick the first 'x_j' that is not integer valued. Define two new NLP problems which bound 'x_j' to the integer below and above, respectively. Branch by solving each of these NLP problems in turn. Prune by not exploring branches less optimal than the currently best integer solution. This technique is referred to as Branch and Bound. An exclusion set may be optionally provided for MINLP problems.Given an objective function 'f(x)' and a constraint function 'g(x)', find values for the solution/decision vector 'x' that minimize the objective function 'f(x)', while satisfying the constraint function, i.e.,
minimize f(x) subject to g(x) <= 0, some x_i must integer-valued
Make b_i negative to indicate a ">=" constraint
-
class
IntegerTabuSearch
extends AnyRef
The
IntegerTabuSearch
class performs tabu search to find minima of functions defined on integer vector domains 'z^n'. Tabu search will not re-visit points already deemed sub-optimal.The
IntegerTabuSearch
class performs tabu search to find minima of functions defined on integer vector domains 'z^n'. Tabu search will not re-visit points already deemed sub-optimal.minimize f(x) subject to g(x) <= 0, x in Z^n
-
trait
LineSearch
extends AnyRef
This trait specifies the pattern for Line Search (LS) algorithms that perform line search on f(x) to find an x-value that minimizes a function f.
-
trait
Minimizer
extends AnyRef
The
Minimizer
trait sets the pattern for optimization algorithms for solving Non-Linear Programming (NLP) problems of the form:The
Minimizer
trait sets the pattern for optimization algorithms for solving Non-Linear Programming (NLP) problems of the form:minimize f(x) subject to g(x) <= 0 [ optionally g(x) == 0 ]
where f is the objective function to be minimized g is the constraint function to be satisfied, if any
Classes mixing in this trait must implement a function 'fg' that rolls the constraints into the objective functions as penalties for constraint violation, a one-dimensional Line Search (LS) algorithm 'lineSearch' and an iterative method (solve) that searches for improved solutions 'x'-vectors with lower objective function values (f(x)).
-
trait
MinimizerLP
extends Error
The
MinimizerLP
trait sets the pattern for optimization algorithms for solving Linear Programming (LP) problems of the form:The
MinimizerLP
trait sets the pattern for optimization algorithms for solving Linear Programming (LP) problems of the form:minimize c x subject to a x <= b, x >= 0
where a is the constraint matrix b is the limit/RHS vector c is the cost vector
Classes mixing in this trait must implement an objective function 'objF' an iterative method (solve) that searches for improved solutions 'x'-vectors with lower objective function values.
-
class
NelderMeadSimplex
extends Minimizer with Error
The
NelderMeadSimplex
solves Non-Linear Programming (NLP) problems using the Nelder-Mead Simplex algorithm.The
NelderMeadSimplex
solves Non-Linear Programming (NLP) problems using the Nelder-Mead Simplex algorithm. Given a function 'f' and its dimension 'n', the algorithm moves a simplex defined by n + 1 points in order to find an optimal solution. The algorithm is derivative-free.minimize f(x)
-
class
NewtonRaphson
extends AnyRef
The
NewtonRaphson
class is used to find roots (zeros) for a one-dimensional (scalar) function 'f'.The
NewtonRaphson
class is used to find roots (zeros) for a one-dimensional (scalar) function 'f'. If f is the derivative of some other function 'g', then this technique can be used to find optima for 'g'. Caveat: Use Conjugate Gradient or Quasi-Newton for complex optimization. -
class
QuadraticSimplex
extends Error
The
QuadraticSimplex
class solves Quadratic Programming (QP) problems using the Quadratic Simplex Algorithm.The
QuadraticSimplex
class solves Quadratic Programming (QP) problems using the Quadratic Simplex Algorithm. Given a constraint matrix 'a', constant vector 'b', cost matrix 'q' and cost vector 'c', find values for the solution/decision vector 'x' that minimize the objective function 'f(x)', while satisfying all of the constraints, i.e.,minimize f(x) = 1/2 x q x + c x subject to a x <= b, x >= 0
Creates an 'MM-by-NN' simplex tableau. This implementation is restricted to linear constraints 'a x <= b' and 'q' being a positive semi-definite matrix. Pivoting must now also handle non-linear complementary slackness
- See also
www.engineering.uiowa.edu/~dbricker/lp_stacks.html
-
class
QuasiNewton
extends Minimizer with Error
The
QuasiNewton
the class implements the Broyden–Fletcher–Goldfarb–Shanno (BFGS) Quasi-Newton Algorithm for solving Non-Linear Programming (NLP) problems.The
QuasiNewton
the class implements the Broyden–Fletcher–Goldfarb–Shanno (BFGS) Quasi-Newton Algorithm for solving Non-Linear Programming (NLP) problems. BFGS determines a search direction by deflecting the steepest descent direction vector (opposite the gradient) by * multiplying it by a matrix that approximates the inverse Hessian. Note, this implementation may be set up to work with the matrix 'b' (approximate Hessian) or directly with the 'binv' matrix (the inverse of 'b').minimize f(x) subject to g(x) <= 0 [ optionally g(x) == 0 ]
-
class
RevisedSimplex
extends MinimizerLP
The
RevisedSimplex
class solves Linear Programming (LP) problems using the Revised Simplex Algorithm.The
RevisedSimplex
class solves Linear Programming (LP) problems using the Revised Simplex Algorithm. Given a constraint matrix 'a', constant vector 'b' and cost vector 'c', find values for the solution/decision vector 'x' that minimize the objective function 'f(x)', while satisfying all of the constraints, i.e.,minimize f(x) = c x subject to a x <= b, x >= 0
The Revised Simplex Algorithm operates on 'b_inv', which is the inverse of the basis-matrix ('ba' = 'B'). It has benefits over the Simplex Algorithm (less memory and reduced chance of round off errors).
-
class
Simplex
extends MinimizerLP
The
Simplex
class solves Linear Programming (LP) problems using a tableau based Simplex Algorithm.The
Simplex
class solves Linear Programming (LP) problems using a tableau based Simplex Algorithm. Given a constraint matrix 'a', limit/RHS vector 'b' and cost vector 'c', find values for the solution/decision vector 'x' that minimize the objective function 'f(x)', while satisfying all of the constraints, i.e.,minimize f(x) = c x subject to a x <= b, x >= 0
In case of 'a_i x >= b_i', use '-b_i' as an indicator of a '>=' constraint. The program will flip such negative b_i back to positive as well as use a surplus variable instead of the usual slack variable, i.e., a_i x <= b_i => a_i x + s_i = b_i // use slack variable s_i with coefficient 1 a_i x >= b_i => a_i x + s_i = b_i // use surplus variable s_i with coefficient -1
Creates an MM-by-NN simplex tableau with -- [0..M-1, 0..N-1] = a (constraint matrix) -- [0..M-1, N..M+N-1] = s (slack/surplus variable matrix) -- [0..M-1, NN-1] = b (limit/RHS vector) -- [M, 0..NN-2] = c (cost vector)
-
class
Simplex2P
extends MinimizerLP
The
Simplex2P
class solves Linear Programming (LP) problems using a tableau based Simplex Algorithm.The
Simplex2P
class solves Linear Programming (LP) problems using a tableau based Simplex Algorithm. Given a constraint matrix 'a', limit/RHS vector 'b' and cost vector 'c', find values for the solution/decision vector 'x' that minimize the objective function 'f(x)', while satisfying all of the constraints, i.e.,minimize f(x) = c x subject to a x <= b, x >= 0
In case of 'a_i x >= b_i', use -b_i as an indicator of a ">=" constraint. The program will flip such negative b_i back to positive as well as use a surplus and artificial variable instead of the usual slack variable, i.e., a_i x <= b_i => a_i x + s_i = b_i // use slack variable s_i with coefficient 1 a_i x >= b_i => a_i x + s_i = b_i // use surplus variable s_i with coefficient -1 For each '>=' constraint, an artificial variable is introduced and put into the initial basis. These artificial variables must be removed from the basis during Phase I of the Two-Phase Simplex Algorithm. After this, or if there are no artificial variables, Phase II is used to find an optimal value for 'x' and the optimum value for 'f'.
Creates an 'MM-by-nn' simplex tableau with -- [0..M-1, 0..N-1] = a (constraint matrix) -- [0..M-1, N..M+N-1] = s (slack/surplus variable matrix) -- [0..M-1, M+N..nn-2] = r (artificial variable matrix) -- [0..M-1, nn-1] = b (limit/RHS vector) -- [M, 0..nn-2] = c (cost vector)
-
class
SimplexBG
extends MinimizerLP
The
SimplexBG
class solves Linear Programming (LP) problems using the Bartels-Golub (BG) Simplex Algorithm.The
SimplexBG
class solves Linear Programming (LP) problems using the Bartels-Golub (BG) Simplex Algorithm. Given a constraint matrix 'a', constant vector 'b' and cost vector 'c', find values for the solution/decision vector 'x' that minimize the objective function 'f(x)', while satisfying all of the constraints, i.e.,minimize f(x) = c x subject to a x <= b, x >= 0
The BG Simplex Algorithm performs LU Factorization/Decomposition of the basis-matrix ('ba' = 'B') rather than computing inverses ('b_inv'). It has benefits over the (Revised) Simplex Algorithm (less run-time, less memory, and much reduced chance of round off errors).
-
class
SimplexFT
extends MinimizerLP
The
SimplexFT
class solves Linear Programming (LP) problems using the Forrest-Tomlin (FT) Simplex Algorithm.The
SimplexFT
class solves Linear Programming (LP) problems using the Forrest-Tomlin (FT) Simplex Algorithm. Given a constraint matrix 'a', constant vector 'b' and cost vector 'c', find values for the solution/decision vector 'x' that minimize the objective function 'f(x)', while satisfying all of the constraints, i.e.,minimize f(x) = c x subject to a x <= b, x >= 0
The FT Simplex Algorithm performs LU Factorization/Decomposition of the basis-matrix ('ba' = 'B') rather than computing inverses ('b_inv'). It has benefits over the (Revised) Simplex Algorithm (less run-time, less memory, and much reduced chance of round off errors).
-
class
SteepestDescent
extends Minimizer with Error
The
SteepestDescent
class solves unconstrained Non-Linear Programming (NLP) problems using the Steepest Descent algorithm.The
SteepestDescent
class solves unconstrained Non-Linear Programming (NLP) problems using the Steepest Descent algorithm. Given a function 'f' and a starting point 'x', the algorithm computes the gradient and takes steps in the opposite direction. The algorithm iterates until it converges. The class assumes that partial derivative functions are not available unless explicitly given via the 'setDerivatives' method.dir_k = -gradient (x)
minimize f(x)
-
class
WolfeLS
extends LineSearch
The
WolfeLS
class performs an inexact line search on 'f' to find a point 'x' that exhibits (1) sufficient decrease ('f(x)' enough less that 'f(0)') and (2) the slope at x is less steep than the slope at 0.The
WolfeLS
class performs an inexact line search on 'f' to find a point 'x' that exhibits (1) sufficient decrease ('f(x)' enough less that 'f(0)') and (2) the slope at x is less steep than the slope at 0. That is, the line search looks for a value for 'x' satisfying the two Wolfe conditions.f(x) <= f(0) + c1 * f'(0) * x Wolfe condition 1 (Armijo condition) |f'(x)| <= |c2 * f'(0)| Wolfe condition 2 (Strong version) f'(x) >= c2 * f'(0) Wolfe condition 2 (Weak version, more robust)
It works on scalar functions (@see
WolfeLSTest
). If starting with a vector function f(x), simply define a new function g(y) = x0 + direction * y (@seeWolfeLSTest2
).
Value Members
-
object
ConjGradientTest
extends App
The
ConjGradientTest
object is used to test theConjGradient
class. -
object
DualSimplexTest
extends App
The
DualSimplexTest
object is used to test theDualSimplex
class. -
object
Ftran
The
Ftran
object ... -
object
GeneticAlgorithmTest
extends App
The
GeneticAlgorithmTest
object is used to test theGeneticAlgorithm
class (unconstrained). -
object
GoldenSectionLSTest
extends App
The
GoldenSectionLSTest
object is used to test theGoldenSectionLS
class on scalar functions. -
object
GoldenSectionLSTest2
extends App
The
GoldenSectionLSTest2
object is used to test theGoldenSectionLS
class on vector functions. -
object
IntegerGoldenSectionLSTest
extends App
The
IntegerGoldenSectionLSTest
object is used to test theIntegerGoldenSectionLS
class on scalar functions. -
object
IntegerLPTest
extends App
The
IntegerLPTest
object is used to test theIntegerLP
class.The
IntegerLPTest
object is used to test theIntegerLP
class. real solution x = (.8, 1.6), f = 8.8 integer solution x = (2, 1), f = 10- See also
Linear Programming and Network Flows, Example 6.14
-
object
IntegerLocalSearchTest
extends App
The
IntegerLocalSearchTest
object is used to test theIntegerLocalSearch
class (unconstrained). -
object
IntegerLocalSearchTest2
extends App
The
IntegerLocalSearchTest2
object is used to test theIntegerLocalSearch
class (constrained). -
object
IntegerNLPTest
extends App
The
IntegerNLPTest
object is used to test theIntegerNLP
class.The
IntegerNLPTest
object is used to test theIntegerNLP
class. real solution x = (.8, 1.6), f = 8.8 integer solution x = (2, 1), f = 10- See also
Linear Programming and Network Flows, Example 6.14
-
object
IntegerTabuSearchTest
extends App
The
IntegerTabuSearchTest
object is used to test theIntegerTabuSearch
class (unconstrained). -
object
IntegerTabuSearchTest2
extends App
The
IntegerTabuSearchTest2
object is used to test theIntegerTabuSearch
class (constrained). -
object
NLPTest1
extends App
The
NLPTest1
object used to test several Non-Linear Programming (NLP) algorithms on unconstrained problems.The
NLPTest1
object used to test several Non-Linear Programming (NLP) algorithms on unconstrained problems. Algorithms: 'sdcs' - Steepest Descent with Custom Line Search 'sdgs' - Steepest Descent with Golden Section Line Search 'prcg' - Polak-Ribiere Conjugate Gradient with Golden Section Line Search 'sdws' - Steepest Descent with Wolfe Line Search 'bfgs' - Broyden–Fletcher–Goldfarb–Shanno with Wolfe Line Search -
object
NLPTest2
extends App
The
NLPTest2
object used to test several Non-Linear Programming (NLP) algorithms on constrained problems. -
object
NLPTestCases1
extends App
The
NLPTestCases1
object used to test several Non-Linear Programming (NLP) algorithms on unconstrained problems.The
NLPTestCases1
object used to test several Non-Linear Programming (NLP) algorithms on unconstrained problems. Algorithms: 'sdcs' - Steepest Descent with Custom Line Search 'sdgs' - Steepest Descent with Golden Section Line Search 'prcg' - Polak-Ribiere Conjugate Gradient with Golden Section Line Search 'sdws' - Steepest Descent with Wolfe Line Search 'bfgs' - Broyden–Fletcher–Goldfarb–Shanno with Wolfe Line Search -
object
NLPTestCases2
extends App
The
NLPTestCases2
object used to test several Non-Linear Programming (NLP) algorithms on constrained problems. -
object
NelderMeadSimplexTest
extends App
The
NelderMeadSimplexTest
object is used to test theNelderMeadSimplex
class.The
NelderMeadSimplexTest
object is used to test theNelderMeadSimplex
class. > run-main scalation.minima.NelderMeadSimplexTest -
object
NewtonRaphsonTest
extends App
The
NewtonRaphsonTest
object is used to test theNewtonRaphson
class.The
NewtonRaphsonTest
object is used to test theNewtonRaphson
class. > run-main scalation.minima.NewtonRaphsonTest -
object
QuadraticSimplexTest
extends App
The
QuadraticSimplexTest
object is used to test theQuadraticSimplex
class. -
object
QuasiNewtonTest
extends App
The
QuasiNewtonTest
object is used to test theQuasiNewton
class.The
QuasiNewtonTest
object is used to test theQuasiNewton
class. > run-main scalation.minima.QuasiNewtonTest -
object
RevisedSimplexTest
extends App
The
RevisedSimplexTest
object is used to test theRevisedSimplex
class.The
RevisedSimplexTest
object is used to test theRevisedSimplex
class. > run-main scalation.minima.RevisedSimplexTest -
object
Simplex2PTest
extends App
The
Simplex2PTest
object is used to test theSimplex2P
class. -
object
SimplexBGTest
extends App
The
SimplexBGTest
object is used to test theSimplexBG
class. -
object
SimplexFTTest
extends App
The
SimplexFT
object is used to test theSimplexFT
class. -
object
SimplexTest
extends App
The
SimplexTest
object is used to test theSimplex
class. -
object
SteepestDescentTest
extends App
The
SteepestDescentTest
object is used to test theSteepestDescent
class. -
object
WolfeLSTest
extends App
The
WolfeLSTest
object is used to test theWolfeLS
class on scalar functions. -
object
WolfeLSTest2
extends App
The
WolfeLSTest2
object is used to test theWolfeLS
class on vector functions.


|
Cannon Cpp
1.0.0
|
A line in 3D space that intersects bodies and return points. More...
#include <Ray.h>
Classes | |
| struct | IntersectOptions |
| Only used by Ray::intersectConvex. More... | |
| struct | RayOptions |
| The options to perform a ray test. More... | |
Public Types | |
| enum | IntersectionMode { IntersectionMode::CLOSEST = 1, IntersectionMode::ANY = 2, IntersectionMode::ALL = 4 } |
| Intersection mode of a ray. More... | |
| using | IntersectFunc = void(*)(Shape *, const Quaternion &, const Vec3 &, Body *, Shape *) |
Public Member Functions | |
| Ray (const Vec3 &from=Vec3::ZERO, const Vec3 &to=Vec3::ZERO) | |
| The constructor of Ray. More... | |
| ~Ray () | |
| bool | intersectWorld (World *world, const RayOptions &options) |
| Do itersection against all bodies in the given World. More... | |
| void | intersectBody (Body *body, RaycastResult *result) |
| Shoot a ray at a body, get back information about the hit. More... | |
| void | intersectBodies (const std::vector< Body * > &bodies, RaycastResult *result=nullptr) |
| intersect Bodies by this ray More... | |
| void | updateDirection () |
| Updates the _direction vector. More... | |
| void | intersectShape (Shape *shape, const Quaternion &quat, const Vec3 &position, Body *body) |
| intersectShape More... | |
| void | intersectBox (Shape *shape, const Quaternion &quat, const Vec3 &position, Body *body, Shape *reportedShape) |
| intersectBox More... | |
| void | intersectPlane (Shape *shape, const Quaternion &quat, const Vec3 &position, Body *body, Shape *reportedShape) |
| intersectPlane More... | |
| void | intersectHeightfield (Shape *shape, const Quaternion &quat, const Vec3 &position, Body *body, Shape *reportedShape) |
| intersectHeightfield More... | |
| void | intersectSphere (Shape *shape, const Quaternion &quat, const Vec3 &position, Body *body, Shape *reportedShape) |
| intersectSphere More... | |
| void | intersectConvex (Shape *shape, const Quaternion &quat, const Vec3 &position, Body *body, Shape *reportedShape, const IntersectOptions *options=nullptr) |
| intersectConvex More... | |
| void | intersectTrimesh (Shape *shape, const Quaternion &quat, const Vec3 &position, Body *body, Shape *reportedShape) |
| intersectTrimesh More... | |
| void | getAABB (AABB *result) |
| Get the world AABB of the ray. More... | |
| bool | reportIntersection (const Vec3 &normal, const Vec3 &hitPointWorld, Shape *shape, Body *body, int hitFaceIndex=-1) |
| Report the intersection info. More... | |
| real_t | distanceFromIntersection (const Vec3 &from, const Vec3 &direction, const Vec3 &position) |
| const Vec3 & | from () const |
| void | setFrom (Vec3 value) |
| const Vec3 & | to () const |
| void | setTo (Vec3 value) |
| const Vec3 & | direction () const |
| bool | skipBackfaces () const |
| void | setSkipBackfaces (bool value) |
| const RaycastResult & | result () const |
| Ray & | operator= (const Ray &other) |
Static Public Member Functions | |
| static Ray * | create (const Vec3 &from=Vec3::ZERO, const Vec3 &to=Vec3::ZERO) |
| static bool | pointInTriangle (const Vec3 &p, const Vec3 &a, const Vec3 &b, const Vec3 &c) |
| As per "Barycentric Technique" as named here http://www.blackpawn.com/texts/pointinpoly/default.html But without the division. More... | |
Private Attributes | |
| Vec3 * | _from = nullptr |
| The start point of this ray. More... | |
| Vec3 * | _to = nullptr |
| The end point of this ray. More... | |
| Vec3 * | _direction = nullptr |
| The direction of this ray. More... | |
| RaycastResult * | _result = nullptr |
| An pointer to current result object. More... | |
| RayCallback * | _callback = nullptr |
| An pointer to an current, user-provided result callback. Will be used if mode is Ray.ALL. More... | |
| real_t | _precision = 0.0001 |
| The precision of the ray. Used when checking parallelity etc. More... | |
| int | _collisionFilterMask = -1 |
| collisionFilterMask More... | |
| int | _collisionFilterGroup = -1 |
| collisionFilterGroup More... | |
| bool | _checkCollisionResponse = true |
| Set to true if you want the Ray to take .collisionResponse flags into account on bodies and shapes. More... | |
| bool | _skipBackfaces = false |
| If set to true, the ray skips any hits with normal.dot(rayDirection) < 0. More... | |
| bool | _hasHit = false |
| Will be set to true during intersectWorld() if the ray hit anything. More... | |
| IntersectionMode | _mode = IntersectionMode::ANY |
| The intersection mode. Should be Ray.ANY, Ray.ALL or Ray.CLOSEST. More... | |
A line in 3D space that intersects bodies and return points.
| using Ray::IntersectFunc = void (*)(Shape*, const Quaternion&, const Vec3&, Body*, Shape*) |
|
strong |
| Ray::Ray | ( | const Vec3 & | from = Vec3::ZERO , |
| const Vec3 & | to = Vec3::ZERO |
||
| ) |
The constructor of Ray.
| from | The start point of the ray |
| to | The end point of the ray |
| Ray::~Ray | ( | ) |
|
static |
|
inline |
| real_t Ray::distanceFromIntersection | ( | const Vec3 & | from, |
| const Vec3 & | direction, | ||
| const Vec3 & | position | ||
| ) |
|
inline |
| void Ray::getAABB | ( | AABB * | result | ) |
Get the world AABB of the ray.
| result | An pointer the aabb result |
| void Ray::intersectBodies | ( | const std::vector< Body * > & | bodies, |
| RaycastResult * | result = nullptr |
||
| ) |
intersect Bodies by this ray
| bodies | An array of Body objects. |
| result | An pointer an RaycastResult, default is nullptr |
| void Ray::intersectBody | ( | Body * | body, |
| RaycastResult * | result | ||
| ) |
Shoot a ray at a body, get back information about the hit.
| body | The body will be tested |
| result | An pointer an RaycastResult |
| void Ray::intersectBox | ( | Shape * | shape, |
| const Quaternion & | quat, | ||
| const Vec3 & | position, | ||
| Body * | body, | ||
| Shape * | reportedShape | ||
| ) |
intersectBox
| shape | The shape will be tested by this ray |
| quat | The orientation of the shape, in world frame |
| position | The position of the shape, in world frame |
| body | The body which owns the shape |
| void Ray::intersectConvex | ( | Shape * | shape, |
| const Quaternion & | quat, | ||
| const Vec3 & | position, | ||
| Body * | body, | ||
| Shape * | reportedShape, | ||
| const IntersectOptions * | options = nullptr |
||
| ) |
intersectConvex
| shape | The shape will be tested by this ray |
| quat | The orientation of the shape, in world frame |
| position | The position of the shape, in world frame |
| body | The body which owns the shape |
| reportedShape | The reportedShape is the owner of the shape above |
| options | The option to specify an faceList for convex ray test |
| void Ray::intersectHeightfield | ( | Shape * | shape, |
| const Quaternion & | quat, | ||
| const Vec3 & | position, | ||
| Body * | body, | ||
| Shape * | reportedShape | ||
| ) |
intersectHeightfield
| shape | The shape will be tested by this ray |
| quat | The orientation of the shape, in world frame |
| position | The position of the shape, in world frame |
| body | The body which owns the shape |
| void Ray::intersectPlane | ( | Shape * | shape, |
| const Quaternion & | quat, | ||
| const Vec3 & | position, | ||
| Body * | body, | ||
| Shape * | reportedShape | ||
| ) |
intersectPlane
| shape | The shape will be tested by this ray |
| quat | The orientation of the shape, in world frame |
| position | The position of the shape, in world frame |
| body | The body which owns the shape |
| void Ray::intersectShape | ( | Shape * | shape, |
| const Quaternion & | quat, | ||
| const Vec3 & | position, | ||
| Body * | body | ||
| ) |
intersectShape
| shape | The shape will be tested by this ray |
| quat | The orientation of the shape, in world frame |
| position | The position of the shape, in world frame |
| body | The body which owns the shape |
| void Ray::intersectSphere | ( | Shape * | shape, |
| const Quaternion & | quat, | ||
| const Vec3 & | position, | ||
| Body * | body, | ||
| Shape * | reportedShape | ||
| ) |
intersectSphere
| shape | The shape will be tested by this ray |
| quat | The orientation of the shape, in world frame |
| position | The position of the shape, in world frame |
| body | The body which owns the shape |
| void Ray::intersectTrimesh | ( | Shape * | shape, |
| const Quaternion & | quat, | ||
| const Vec3 & | position, | ||
| Body * | body, | ||
| Shape * | reportedShape | ||
| ) |
intersectTrimesh
| shape | The shape will be tested by this ray |
| quat | The orientation of the shape, in world frame |
| position | The position of the shape, in world frame |
| body | The body which owns the shape |
| reportedShape | The reportedShape is the owner of the shape above |
| bool Ray::intersectWorld | ( | World * | world, |
| const RayOptions & | options | ||
| ) |
Do itersection against all bodies in the given World.
| world | The world will be tested by this ray |
| options | The options to perform a ray test |
As per "Barycentric Technique" as named here http://www.blackpawn.com/texts/pointinpoly/default.html But without the division.
| bool Ray::reportIntersection | ( | const Vec3 & | normal, |
| const Vec3 & | hitPointWorld, | ||
| Shape * | shape, | ||
| Body * | body, | ||
| int | hitFaceIndex = -1 |
||
| ) |
Report the intersection info.
| normal | The normal result |
| hitPointWorld | The hitPoint in world frame |
| shape | The shape is hit |
| body | The body is hit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void Ray::updateDirection | ( | ) |
Updates the _direction vector.
|
private |
An pointer to an current, user-provided result callback. Will be used if mode is Ray.ALL.
|
private |
Set to true if you want the Ray to take .collisionResponse flags into account on bodies and shapes.
|
private |
collisionFilterGroup
|
private |
collisionFilterMask
|
private |
The direction of this ray.
|
private |
The start point of this ray.
|
private |
Will be set to true during intersectWorld() if the ray hit anything.
|
private |
The intersection mode. Should be Ray.ANY, Ray.ALL or Ray.CLOSEST.
|
private |
The precision of the ray. Used when checking parallelity etc.
|
private |
An pointer to current result object.
|
private |
If set to true, the ray skips any hits with normal.dot(rayDirection) < 0.
|
private |
The end point of this ray.


Links go here
Search goes here
Test HMTL and ARIA role Landmarks
Links go here
VoiceOver reads landmarks as:
banner
Main navigation
search
main
Quick links navigation
complementary
contentinfo
Footer navigation


About Me
Education
B.S. MGMT Information Systems Spring 2019
Skills
- 1. Troubleshooting
- 2. Tech Support
- 3. Leadership
Expectations for this course
I expect to learn how to create my own website for my future business.
Welcome to IS 445 Homework 1
B.S. MGMT Information Systems Spring 2019
I expect to learn how to create my own website for my future business.


{% extends "base.html" %} {% block content %}
Use the username and password you registered with to log in.
You may also log in over ssh at shell.ctf.tamu.edu:2222


by
René Clausen Nielsen
Data Innovation Strategist, UN Global Pulse
The guide is a product of a “big data for development exploration journey” we facilitated for UNDP innovation teams in Eastern Europe and Arab States in 2016.
And that whole journey was based on the premise that any UN entity should be able to "do data innovation".
(WFP OR "World Food Programme")
vs. (UNICEF OR ((UN OR "United Nations") AND "Children's Emergency Fund")
(WFP OR "World Food Programme" OR "World Food Program") AND hunger
vs. (UNICEF OR ((UN OR "United Nations") AND "Children's Emergency Fund")) AND hunger
(WFP OR "World Food Programme") AND "Yemen"
vs. (UNICEF OR ((UN OR "United Nations") AND "Children's Emergency Fund")) AND Yemen
Share of voice does not have to be brand related, of course. Here we see the propotions of word usage between years. Climate change related keywords gain share of voice over food related keywords.
To see if a campaign is gaining more traction than the baseline, we can compare with more static brands (brands that are generally not event-driven). Here an example for the Every Woman Every Child campaign
There are many different shares of voices that will make sense to KPIs.
\[ \frac{\text{No. of WFP mentions}}{\text{Total no. of mentions of WFP and similar agencies}} = \text{Share of voice} \]
\[ \frac{\text{No. of WFP mentions}}{\text{Total no. of mentions about logisics in Yemen}} = \text{Share of voice} \]
\[ \frac{\text{No. of successful delivery stories}}{\text{Total no. of WFP mentions}} = \text{Share of voice} \]
And many many more. Your job is to find those that make most sense to your KPIs and narratives.
Let's also look at one last thing that's really interesting, and almost a share of voice. Google searches. How much do pelople search for WFP?
\[ \frac{\text{No. of WFP searches}}{\text{Total no. of Google searches}} = \text{Share of voice} \]
Only, we don't know
So that's not possible. Oh well.
Although we don't get individual Shares of Voice, we do get share of voice compared to the highest share of voice. The higest number of searches was for WHO in April 2018, and the search for other organisations is then relative to that. In that month, WFP's share of voice relative to WHO was only 7%.


Functions for querying the EBI Metagenomics Portal <https://www.ebi.ac.uk/metagenomics/>. The current main focus is on taxa abundance data, but the intention is that this package should evolve into a general purpose package for working with EBI Metagenomics data using R.
| Version: | 0.6 |
| Depends: | R (≥ 3.0.0), sads, vegan, breakaway, methods |
| Published: | 2018-10-28 |
| Author: | Darren Wilkinson |
| Maintainer: | Darren Wilkinson <darren.wilkinson at ncl.ac.uk> |
| License: | LGPL-3 |
| NeedsCompilation: | no |
| CRAN checks: | ebimetagenomics results |
| Reference manual: | ebimetagenomics.pdf |
| Package source: | ebimetagenomics_0.6.tar.gz |
| Windows binaries: | r-devel: ebimetagenomics_0.6.zip, r-release: ebimetagenomics_0.6.zip, r-oldrel: ebimetagenomics_0.6.zip |
| OS X binaries: | r-release: ebimetagenomics_0.6.tgz, r-oldrel: ebimetagenomics_0.6.tgz |
| Old sources: | ebimetagenomics archive |
Please use the canonical form https://CRAN.R-project.org/package=ebimetagenomics to link to this page.


Gearshare aims to increase access to outdoor gear in communities and offers a platform to maximize the productivity of outdoor products for their owners. Use Gearshare to rent out yoru gear or rent others gear, make a gear swap with another Gearshare member, or connect with other adventurers near you and benefit from the outdoors knowledge and skills in your community.


We may define
TDPV
discoursal point of view
as
the relationship, expressed through discourse structure, between the implied author or some other addresser, and the fiction.


content-disposition
Create and parse HTTP Content-Disposition
header
Installation
$ npm install content-disposition
API
var contentDisposition = require('content-disposition')
contentDisposition(filename, options)
Create an attachment Content-Disposition
header value using the given file name,
if supplied. The filename
is optional and if no file name is desired, but you
want to specify options
, set filename
to undefined
.
res.setHeader('Content-Disposition', contentDisposition('∫ maths.pdf'))
note HTTP headers are of the ISO-8859-1 character set. If you are writing this
header through a means different from setHeader
in Node.js, you’ll want to specify
the 'binary'
encoding in Node.js.
Options
contentDisposition
accepts these properties in the options object.
fallback
If the filename
option is outside ISO-8859-1, then the file name is actually
stored in a supplemental field for clients that support Unicode file names and
a ISO-8859-1 version of the file name is automatically generated.
This specifies the ISO-8859-1 file name to override the automatic generation or
disables the generation all together, defaults to true
.
- A string will specify the ISO-8859-1 file name to use in place of automatic generation.
false
will disable including a ISO-8859-1 file name and only include the Unicode version (unless the file name is already ISO-8859-1).true
will enable automatic generation if the file name is outside ISO-8859-1.
If the filename
option is ISO-8859-1 and this option is specified and has a
different value, then the filename
option is encoded in the extended field
and this set as the fallback field, even though they are both ISO-8859-1.
type
Specifies the disposition type, defaults to "attachment"
. This can also be
"inline"
, or any other value (all values except inline are treated like
attachment
, but can convey additional information if both parties agree to
it). The type is normalized to lower-case.
contentDisposition.parse(string)
var disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt');
Parse a Content-Disposition
header string. This automatically handles extended
(“Unicode”) parameters by decoding them and providing them under the standard
parameter name. This will return an object with the following properties (examples
are shown for the string 'attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt'
):
-
type
: The disposition type (always lower case). Example:'attachment'
-
parameters
: An object of the parameters in the disposition (name of parameter always lower case and extended versions replace non-extended versions). Example:{filename: "€ rates.txt"}
Examples
Send a file for download
var contentDisposition = require('content-disposition')
var destroy = require('destroy')
var http = require('http')
var onFinished = require('on-finished')
var filePath = '/path/to/public/plans.pdf'
http.createServer(function onRequest(req, res) {
// set headers
res.setHeader('Content-Type', 'application/pdf')
res.setHeader('Content-Disposition', contentDisposition(filePath))
// send file
var stream = fs.createReadStream(filePath)
stream.pipe(res)
onFinished(res, function (err) {
destroy(stream)
})
})
Testing
$ npm test
References
- RFC 2616: Hypertext Transfer Protocol – HTTP/1.1
- RFC 5987: Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters
- RFC 6266: Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)
- Test Cases for HTTP Content-Disposition header field (RFC 6266) and the Encodings defined in RFCs 2047, 2231 and 5987


Click on button for create private key
Generate single-use bitcoin address
ATTENTION: for each payment need to generate a new address
It's manual


Lambda functions are an easy way to quickly define functions within Python. They are a departure from the regular def format for creating functions and can be confusing at first. Let’s begin with defining a simple square root function using the normal def syntax, and then converting it into a lambda function.
import numpy as np
def root(x):
return np.sqrt(x)
In this instance any time we call root it will return the square root of x.
root(16)
4.0
Now we are going to replicate root as lamroot, where lamroot is defined using lambda.
lamroot = lambda x: np.sqrt(x)
Once again calling lamroot will return the square root of x.
lamroot(16)
Lets piece apart what has gone on here.
Lambda lets us define an outcome against a parameter with some sort of function, in this case x is the parameter, and NumPy’s square root function is being called against x to create the outcome. The split between the parameter and the function is the colon, everything before are parameters, everything after is the manipulations the function is making.
We can define a lambda function with more than one parameter.
lamroot2 = lambda x,y: np.sqrt(x+y)
Here we have given the function two parameters, x and y, and it will return the square root of the sum of the two parameters.
lamroot2(10,6)
4.0
From the structure we have laid out so far you are able to replace many functions throughout your code with lambda functions. There is a drawback to lambda functions in they do sacrifice some clarity in exchange for brevity. It is up to you to determine which is more useful in your situation.
Lambda functions really come into there own when applied to collections of data, such as lists or pandas DataFrames. Instead of writing a loop to manipulate these sorts of collections we can instead write a map or apply statement against the collection to have every piece calculated at once.
To demonstrate this I’m going to import pandas and spin up a quick DataFrame with the integers from 0 to 10.
import pandas as pd
df = pd.DataFrame(np.arange(0,11))
df
| 0 | |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | 6 |
| 7 | 7 |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
Now we rewrite the previous lamroot function within an apply function on the DataFrame.
df = df.apply(lambda x: np.sqrt(x))
df
| 0 | |
|---|---|
| 0 | 0.000000 |
| 1 | 1.000000 |
| 2 | 1.189207 |
| 3 | 1.316074 |
| 4 | 1.414214 |
| 5 | 1.495349 |
| 6 | 1.565085 |
| 7 | 1.626577 |
| 8 | 1.681793 |
| 9 | 1.732051 |
| 10 | 1.778279 |
Here we have applied the function against the entire DataFrame, viewing it now will show our integers have been turned into their square roots. This is very useful to write quick single line functions to cleanup or clarify a specific aspect of a dataset.


( a, b) AC impedance plots of the LLZNO ceramics with different sintering conditions at 25 °C; ( c) AC impedance plots and fitting curve of SL2 at 25 °C; ( d) equivalent circuit to fit the curves. ( e) Total conductivity and relative density of the LLZNO ceramics.


{
success: true/false, // error indicator
message: 'your message here', // successfull or error message
data: N // removed event ID
}
Documentation
Options
nowType: Date object, Default: new Date()Visible week on initialization.localeType: object, Default: english localeTranslated phraseslocale.buttonsType: object, Default: english localeTranslations for buttons. Contents such fields:
prev_month : "Previous month",
prev_week : "Previous week",
curr_week : "Current week",
next_week : "Next week",
next_month : "Next month",
create_event : "Create",
modify_event : "Save",
remove_event : "Remove"
locale.captionsType: object, Default: english localeTranslations for windows captions. Contents such fields:
title : "Events: ",
create_event : "Create a new event",
modify_event : "Update event",
footer : "From %from% to %to% was found %records% items"
locale.daysType: array, Default: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Sunday"]Translations for weekdayslocale.long_monthsType: array, Default: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]Translations for month long nameslocale.short_monthsType: array, Default: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]Translations for month short nameslocale.errorType: string, Default: "Application server error"Translations for undefined server erroreventType: object, Default: {}Parameters for events handleevent.get_urlType: string, Default: "./"Url for request to fetch events from serverevent.add_urlType: string, Default: "./add"Url for request to add new eventevent.update_urlType: string, Default: "./update"Url for request to update exists eventevent.remove_urlType: string, Default: "./remove"Url for request to remove eventevent.paramsType: object, Default: {}Additional parameter for request to serverevent.viewType: jquery-object / string, Default: "{id}"Template for event imaging in calendarevent.popupType: jquery-object, Default: nullTemplate to display additional information in popup window on event hoverevent.addFormType: jquery-object, Default: nullTemplate for form in window for add new eventevent.updFormType: jquery-object, Default: nullTemplate for form in window for modify eventcallbackType: object, Default: {}Callback function on events called, details see in section "Events"autoloadType: boolean, Default: trueLoad events from server on calendar init and dates change
Methods
object.mWeeker('loadEvents', params )Argument: objectFetch event from server. Argument params is additional object to send in requestobject.mWeeker('clearEvents', condition )Argument: object / nullErase events from calendar. If condition is null or false - erase all events.
If condition is object in format {field:'?', value:'?'}, then erase only events with this value in defined field
Events
callback.onEventsLoad( items:array_of_objects )Triggered when events are loaded from server. Contains all events.callback.onEventAddWindow( win:jquery_object, date: string ) : booleanTriggered when is opened window for event add. Contents object of window and date.
Must return boolean: false, if is denied to add new event, else truecallback.onEventAdd( message:string, item:object )Triggered when events is added. Contents successfully message and added event.callback.onEventUpdateWindow( win:jquery_object, event:object ) : booleanTriggered when is opened window for event update. Contents object of window and object of modified event.
Must return boolean: false, if is denied to modify event, else truecallback.onEventUpdate( message:string, item:object )Triggered when event is moved. Contents successfully message and modified event.callback.onEventRemove( message:string, item:object )Triggered when event is removed. Contents successfully message and removed event.callback.onError( message:string )Triggered when except error with server communication


Utility Functions¶
This module contains utility functions that do NOT rely on CASA.
-
class
admit.util.utils.
Dtime
(label='.', report=True)[source]¶ Class to help measuring the wall clock time between tagged events Typical usage: dt = Dtime() ... dt.tag(‘a’) ... dt.tag(‘b’)
Methods
end
()reset
([report])show
()tag
(mytag)time
()pick the actual OS routine that returns some kind of timer
-
admit.util.utils.
add_new_at
()[source]¶ Method to add a new BDP to AT to the ADMIT infrastructure. Alternatively, the command line tool dtdGenerator can be used.
Parameters: None Returns: None
-
admit.util.utils.
add_new_bdp
()[source]¶ Method to add a new BDP or AT to the ADMIT infrastructure. Alternatively, the command line tool dtdGenerator can be used.
Parameters: None Returns: None
-
admit.util.utils.
admit_root
()[source]¶ Return the root directory of the ADMIT environment
Typically in ADMIT/etc there are files needed by certain functions and other TBD locations. For now we are using getenv(), but in deployment this may not be the case.
-
admit.util.utils.
casa_argv
(argv)[source]¶ Processes casarun arguments into C-style argv list.
Modifies the argv from a casarun script to a classic argv list such that the returned argv[0] is the casarun scriptname.
Parameters: argv : list of str
Argument list.
Returns: str
Script name.
Notes
Does not depend on CASA being present.
-
admit.util.utils.
find_files
(directory, pattern)[source]¶ Find files with a given pattern down a directory tree. This is a generator function.
Parameters: directory : str
Root directory to start search
pattern : str
Pattern to match
Returns: list
See also
Admit.find_files
Examples
find_files(‘/tmp/a’, ‘*.fits’)
-
admit.util.utils.
fitgauss2D
(x, y, par=None)[source]¶ Method for fitting a gaussian to a spectrum
Parameters: x: list
The x co-ordinates of the spectrum
y: list
The y co-ordinates of the spectrum
par: list
The initial guesses for the fit parameters
Returns: A tuple containing the best fit parameters (as a list) and the covariance
of the parameters (as a list)
-
admit.util.utils.
format_chem
(form)[source]¶ Method to calculate the rough mass of a molecule
Parameters: formula : str
The chemical formula, usually obtained from splatalogue
Returns: int of the rough mass
-
admit.util.utils.
freqtovel
(freq, delta)[source]¶ Method to convert between offset frequency and offset velocity
Parameters: freq : float
The base frequency
delta : float
The change in frequency
Returns: The offset velocity (in km/s) corresponding to the frequency shift.
-
admit.util.utils.
gaussian2D
(x, intensity, center, sigma)[source]¶ Method for generating a gaussian, primarily used ofr input to the line fitting routine
Parameters: x : list
list of points
intensity : float
intensity of the gaussian
center : float
The center position (peak) of the gaussian
sigma : float
FWHM of the gaussian
Returns: a list of intensities for the gaussian, one for each item in x
-
admit.util.utils.
getClass
(typ, name, init=None)[source]¶ Get an instance of an ADMIT class
Parameters: typ : str
package name, e.g. at or bdp, ‘admit.’ wil be prepended to this.
name : str
The name of the class to retrieve
init : dict
Initialization parameters. Default: None
Returns: An instance of the requested class
-
admit.util.utils.
get_references
(filename)[source]¶ Read a references file , which contain two columns, one with frequencies (or any float), one with line (references), a string. They are returned as a dictionary { freq:line, ... } to be used for plotting references in e.g. APlot.makespec()
Lines starting with the usual comment symbol ‘#’ are skipped Blank lines are skipped Duplicate entries are skipped
Used by e.g. LineID_AT and passed to APlot.makespec()
-
admit.util.utils.
getmass
(formula)[source]¶ Method to calculate the rough mass of a molecule
Parameters: formula : str
The chemical formula, usually obtained from splatalogue
Returns: int of the rough mass
-
admit.util.utils.
getplain
(formula)[source]¶ Method to make a chemical formula more readable for embedding in filenames Examples: CO(1-0) -> CO
CH3COOHv=0 -> CH3COOH
g-CH3CH2OH -> CH3CH2OH
(CH3)2COv=0 -> ???
Hδ
cis-CH2OHCHOv=
g’Ga-(CH2OH)2
Parameters: formula : str
The chemical formula to process
Returns: String of the more readable formula
-
admit.util.utils.
interpolatespectrum
(spec, left=0.0, right=0.0)[source]¶ Method to interpolate over bad points in a spectrum. Bad points generally come from masked pixels in an image. On read in these show up as exactly 0.0 or +/-inf, or nan in the spectrum. Edge channels that are bad are just converted to 0.0.
Parameters: spec : numpy array
The input spectrum to process
left : float
The value to assign bad edge channels to on the left side of the spectrum. Defualt: 0.0
right : float
The value to assign bad edge channels to on the right side of the spectrum. Defualt: 0.0
Returns: A numpy array with the same length as the input with nan values converted to
iterpolated values between good points, and bad edge values.
-
admit.util.utils.
iscloseinE
(v1, v2)[source]¶ Method to determine if two spectral lines are very close in energy
Parameters: v1 : float
Energy of first transition.
v2 : float
Energy of second transition
Returns: True/False whether or not the energies are very close
-
admit.util.utils.
isotopecount
(formula)[source]¶ Method to count the number of isotopes in a molecule
Parameters: formula : str
The chemical formula to analyze
Returns: An integer of the number of less common isotopes found
-
admit.util.utils.
makeThumbnail
(file, scale=0.33)[source]¶ - Create a thumbnail from an input image. The output
- file will be root of input plus ‘_thumb’ plus input extension. For instance, if the input were “myimage.png”, the output would be “myimage_thumb.png”. Note: only PNG format is currently supported (matplotlib restriction).
Parameters: file : str
input image file name
- scale : multiplier to scale input image, e.g. for 50% scaling,
scale = 0.5. Default: 0.33
@todo scale could be float or pair list indicating x, y output pixels
Returns: The name of the thumbnail file
-
admit.util.utils.
on_error_retry
(exception, callback, timeout=2, timedelta=0.1)[source]¶ A generic method for doing retries with timeout.
Parameters: exception : Exception
An Exception class to handle exceptions from the callback.
callback : function
The callback method to invoke
timeout : float
timeout in seconds before giving up. default: 2
timedelta : float
number of seconds to sleep before retries. default: 0.1
Examples
- for retry in on_error_retry(SomeSpecificException, do_stuff):
- retry()
stolen from stackoverflow.
-
admit.util.utils.
remove
(item)[source]¶ Remove a file or directory.
The method determines if it is a file or directory and removes it appropriately.
Parameters: item : str
Item to be deleted
Returns: None
-
admit.util.utils.
rename
(item1, item2)[source]¶ Rename a file or directory, but ensuring the destination is removed first
Parameters: item1 : string
Source
item2 : string
Destination
Returns: None
-
admit.util.utils.
rm
(file)[source]¶ Remove a file
Parameters: file : str
File to be deleted
Returns: None
-
admit.util.utils.
rmdir
(dir)[source]¶ Remove a directory. Calls shutil.rmtree
Parameters: dir : str
Directory to be deleted
Returns: None
-
admit.util.utils.
rreplace
(s, old, new, occurrence=1)[source]¶ Replace portion of a string (from the right side) Handy utility to change a filename extension, e.g. rreplace(‘a/b/c.fits’, ‘fits’, ‘im’) -> ‘a/b/c.im’
-
admit.util.utils.
undoppler
(sky, vel)[source]¶ Method to convert from sky frequency to source rest frequency
Parameters: sky : float, list, or numpy array
The sky frequency
vel : float
The source vlsr in km/s
Returns: The input value converted to rest frequency, in the same form that the input
was given.


# reddit2md
Turn any selftext posts to markdown... That's it.
## About
reddit2md turns your favorite reddit posts to markdown... That's pretty much it.
## Why?
Printing or archiving.
## Why is this so slow?
Because a) praw is not that fast and b) this is poorly coded. Keep in mind that longer posts will take significantly more time.
## Any known issues?
Multi-line HTML code blocks won't be converted properly. No, this issue will not be fixed as it would take significantly longer conversion time to do so.
## It doesn't work / Something's wrong with the website
Please let me know the issue in Issues page.


◆ UserServiceImpl()
| com.smartlock.server.user.service.UserServiceImpl.UserServiceImpl |
( |
UserRepository |
userRepository, |
|
|
PasswordEncoder |
passwordEncoder, |
|
|
LockRepository |
lockRepository |
|
) |
| |
Class constructor.
- Parameters
-
| userRepository | UserRepository instantiated class corresponding to the current Spring profile. |
| passwordEncoder | PasswordEncoder instantiated class corresponding to the current Spring profile. |
| lockRepository | LockRepository instantiated class corresponding to the current Spring profile. |
◆ createUser()
◆ getAllLocksThisUserCanAccess()
| List<LockDto> com.smartlock.server.user.service.UserServiceImpl.getAllLocksThisUserCanAccess |
( |
Long |
userId | ) |
|
◆ getAllUsersThatCanAccessToThisLock()
| List<UserWithoutLocksDto> com.smartlock.server.user.service.UserServiceImpl.getAllUsersThatCanAccessToThisLock |
( |
Long |
lockId, |
|
|
Long |
userId |
|
) |
| throws NotFoundException |
For a specific Lock returns all the users who have permission to access it.
Only the admin can ask for this information.
- Parameters
-
| lockId | the Id for the lock |
| userId | the user, presumably the lock owner, who requested the information. |
- Returns
- a List of UserWithoutLocksDto who can access the given lock.
- Exceptions
-
| NotFoundException | when the Lock does not exist. |
Implements com.smartlock.server.user.service.UserService.
◆ getMyID()
| Long com.smartlock.server.user.service.UserServiceImpl.getMyID |
( |
| ) |
|
◆ getUser()
| UserDto com.smartlock.server.user.service.UserServiceImpl.getUser |
( |
Long |
id | ) |
|
◆ leaveFromThisLock()
| void com.smartlock.server.user.service.UserServiceImpl.leaveFromThisLock |
( |
Long |
lockId, |
|
|
Long |
userId |
|
) |
| throws NotFoundException |
Removes the User that requested it from a Lock.
Can NOT be performed by the Lock owner.
- Parameters
-
| lockId | the Id of the Lock that the user wants to remove from his library. |
| userId | the Id for the user that performed the action. |
- Exceptions
-
| NotFoundException | when the Lock does not exist. |
Implements com.smartlock.server.user.service.UserService.
The documentation for this class was generated from the following file:
- server/src/main/java/com/smartlock/server/user/service/UserServiceImpl.java


--- title: Documentation layout: base bodyclass: welcome ---
Go to the documentation section.
Read a guide on adding the content to the documentation.
This page is only available on this site and will not be rendered on the spine.io


Netrix Component has full support for styles. You can:
This document can be modified by adding an external stylesheet. This is done by adding a LINK element. The style sheet file is copied to the assemblies exeutable folder.
Assume you have a dialog where a style editor is present, the following code writes and shows the current element's styles:
IElement currentElement = EditorDocument.HtmlEditor.GetCurrentElement(); string cssText = currentElement.GetStyle(); if (editStylesDialog.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { currentElement.SetStyle(cssText); }
Style sheets are linked through a LINK element in the HEAD section. The HtmlDocumentStructure class exposes this (and other parts) as collections. The code shown next adds and removes a stylesheet accordingly to the state of the ribbon's toggle button.
void _toggleButtonStylesLinkedStylesEnabled_ExecuteEvent(object sender, ExecuteEventArgs e) { bool enable = _toggleButtonStylesLinkedStylesEnabled.BooleanValue; // assume the file "LinkedStylesheet.css" is in the output directory // for the first time, we add it to the current document bool alreadyLinked = false; if (EditorDocument.HtmlEditor.DocumentStructure.LinkedStylesheets.Count > 0) { IElement linkedCss = EditorDocument.HtmlEditor.GetElementById("LinkElement2134"); if (linkedCss != null && linkedCss is LinkElement) { alreadyLinked = true; linkedCss.ElementDom.RemoveElement(false); } } string css = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Resources\\Css\\LinkedStylesheet.css"); if (File.Exists(css) && !alreadyLinked && enable) { LinkElement link = EditorDocument.HtmlEditor.CreateElement("LINK") as LinkElement; link.rel = "Stylesheet"; link.media = LinkElementMedia.All; link.type = "text/css"; link.href = css; link.ID = "LinkElement2134"; EditorDocument.HtmlEditor.DocumentStructure.LinkedStylesheets.Add(link); } if (enable) { MessageBox.Show(String.Format("{0} linked styles found", EditorDocument.HtmlEditor.DocumentStructure.LinkedStylesheets.Count), "Linked Stylesheet", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
There are several techniques involved here. The LINK element is created using the CreateElement method. The required attributes are set properly. Then the element is being added to the collection of stylesheet. By default this collection is empty. You can add as many stylesheets as you like.
If the link is about to be removed the element is first retrieved using its ID. If it is there, the ElementDom class is used to remove it from the document.
This is, however, a complete access to the documents content. If you like to disable the style temporarily, just to check an effect first, you can use this call:
EditorDocument.HtmlEditor.LinkedStylesheetsEnabled = enable;
The stylesheet has no effect if disabled, but the LINK element is still in the document.
The style parser parses a stylesheet and creates a dictionary of styles, each as an object. The style dialog uses this code:
public string CssText { get { return styleControl1.StyleString; } set { styleControl1.StyleString = value; } } public IElement Element { set { if (value != null) { labelElement.Text = value.TagName.ToUpper(); styleControl1.Enabled = true; textBoxStyles.Enabled = false; } else { labelElement.Text = ""; styleControl1.Enabled = false; textBoxStyles.Enabled = false; } } } private void styleControl1_ParserReady(object sender, SelectorEventArgs e) { textBoxStyles.Text = e.Selector.ToString(); } private void styleControl1_ContentChanged(object sender, EventArgs e) { textBoxStyles.Text = styleControl1.StyleString; }
Two events are used. ParserReady is fired after the stylesheet has been parsed. Here it is used to sync the textbox. When the user changes a style in the control, the parser fires the ContentChanged event. The current style is always available through the style control's StyleString property.


SpamNet: Spam Classification Using Deep Learning
This project was part of the Smart India Hackathon held at Ahmedabad, Gujarat under the aegis of Indian Space Research Organisation and All India Council of Technical Education (AICTE), Government of India. The project is contiued as a collaboration between ISRO and Jamia Millia Islamia aimed at fully deploying a spam classifying agent on ISRO's mail server.
Saquib Ali Khan, Najeeb Khan, Yasir Mir, Zafarullah Mahmood, Suhail Khan
Smart India Hackathon, 2017


A process that occurs without the transfer of heat or mass across the boundaries of the system is called adiabatic. If a confined gas in a cylinder is compressed by the motion of a piston while the cylinder resides in a reservoir that maintains its temperature, that process is not adiabatic because heat will be transferred from the cylinder to the reservoir. However, equalization of pressure that occurs when a valve separating two chambers is opened is adiabatic. When a buoyant parcel (i.e., one having density lower than its surroundings) rises in the atmosphere, the process in the core of the parcel can be approximated as adiabatic, so relationships for adiabatic processes are useful when one considers stability in the atmosphere. An adiabatic process can still include work done on or by the system, where the work is equal to the pressure times the change in volume.
To consider relationships for an adiabatic process, we need both the first law of thermodynamics (essentially, energy conservation) and the ideal-gas law. The first law states: where U is the internal energy (CvT for an ideal gas), Q is the heat transferred (zero for an adiabatic process), and p and v refer to the pressure and specific volume (volume per mass, or the inverse of the density).


Here’s how to unwind this week
Ends Sunday!
FREE Candle when you buy one
Any Size, Any Fragrance
Use Code: PARADISE
To shop now, copy and paste:
http://links.mkt1917.com/ctt?kn=31&ms=MTI4MTk5MzIS1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzIzMDI3NjgxS0&mt=1&rt=0
into your browser
To find a store near you, copy and paste:
http://links.mkt1917.com/ctt?kn=6&ms=MTI4MTk5MzIS1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzIzMDI3NjgxS0&mt=1&rt=0
into your browser
2 for $10
Car Jar® Ultimates &
Smart Scent™ Vent Clips
Reg. $5.49
To shop now, copy and paste:
http://links.mkt1917.com/ctt?kn=18&ms=MTI4MTk5MzIS1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzIzMDI3NjgxS0&mt=1&rt=0
into your browser
Enter for a chance to win!
Margaritaville® Sweepstakes
To enter, copy and paste:
http://links.mkt1917.com/ctt?kn=3&ms=MTI4MTk5MzIS1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzIzMDI3NjgxS0&mt=1&rt=0
into your browser


--- layout: post title: Why Mac for Science. categories: [] tags: [] status: publish type: post published: true meta: _original_post_id: '' _original_import_author: John Duprey author: ---
jduprey
geeky


|
GenSSI
2016-02-19
GenSSI
|
GenSSI is a Matlab implementation of generating series for structural identifiability as defined in
With GenSSI, the user can specify differential equation models in terms of symbolic variables in Matlab and then analyze the models to determine which parameters are globally or locally identifiable. In addition, there are some utilities for converting models to polynomial form, or to or from AMICI format.
The sources for GenSSI are accessible as
Once you've obtained your copy check out the Installation
In order to always stay up to date with the latest GenSSI versions, simply pull it from our Git repository and recompile it when a new release is available. For more information about Git checkout their website
The Git repository can currently be found at https://github.com/thomassligon/GenSSI and a direct clone is possible via
This software is available under the BSD license
Copyright (c) 2016, Oana-Teodora Chiş, Julio R. Banga, Eva Balsa-Canto, Thomas S. Ligon, Fabian Fröhlich and Jan Hasenauer. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
If GenSSI was downloaded as a zip, it needs to be unpacked in a convenient directory. If GenSSI was obtained via cloning of the git repository, no further unpacking is necessary.
Models are generally stored in
but GenSSI should be able to find them in any directory that is is the Matlab path.
When a model is analyzed GenSSI stores the results in
To use GenSSI, start Matlab and add the GenSSI direcory to the Matlab path. To add all toolbox directories to the Matlab path, execute the Matlab script
To store the installation for further Matlab session, the path can be saved via


{% extends 'nav.html' %} {% block content %}
Prof. Dragutin Petkovic
CS Department, SFSU Class teacher, also simulating the role of CEO and customer council;
Anthony Souza
Lecturer, CS Department, SFSU, also simulating the role of CTO;
Branden Nguyen
Team lead
<EMAIL_ADDRESS>Robert Freeman
Github Master
Yongjian Pan
Backend Lead
Tin Thu Zar Aye
Backend
Jasmine Jahan
Frontend Lead
Gurjot Singh
Frontend


Games:
Games Bruv
Sonic
Duck Life 3
Duck Life 4
Zelda
Mario
Doodle Jump
Pong
Basketball Legends
slope
Dinosaur Game
Fall Cars
Velocity
Among Us
Retro Bowl
8-Ball Pool
Geometry Dash
Minecraft
All Star Soccer
Buy your watch


10
The Greatness of Mordecai
1 King Ahasuerus imposed tax on the land and on the coastlands of the sea.
2 And all the acts of his power and might, and the full account of the high honor of Mordecai, to which the king advanced him, are they not written in the Book of the Chronicles of the kings of Media and Persia?
3 For Mordecai the Jew was second in rank to King Ahasuerus, and he was great among the Jews and popular with the multitude of his brothers, for he sought the welfare of his people and spoke peace to all his people.


YACS
Classes
Search
Filter Sub-Semester
All
{{subsemester.date_start_display}} - {{subsemester.date_end_display}}
Filter Department
All
{{department}}
{{ class.name }} (4 Credits)
{{ class.title }}
by Professor Kuzmin
Schedule
{{day}}
{{day}}{{hour}}


My name is Diana Atieno.  I am a graduate with Bachelor Degree in Mathematics and Computer Science, statistics option from the Technical University of Mombasa. Currently, I am not employed. I am interested in programming because the digital world today needs individuals who are equipped with skills that are computer related. Also, I am interested in programming to acquire skills that will help me in my future career as a Computer Scientist.
The following are the lists of projects I have done.
This is a cookie recipe that was in the practice on canvas. I cloned it from the Github according to the instructions that were given
Click HereThis is my first html website that I was practicing on making an online restaurant
Click HereMy hobbies include the following:


Recommendation:
Detangle consists of a Chrome extension and a native package installed onto your machine. Please install detangle by running:
sudo apt-get install detangle
Once the package is installed, restart chrome with chrome://restart.
Recommendation:
Detangle consists of a Chrome extension and a native package installed onto your machine. It appears the native package is missing. Try:
- Open the Managed Software Center application.
- Search for and install Detangle.
- Once Detangle is installed, run chrome://restart in this browser.
Recommendation:
Detangle consists of a Chrome extension and a native package installed onto your machine. It appears the native package is missing. Try:
- Open the Software Center.
- Search for and install Detangle.
- Once Detangle is installed, run chrome://restart in this browser.
Recommendation:
Detangle works by downloading a sitelist, which is used to decide if the URL can be opened in the corporate browser.
Detangle has not yet downloaded this sitelist, so no site will be allowed to open in Corporate. To fix this, try:
- Go to the Global Settings tab, and press Refresh Policy from Server.
- Restarting chrome with chrome://restart.
Your platform is not supported :(
Detangle will partially function on your machine after manual configuration.
Unfortunately, Detangle is only partically supported on your platform. Automatically opening non-corporate sites in regular/risky
browsers will not occur, instead the request will be stopped. After an intercept, you can either open the site in incognito
or manually copy the URL into another browser.
Everything looks good from here! :) If you are having issues with Detangle, feel free to open a bug.


General Information
- Breed Purpose
- Egg Layer
- Comb
- Single
- Broodiness
- Seldom
- Climate Tolerance
- All Climates
- Egg Productivity
- High
- Egg Size
- Large
- Egg Color
- White
- Breed Temperament
- Friendly, Flighty, Bears confinement well, Noisy, Shy
- Breed Colors/Varieties
- White, light brown, dark brown, black, blue, buff, Columbian, buff Columbian, barred, exchequer and silver
- Breed Size
- Large Fowl
- APA/ABA Class
- Mediterranean
The Leghorn appears to derive from light breeds originating in rural Tuscany, though the origins are not clear. The name Leghorn was derived from Livorno, the Tuscan port from which the first birds were exported to North America. The date of the first exports is variously reported as 1828, "about 1830" and 1852. They were initially known as "Italians" and they were first referred to as "Leghorns" in 1865.
The Leghorn was included in the APA's Standard of Perfection in 1874, with three colours: black, white and brown (light and dark). Rose comb light and dark brown were added in 1883, and rose comb white in 1886. Single comb buff and silver followed in 1894, and red, black-tailed red, and Columbian in 1929. In 1981 rose comb black, buff, silver, and golden duckwing were also added.
The breed was first introduced to Britain from the United States in 1870, and from there re-exported to Italy. White Leghorns that had won first prize at the 1868 New York show were imported to Britain in 1870, and brown Leghorns from 1872. Pyle Leghorns were first bred in Britain in the 1880s; gold and silver duckwings originated there a few years later, from crosses with Phoenix or Japanese Yokohama birds. Buff Leghorns were first seen in Denmark in 1885, and in England in 1888.
A flighty breed, the Leghorn are popular today for their great egg production and also for exhibition.
Leghorn eggs
Leghorn chick
Leghorn juveniles
Leghorn hen
Leghorn rooster
For more info on Leghorns and their owners' and breeders' experiences, see our breed discussion here:
https://www.backyardchickens.com/threads/chicken-breed-focus-leghorn.1152504/


import json import logging from typing import Optional from pip._vendor.pkg_resources import Distribution from pip._internal.models.direct_url import ( DIRECT_URL_METADATA_NAME, ArchiveInfo, DirectUrl, DirectUrlValidationError, DirInfo, VcsInfo, ) from pip._internal.models.link import Link from pip._internal.vcs import vcs logger = logging.getLogger(__name__) def direct_url_as_pep440_direct_reference(direct_url, name): # type: (DirectUrl, str) -> str """Convert a DirectUrl to a pip requirement string.""" direct_url.validate() # if invalid, this is a pip bug requirement = name + " @ " fragments = [] if isinstance(direct_url.info, VcsInfo): requirement +=<EMAIL_ADDRESS>direct_url.info.vcs, direct_url.url, direct_url.info.commit_id ) elif isinstance(direct_url.info, ArchiveInfo): requirement += direct_url.url if direct_url.info.hash: fragments.append(direct_url.info.hash) else: assert isinstance(direct_url.info, DirInfo) requirement += direct_url.url if direct_url.subdirectory: fragments.append("subdirectory=" + direct_url.subdirectory) if fragments: requirement += "#" + "&".join(fragments) return requirement def direct_url_from_link(link, source_dir=None, link_is_in_wheel_cache=False): # type: (Link, Optional[str], bool) -> DirectUrl if link.is_vcs: vcs_backend = vcs.get_backend_for_scheme(link.scheme) assert vcs_backend url, requested_revision, _ = vcs_backend.get_url_rev_and_auth( link.url_without_fragment ) # For VCS links, we need to find out and add commit_id. if link_is_in_wheel_cache: # If the requested VCS link corresponds to a cached # wheel, it means the requested revision was an # immutable commit hash, otherwise it would not have # been cached. In that case we don't have a source_dir # with the VCS checkout. assert requested_revision commit_id = requested_revision else: # If the wheel was not in cache, it means we have # had to checkout from VCS to build and we have a source_dir # which we can inspect to find out the commit id. assert source_dir commit_id = vcs_backend.get_revision(source_dir) return DirectUrl( url=url, info=VcsInfo( vcs=vcs_backend.name, commit_id=commit_id, requested_revision=requested_revision, ), subdirectory=link.subdirectory_fragment, ) elif link.is_existing_dir(): return DirectUrl( url=link.url_without_fragment, info=DirInfo(), subdirectory=link.subdirectory_fragment, ) else: hash = None hash_name = link.hash_name if hash_name: hash = f"{hash_name}={link.hash}" return DirectUrl( url=link.url_without_fragment, info=ArchiveInfo(hash=hash), subdirectory=link.subdirectory_fragment, ) def dist_get_direct_url(dist): # type: (Distribution) -> Optional[DirectUrl] """Obtain a DirectUrl from a pkg_resource.Distribution. Returns None if the distribution has no `direct_url.json` metadata, or if `direct_url.json` is invalid. """ if not dist.has_metadata(DIRECT_URL_METADATA_NAME): return None try: return DirectUrl.from_json(dist.get_metadata(DIRECT_URL_METADATA_NAME)) except ( DirectUrlValidationError, json.JSONDecodeError, UnicodeDecodeError, ) as e: logger.warning( "Error parsing %s for %s: %s", DIRECT_URL_METADATA_NAME, dist.project_name, e, ) return None


Current Conditions:
Clear
Forecast:
Wed - Sunny. High: 85Low: 64
Thu - Sunny. High: 81Low: 64
Fri - Mostly Sunny. High: 79Low: 58
Sat - Partly Cloudy. High: 82Low: 58
Sun - Sunny. High: 84Low: 59
Full Forecast at Yahoo! Weather
(provided by The Weather Channel)


Warning - merging is quite drastic - proceed with caution
Merge should only be used where multiple versions of the same enzyme have been entered into the database. Merge the entry with the least data into the one with the most data.
All references to this sequence in any activity data will be overwritten with that of the merged sequence, and this entry will be deleted. This can not be undone
If you are not sure, please ask the RetroBioCat admins.


Komodo
introductions
Are you a developer or blockchain enthusiast? Introduce yourself. Please note that normal chat messages will be removed. Go to #general to start a discussion or ask a follow-up question.
100 messages
Between 07-Dec-19 12:00 AM and 08-Dec-19 12:00 AM
YAGPDB.xyz
BOT
07-Dec-19 12:49 AM
Exotic#7938<PHONE_NUMBER>68274954)
New user joined waiting to be verified as a human
Gross#4686<PHONE_NUMBER>51833354)
New user joined waiting to be verified as a human
Clueless Possession#1599<PHONE_NUMBER>01933315)
New user joined waiting to be verified as a human
Intrepid#3908<PHONE_NUMBER>69277698)
New user joined waiting to be verified as a human
Ultimate Table#1739<PHONE_NUMBER>26968361)
New user joined waiting to be verified as a human
Terrible#4882<PHONE_NUMBER>83567619)
New user joined waiting to be verified as a human
Thrifty#5174<PHONE_NUMBER>59522877)
New user joined waiting to be verified as a human
Opulent Emotion#6785<PHONE_NUMBER>45230888)
New user joined waiting to be verified as a human
Vapid Other#3370<PHONE_NUMBER>99672609)
New user joined waiting to be verified as a human
Required Safe#6644<PHONE_NUMBER>61369375)
New user joined waiting to be verified as a human
Unrealistic#4164<PHONE_NUMBER>66990351)
New user joined waiting to be verified as a human
Dizzy Hook#1162<PHONE_NUMBER>88517120)
New user joined waiting to be verified as a human
Courteous#5937<PHONE_NUMBER>30280981)
New user joined waiting to be verified as a human
Bulky#8037<PHONE_NUMBER>32459041)
New user joined waiting to be verified as a human
Sniveling Trick#6899<PHONE_NUMBER>20526080)
New user joined waiting to be verified as a human
Misty Range#2790<PHONE_NUMBER>33334026)
New user joined waiting to be verified as a human
Awkward#2882<PHONE_NUMBER>28309789)
New user joined waiting to be verified as a human
Deserted Leader#4723<PHONE_NUMBER>13976852)
New user joined waiting to be verified as a human
Supportive Drop#3081<PHONE_NUMBER>94684692)
New user joined waiting to be verified as a human
Pushy Quantity#0630<PHONE_NUMBER>56500225)
New user joined waiting to be verified as a human
Coarse Term#4770<PHONE_NUMBER>42118428)
New user joined waiting to be verified as a human
Worn Shoe#8143<PHONE_NUMBER>84261131)
New user joined waiting to be verified as a human
Unsung#0219<PHONE_NUMBER>88259328)
New user joined waiting to be verified as a human
Frugal#0283<PHONE_NUMBER>36166401)
New user joined waiting to be verified as a human
Shameful Image#2648<PHONE_NUMBER>00830987)
New user joined waiting to be verified as a human
Single#0668<PHONE_NUMBER>01973537)
New user joined waiting to be verified as a human
Scared#9880<PHONE_NUMBER>22615306)
New user joined waiting to be verified as a human
Present#3712<PHONE_NUMBER>35423311)
New user joined waiting to be verified as a human
Muddy#4507<PHONE_NUMBER>65467938)
New user joined waiting to be verified as a human
Arctic Classic#0590<PHONE_NUMBER>87271938)
New user joined waiting to be verified as a human
Quixotic#7037<PHONE_NUMBER>75788810)
New user joined waiting to be verified as a human
Possible#0129<PHONE_NUMBER>02246685)
New user joined waiting to be verified as a human
Remarkable#2830<PHONE_NUMBER>45469461)
New user joined waiting to be verified as a human
Tragic#7972<PHONE_NUMBER>87730432)
New user joined waiting to be verified as a human
Loyal#1548<PHONE_NUMBER>55366696)
New user joined waiting to be verified as a human
Concrete Birth#5849<PHONE_NUMBER>00336160)
New user joined waiting to be verified as a human
Hollow#3043<PHONE_NUMBER>47039058)
New user joined waiting to be verified as a human
Meager#6288<PHONE_NUMBER>78672896)
New user joined waiting to be verified as a human
Steep Method#5515<PHONE_NUMBER>81668106)
New user joined waiting to be verified as a human
Few Dare#3784<PHONE_NUMBER>94516995)
New user joined waiting to be verified as a human
Motionless#8504<PHONE_NUMBER>83707914)
New user joined waiting to be verified as a human
Glossy#2820<PHONE_NUMBER>66717706)
New user joined waiting to be verified as a human
Babyish Recommendation#1956<PHONE_NUMBER>51083029)
New user joined waiting to be verified as a human
Conscious#8274<PHONE_NUMBER>46019584)
New user joined waiting to be verified as a human
Actual Comparison#6531<PHONE_NUMBER>61395200)
New user joined waiting to be verified as a human
Opulent Sport#4623<PHONE_NUMBER>16868610)
New user joined waiting to be verified as a human
False#0022<PHONE_NUMBER>01068821)
New user joined waiting to be verified as a human
Noted#8785<PHONE_NUMBER>12290324)
New user joined waiting to be verified as a human
Sweet#3126<PHONE_NUMBER>15796027)
New user joined waiting to be verified as a human
Second-hand#3433<PHONE_NUMBER>53898270)
New user joined waiting to be verified as a human
Huge#9555<PHONE_NUMBER>42766375)
New user joined waiting to be verified as a human
Fluffy Eye#9126<PHONE_NUMBER>74952705)
New user joined waiting to be verified as a human
Bronze#7860<PHONE_NUMBER>22817792)
New user joined waiting to be verified as a human
Livid#8582<PHONE_NUMBER>49905696)
New user joined waiting to be verified as a human
Excitable Front#7820<PHONE_NUMBER>19524639)
New user joined waiting to be verified as a human
Harsh#4618<PHONE_NUMBER>38739743)
New user joined waiting to be verified as a human
Wealthy#4065<PHONE_NUMBER>07781120)
New user joined waiting to be verified as a human
Loyal#0652<PHONE_NUMBER>59793688)
New user joined waiting to be verified as a human
Smart#8634<PHONE_NUMBER>38813452)
New user joined waiting to be verified as a human
Third Status#3273<PHONE_NUMBER>05900042)
New user joined waiting to be verified as a human
Round Truck#3398<PHONE_NUMBER>46630933)
New user joined waiting to be verified as a human
Outlandish Simple#8750<PHONE_NUMBER>09465602)
New user joined waiting to be verified as a human
Starry#1515<PHONE_NUMBER>91654923)
New user joined waiting to be verified as a human
Waterlogged Other#1867<PHONE_NUMBER>86957865)
New user joined waiting to be verified as a human
Rash#6010<PHONE_NUMBER>22239748)
New user joined waiting to be verified as a human
Hot#2115<PHONE_NUMBER>39200601)
New user joined waiting to be verified as a human
Lustrous#6496<PHONE_NUMBER>97021717)
New user joined waiting to be verified as a human
Serious Supermarket#0861<PHONE_NUMBER>62425098)
New user joined waiting to be verified as a human
Grateful Guitar#5706<PHONE_NUMBER>61206046)
New user joined waiting to be verified as a human
Outlandish#3638<PHONE_NUMBER>58561320)
New user joined waiting to be verified as a human
Sizzling#8790<PHONE_NUMBER>03027213)
New user joined waiting to be verified as a human
Natural#7714<PHONE_NUMBER>11997189)
New user joined waiting to be verified as a human
Victorious#4177<PHONE_NUMBER>17165568)
New user joined waiting to be verified as a human
Baggy Ratio#7003<PHONE_NUMBER>88757545)
New user joined waiting to be verified as a human
Impartial#9580<PHONE_NUMBER>01309225)
New user joined waiting to be verified as a human
Scaly#0501<PHONE_NUMBER>05820951)
New user joined waiting to be verified as a human
Puzzled#1529<PHONE_NUMBER>69130241)
New user joined waiting to be verified as a human
Profuse#7433<PHONE_NUMBER>59758336)
New user joined waiting to be verified as a human
Internal#3814<PHONE_NUMBER>41710603)
New user joined waiting to be verified as a human
Old Sail#6029<PHONE_NUMBER>54103564)
New user joined waiting to be verified as a human
Frequent Script#1029<PHONE_NUMBER>53321996)
New user joined waiting to be verified as a human
Handmade#6712<PHONE_NUMBER>85086722)
New user joined waiting to be verified as a human
Talkative Top#2984<PHONE_NUMBER>34433792)
New user joined waiting to be verified as a human
Thoughtful Cup#1825<PHONE_NUMBER>84524057)
New user joined waiting to be verified as a human
Dense Crew#3803<PHONE_NUMBER>15510547)
New user joined waiting to be verified as a human
YAGPDB.xyz
BOT
07-Dec-19 12:59 AM
Exotic#7938<PHONE_NUMBER>68274954)
Kicked for not verifying within deadline
Gross#4686<PHONE_NUMBER>51833354)
Kicked for not verifying within deadline
Clueless Possession#1599<PHONE_NUMBER>01933315)
Kicked for not verifying within deadline
Intrepid#3908<PHONE_NUMBER>69277698)
Kicked for not verifying within deadline
Thrifty#5174<PHONE_NUMBER>59522877)
Kicked for not verifying within deadline
Terrible#4882<PHONE_NUMBER>83567619)
Kicked for not verifying within deadline
Ultimate Table#1739<PHONE_NUMBER>26968361)
Kicked for not verifying within deadline
Bulky#8037<PHONE_NUMBER>32459041)
Kicked for not verifying within deadline
Vapid Other#3370<PHONE_NUMBER>99672609)
Kicked for not verifying within deadline
Required Safe#6644<PHONE_NUMBER>61369375)
Kicked for not verifying within deadline
Deserted Leader#4723<PHONE_NUMBER>13976852)
Kicked for not verifying within deadline
Courteous#5937<PHONE_NUMBER>30280981)
Kicked for not verifying within deadline
Sniveling Trick#6899<PHONE_NUMBER>20526080)
Kicked for not verifying within deadline
Dizzy Hook#1162<PHONE_NUMBER>88517120)
Kicked for not verifying within deadline


Install it:
pip install flask-appbuilder
git clone https://github.com/dpgaspar/Flask-AppBuilder-Skeleton.git
Run it:
cd Flask-AppBuilder-Skeleton
python run.py
That’s it!!
The git clone is not actually needed for you to run AppBuilder. but it’s a good way to start, also comes with all the translations from the framework see i18n Translations
pip instalations installs all the requirements for you.
Flask App Builder dependes on
- flask : The web framework, this is what were extending
- flask-sqlalchemy : DB access see SQLAlchemy, This requirement is optional
- flask-login : Login, session on flask.
- flask-openid : Open ID authentication
- flask-wtform
- flask-Babel : For internationalization
If you plan to use Image on database, you will need to install PIL:
pip install pillow
or:
pip install PIL
When starting your application for the first time, all your models and AppBuilder security tables will be created for you. Version 0.3.X does not need you to run “init_app.py”. AppBuilder will create all available permissions associated with your views and menus, and these will be automaticaly associated with your defined role AUTH_ROLE_ADMIN
The ‘admin’ password will be ‘general’. Change it on your first access using the application. (Click the username on the navigation bar, then choose ‘Reset Password’)


Strings, Char Lists, Graphemes and Codepoints.
Table of Contents
Strings
Elixir strings are nothing but a sequence of bytes. Let’s look at an example:
iex> string = <<104,101,108,108,111>>
"hello"
iex> string <> <<0>>
<<104, 101, 108, 108, 111, 0>>
By concatenating the string with the byte 0
, IEx displays the string as a binary because it is not a valid string anymore.
This trick can help us view the underlying bytes of any string.
NOTE: Using « » syntax we are saying to the compiler that the elements inside those symbols are bytes.
Charlists
Internally, Elixir strings are represented with a sequence of bytes rather than an array of characters. Elixir also has a char list type (character list). Elixir strings are enclosed with double quotes, while char lists are enclosed with single quotes.
What’s the difference? Each value in a charlist is the Unicode code point of a character whereas in a binary, the codepoints are encoded as UTF-8. Let’s dig in:
iex> 'hełło'
[104, 101, 322, 322, 111]
iex> "hełło" <> <<0>>
<<104, 101, 197, 130, 197, 130, 111, 0>>
322
is the Unicode codepoint for ł but it is encoded in UTF-8 as the two bytes 197
, 130
.
You can get a character’s code point by using ?
iex> ?Z
90
This allows you to use the notation ?Z
rather than ‘Z’ for a symbol.
When programming in Elixir, we usually use strings, not charlists. The charlist support is mainly included because it is required for some Erlang modules.
For further information, see the official Getting Started Guide
.
Graphemes and Codepoints
Codepoints are just simple Unicode characters which are represented by one or more bytes, depending on the UTF-8 encoding.
Characters outside of the US ASCII character set will always encode as more than one byte.
For example, Latin characters with a tilde or accents (á, ñ, è
) are typically encoded as two bytes.
Characters from Asian languages are often encoded as three or four bytes.
Graphemes consist of multiple codepoints that are rendered as a single character.
The String module already provides two functions to obtain them, graphemes/1
and codepoints/1
.
Let’s look at an example:
iex> string = "\u0061\u0301"
"á"
iex> String.codepoints string
["a", "́"]
iex> String.graphemes string
["á"]
String Functions
Let’s review some of the most important and useful functions of the String module.
This lesson will only cover a subset of the available functions.
To see a complete set of functions visit the official String
docs.
length/1
Returns the number of Graphemes in the string.
iex> String.length "Hello"
5
replace/3
Returns a new string replacing a current pattern in the string with some new replacement string.
iex> String.replace("Hello", "e", "a")
"Hallo"
duplicate/2
Returns a new string repeated n times.
iex> String.duplicate("Oh my ", 3)
"Oh my Oh my Oh my "
split/2
Returns a list of strings split by a pattern.
iex> String.split("Hello World", " ")
["Hello", "World"]
Exercise
Let’s walk through a simple exercise to demonstrate we are ready to go with Strings!
Anagrams
A and B are considered anagrams if there’s a way to rearrange A or B making them equal. For example:
- A = super
- B = perus
If we re-arrange the characters on String A, we can get the string B, and vice versa.
So, how could we check if two strings are Anagrams in Elixir? The easiest solution is to just sort the graphemes of each string alphabetically and then check if they both lists are equal. Let’s try that:
defmodule Anagram do
def anagrams?(a, b) when is_binary(a) and is_binary(b) do
sort_string(a) == sort_string(b)
end
def sort_string(string) do
string
|> String.downcase()
|> String.graphemes()
|> Enum.sort()
end
end
Let’s first look at anagrams?/2
.
We are checking whether the parameters we are receiving are binaries or not.
That’s the way we check if a parameter is a String in Elixir.
After that, we are calling a function that orders the string alphabetically.
It first converts the string to lowercase and then uses String.graphemes/1
to get a list of the graphemes in the string.
Finally, it pipes that list into Enum.sort/1
.
Pretty straight, right?
Let’s check the output on iex:
iex> Anagram.anagrams?("Hello", "ohell")
true
iex> Anagram.anagrams?("María", "íMara")
true
iex> Anagram.anagrams?(3, 5)
** (FunctionClauseError) no function clause matching in Anagram.anagrams?/2
The following arguments were given to Anagram.anagrams?/2:
# 1
3
# 2
5
iex:11: Anagram.anagrams?/2
As you can see, the last call to anagrams?
caused a FunctionClauseError.
This error is telling us that there is no function in our module that meets the pattern of receiving two non-binary arguments, and that’s exactly what we want, to just receive two strings, and nothing more.
Caught a mistake or want to contribute to the lesson? Edit this page on GitHub!