Shapely
Manipulation and analysis of geometric objects in the Cartesian plane.
Shapely is a BSD-licensed Python package for manipulation and analysis of
planar geometric objects. It is based on the widely deployed GEOS (the engine
of PostGIS) and JTS (from which GEOS is ported) libraries. Shapely is not
concerned with data formats or coordinate systems, but can be readily
integrated with packages that are. For more details, see:
Requirements
Shapely 1.3 requires
- Python >=2.6 (including Python 3.x)
- libgeos_c >=3.1 (3.0 and below have not been tested, YMMV)
Installation
Windows users should use the executable installer, which contains the required
GEOS DLL. Other users should acquire libgeos_c by any means, make sure that it
is on the system library path, and install from the Python package index:
or from a source distribution with the setup script:
$ python setup.py install
Warning
Windows users:
do not under any circumstances use pip (or easy_install) to uninstall
Shapely versions < 1.2.17. Due to the way Shapely used to install its GEOS
DLL and a distribute or setuptools bug, your Python installation may be
broken by an uninstall command. Shapely 1.2.17 will uninstall safely.
Usage
Here is the canonical example of building an approximately circular patch by
buffering a point:
>>> from shapely.geometry import Point
>>> patch = Point(0.0, 0.0).buffer(10.0)
>>> patch
<shapely.geometry.polygon.Polygon object at 0x...>
>>> patch.area
313.65484905459385
See the manual for comprehensive usage snippets and the dissolve.py and
intersect.py example apps.
Integration
Shapely does not read or write data files, but it can serialize and deserialize
using several well known formats and protocols. The shapely.wkb and shapely.wkt
modules provide dumpers and loaders inspired by Python’s pickle module.:
>>> from shapely.wkt import dumps, loads
>>> dumps(loads('POINT (0 0)'))
'POINT (0.0000000000000000 0.0000000000000000)'
All linear objects, such as the rings of a polygon (like patch above),
provide the Numpy array interface.:
>>> from numpy import asarray
>>> ag = asarray(patch.exterior)
>>> ag
array([[ 1.00000000e+01, 0.00000000e+00],
[ 9.95184727e+00, -9.80171403e-01],
[ 9.80785280e+00, -1.95090322e+00],
...
[ 1.00000000e+01, 0.00000000e+00]])
That yields a Numpy array of [x, y] arrays. This is not always exactly what one
wants for plotting shapes with Matplotlib (for example), so Shapely 1.2 adds
a xy property for obtaining separate arrays of coordinate x and y values.:
>>> x, y = patch.exterior.xy
>>> ax = asarray(x)
>>> ax
array([ 1.00000000e+01, 9.95184727e+00, 9.80785280e+00, ...])
Numpy arrays can also be adapted to Shapely linestrings:
>>> from shapely.geometry import asLineString
>>> asLineString(ag).length
62.806623139095073
>>> asLineString(ag).wkt
'LINESTRING (10.0000000000000000 0.0000000000000000, ...)'
Shapely can also integrate with other Python GIS packages using data modeled
after GeoJSON.
>>> import json
>>> from shapely.geometry import mapping, shape
>>> s = shape(json.loads('{"type": "Point", "coordinates": [0.0, 0.0]}'))
>>> s
<shapely.geometry.point.Point object at 0x...>
>>> print(json.dumps(mapping(s)))
{"type": "Point", "coordinates": [0.0, 0.0]}
Development and Testing
Dependecies for developing Shapely are listed in requirements-dev.txt. Cython
and Numpy are not required for production installations, only for development.
Use of a virtual environment is strongly recommended.:
$ virtualenv .
$ source bin/activate
(env)$ pip install -r requirements-dev.txt
(env)$ python setup.py develop
Shapely uses a Zope-stye suite of unittests and doctests, exercised via
setup.py.:
(env)$ python setup.py test
Nosetests won’t run the tests properly; Zope doctest suites are not currently
supported well by nose.
Credits
Shapely is written by:
- Sean Gillies
- Aron Bierbaum
- Kai Lautaportti
- Oliver Tonnhofer
Patches contributed by:
See also: https://github.com/Toblerity/Shapely/graphs/contributors.
Additional help from:
- Justin Bronn (GeoDjango) for ctypes inspiration
- Martin Davis (JTS)
- Jaakko Salli for the Windows distributions
- Sandro Santilli, Mateusz Loskot, Paul Ramsey, et al (GEOS Project)
Major portions of this work were supported by a grant (for Pleiades) from the
U.S. National Endowment for the Humanities (http://www.neh.gov).
Changes
1.3.0 (2013-12-31)
- Include support for Python 3.2 and 3.3 (#56), minimum version is now 2.6.
- Switch to GEOS WKT/WKB Reader/Writer API, with defaults changed to enable 3D
output dimensions, and to ‘trim’ WKT output for GEOS >=3.3.0.
- Use GEOS version instead of GEOS C API version to determine library
capabilities (#65).
1.2.19 (2013-12-30)
- Add buffering style options (#55).
1.2.18 (2013-07-23)
- Add shapely.ops.transform.
- Permit empty sequences in collection constructors (#49, #50).
- Individual polygons in MultiPolygon.__geo_interface__ are changed to tuples
to match Polygon.__geo_interface__ (#51).
- Add shapely.ops.polygonize_full (#57).
1.2.17 (2013-01-27)
- Avoid circular import between wkt/wkb and geometry.base by moving calls
to GEOS serializers to the latter module.
- Set _ndim when unpickling (issue #6).
- Don’t install DLLs to Python’s DLL directory (#37).
- Add affinity module of affine transformation (#31).
- Fix NameError that blocked installation with PyPy (#40, #41).
1.2.16 (2012-09-18)
- Add ops.unary_union function.
- Alias ops.cascaded_union to ops.unary_union when GEOS CAPI >= (1,7,0).
- Add geos_version_string attribute to shapely.geos.
- Ensure parent is set when child geometry is accessed.
- Generate _speedups.c using Cython when building from repo when missing,
stale, or the build target is “sdist”.
- The is_simple predicate of invalid, self-intersecting linear rings now
returns False.
- Remove VERSION.txt from repo, it’s now written by the distutils setup script
with value of shapely.__version__.
1.2.15 (2012-06-27)
- Eliminate numerical sensitivity in a method chaining test (Debian bug
#663210).
- Account for cascaded union of random buffered test points being a polygon
or multipolygon (Debian bug #666655).
- Use Cython to build speedups if it is installed.
- Avoid stumbling over SVN revision numbers in GEOS C API version strings.
1.2.14 (2012-01-23)
- A geometry’s coords property is now sliceable, yielding a list of coordinate
values.
- Homogeneous collections are now sliceable, yielding a new collection of the
same type.
1.2.13 (2011-09-16)
- Fixed errors in speedups on 32bit systems when GEOS references memory above
2GB.
- Add shapely.__version__ attribute.
- Update the manual.
1.2.12 (2011-08-15)
- Build Windows distributions with VC7 or VC9 as appropriate.
- More verbose report on failure to speed up.
- Fix for prepared geometries broken in 1.2.11.
- DO NOT INSTALL 1.2.11
1.2.11 (2011-08-04)
- Ignore AttributeError during exit.
- PyPy 1.5 support.
- Prevent operation on prepared geometry crasher (#12).
- Optional Cython speedups for Windows.
- Linux 3 platform support.
1.2.10 (2011-05-09)
- Add optional Cython speedups.
- Add is_cww predicate to LinearRing.
- Add function that forces orientation of Polygons.
- Disable build of speedups on Windows pending packaging work.
1.2.9 (2011-03-31)
- Remove extra glob import.
- Move examples to shapely.examples.
- Add box() constructor for rectangular polygons.
- Fix extraneous imports.
1.2.8 (2011-12-03)
- New parallel_offset method (#6).
- Support for Python 2.4.
1.2.7 (2010-11-05)
- Support for Windows eggs.
1.2.6 (2010-10-21)
- The geoms property of an empty collection yields [] instead of a ValueError
(#3).
- The coords and geometry type sproperties have the same behavior as above.
- Ensure that z values carry through into products of operations (#4).
1.2.5 (2010-09-19)
- Stop distributing docs/_build.
- Include library fallbacks in test_dlls.py for linux platform.
1.2.4 (2010-09-09)
- Raise AttributeError when there’s no backend support for a method.
- Raise OSError if libgeos_c.so (or variants) can’t be found and loaded.
- Add geos_c DLL loading support for linux platforms where find_library doesn’t
work.
1.2.3 (2010-08-17)
- Add mapping function.
- Fix problem with GEOSisValidReason symbol for GEOS < 3.1.
1.2.2 (2010-07-23)
- Add representative_point method.
1.2.1 (2010-06-23)
- Fixed bounds of singular polygons.
- Added shapely.validation.explain_validity function (#226).
1.2rc2 (2010-05-26)
- Add examples and tests to MANIFEST.in.
- Release candidate 2.
1.2b7 (2010-04-22)
- Memory leak associated with new empty geometry state fixed.
1.2b6 (2010-04-13)
- Broken GeometryCollection fixed.
1.2b5 (2010-04-09)
- Objects can be constructed from others of the same type, thereby making
copies. Collections can be constructed from sequences of objects, also making
copies.
- Collections are now iterators over their component objects.
- New code for manual figures, using the descartes package.
1.2b4 (2010-03-19)
- Adds support for the “sunos5” platform.
1.2b3 (2010-02-28)
- Only provide simplification implementations for GEOS C API >= 1.5.
1.2b2 (2010-02-19)
- Fix cascaded_union bug introduced in 1.2b1 (#212).
1.2b1 (2010-02-18)
- Update the README. Remove cruft from setup.py. Add some version 1.2 metadata
regarding required Python version (>=2.5,<3) and external dependency
(libgeos_c >= 3.1).
1.2a6 (2010-02-09)
- Add accessor for separate arrays of X and Y values (#210).
TODO: fill gap here
1.2a1 (2010-01-20)
- Proper prototyping of WKB writer, and avoidance of errors on 64-bit systems
(#191).
- Prototype libgeos_c functions in a way that lets py2exe apps import shapely
(#189).
1.2 Branched (2009-09-19)
1.0.12 (2009-04-09)
- Fix for references held by topology and predicate descriptors.
1.0.11 (2008-11-20)
- Work around bug in GEOS 2.2.3, GEOSCoordSeq_getOrdinate not exported properly
(#178).
1.0.10 (2008-11-17)
- Fixed compatibility with GEOS 2.2.3 that was broken in 1.0.8 release (#176).
1.0.9 (2008-11-16)
- Find and load MacPorts libgeos.
1.0.8 (2008-11-01)
- Fill out GEOS function result and argument types to prevent faults on a
64-bit arch.
1.0.7 (2008-08-22)
- Polygon rings now have the same dimensions as parent (#168).
- Eliminated reference cycles in polygons (#169).
1.0.6 (2008-07-10)
- Fixed adaptation of multi polygon data.
- Raise exceptions earlier from binary predicates.
- Beginning distributing new windows DLLs (#166).
1.0.5 (2008-05-20)
- Added access to GEOS polygonizer function.
- Raise exception when insufficient coordinate tuples are passed to LinearRing
constructor (#164).
1.0.4 (2008-05-01)
- Disentangle Python and topological equality (#163).
- Add shape(), a factory that copies coordinates from a geo interface provider.
To be used instead of asShape() unless you really need to store coordinates
outside shapely for efficient use in other code.
- Cache GEOS geometries in adapters (#163).
1.0.3 (2008-04-09)
- Do not release GIL when calling GEOS functions (#158).
- Prevent faults when chaining multiple GEOS operators (#159).
1.0.2 (2008-02-26)
- Fix loss of dimensionality in polygon rings (#155).
1.0.1 (2008-02-08)
- Allow chaining expressions involving coordinate sequences and geometry parts
(#151).
- Protect against abnormal use of coordinate accessors (#152).
- Coordinate sequences now implement the numpy array protocol (#153).
1.0 RC2 (2008-01-16)
- Added temporary solution for #149.


#1 Declares named inline function and assigns it to a variable. #2 Tests that the tow names are equivalent inside the inline function. #3 Invokes function to perform the internal test. #4 Tests that the inline function’s name isn’t available outside the inline function. This listing brings up the most important point regarding inline function So while giving inline functions a name may provide a means to clearly allow recursive references within those function – arguably, this approach provides more clarity than using this – it has limited utility elsewhere.


We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.
Loading……


:: com :: sun :: star :: text ::
|
| deprecated |
constants group TimeDisplayFormat |
|
|
- Usage Restrictions
- deprecated
- Description
- This constants define how a time field is formated before it is displayed.
The formate may also depend on the system or document locale.
|
| Constants' Details |
STANDARD
const short STANDARD = 0;
- Description
- the system standard
|
|
HHMM
const short HHMM = 1;
- Description
- 13:49
|
|
HHMMSS
const short HHMMSS = 2;
- Description
- 13:49:20
|
|
HHMMSS00
const short HHMMSS00 = 3;
- Description
- 13:49:20.30
|
|
HHMMAMPM
const short HHMMAMPM = 4;
- Description
- 01:49
|
|
HHMMSSAMPM
const short HHMMSSAMPM = 5;
- Description
- 01:49:20
|
|
HHMMSS00AMPM
const short HHMMSS00AMPM = 6;
- Description
- 01:49:20.30
|
|
Top of Page
Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.


--- layout: post title: "Laniakea SARS-CoV-2 flavour available" subtitle: "New flavour specifically developed for Covid-19 analysis is available." date: 2020-03-27 012:00:00 -0400 background: '/img/posts/covid19.png' ---
A Galaxy Covid-19 flavour is now available in Laniakea, as Docker Container. It is based on the GalaxyProject covid-19 analysis and it is continuously updated.
Due to the current Covid-19 outbreak, the flavour is made available to Laniakea users without the usual test routine. Users are welcome to deploy it and report any issue. We will continue its development in the following days.


Emacs
Once integrated with DIScover, Emacs displays an DIScover Worktray menu that allows you to access the following DIScover features:
• Symbol Info
• Open Definition
• Browse Symbol
• Activate Browser (launches DIScover)
When you work with DIScover from within your Emacs IDE, DIScover messages appear in the Mini-Buffer window at the bottom of the screen. You can resize the Mini-Buffer by placing your cursor on the horizontal rule that divides the two windows and dragging it up or down until both windows are of the desired proportion.
To toggle back and forth between the Emacs and DIScover environments, use the Browse Symbol menu option for a selected symbol when you are in Emacs, and the double-click method for an entity from within the DIScover Browser.
Though most Emacs functionality is available through the DIScover text view, a few areas are not supported or require special attention:
• The C-z minimize function is not available.
• Although Emacs size and placement commands are not supported, you can use C-x n to control Emacs-style splits within a single DIScover View window.
• The command recover-file is not supported.
• The command revert-buffer is supported for raw mode views, but not S-MODE. To work around this, kill the buffer, or unload the file and load it again.
• Killing the dis-buffer is not available.
• Buffers that do not visit files (such as shells, scratch, or dired) do not appear in the View List option menu. You can access these buffers with the conventional Emacs buffer commands: C-x b or C-x 4 b.
• Emacs menus may appear detached from the Emacs frame, outside of the View window. Resize the View window to ensure that menus appear inside the Emacs frame.


Student Registration Form
First Name
Last Name
Username
Password
Email Address
Gender
Male
Female
Date of Birth
Phone Number


Click on the link above. Log in and fork repository
We've talked about "sequences of numbers" a lot, and that's what arrays represent-an ordered sequence of numbers, or strings, or really anything. In theory, they look something like this: A = [a1, a2, ... , an], where n is the length of the array.
Arrays can only hold objects of a single data type. We must specify what that type is, its size, and its name, as such: type name[size]; For instance, an integer array of size 50 named "arr" is defined like this:
int arr[50];
To access the element at the k-th position of the sequence, we can use arr[k]. This can be either changed or used any way you like, and can be treated like a variable. For instance, if you wanted to add 2 to arr[k] and print the sum of arr[k] and arr[k-1], we can do
arr[k] += 2; cout << arr[k] + arr[k-1] << '\n';
One key thing to remember about arrays is that they are 0-indexed and not 1-indexed. When we order a list of numbers we usually say this is the first number, then the 2nd number, then the third, and so on. That is called 1-indexing because we start our counting at 1. So now what do you think 0-indexing is?
0-indexing means that arrays start at 0 and not 1 so this means our valid index positions are 0 to 49 if we create an array of size 50. If we go below 0 or above 49 then we will get something that we don’t want.
The main way to go through an array is using a for loop like the following:
for (int i = 0; i < n; i++) { // do something to arr[i]. }
Where n is the size of the array. Remember if you are given an array of size n, the valid indexes are from 0 to n-1, so this for loop is going through all those valid positions. But there is another way:
for (int i : arr) { // do something to i. }
In this example we go through all the ints in the array and our variable i gets represented as those ints.
However, the key difference between this and the first one is that if we do i = 5, this won't affect the array, but if we do arr[i] = 5 in the first example this will change the array.
What we just discussed are 1-dimensional arrays, or simple lists. What if we wanted a 2-dimensional grid, or 3-dimensional box of numbers?
We can initialize a 2-d array of integers like so:
int arr[10][10];
Which creates a 10 by 10 box. We can create arrays with more dimensions just by putting more brackets with numbers at the end.
We can think of a 2-d array as a 1-d array of 1-d arrays. We can think of the big array of arrays as going from up to down, and each constituent array as going from left to right. Here is an image for convenience:
The syntax for accessing elements is similar: we use arr[i][j]. The first index, i, refers to the index in the bigger array of arrays. The second index, j, refers to the index in the constituent array, arr[i]. You can also use other coordinate systems to think about arrays in 2 dimensions or higher dimensions, as long as it stays consistent.
You can get the size of an array by doing the following:
int arr[10]; int n = sizeof(arr)/sizeof(arr[0]); // n will be 10.
What this code is doing is that it finds the total amount of memory for the entire array and then the total amount of memory for a single element and then divides the two to get the number of elements. In most circumstances you don't have to worry about not knowing the size of an array, as they are usually provided, but this is just in case you do.
Notice the last element of an array is in the position length - 1 of the array, this is helpful in many cases.
You can initialize arrays by creating a comma separated list of elements surrounded by curly braces like the following:
int arr[5] = {1, 2, 3, 4, 5};
Or you can loop through the array and set the value of each element in the loop from standard input like the following:
int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i];
Warning! Arrays are very easy to mess up, you can do a whole number of things like going out of the valid ranges of an array and messing stuff up, so just be careful that your accessing the correct elements of an array in your code.
Warning! Don't pass arrays to functions unless you really have to. They are a pain to deal with in functions.
Note for these problems try to come up with test cases yourselves and test them out in your code to see if they work.
Problem 1: Given an array of ints with a known size from standard input, print true if the array is length 1 or more, and the first element and the last element are equal, else print false.
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i]; if (n == 0) cout << "false\n"; else if (arr[0] == arr[n-1]) cout << "true\n"; else cout << "false\n"; }
Problem 2: Given an array of known size from standard input, print the difference between the largest and smallest values in the array. Note: the built-in min(v1, v2) and max(v1, v2) methods return the smaller or larger of two values.
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i]; int mn =<PHONE_NUMBER>, mx = -1000000000; for (int i = 0; i < n; i++) { mn = min(mn, arr[i]); mx = max(mx, arr[i]); } cout << mx-mn << "\n"; return 0; }
Problem 3: Given an array of known size from standard input, print the sum of the numbers in the array, except ignore sections of numbers starting with a 6 and extending to the next 7 (every 6 will be followed by at least one 7). Print 0 for no numbers.
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i]; int sm = 0; bool add = true; for (int i = 0; i < n; i++) { if (arr[i] == 6) add = false; if (add) sm += arr[i]; if (arr[i] == 7) add = true; } cout << sm << "\n"; return 0; }
Problem 4: Given an array of ints of known size from standard input, print true if the number of 1's is greater than the number of 4's, else print false.
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i]; int c1 = 0, c4 = 0; for (int i = 0; i < n; i++) { if (arr[i] == 1) c1++; if (arr[i] == 4) c4++; } if (c1 > c4) cout << "true\n"; else cout << "false\n"; return 0; }
Problem 5: Given a non-empty array of known size, print true if there is a place to split the array so that the sum of the numbers on one side is equal to the sum of the numbers on the other side, else print false.
#include <bits/stdc++.h> using namespace std; int main() { int n = sizeof(arr)/sizeof(arr[0]); bool found = true; for (int i = 0; i < n; i++) { int sm1 = 0, sm2 = 0; for (int q = 0; q < i; q++) { sm1 += arr[q]; } for (int q = i; q < n; q++) { sm2 += arr[q]; } if (sm1 == sm2) { cout << "true\n"; return 0; } } cout << "false\n"; return 0; }
Problem 6: Given an n by m 2D array, arr, create a new array of size n, sum, where sum[i] contains the sum of elements of arr[i].
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int arr[n][m]; for (int i = 0; i < n; i++) { for (int q = 0; q < m; q++) { cin >> arr[i][q]; } } int sum[n]; for (int i = 0; i < n; i++) { int sm = 0; for (int q = 0; q < m; q++) { sm += arr[i][q]; } sum[i] = sm; } for (int i = 0; i < n; i++) { cout << sum[i] << " "; } cout << "\n"; }


--- layout: default title: Local sensitivity analysis and screening analysis ---
Note to the user: all MatLab code is written in MatLab R2014, and some require additional toolboxes (e.g. the statistics toolbox, which is mentioned in the scripts). In case you don’t have access to MatLab, there is a free alternative called Octave available. Both the ipython notebook and the python scripts are written in Python 3.
A local sensitivity analysis quantifies the effect on the output when an input parameter is changed.
The code for performing a local sensitivity analysis using the multiplier method (MPM) in matrix-based life cycle assessment can be found here:
MatLab/Octave: MatLab code MPM LCA.
IPython notebook: IPhyton code MPM LCA
Python notebook: Python code MPM LCA
A screening analysis quantifies the effect on the output when an input parameter is changed according the to uncertainty range of an input parameter.
The MATLAB code for performing a screening analysis using the methods of elementary effects (MEE) in matrix-based life cycle assessment can be found here: MATLAB code MEE LCA.
Source: PhD thesis Evelyne Groen, An uncertain climate: the value of uncertainty and sensitivity analysis in environmental impact assessment of food, 2016
ISBN: 978-94-6257-755-8; DOI: 10.18174/375497
The MatLab code for performing MPM and MEE was used in Sensitivity analysis of greenhouse gas emissions from a pork production chain, Journal of Cleaner Production, August 2016 (Volume 129, Pages 202–211).
The MatLab code for performing MPM was used in Assessing greenhouse gas emissions of milk prodution: which parameters are essential?, The international Journal of Life Cycle Assessment, First online: 31 July, 2016.


|
QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.30
|
Base class for 1-D solvers. More...
#include <ql/math/solver1d.hpp>
Public Member Functions | |
| Solver1D ()=default | |
Modifiers | |
| Real | root_ |
| Real | xMin_ |
| Real | xMax_ |
| Real | fxMin_ |
| Real | fxMax_ |
| Size | maxEvaluations_ = 100 |
| Size | evaluationNumber_ |
| Real | lowerBound_ |
| Real | upperBound_ |
| bool | lowerBoundEnforced_ = false |
| bool | upperBoundEnforced_ = false |
| template<class F > | |
| Real | solve (const F &f, Real accuracy, Real guess, Real step) const |
| template<class F > | |
| Real | solve (const F &f, Real accuracy, Real guess, Real xMin, Real xMax) const |
| void | setMaxEvaluations (Size evaluations) |
| void | setLowerBound (Real lowerBound) |
| sets the lower bound for the function domain More... | |
| void | setUpperBound (Real upperBound) |
| sets the upper bound for the function domain More... | |
| Real | enforceBounds_ (Real x) const |
Additional Inherited Members | |
| Protected Member Functions inherited from CuriouslyRecurringTemplate< Impl > | |
| CuriouslyRecurringTemplate ()=default | |
| ~CuriouslyRecurringTemplate ()=default | |
| Impl & | impl () |
| const Impl & | impl () const |
Base class for 1-D solvers.
The implementation of this class uses the so-called "Barton-Nackman trick", also known as "the curiously recurring template pattern". Concrete solvers will be declared as:
Before calling solveImpl
, the base class will set its protected data members so that:
xMin_
and xMax_
form a valid bracket;fxMin_
and fxMax_
contain the values of the function in xMin_
and xMax_
;root_
is a valid initial guess. The implementation of solveImpl
can safely assume all of the above.Definition at line 67 of file solver1d.hpp.
|
default |
This method returns the zero of the function \( f \), determined with the given accuracy \( \epsilon \); depending on the particular solver, this might mean that the returned \( x \) is such that \( |f(x)| < \epsilon \), or that \( |x-\xi| < \epsilon \) where \( \xi \) is the real zero.
This method contains a bracketing routine to which an initial guess must be supplied as well as a step used to scan the range of the possible bracketing values.
Definition at line 84 of file solver1d.hpp.
This method returns the zero of the function \( f \), determined with the given accuracy \( \epsilon \); depending on the particular solver, this might mean that the returned \( x \) is such that \( |f(x)| < \epsilon \), or that \( |x-\xi| < \epsilon \) where \( \xi \) is the real zero.
An initial guess must be supplied, as well as two values \( x_\mathrm{min} \) and \( x_\mathrm{max} \) which must bracket the zero (i.e., either \( f(x_\mathrm{min}) \leq 0 \leq f(x_\mathrm{max}) \), or \( f(x_\mathrm{max}) \leq 0 \leq f(x_\mathrm{min}) \) must be true).
Definition at line 163 of file solver1d.hpp.
| void setMaxEvaluations | ( | Size | evaluations | ) |
This method sets the maximum number of function evaluations for the bracketing routine. An error is thrown if a bracket is not found after this number of evaluations.
Definition at line 238 of file solver1d.hpp.
| void setLowerBound | ( | Real | lowerBound | ) |
sets the lower bound for the function domain
Definition at line 243 of file solver1d.hpp.
| void setUpperBound | ( | Real | upperBound | ) |
sets the upper bound for the function domain
Definition at line 249 of file solver1d.hpp.
|
mutableprotected |
Definition at line 225 of file solver1d.hpp.
|
protected |
Definition at line 225 of file solver1d.hpp.
|
protected |
Definition at line 225 of file solver1d.hpp.
|
protected |
Definition at line 225 of file solver1d.hpp.
|
protected |
Definition at line 225 of file solver1d.hpp.
|
protected |
Definition at line 226 of file solver1d.hpp.
|
mutableprotected |
Definition at line 227 of file solver1d.hpp.
|
private |
Definition at line 230 of file solver1d.hpp.
|
private |
Definition at line 230 of file solver1d.hpp.
|
private |
Definition at line 231 of file solver1d.hpp.
|
private |
Definition at line 231 of file solver1d.hpp.


RouterRequest
public class RouterRequest
The RouterRequest
class is used to interact with incoming HTTP requests to the Router.
It contains and allows access to the request’s Headers
and Body
as well as other properties of the request.
It can also perform content negotiation based on the request’s Accept
header.
Usage Example:
In this example request
is an instance of the class RouterRequest
.
It is used by the server to read the body of the request as a String and send it back to the user.
let router = Router()
router.post("/") { request, response, next in
let body = request.readString()
response.send(body)
next()
}
-
The hostname of the request.
Declaration
Swift
public var hostname: String
-
The port of the request.
Declaration
Swift
public var port: Int
-
The domain name of the request.
Declaration
Swift
public private(set) lazy var domain: String = { [unowned self] in
-
The subdomains string array of request.
Declaration
Swift
public private(set) lazy var subdomains: [String] = { [unowned self] in
-
The HTTP version of the request.
Declaration
Swift
public let httpVersion: HTTPVersion
-
The method of the request.
Declaration
Swift
public let method: RouterMethod
-
The router as a String.
Declaration
Swift
public internal(set) var route: String?
-
IP address string of server.
Declaration
Swift
public var remoteAddress: String
-
The parsed URL.
Declaration
Swift
public private(set) lazy var parsedURL: URLParser = { [unowned self] in
-
The currently matched section of the URL.
Declaration
Swift
public internal(set) var matchedPath = ""
-
The original URL as a string.
Declaration
Swift
public var originalURL: String
-
The URL. This contains just the path and query parameters starting with ‘/’ Use ‘urlURL’ for the full URL
Declaration
Swift
public var url: String
-
The URL from the request as URLComponents URLComponents has a memory leak on linux as of swift 3.0.1. Use ‘urlURL’ instead
Declaration
Swift
public var urlComponents: URLComponents
-
The URL from the request
Declaration
Swift
public var urlURL: URL
-
List of URL parameters.
Declaration
Swift
public internal(set) var parameters: [String:String] = [:]
-
List of HTTP headers with simple String values.
Declaration
Swift
public let headers: Headers
-
Parsed Cookies, used to do a lazy parsing of the appropriate headers.
Declaration
Swift
public lazy var cookies: [String: HTTPCookie] = { [unowned self] in
-
List of query parameters and comma-separated values.
Declaration
Swift
public lazy var queryParameters: [String:String] = { [unowned self] in
-
Query parameters with values as an array.
Declaration
Swift
public lazy var queryParametersMultiValues: [String: [String]] = { [unowned self] in
-
Convert query parameters into a QueryParam type
Declaration
Swift
public func getQueryParameters<T: QueryParams>(as type: T.Type) -> T?
Parameters
type
The QueryParam type describing the expected query parameters
Return Value
The route’s Query parameters as a QueryParam object
-
User info. Can be used by middlewares and handlers to store and pass information on to subsequent handlers.
Declaration
Swift
public var userInfo: [String: Any] = [:]
-
Body of the message.
Declaration
Swift
public internal(set) var body: ParsedBody?
-
Read the body of the request as Data.
Throws
Socket.Error if an error occurred while reading from a socket.Declaration
Swift
public func read(into data: inout Data) throws -> Int
Parameters
into
Data object in which the body of the request is returned.
Return Value
the number of bytes read.
-
Read the body of the request as a Codable object using a
BodyDecoder
that was selected based on the Content-Type header. Defaults toJSONDecoder()
if no decoder is provided.Usage Example:
The example below defines a
User
struct and then decodes aUser
from the body of a request.public struct User: Codable { let name: String } let router = Router() router.post("/example") { request, response, next in let user = try request.read(as: User.self) print(user.name) next() }
Throws
Socket.Error if an error occurred while reading from a socket.Throws
DecodingError.dataCorrupted
if values requested from the payload are corrupted, or if the given data is not valid JSON.Throws
An error if any value throws an error during decoding.Declaration
Swift
public func read<T: Decodable>(as type: T.Type) throws -> T
Parameters
as
Codable object to which the body of the request will be converted.
Return Value
The instantiated Codable object
-
Read the body of the request as String.
Throws
Socket.Error if an error occurred while reading from a socket.Declaration
Swift
public func readString() throws -> String?
Return Value
the String with the request body.
-
Check if passed in types are acceptable based on the request’s header field specified in the first parameter.
Declaration
Swift
public func accepts(header: String = "Accept", types: [String]) -> String?
Parameters
header
name of request’s header field to be checked.
types
array of content/mime type strings.
Return Value
most acceptable type or nil if there are none.
-
Check if passed in types are acceptable based on the request’s header field specified in the first parameter.
Declaration
Swift
public func accepts(header: String = "Accept", types: String...) -> String?
Parameters
header
name of request’s header field to be checked.
types
content/mime type strings.
Return Value
most acceptable type or nil if there are none.
-
Check if passed in types are acceptable based on the request’s header field specified in the first parameter.
Declaration
Swift
public func accepts(header: String = "Accept", type: String) -> String?
Parameters
header
name of request’s header field to be checked.
type
content/mime type string.
Return Value
most acceptable type or nil if there are none.


Computer:
Points
Games
{{scores.computerScores}}
{{scores.computerGames}}
Player:
Points
Games
Money
{{scores.playerScores}}
{{scores.playerGames}}
${{scores.playerMonies}}
Player Inventory:
{{item}}
{{purchaseMessage}}


The folder in which your favorite bookmarks are stored.
The title for the list of favorites.
The introduction for the list of favorites.
If yes, favicons will be loaded from Google's cache and displayed next to each favorite bookmark.
If yes, URLs of the links will be displayed.


User Rights Assignment
Location
- Open Administrative Tools
- Find and click on Local Security Policy
- Find and double click on User Rights Assignment
Settings
These are the default settings
-
Access Credential Manager as a trusted caller
-
Access this computer from the network
- Administrators
- Backup Operators
- Everyone
- Users
-
Act as part of the operating system
-
Add workstations to domain
-
Adjust memory quotas for a process
- Administrators
- Local Service
- Network Service
-
Allow log on locally
- Administrators
- Backup Operators
- Guest
- Users
-
Allow log on through Remote Desktop Services
- Administrators
- Remote Desktop Users
-
Back up files and directories
- Administrators
- Backup Operators
-
Bypass traverse checking
- Administrators
- Backup Operators
- Everyone
- Local Service
- Network Service
- Users
-
Change the system time
- Administrators
- Local Service
-
Change the time zone
- Administrators
- Local Service
- Users
-
Create a pagefile
-
Create a token object
-
Create global objects
- Administrators
- Local Service
- Network Service
- Service
-
Create permanent shared objects
-
Create symbolic links
-
Debug Programs
-
Deny access to this computer from the network
-
Deny log on as a batch job
-
Deny log on as a service
-
Deny log on locally
-
Deny log on through Remote Desktop/Terminal Services
-
Enable computer and user accounts to be trusted for delegation
-
Force shutdown from a remote system
-
Generate security audits
- Local Service
- Network Service
-
Impersonate a client after authentication
- Adminstrators
- Local Service
- Network Service
- Service
-
Increase a process working set
-
Increase scheduling priority
-
Load and unload device drivers
-
Lock pages in memory
-
Log on as a batch job
- Administrators
- Backup Operators
- Performance Log Users
-
Log on as a service
-
Manage auditing and security log
-
Modify an object label
-
Modify firmware environment values
-
Perform volume maintenance tasks
-
Profile single process
-
Profile system performance
- Administrators
- NT Service\WdiServiceHost
-
Remove computer from docking station
-
Replace a process level token
- Local Service
- Network Service
-
Restore files and directories
- Administrators
- Backup Operators
-
Shut down the system
- Administrators
- Backup Operators
- Users
-
Synchronize directory service data
-
Take ownership of files or other objects


Tarteel Privacy Policy
Tarteel is committed to maintaining robust privacy protections for its users. Our Privacy Policy is designed to
help you understand how we collect, use and safeguard the information you provide to us and to assist you in
making informed decisions when using our service. By accessing our Site or our Service, you accept our Privacy
Policy, and you consent to our collection, storage, use and disclosure of your Personal Information and Data as
described in this Privacy Policy.
I. Information We Collect
We collect “Non-Personal Information” and “Personal Information.” Non-Personal Information includes
information that cannot be used to personally identify you, such as anonymous usage data, general demographic
information we may collect, referring/exit pages and URLs, platform types, preferences you submit and
preferences that are generated based on the data you submit and number of clicks. Personal Information includes
the voice recordings which you submit to us through the recitation process, demographic information that you
provide, IP addresses, as well as your email when you elect to join the mailing list.
1. Information collected via Technology
In an effort to improve the quality of the Service, we track information provided to us by your browser or
by our software application when you view or use the Service, such as the website you came from (known as the
“referring URL”), the type of browser you use, the device from which you connected to the Service, the time and
date of access, and other information that does not personally identify you. We track this information using
cookies, or small text files which include an anonymous unique identifier. Cookies are sent to a user’s browser
from our servers and are stored on the user’s computer hard drive. Sending a cookie to a user’s browser enables
us to collect Non-Personal information about that user and keep a record of the user’s preferences when
utilizing our services, both on an individual and aggregate basis.
2. Information you provide to us
In addition to the information provided automatically by your browser when you visit the Site, users of this
site voluntary submit information through this site. We collect this information, including the voice recordings
which you submit to us through the recitation process, demographic information that you provide, as well as your
email when you elect to join the mailing list.
3. Children’s Privacy
The Site and the Service are not directed to anyone under the age of 13. The Site does not knowingly collect
or solicit information from anyone under the age of 13. In the event that we learn that we have gathered
personal information from anyone under the age of 13 without the consent of a parent or guardian, we will delete
that information as soon as possible. If you believe we have collected such information, please contact us.
II. HOW WE USE AND SHARE INFORMATION
Personal Information:
Except as otherwise stated in this Privacy Policy, we do not sell, trade, rent or otherwise share for
marketing purposes your Personal Information with third parties without your consent. We do share Personal
Information with vendors who are performing services for the Company, such as the servers for our email
communications who are provided access to user’s email address for purposes of sending emails from us. Those
vendors use your Personal Information only at our direction and in accordance with our Privacy Policy. However,
note that the dataset that we are making is open-source: this means that the audio files of the recitations will
be released publicly along with the demographic information that you have provided. This is to provide software
developers the ability to develop tools based on the data. Please consider this thoroughly before using the
service on the Site.
In general, the Personal Information you provide to us is used to help us communicate with you. For example,
we use Personal Information to contact users in response to questions, solicit feedback from users, provide
technical support, and inform users about promotional offers.
We may share Personal Information with outside parties if we have a good-faith belief that access, use,
preservation or disclosure of the information is reasonably necessary to meet any applicable legal process or
enforceable governmental request; to enforce applicable Terms of Service, including investigation of potential
violations; address fraud, security or technical concerns; or to protect against harm to the rights, property,
or safety of our users or the public as required or permitted by law.
Non-Personal Information
In general, we use Non-Personal Information to help us improve the Service and customize the user
experience. We also aggregate Non-Personal Information in order to track trends and analyze use patterns on the
Site. This Privacy Policy does not limit in any way our use or disclosure of Non-Personal Information and we
reserve the right to use and disclose such Non-Personal Information to our partners, advertisers and other third
parties at our discretion.
In the event we undergo a business transaction such as a merger, acquisition by another company, or sale of
all or a portion of our assets, your Personal Information may be among the assets transferred. You acknowledge
and consent that such transfers may occur and are permitted by this Privacy Policy, and that any acquirer of our
assets may continue to process your Personal Information as set forth in this Privacy Policy. If our information
practices change at any time in the future, we will post the policy changes to the Site so that you may opt out
of the new information practices. We suggest that you check the Site periodically if you are concerned about how
your information is used.
III. HOW WE PROTECT INFORMATION
We implement security measures designed to protect your information from unauthorized access. Your account
is protected by your account password and we urge you to take steps to keep your personal information safe by
not disclosing your password and by logging out of your account after each use. We further protect your
information from potential security breaches by implementing certain technological security measures including
encryption, firewalls and secure socket layer technology. However, these measures do not guarantee that your
information will not be accessed, disclosed, altered or destroyed by breach of such firewalls and secure server
software. By using our Service, you acknowledge that you understand and agree to assume these risks.
IV. YOUR RIGHTS REGARDING THE USE OF YOUR PERSONAL INFORMATION
You have the right at any time to prevent us from contacting you for marketing purposes. When we send a
promotional communication to a user, the user can opt out of further promotional communications by following the
unsubscribe instructions provided in each promotional e-mail. You can also indicate that you do not wish to
receive marketing communications from us in the [list location of opt-out page, i.e. “Settings” section] of the
Site. Please note that notwithstanding the promotional preferences you indicate by either unsubscribing or
opting out in the [location of opt-out page] of the Site, we may continue to send you administrative emails
including, for example, periodic updates to our Privacy Policy.
V. LINKS TO OTHER WEBSITES
As part of the Service, we may provide links to or compatibility with other websites or applications.
However, we are not responsible for the privacy practices employed by those websites or the information or
content they contain. This Privacy Policy applies solely to information collected by us through the Site and the
Service. Therefore, this Privacy Policy does not apply to your use of a third party website accessed by
selecting a link on our Site or via our Service. To the extent that you access or use the Service through or on
another website or application, then the privacy policy of that other website or application will apply to your
access or use of that site or application. We encourage our users to read the privacy statements of other
websites before proceeding to use them.
VI. CHANGES TO OUR PRIVACY POLICY
The Company reserves the right to change this policy and our Terms of Service at any time. We will notify
you of significant changes to our Privacy Policy by sending a notice to the primary email address specified in
your account or by placing a prominent notice on our site. Significant changes will go into effect 30 days
following such notification. Non-material changes or clarifications will take effect immediately. You should
periodically check the Site and this privacy page for updates.
{% compress js file base %}
{% endcompress %}


| lavCor {lavaan} | R Documentation |
Polychoric, polyserial and Pearson correlations
Description
Fit an unrestricted model to compute polychoric, polyserial and/or Pearson
correlations.
Usage
lavCor(object, ordered = NULL, group = NULL, missing = "listwise",
ov.names.x = NULL, se = "none", test = "none",
estimator = "two.step", baseline = FALSE, ...,
cor.smooth = FALSE, cor.smooth.tol = 1e-06, output = "cor")
Arguments
object |
Either a data.frame , or an object of class
lavaan . If the input is a data.frame , and
some variables are declared as ordered factors, lavaan will
treat them as ordinal variables.
|
ordered |
Character vector. Only used if object is a
data.frame . Treat these variables as ordered (ordinal) variables.
Importantly, all other variables will be treated as numeric (unless they
are declared as ordered in the original data frame.)
|
group |
Only used if object is a data.frame . Specify
a grouping variable.
|
missing |
If "listwise" , cases with missing values are removed
listwise from the data frame. If "direct" or
"ml" or "fiml" and the estimator is maximum likelihood,
an EM algorithm is used to estimate the unrestricted covariance matrix
(and mean vector). If "pairwise" , pairwise deletion is used. If
"default" , the value is set depending on the estimator and the
mimic option.
|
ov.names.x |
Only used if object is a data.frame . Specify
variables that need to be treated as exogenous. Only used if at least
one variable is declared as ordered.
|
se |
Only used if output (see below) contains standard errors.
See lavOptions for possible options.
|
test |
Only used if output is "fit" or "lavaan" . See
lavOptions for possible options.
|
estimator |
If "none" or "two.step" or "two.stage" ,
only starting values are computed for the correlations (and thresholds),
without any further estimation. If all variables are continuous, the
starting values are the sample covariances (converted to correlations
if output = "cor" ). If at least one variable is ordered,
the thresholds are computed using univariate information only. The
polychoric and/or polyserial correlations are computed in a second
stage, keeping the values of the thresholds constant. If an estimator
(other than "two.step" or "two.stage" ) is specified
(for example estimator = "PML" ), these starting values are
further updated by fitting the unrestricted model using the chosen
estimator. See the lavaan function for alternative
estimators.
|
baseline |
Only used if output is "fit" or "lavaan" . If
TRUE , a baseline model is also estimated. Note that the test
argument should also be set to a value other than "none" .
|
... |
Optional parameters that are passed to the lavaan
function.
|
cor.smooth |
Logical. Only used if output = "cor" .
If TRUE , ensure the resulting correlation matrix is positive
definite. The following simple method is used: an eigenvalue decomposition
is computed; then, eigenvalues smaller than cor.smooth.tol
are set to be equal to cor.smooth.tol , before the matrix
is again reconstructed. Finally, the matrix (which may no longer have unit
diagonal elements) is converted to a correlation matrix using
cov2cor .
|
cor.smooth.tol |
Numeric. Smallest eigenvalue used when reconstructing
the correlation matrix after an eigenvalue decomposition.
|
output |
If "cor" , the function returns the correlation matrix only. If "cov" , the function returns the covariance matrix (this only makes
a difference if at least one variable is numeric). If "th" or
"thresholds" , only the thresholds are returned. If "sampstat" ,
the output equals the result of lavInspect(fit, "sampstat") where
fit is the unrestricted model. If "est" or "pe" or
"parameterEstimates" , the output equals the result of
parameterEstimates(fit) . Finally, if output is "fit" or
"lavaan" , the function returns an object of class
lavaan .
|
Details
This function is a wrapper around the lavaan
function,
but where the model is defined as the unrestricted model. The
following free parameters are included: all covariances/correlations among
the variables, variances for continuous variables, means for continuous
variables, thresholds for ordered variables, and if exogenous variables
are included (ov.names.x
is not empty) while some variables
are ordered, also the regression slopes enter the model.
Value
By default, if output = "cor"
or output = "cov"
, a symmetric
matrix (of class "lavaan.matrix.symmetric"
, which only affects the
way the matrix is printed). If output = "th"
, a named vector of
thresholds. If output = "fit"
or output = "lavaan"
,
an object of class lavaan
.
References
Olsson, U. (1979). Maximum likelihood estimation of the polychoric correlation
coefficient. Psychometrika, 44(4), 443-460.
Olsson, U., Drasgow, F., & Dorans, N. J. (1982). The polyserial correlation coefficient. Psychometrika, 47(3), 337-347.
See Also
lavaan
Examples
# Holzinger and Swineford (1939) example
HS9 <- HolzingerSwineford1939[,c("x1","x2","x3","x4","x5",
"x6","x7","x8","x9")]
# Pearson correlations
lavCor(HS9)
# ordinal version, with three categories
HS9ord <- as.data.frame( lapply(HS9, cut, 3, labels = FALSE) )
# polychoric correlations, two-stage estimation
lavCor(HS9ord, ordered=names(HS9ord))
# thresholds only
lavCor(HS9ord, ordered=names(HS9ord), output = "th")
# polychoric correlations, with standard errors
lavCor(HS9ord, ordered=names(HS9ord), se = "standard", output = "est")
# polychoric correlations, full output
fit.un <- lavCor(HS9ord, ordered=names(HS9ord), se = "standard",
output = "fit")
summary(fit.un)
[Package
lavaan version 0.6-8
Index]


Calculate Score
Note: Unticked items means it is incorrect (score will show in negative on start)
{{key}}. {{responseData[key].res}}
Questions unanswered
{{questions - answered}}
Answered correct
{{right}}
Answered incorrect
{{wrong}}
Total Score out of {{positive*questions}}
{{total}}


Hello! I'm a software engineer at Snap Inc. on the AI/ML Platform team. I'm always looking to learn more in my field!
I received my Master's and Bachelor's degree from the University of California, San Diego (UCSD) in Computer Engineering. While there, I was the President of Triton Software Engineering, a community-service oriented software engineering student organization.
December 2022 – Present
Building a unified Training Platform for all Machine Learning operations at Snap.
June 2021 – September 2021, June 2022 - September 2022
Developing new features to optimize and support all Machine Learning operations at Snap.
June 2020 – September 2020
Developing new iOS features for the Games and Minis platform on the Snapchat application.
June 2019 – September 2019
Working in the Chaos Engineering space using Java Agents to ensure service reliability across Amazon.
June 2018 - September 2018
Developing, debugging, and improving internal tools to improve testing of software and analytics.
April 2018 - June 2018, September 2018 - March 2019
Developing the front-end portal for the Information Theory and Applications (ITA) workshop.
ita.ucsd.edu/ws/A course to teach high school students how to build their own website. Aims to inspire interest in the field of Computer Science.
tritonse.github.io/build-a-websiteHosting a virtual talk for incoming UCSD students to teach them tips and tricks to succeed early in their careers in the software engineering field.
YouTube


Blockchain Download Status: {{ blockchain_download_size }} so far...
On very first launch, the Chia blockchain database is being downloaded from https://chiaforksblockchain.com. At nearly 30 GB in size, this will take a while.
However minutes of download now, will save you multiple days of blockchain syncing later. Please be patient!
NOTE: If you would prefer to allow Chia to sync the blockchain over many days, see the Wiki for details. Similarly, you may instead import your own blockchain if you have one from a previous Chia install.
{% else %}To get started with Machinaris as a Chia™ fullnode, either import your existing 24-word mnemonic seed phrase:
NOTE: If you would prefer to instead import your mnenmoic seed phrase yourself at the command-line, see the Wiki for details.
{% endif %}


Engineer based in the metro Atlanta area. Currently working as a materials test engineer and not looking for employment. I am always looking for new skills to learn and projects to work on to build my portfolio.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam omnis, maxime libero natus qui minus!


 The Burning Legion wants to conquer the forest so they sent some liches to kill all the wisps.  So the lich can attack a wisp when the distance between them is less than or equal to specific R and no trees are on the segment between the lich and wisp. Each lich has a cool down time that once he used Frost Nova he has to wait a few seconds for the next attack. Different liches may have different attack range and cool down time. The Lich King is the leader of the Burning Legion and he wants to arrange the attack order so the liches can wipe out all the wisps as soon as possible.
输入:
The first line consists of an integer T, indicating the number of test cases.
The first line of each case consists of three integers N, M, K, indicating the number of lich, the number of wisps and the number of trees. The next N lines, each line consists of four integers x, y, r, t indicating the coordinate of that a lich, the radius of the attack range that lich’s Frost Nova can reach and the value of cool down time. The next M lines, each line consists of two integers x, y indicating the coordinate of each wisp. The last K lines, each line consists of three integers x, y, r, indicating the coordinate and radius of a tree. A lich cannot attack a wisp if the segment between them has a common point with the tree. The lich, wisp and trees will not overlap with each other.
The first line of each case consists of three integers N, M, K, indicating the number of lich, the number of wisps and the number of trees. The next N lines, each line consists of four integers x, y, r, t indicating the coordinate of that a lich, the radius of the attack range that lich’s Frost Nova can reach and the value of cool down time. The next M lines, each line consists of two integers x, y indicating the coordinate of each wisp. The last K lines, each line consists of three integers x, y, r, indicating the coordinate and radius of a tree. A lich cannot attack a wisp if the segment between them has a common point with the tree. The lich, wisp and trees will not overlap with each other.
输出:
The first line consists of an integer T, indicating the number of test cases.
The first line of each case consists of three integers N, M, K, indicating the number of lich, the number of wisps and the number of trees. The next N lines, each line consists of four integers x, y, r, t indicating the coordinate of that a lich, the radius of the attack range that lich’s Frost Nova can reach and the value of cool down time. The next M lines, each line consists of two integers x, y indicating the coordinate of each wisp. The last K lines, each line consists of three integers x, y, r, indicating the coordinate and radius of a tree. A lich cannot attack a wisp if the segment between them has a common point with the tree. The lich, wisp and trees will not overlap with each other.
The first line of each case consists of three integers N, M, K, indicating the number of lich, the number of wisps and the number of trees. The next N lines, each line consists of four integers x, y, r, t indicating the coordinate of that a lich, the radius of the attack range that lich’s Frost Nova can reach and the value of cool down time. The next M lines, each line consists of two integers x, y indicating the coordinate of each wisp. The last K lines, each line consists of three integers x, y, r, indicating the coordinate and radius of a tree. A lich cannot attack a wisp if the segment between them has a common point with the tree. The lich, wisp and trees will not overlap with each other.
样例输入:
1 2 3 1 -100 0 100 3 100 0 100 5 -100 -10 100 10 110 11 5 5 10
样例输出:
5
/* * 解法: 很明显是几何 + 最小费用最大流, 关键是如何建图. * 1. 设置一个源点和汇点. * 2. 每个lich和每个wisp分别用一个点来表示. * 3. 如果第i个lich能攻击到第j个wisp, 那么在图中从lich[i]到wisp[j]增加一条边, 容量为1, 费用为0. * 4. 每个wisp连一条边到汇点, 容量为1, 费用为0. * 5. 源点到每个lich连k条边, k为每个lich能攻击到的wisp数量, 每条边的容量为1, 第i条边的费用为i * t (i为0 - k-1, t为lich的cooldown时间) * 运行最小费用最大流, 答案就是从源点到lich满流的边, 且费用最大的那条边的费用值. */ #include <iostream> #include <math.h> using namespace std; const int maxn = 205; const double eps = 1e-8; typedef int typef; typedef int typec; #define inff 0x0fffffff #define infc 0x0fffffff #define V 500 #define E 200000 struct network { int nv, ne, pnt[E], nxt[E]; int vis[V], que[V], head[V], pv[V], pe[V]; typef flow, cap[E]; typec cost, dis[E], d[V]; void addedge(int u, int v, typef c, typec w) { pnt[ne] = v; cap[ne] = c; dis[ne] = w; nxt[ne] = head[u]; head[u] = ne++; pnt[ne] = u; cap[ne] = 0; dis[ne] = -w; nxt[ne] = head[v]; head[v] = ne++; } int mincost(int src, int sink) { int i, k, f, r; typef mxf; for(flow = 0, cost = 0; ; ) { memset(pv, -1, sizeof(pv)); memset(vis, 0, sizeof(vis)); for(i = 0; i < nv; ++i) d[i] = infc; d[src] = 0; pv[src] = src; vis[src] = 1; for(f = 0, r = 1, que[0] = src; r != f; ) { i = que[f++]; vis[i] = 0; if(V == f) f = 0; for(k = head[i]; k != -1; k = nxt[k]) if(cap[k] && dis[k]+d[i] < d[pnt[k]]) { d[pnt[k]] = dis[k] + d[i]; if(0 == vis[pnt[k]]) { vis[pnt[k]] = 1; que[r++] = pnt[k]; if(V == r) r = 0; } pv[pnt[k]] = i; pe[pnt[k]] = k; } } if(-1 == pv[sink]) break; for(k = sink, mxf = inff; k != src; k = pv[k]) if(cap[pe[k]] < mxf) mxf = cap[pe[k]]; flow += mxf; cost += d[sink] * mxf; for(k = sink; k != src; k = pv[k]) { cap[pe[k]] -= mxf; cap[pe[k]^1] += mxf; } } return cost; } void init(int v) { nv = v; ne = 0; memset(head, -1, 4 * v); } } nw; struct Lich { double x, y, r; int t; void input() { scanf("%lf %lf %lf %d", &x, &y, &r, &t); } } lich[maxn]; struct Wisp { double x, y; void input() { scanf("%lf %lf", &x, &y); } } wisp[maxn]; struct Tree { double x, y, r; void input() { scanf("%lf %lf %lf", &x, &y, &r); } } tree[maxn]; int T, N, M, K; int ecnt[maxn]; double Dot(double dx1, double dy1, double dx2, double dy2) { return dx1 * dx2 + dy1 * dy2; } double Dis(double x0, double y0, double x1, double y1, double x2, double y2) { double a, b, c; if (fabs(x1 - x2) > fabs(y1 - y2)) { b = 1.0; a = b * (y2 - y1) / (x1 - x2); c = -(a * x1 + b * y1); } else { a = 1.0; b = a * (x2 - x1) / (y1 - y2); c = -(a * x1 + b * y1); } return fabs(a * x0 + b * y0 + c) / sqrt(a * a + b * b); } bool NoCross(int a, int b) { int i; for (i = 0; i < K; i++) { if (Dot(tree[i].x - lich[a].x, tree[i].y - lich[a].y, wisp[b].x - lich[a].x, wisp[b].y - lich[a].y) > 0.0 && Dot(tree[i].x - wisp[b].x, tree[i].y - wisp[b].y, lich[a].x - wisp[b].x, lich[a].y - wisp[b].y) > 0.0 && Dis(tree[i].x, tree[i].y, lich[a].x, lich[a].y, wisp[b].x, wisp[b].y) < tree[i].r + eps) return false; } return true; } bool InRound(int i, int j) { double dx = lich[i].x - wisp[j].x; double dy = lich[i].y - wisp[j].y; return sqrt(dx * dx + dy * dy) < lich[i].r + eps; } void BuildGraph() { int i, j; for (i = 0; i < N; i++) { ecnt[i] = 0; for (j = 0; j < M; j++) { if (InRound(i, j) && NoCross(i, j)) { ecnt[i]++; nw.addedge(i, N + j, 1, 0); } } } for (i = 0; i < N; i++) { for (j = 0; j < ecnt[i]; j++) nw.addedge(N + M, i, 1, lich[i].t * j); } for (i = 0; i < M; i++) nw.addedge(N + i, N + M + 1, 1, 0); } void Solve() { nw.mincost(N + M, N + M + 1); if (nw.flow != M) { printf("-1/n"); return; } int ans = 0; for (int p = nw.head[N+M]; p != -1; p = nw.nxt[p]) { if (nw.cap[p] == 0 && nw.dis[p] > ans) ans = nw.dis[p]; } printf("%d/n", ans); } int main() { int i; for (scanf("%d", &T); T; T--) { scanf("%d %d %d", &N, &M, &K); for (i = 0; i < N; i++) lich[i].input(); for (i = 0; i < M; i++) wisp[i].input(); for (i = 0; i < K; i++) tree[i].input(); nw.init(N + M + 2); BuildGraph(); Solve(); } return 0; }
参考：http://blog.csdn.net/RaceBug2010/article/details/6092516
(adsbygoogle = window.adsbygoogle || []).push({});
TOP GUN在我在大陆电视上看的时候是叫做壮志凌云的……
TOP GUN在我在大陆电视上看的时候是叫做壮志凌云的……
TOP GUN在我在大陆电视上看的时候是叫做壮志凌云的……
TOP GUN在我在大陆电视上看的时候是叫做壮志凌云的……
TOP GUN在我在大陆电视上看的时候是叫做壮志凌云的……
TOP GUN在我在大陆电视上看的时候是叫做壮志凌云的……
TOP GUN在我在大陆电视上看的时候是叫做壮志凌云的……
TOP GUN在我在大陆电视上看的时候是叫做壮志凌云的……
TOP GUN在我在大陆电视上看的时候是叫做壮志凌云的……
TOP GUN在我在大陆电视上看的时候是叫做壮志凌云的……
TOP GUN在我在大陆电视上看的时候是叫做壮志凌云的……
神奇的网站
因为是要把从字符串s的start位到当前位在hash中重置，修改提交后能accept，但是不修改居然也能accept
我还有个问题想请教一下，就是感觉对于新手来说，递归理解起来有些困难，不知有没有什么好的方法或者什么好的建议？
“可以发现,树将是满二叉树,”这句话不对吧，构造的树应该是“完全二叉树”，而非“满二叉树”。
已更正。
这是研发类的题还是算法类？
已更正。
真考人啊
站长好。我是一个准备创业的互联网小白,我们打算做一个有关国*际*游*学的平台。手上也有了一些境外资源。现阶段的团队现在没有cto.原意出让一些管理股寻找一个靠谱的技术专家做合伙人, 不知道是不是能得到您的帮助。发个帖子或者其他方式。期待您的回应。可以加我微信tianxielemon聊聊。
有些说不通吧，只有1个孩子肯定是男孩了
这是研发的在线笔试题吗?发现很多C啊，阿里不是JAVA多么？
等待后面的实现，多谢
Java真是解决大数的利器


Add a GitHub Access Token
Useful-Forks uses the GitHub API to retrieve repository metadata. You may see this page because you have hit the GitHub API rate limit.
Useful-Forks will need a personal Access Token to increase that limit (it increases it by almost 5000 calls per hour). If you don't already have one, you can create one and paste it into the text-box below. The required scope is already defined by the link above.


Want to put some stuff on a square grid? Quadrille generates easy
classes in SCSS and uses a jQuery plugin to keep everything
snapped to the grid. Resize
the window to see things snap. Inspect the elements
and you'll see them stay true.
This is probably only useful if you’re working with square,
fixed grids and need an easy coordinate system to play with. If
that is what you’re up to, Quadrille will make your life
way easier.
If you just want grids, you probably want to play with
a proper framework, not this. This was originally made as a
proof-of-concept for a really odd client request: a full-screen
image with a grid overlay, where the grid scaled and elastically
centered content while always
remaining snapped to the grid. This required
basically recreating the viewport. You’ll notice that layout
used on this page.
Before you can play with Quadrille, you will need to make sure you
have Sass. If you don’t have Sass installed,
just run
$ gem install sass
and everything will be OK.
The hardest part of Quadrille is configuration, and it’s not
very hard. Before you start with Quadrille, you’ll need to know
your grid size and grid
offsets.
 (In the case of this page, it’s 24x24.)
Your grid offset is the offset within the
grid background image that the intersection point is. This page’s
grid intersects directly in the middle, at (12,12).
If you know these, you’re good to go. Run Quadrille's
code generator:
$ ./quadrille
Follow the steps.
If you forgot to install Sass the generator will complain.
Quadrille extends jQuery. If you are proficient with jQuery and want
to generate your own code, include jquery.quadrille.min.js
and work from there. Your code will look like:
$.quadrille({
// your options go here
});
The jQuery plugin has a few different options: grid_size
,
grid_offset_x
, grid_offset_y
,
animate_on_resize
, resize_timer_resolution
,
and background_image_url
. The code autogenerator sets
the basics grid_size
, grid_offset_x
,
and grid_offset_y
for a new user.
grid_size
is the size of your square grid, in
pixels.
grid_offset_x
is the offset in the x axis to
the centerpoint of your grid.
grid_offset_y
is the offset in the y axis to
the centerpoint of your grid.
animate_on_resize
is a boolean value that
animates the elastic grid movement upon resize so it
“slides” back onto the grid. This defaults to
false
. It is experimental.
resize_timer_resolution
is an integer that
buffers the animation resize. This stops the animations from stacking
up and getting ridiculous when the window is resized all over the
place wildly. This is defaulted to a subjective number.
background_image_url
is the URL to a fixed,
full-screen background image if you need one. Quadrille creates the
image tags necessary for this to work and handles the full-screen
zooming for you.
Quadrille is meant to be used with no understanding of anything but very basic HTML and CSS. You should not have to touch anything else. Because of this, Quadrille has a very verbose class syntax that allows you to develop on fixed grids up to 5000px by 5000px with just different classes.
For example, this text uses the classes
block w30 h5
. That sounds nasty but it
isn’t when it is explained. Quadrille has
blocks, dimensions, and
floaters. In this paragraph’s case, its
block is block
, its dimensions w30
and
h5
.
Blocks come in four different flavors:
block
, gblock
,
relblock
and absblock
,
all of which get positioned differently.
block
takes up an entire
row even if your grid dimension doesn’t go that far. It works
like a normal block element.
gblock
creates a
grid block. These float to the left and allow
you to put many of them side by side. They will wrap at the width
of qdr-maincontent
(the elastic grid container).
relblock
relatively positions
a block. These blocks are still considered in the flow, so you will
not have two relblocks appear adjacent to one another.
absblock
allows you to
arbitrarily place blocks wherever you please on the coordinate
grid.
Dimensions give blocks graphical coordinates
or sizes. Dimensions come in a few different types:
w
, h
,
s
, x
,
y
, lh
, and
fs
. All of these are short names, and all do
only one thing: set a certain dimension or offset on the page to
a multiple of your grid size. There is also a special dimension
class called offset
but we’ll get to that
later.
w
dimensions are width
dimensions. For example, w1
will set your element to exactly
one grid square wide. w10
will set the element to exactly
ten squares wide, and so on.
h
dimensions are height
dimensions and work exactly like width blocks, only vertically.
s
dimensions are space
dimensions. They are only useful really for gblock
(grid
blocks). They add blank space in between different grid blocks.
x
dimensions are x-coordinate
dimensions, which you use with absblock
or
relblock
structures. x-dimensions work the way you'd expect
from the top of your grid to the right. For example, x1
would be in the first square of your grid.
y
dimensions are y-coordinate
dimensions.  This is normal for the web. As an
example, y7
is seven grid squares down from the top of your grid.
lh
dimensions are a convenience dimension. They set the
font’s line height to a multiple of the grid.
fs
are also a font convenience dimension, setting
the font size to a multiple of the grid.
offset
, offset-x
, and
offset-y
are special dimensional classes. If
you aren’t working inside mainContent
and want to
arbitrarily place blocks, these will compensate for your grid offset.
They’re for being powerful. offset
offsets in both
x and y directions, while the others only offset in one.
Floaters control the floating/nesting structure
of the grid. They are for use with gblock
(grid blocks)
only. They are clearleft
,
clearright
, and clearboth
.
clearleft
clears grid bits floating to the left.
This is a shortcut for the CSS clear: left;
and you should
use this with a gblock
if you don’t want anything
to the side of it.
clearright
does the same, but to the right:
anything floated to the right will be cleared.
clearboth
is the hammer that clears everything
in both directions, in case you need to go Conan on your grid.
Quadrille should work in Internet Explorer 8 or higher. You might have luck with older browsers but it isn’t tested in those. If for some reason your client does not have JavaScript enabled, the site will try to gracefully break down and not snap to the elastic grid. This is a rather large rarity in today’s browsing environment.
If you have found a bug in Quadrille, please open an issue on GitHub. If you are a smart developer, you can issue your own fix as well.
Quadrille is released under the MIT License, just like Sass and jQuery. If you like Quadrille, donate money to the Electronic Frontier Foundation, the Open Source Initiative, Creative Commons or the Free Software Foundation.


VALORANT
HOME
THANK YOU FOR
REGISTERING INTO VALORANT
YOUR DOWNLOAD WILL BEGIN SOON...
TIME TO EXPLODE.
DOWNLOAD NOW
©Srujan_Baliarsingh_2021.


2 separate earthquakes hit Ventura area minutes apart
VENTURA, Calif. (KABC) -- A 3.4-magnitude earthquake hit Ventura early Thursday morning, according to the U.S. Geological Survey.
The quake hit south-southwest of Ventura at about 5:05 a.m. According to the USGS, the quake hit 8.4 miles northwest of Oxnard and about 10 miles from Port Hueneme.
Minutes before the 3.4 quake, a 3.3-magnitude temblor also hit Ventura.

There were no immediate reports of damage or injuries from the two earthquakes.


This website uses cookies to deliver its services. By using this website, you agree to the use of cookies.
Learn more
Got it
Your Browser must support Javascript to display this website.


--- title: The number of engineers in the Swedish regions, feature importance author: Mikael Lundqvist date: '2020-05-04' slug: the-number-of-engineers-in-the-swedish-regions-feature-importance categories: - R tags: - plot - R Markdown - regression ---
In my last post, I analysed the feature importance for the per cent of engineers in Sweden who are women. I found that the size of the region is a feature that is significant for the per cent of engineers in Sweden who are women. The size of the region is correlated to the number of engineers that works in the region. In this post, I will analyse what predictors are best to forecast the number of engineers in the region. I will use models from the caret package in my analysis.
Statistics Sweden use NUTS (Nomenclature des Unités Territoriales Statistiques), which is the EU’s hierarchical regional division, to specify the regions.
Please send suggestions for improvement of the analysis to<EMAIL_ADDRESS>First, define libraries and functions.
library (tidyverse)
## -- Attaching packages -------------------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.0 v purrr 0.3.4
## v tibble 3.0.0 v dplyr 0.8.5
## v tidyr 1.0.2 v stringr 1.4.0
## v readr 1.3.1 v forcats 0.5.0
## -- Conflicts ----------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library (broom)
library (car)
## Loading required package: carData
##
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
##
## recode
## The following object is masked from 'package:purrr':
##
## some
library (caret)
## Loading required package: lattice
##
## Attaching package: 'caret'
## The following object is masked from 'package:purrr':
##
## lift
library (recipes)
##
## Attaching package: 'recipes'
## The following object is masked from 'package:stringr':
##
## fixed
## The following object is masked from 'package:stats':
##
## step
library (PerformanceAnalytics)
## Loading required package: xts
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
##
## Attaching package: 'xts'
## The following objects are masked from 'package:dplyr':
##
## first, last
##
## Attaching package: 'PerformanceAnalytics'
## The following object is masked from 'package:graphics':
##
## legend
library (ggpubr)
## Loading required package: magrittr
##
## Attaching package: 'magrittr'
## The following object is masked from 'package:purrr':
##
## set_names
## The following object is masked from 'package:tidyr':
##
## extract
library (ipred)
library (iml)
library (DALEX)
## Welcome to DALEX (version: 1.2.1).
## Find examples and detailed introduction at: https://pbiecek.github.io/ema/
##
## Attaching package: 'DALEX'
## The following object is masked from 'package:dplyr':
##
## explain
library (Metrics)
##
## Attaching package: 'Metrics'
## The following objects are masked from 'package:caret':
##
## precision, recall
library (auditor)
##
## Attaching package: 'auditor'
## The following object is masked from 'package:DALEX':
##
## model_performance
readfile <- function (file1){read_csv (file1, col_types = cols(), locale = readr::locale (encoding = "latin1"), na = c("..", "NA")) %>%
gather (starts_with("19"), starts_with("20"), key = "year", value = groupsize) %>%
drop_na() %>%
mutate (year_n = parse_number (year))
}
perc_women <- function(x){
ifelse (length(x) == 2, x[2] / (x[1] + x[2]), NA)
}
nuts <- read.csv("nuts.csv") %>%
mutate(NUTS2_sh = substr(NUTS2, 3, 4))
nuts %>%
distinct (NUTS2_en) %>%
knitr::kable(
booktabs = TRUE,
caption = 'Nomenclature des Unités Territoriales Statistiques (NUTS)')
| NUTS2_en |
|---|
| SE11 Stockholm |
| SE12 East-Central Sweden |
| SE21 Småland and islands |
| SE22 South Sweden |
| SE23 West Sweden |
| SE31 North-Central Sweden |
| SE32 Central Norrland |
| SE33 Upper Norrland |
bs <- function(formula, data, indices) {
d <- data[indices,] # allows boot to select sample
fit <- lm(formula, weights = tbnum_weights, data=d)
return(coef(fit))
}
The data tables are downloaded from Statistics Sweden. They are saved as a comma-delimited file without heading, UF0506A1.csv, http://www.statistikdatabasen.scb.se/pxweb/en/ssd/.
The tables:
UF0506A1_1.csv: Population 16-74 years of age by region, highest level of education, age and sex. Year 1985 - 2018 NUTS 2 level 2008- 10 year intervals (16-74)
000000CG_1: Average basic salary, monthly salary and women´s salary as a percentage of men´s salary by region, sector, occupational group (SSYK 2012) and sex. Year 2014 - 2018 Monthly salary All sectors.
000000CD_1.csv: Average basic salary, monthly salary and women´s salary as a percentage of men´s salary by region, sector, occupational group (SSYK 2012) and sex. Year 2014 - 2018 Number of employees All sectors-
The data is aggregated, the size of each group is in the column groupsize.
I have also included some calculated predictors from the original data.
perc_women: The percentage of women within each group defined by edulevel, region and year
perc_women_region: The percentage of women within each group defined by year and region
regioneduyears: The average number of education years per capita within each group defined by year and region
eduquotient: The quotient between regioneduyears for men and women
salaryquotient: The quotient between salary for men and women within each group defined by year and region
perc_women_eng_region: The percentage of women who are engineers within each group defined by year and region
numedulevel <- read.csv("edulevel_1.csv")
numedulevel[, 2] <- data.frame(c(8, 9, 10, 12, 13, 15, 22, NA))
tb <- readfile("000000CG_1.csv")
tb <- readfile("000000CD_1.csv") %>%
left_join(tb, by = c("region", "year", "sex", "sector","occuptional (SSYK 2012)")) %>%
filter(`occuptional (SSYK 2012)` == "214 Engineering professionals")
tb <- readfile("UF0506A1_1.csv") %>%
right_join(tb, by = c("region", "year", "sex")) %>%
right_join(numedulevel, by = c("level of education" = "level.of.education")) %>%
filter(!is.na(eduyears)) %>%
mutate(edulevel = `level of education`) %>%
group_by(edulevel, region, year, sex) %>%
mutate(groupsize_all_ages = sum(groupsize)) %>%
group_by(edulevel, region, year) %>%
mutate (perc_women = perc_women (groupsize_all_ages[1:2])) %>%
mutate (suming = sum(groupsize.x)) %>%
mutate (salary = (groupsize.y[2] * groupsize.x[2] + groupsize.y[1] * groupsize.x[1])/(groupsize.x[2] + groupsize.x[1])) %>%
group_by (sex, year, region) %>%
mutate(regioneduyears_sex = sum(groupsize * eduyears) / sum(groupsize)) %>%
mutate(regiongroupsize = sum(groupsize)) %>%
mutate(suming_sex = groupsize.x) %>%
group_by(region, year) %>%
mutate (sum_pop = sum(groupsize)) %>%
mutate (regioneduyears = sum(groupsize * eduyears) / sum(groupsize)) %>%
mutate (perc_women_region = perc_women (regiongroupsize[1:2])) %>%
mutate (eduquotient = regioneduyears_sex[2] / regioneduyears_sex[1]) %>%
mutate (salary_sex = groupsize.y) %>%
mutate (salaryquotient = salary_sex[2] / salary_sex[1]) %>%
mutate (perc_women_eng_region = perc_women(suming_sex[1:2])) %>%
left_join(nuts %>% distinct (NUTS2_en, NUTS2_sh), by = c("region" = "NUTS2_en")) %>%
drop_na()
summary(tb)
## region age level of education sex
## Length:532 Length:532 Length:532 Length:532
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## year groupsize year_n sector
## Length:532 Min. : 405 Min. :2014 Length:532
## Class :character 1st Qu.: 20996 1st Qu.:2015 Class :character
## Mode :character Median : 43656 Median :2016 Mode :character
## Mean : 64760 Mean :2016
## 3rd Qu.:102394 3rd Qu.:2017
## Max. :271889 Max. :2018
## occuptional (SSYK 2012) groupsize.x year_n.x groupsize.y
## Length:532 Min. : 340 Min. :2014 Min. :34700
## Class :character 1st Qu.: 1700 1st Qu.:2015 1st Qu.:40300
## Mode :character Median : 3000 Median :2016 Median :42000
## Mean : 5850 Mean :2016 Mean :42078
## 3rd Qu.: 7475 3rd Qu.:2017 3rd Qu.:43925
## Max. :21400 Max. :2018 Max. :49400
## year_n.y eduyears edulevel groupsize_all_ages
## Min. :2014 Min. : 8.00 Length:532 Min. : 405
## 1st Qu.:2015 1st Qu.: 9.00 Class :character 1st Qu.: 20996
## Median :2016 Median :12.00 Mode :character Median : 43656
## Mean :2016 Mean :12.71 Mean : 64760
## 3rd Qu.:2017 3rd Qu.:15.00 3rd Qu.:102394
## Max. :2018 Max. :22.00 Max. :271889
## perc_women suming salary regioneduyears_sex
## Min. :0.3575 Min. : 2040 Min. :38376 Min. :11.18
## 1st Qu.:0.4338 1st Qu.: 3080 1st Qu.:40916 1st Qu.:11.61
## Median :0.4631 Median : 8950 Median :42866 Median :11.74
## Mean :0.4771 Mean :11701 Mean :42776 Mean :11.79
## 3rd Qu.:0.5132 3rd Qu.:20100 3rd Qu.:44444 3rd Qu.:12.04
## Max. :0.6423 Max. :29500 Max. :48429 Max. :12.55
## regiongroupsize suming_sex sum_pop regioneduyears
## Min. :128262 Min. : 340 Min. : 262870 Min. :11.39
## 1st Qu.:288058 1st Qu.: 1700 1st Qu.: 587142 1st Qu.:11.54
## Median :514608 Median : 3000 Median :1029820 Median :11.81
## Mean :453318 Mean : 5850 Mean : 906635 Mean :11.79
## 3rd Qu.:691870 3rd Qu.: 7475 3rd Qu.:1395157 3rd Qu.:11.90
## Max. :827940 Max. :21400 Max. :1655215 Max. :12.41
## perc_women_region eduquotient salary_sex salaryquotient
## Min. :0.4831 Min. :1.019 Min. :34700 Min. :0.8653
## 1st Qu.:0.4882 1st Qu.:1.029 1st Qu.:40300 1st Qu.:0.9329
## Median :0.4934 Median :1.034 Median :42000 Median :0.9395
## Mean :0.4923 Mean :1.034 Mean :42078 Mean :0.9447
## 3rd Qu.:0.4970 3rd Qu.:1.041 3rd Qu.:43925 3rd Qu.:0.9537
## Max. :0.5014 Max. :1.047 Max. :49400 Max. :1.0446
## perc_women_eng_region NUTS2_sh
## Min. :0.1566 Length:532
## 1st Qu.:0.1787 Class :character
## Median :0.2042 Mode :character
## Mean :0.2039
## 3rd Qu.:0.2216
## Max. :0.2746
Prepare the data using Tidyverse recipes package, i.e. centre, scale and make sure all predictors are numerical.
tbtemp <- ungroup(tb) %>% dplyr::select(region, salary, year_n, sum_pop, regioneduyears, suming, perc_women_region, salaryquotient, eduquotient, perc_women_eng_region)
tb_outliers_info <- unique(tbtemp)
tb_unique <- unique(dplyr::select(tbtemp, -region))
tbnum_weights <- tb_unique$suming
blueprint <- recipe(suming ~ ., data = tb_unique) %>%
step_integer(matches("Qual|Cond|QC|Qu")) %>%
step_center(all_numeric(), -all_outcomes()) %>%
step_scale(all_numeric(), -all_outcomes()) %>%
step_dummy(all_nominal(), -all_outcomes(), one_hot = TRUE)
prepare <- prep(blueprint, training = tb_unique)
tbnum <- bake(prepare, new_data = tb_unique)
The correlation chart shows that many predictors are correlated with the response variable but also that many predictors are correlated between each other. Some notable correlations are in a dedicated plot below.
chart.Correlation(tbnum, histogram = TRUE, pch = 19)
p1 <- tb %>%
ggscatter(x = "sum_pop", y = "suming",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson")
p2 <- tb %>%
ggscatter(x = "sum_pop", y = "perc_women_region",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson")
p3 <- tb %>%
ggscatter(x = "suming", y = "perc_women_eng_region",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson")
p4 <- tb %>%
ggscatter(x = "sum_pop", y = "perc_women_eng_region",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson")
gridExtra::grid.arrange(p1, p2, p3, p4, ncol = 2)
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
plot_model will show diagnostics for the model, a residual plot, scale location plot, residual density and the regression error characteristic curve. It will also show the residuals versus the actual response to help find outliers. It will plot the feature importance and feature effects. In addition, it will plot how strongly features interact with each other and the 2-way interactions between the feature with the strongest interaction and all other features. The interaction measure regards how much of the variance of f(x) is explained by the interaction. The measure is between 0 (no interaction) and 1 (= 100% of variance of f(x) due to interactions).
plot_model <- function(model){
invisible(capture.output(exp_model <- DALEX::explain(model, data = tbnum, y = tbnum$suming))) # Knit and DALEX::explain generates invalid rss feed
lm_mr <- model_residual(exp_model)
predictor <- Predictor$new(model,
data = dplyr::select(tbnum, -suming),
y = tbnum$suming)
writeLines("")
print(model)
print(postResample(pred = predict(model), obs = tbnum$suming))
p1 <- plot(lm_mr, type = "residual")
p2 <- plot(lm_mr, type = "scalelocation")
p3 <- plot(lm_mr, type = "residual_density")
p4 <- plot(lm_mr, type = "rec")
print(gridExtra::grid.arrange(p1, p2, p3, p4, ncol = 2))
print(plot_residual(lm_mr, variable = "_y_hat_", nlabel = 10))
print(plot (FeatureImp$new(predictor, loss = "mae")))
print(plot (FeatureEffects$new(predictor)))
interact <- Interaction$new(predictor)
p1 <- plot (interact)
p2 <- plot (Interaction$new(predictor, feature = as.character(arrange(interact$results, desc(.interaction))[1,1])))
print(gridExtra::grid.arrange(p1, p2, ncol = 2))
}
Fit the following models and plot inference and diagnostics. Principal component analysis (PCA) is used to transform the data into a smaller subspace where the new variables are uncorrelated with one another due to the high multicollinearity. Linear Regression, Projection Pursuit Regression, Bagged MARS, Random Forest, Bagged CART, Boosted Tree, Conditional Inference Tree
modelcollection <- c("lm", "ppr", "bagEarth", "ranger", "treebag", "blackboost", "ctree")
for (model in modelcollection){
invisible(capture.output(model <- caret::train(
suming ~ .,
data = tbnum,
method = model,
preProc=c("pca"),
weights = tbnum_weights,
trControl = trainControl(method = "cv", number = 10)
)))
plot_model(model)
}
##
## Linear Regression
##
## 38 samples
## 8 predictor
##
## Pre-processing: principal component signal extraction (8), centered (8),
## scaled (8)
## Resampling: Cross-Validated (10 fold)
## Summary of sample sizes: 35, 34, 34, 35, 34, 34, ...
## Resampling results:
##
## RMSE Rsquared MAE
## 4237.874 0.8822043 3423.46
##
## Tuning parameter 'intercept' was held constant at a value of TRUE
## RMSE Rsquared MAE
## 3883.8558386 0.8463367 2767.1742230
## TableGrob (2 x 2) "arrange": 4 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
## 3 3 (2-2,1-1) arrange gtable[layout]
## 4 4 (2-2,2-2) arrange gtable[layout]
##
## Attaching package: 'patchwork'
## The following object is masked from 'package:MASS':
##
## area
## TableGrob (1 x 2) "arrange": 2 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
##
## Projection Pursuit Regression
##
## 38 samples
## 8 predictor
##
## Pre-processing: principal component signal extraction (8), centered (8),
## scaled (8)
## Resampling: Cross-Validated (10 fold)
## Summary of sample sizes: 34, 34, 34, 34, 34, 34, ...
## Resampling results across tuning parameters:
##
## nterms RMSE Rsquared MAE
## 1 4130.062 0.8121472 3256.277
## 2 4246.374 0.8418553 3408.002
## 3 3906.203 0.8768507 3171.871
##
## RMSE was used to select the optimal model using the smallest value.
## The final value used for the model was nterms = 3.
## RMSE Rsquared MAE
## 1402.1162486 0.9796416 1090.5426055
## TableGrob (2 x 2) "arrange": 4 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
## 3 3 (2-2,1-1) arrange gtable[layout]
## 4 4 (2-2,2-2) arrange gtable[layout]
## TableGrob (1 x 2) "arrange": 2 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
## Loading required package: earth
## Loading required package: Formula
## Loading required package: plotmo
## Loading required package: plotrix
##
## Attaching package: 'plotrix'
## The following object is masked from 'package:scales':
##
## rescale
## Loading required package: TeachingDemos
##
## Bagged MARS
##
## 38 samples
## 8 predictor
##
## Pre-processing: principal component signal extraction (8), centered (8),
## scaled (8)
## Resampling: Cross-Validated (10 fold)
## Summary of sample sizes: 34, 34, 34, 34, 35, 34, ...
## Resampling results across tuning parameters:
##
## nprune RMSE Rsquared MAE
## 2 4671.353 0.8678650 3762.492
## 7 4301.170 0.8466750 3379.813
## 13 4535.948 0.8434574 3713.592
##
## Tuning parameter 'degree' was held constant at a value of 1
## RMSE was used to select the optimal model using the smallest value.
## The final values used for the model were nprune = 7 and degree = 1.
## RMSE Rsquared MAE
## 2950.1269148 0.9075753 2178.7339222
## TableGrob (2 x 2) "arrange": 4 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
## 3 3 (2-2,1-1) arrange gtable[layout]
## 4 4 (2-2,2-2) arrange gtable[layout]
## TableGrob (1 x 2) "arrange": 2 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
##
## Random Forest
##
## 38 samples
## 8 predictor
##
## Pre-processing: principal component signal extraction (8), centered (8),
## scaled (8)
## Resampling: Cross-Validated (10 fold)
## Summary of sample sizes: 34, 34, 34, 34, 34, 34, ...
## Resampling results across tuning parameters:
##
## mtry splitrule RMSE Rsquared MAE
## 2 variance 6106.457 0.7899054 5600.253
## 2 extratrees 5899.990 0.8178129 5413.206
## 3 variance 5242.999 0.8372295 4583.812
## 3 extratrees 4978.308 0.8145967 4339.194
## 4 variance 4367.341 0.8690214 3526.925
## 4 extratrees 4461.317 0.8391514 3797.024
##
## Tuning parameter 'min.node.size' was held constant at a value of 5
## RMSE was used to select the optimal model using the smallest value.
## The final values used for the model were mtry = 4, splitrule = variance
## and min.node.size = 5.
## RMSE Rsquared MAE
## 1782.3243833 0.9749664 1275.2575351
## TableGrob (2 x 2) "arrange": 4 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
## 3 3 (2-2,1-1) arrange gtable[layout]
## 4 4 (2-2,2-2) arrange gtable[layout]
## TableGrob (1 x 2) "arrange": 2 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
##
## Bagged CART
##
## 38 samples
## 8 predictor
##
## Pre-processing: principal component signal extraction (8), centered (8),
## scaled (8)
## Resampling: Cross-Validated (10 fold)
## Summary of sample sizes: 35, 34, 34, 34, 34, 34, ...
## Resampling results:
##
## RMSE Rsquared MAE
## 4828.894 0.8094027 3527.702
##
## RMSE Rsquared MAE
## 3481.9118680 0.8750994 2582.9979981
## TableGrob (2 x 2) "arrange": 4 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
## 3 3 (2-2,1-1) arrange gtable[layout]
## 4 4 (2-2,2-2) arrange gtable[layout]
## TableGrob (1 x 2) "arrange": 2 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
## Warning in if (class(response) == "data.frame") response <- as.matrix(response):
## the condition has length > 1 and only the first element will be used
## Warning in if (class(response) == "data.frame") response <- as.matrix(response):
## the condition has length > 1 and only the first element will be used
##
## Boosted Tree
##
## 38 samples
## 8 predictor
##
## Pre-processing: principal component signal extraction (8), centered (8),
## scaled (8)
## Resampling: Cross-Validated (10 fold)
## Summary of sample sizes: 34, 34, 34, 34, 34, 35, ...
## Resampling results across tuning parameters:
##
## maxdepth mstop RMSE Rsquared MAE
## 1 50 4440.664 0.7708467 3558.175
## 1 100 4429.005 0.7943325 3512.541
## 1 150 4456.381 0.7981314 3487.719
## 2 50 4598.712 0.8028983 3497.232
## 2 100 4582.388 0.7786909 3482.167
## 2 150 4546.031 0.7990669 3437.192
## 3 50 4166.522 0.8926944 2940.884
## 3 100 4134.064 0.8935203 2910.923
## 3 150 4139.154 0.8939033 2918.382
##
## RMSE was used to select the optimal model using the smallest value.
## The final values used for the model were mstop = 100 and maxdepth = 3.

## Resampling results across tuning parameters:
##
## mincriterion RMSE Rsquared MAE
## 0.01 4244.251 0.7539372 2824.5
## 0.50 4244.251 0.7539372 2824.5
## 0.99 4244.251 0.7539372 2824.5
##
## RMSE was used to select the optimal model using the smallest value.
## The final value used for the model was mincriterion = 0.99.
## RMSE Rsquared MAE
## 0 1 0
## Warning: Removed 38 rows containing missing values (geom_point).
 Model error is 0,
## switching from compare='ratio' to compare='difference'
## TableGrob (1 x 2) "arrange": 2 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]


version number:
.
.
current state:
no publish
test publish
official publish
publish notes:
update notes:


{{conversation.display_name}}
{{member.username}}
account_circle {{(selectedConversation.members).length}} Members
{{event.body.text}}
{{selectedConversation.members[event.from].user.name}} has joined the conversation


--- title: Local Retail Partners layout: default ---
A unique baby boutique featuring everything for your special little one. Clothing, cribs, toys, strollers, and so much more!
10% off any one regularly priced clothing item
The Bar Method is an efficiently designed exercise that combines every aspect important to your fitness. It builds strength, increases flexibility, improves posture, and burns calories.
25% discount on a five-class punch pass (redeem discount at the studio - not available online)
Offering 140 varieties of ground cover that are garden ready and Utah hardy.
10% discount off full flats
Potted blooming and tropical plants, annuals, perennials, and flowering shrubs.
10% discount on products
Specializing in the design, construction, and maintenance of garden ponds. Featuring new aquaponics supplies this year. Providing “How To” seminars to ensure that you “do it right the first time.”
10% off
The Garage On Beck is a roadhouse bar and grill music venue located on the edge of Salt Lake City. Best patio in town!
15% off food purchases (Not good with any other offer)
Glover Nursery has been in the nursery business for over 100 years! We offer "retail ready" plant material of all varieties of shrubs, trees, conifers, perennials and annuals. We have a great selection of bulk products as well as a pond department featuring "pondless" water features.
10% discount off all non sale items
Third-generation jewelers. Offering gold and platinum jewelry, diamonds, colored stones, and Citizen watches. Jewelry and watch repair.
20% discount
Let this boutique put together your dream outfit for a wedding or to pair with your favorite jeans! Our unique and timeless jewelry, accessories, and clothing with lovely handwork, keep step with the latest fashions and trends.
10% off on regularly priced items
A Utah treasure with the largest selection of high-fired pottery, fairy garden supplies, and outdoor decorations. Water fountains and fire pots custom made from beautiful pots you pick out. No other outdoor yard decoration store like us, great selection, value and price.
10% discount
Utah's favorite garden center for over 60 years with an outstanding variety of plants and garden supplies.
10% discount (Excludes bulk and sod items)
Experienced and caring electricians repairing and remodeling Wasatch Front homes and businesses since 1995. With NEC you get free estimates, a 2-year trouble-free warranty, and an A+ rating from the BBB.
$20 discount on a one-hour repair or service call or a 5% discount on jobs greater than $500.
Automotive service and repair on all makes and models – especially Subarus!
$25 one-time discount good for any service $100 or more
$28 for Safety & Emission testing for 1996 and newer vehicles. $35 for 1995 and older.
Free check engine light check for 1996 and newer vehicles.
A local favorite since 1991. The menu includes an inspired selection of seasonal entrees that change every two weeks. Desert Edge brews beer on tap and bakes signature cakes and tarts in-house.
Two-for-One desserts by the slice
Offering a great selection of locally made products and a wide variety of garden-inspired gifts.
10% discount
One of Salt Lake City’s favorite neighborhood coffee shops. Featuring Great Harvest Breads, Rico’s Burritos, and Rimini Coffee all baked, prepared and roasted in Salt Lake City. Rimini was voted Best of Utah Coffee Beans by City Weekly in 2013.
10% discount
We have what your skin needs! Aromatherapy products, lotions, oils, massage oils, breezy sleepwear, perfumes, essential oils, natural body and hair care products for men and women.
10% off entire purchase
Offers an urban-chic, warm, inviting atmosphere and a well versed menu of New York style pizzas, pastas, salads, sandwiches, soups, and award-winning tiramisu. Now offering Sunday brunch.
10% off food purchases (Not good with any other offer).
Salt Lake City’s "Best Neighborhood Coffee Shop." Sugar House Coffee has been providing the community with a public gathering space since 2002. Locally sourced ingredients make the menu memorable.
10% discount
Toys That Spark Imagination And Growth.
15% off any one item (Not combinable)
Voted “Best Roses in Utah” by Salt Lake Magazine five years in a row. Beautiful flowers for all occasions.
20% discount (Not good with any other sale or promotion)
A bed and breakfast offering comfortable night stays, gourmet breakfasts, and warm personal service.
10% discount (Reservations required)


| DOSE: |
1 repeated |
smoked |
5-MeO-DMT |
(powder / crystals) |
| |
1 repeated |
smoked |
Cannabis |
(plant material) |
My friends and I were hanging out after I'd left work. I picked up my friend Perkins and rolled a blunt of weed to smoke on the way to my friend Josh's house. We were high as hell and showed up at Josh's red-eyed and bushy-tailed. Josh wanted to get high in his garage, but with the fog machine on and with 5-Meo-DMT sprinkled on the weed, Perkin's and I were all over this. We got some food and went to his garage, it took Josh an hour to get the fog working and it was quite entertaining considering how high I was.
Josh sprinkled a small amount of 5-Meo-DMT on the weed, 4 or 5 crystals. We could taste plastic and our lips were numb for just a moment, but still no serious effect. With every bowl of weed we packed more and more and more 5meo-dmt and began seriously hallucinating. Perkins and I felt as if our arms had disconnected and our bodies and minds were completely disassociated with reality. I saw all kinds of weird patterns and flashes of color, my body panicking with forgeign feelings. I tried to eat and it felt like I was a huge head being fed by smaller hands and arms, and I couldn't feel anything. You have to excuse my typing and lack of...I dunno I am still very hungover/high.
5-Meo-DMT did NOT disappoint me, while driving everything turned completely 8-bit, the street was made of cells, beige or black, and they were in patterns as if in a gameboy or cell phone interface.
[Erowid Note: Driving while intoxicated or tripping is dangerous and irresponsible because it endangers other people. Don't do it!]
 :)
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.