Goals
The URL standard takes the following approach towards making URLs fully interoperable:
-
Align RFC 3986 and RFC 3987 with contemporary implementations and obsolete them in the process. (E.g. spaces, other "illegal" code points, query encoding, equality, canonicalization, are all concepts not entirely shared, or defined.) URL parsing needs to become as solid as HTML parsing. [RFC3986] [RFC3987]
-
Standardize on the term URL. URI and IRI are just confusing. In practice a single algorithm is used for both so keeping them distinct is not helping anyone. URL also easily wins the search result popularity contest.
-
Supplanting Origin of a URI [sic]. [RFC6454]
-
Define URL’s existing JavaScript API in full detail and add enhancements to make it easier to work with. Add a new
URL
object as well for URL manipulation without usage of HTML elements. (Useful for JavaScript worker environments.)
As the editors learn more about the subject matter the goals might increase in scope somewhat.
1. Terminology
Some terms used in this specification are defined in the DOM, Encoding, IDNA, and Web IDL Standards. [DOM] [ENCODING] [IDNA] [WEBIDL]
The C0 controls are code points in the range U+0000 to U+001F, inclusive.
The C0 controls and space are C0 controls and code point U+0020.
The ASCII digits are code points in the range U+0030 to U+0039, inclusive.
The ASCII hex digits are ASCII digits, code points in the range U+0041 to U+0046, inclusive, and code points in the range U+0061 to U+0066, inclusive.
The ASCII alpha are code points in the range U+0041 to U+005A, inclusive, and in the range U+0061 to U+007A, inclusive.
The ASCII alphanumeric are ASCII digits and ASCII alpha.
An ASCII string is a string in the range U+0000 to U+007F, inclusive.
1.1. Parsers
The EOF code point is a conceptual code point that signifies the end of a string or code point stream.
A parse error indicates a non-fatal mismatch between input and requirements. User agents are encouraged to expose parse errors somehow.
Within a parser algorithm that uses a pointer variable, c references the code point the pointer variable points to.
Within a string-based parser algorithm that uses a pointer variable, remaining references the substring after pointer in the string being processed.
If "mailto:username@example
" is a string being
processed and pointer points to "@
",
c is "@
" and remaining is
"example
".
2. Percent-encoded bytes
A percent-encoded byte is "%
", followed by
two ASCII hex digits. Sequences of
percent-encoded bytes, after
conversion to bytes, should not cause a
utf-8 decoder to run into any
errors.
To percent encode a byte into a
percent-encoded byte, return a string consisting of
"%
", followed by a double-digit, uppercase, hexadecimal
representation of byte.
To percent decode a byte sequence input, run these steps:
Using anything but a utf-8 decoder when the input contains bytes outside the range 0x00 to 0x7F might be insecure and is not recommended.
-
Let output be an empty byte sequence.
-
For each byte byte in input, run these steps:
-
If byte is not `
%
`, append byte to output. -
Otherwise, if byte is `
%
` and the next two bytes after byte in input are not in the ranges 0x30 to 0x39, 0x41 to 0x46, and 0x61 to 0x66, append byte to output. -
Otherwise, run these substeps:
-
Let bytePoint be the two bytes after byte in input, decoded, and then interpreted as hexadecimal number.
-
Append a byte whose value is bytePoint to output.
-
Skip the next two bytes in input.
-
-
-
Return output.
The simple encode set are C0 controls and all code points greater than U+007E.
The default encode set is the
simple encode set and code points U+0020,
'"
',
"#
",
"<
",
">
",
"?
",
"`
",
"{
",
and
"}
".
The password encode set is the
default encode set and code points
"/
",
"@
",
and
"\
".
The username encode set is the
password encode set and code point
":
".
To utf-8 percent encode a code point, using an encode set, run these steps:
-
If code point is not in encode set, return code point.
-
Let bytes be the result of running utf-8 encode on code point.
-
Percent encode each byte in bytes, and then return them concatenated, in the same order.
3. Hosts (domains and IP addresses)
A host is a network address in the form of a domain, an IPv4 address, or an IPv6 address.
A domain identifies a realm within a network.
An IPV4 address is a 32-bit identifier.
An IPv6 address is a 128-bit identifier and for the purposes of this specification represented as an ordered list of eight 16-bit pieces. [RFC4291]
3.1. IDNA
The domain to ASCII given a domain domain, runs these steps:
-
Let result be the result of running Unicode ToASCII with domain_name set to domain, UseSTD3ASCIIRules set to false, processing_option set to Transitional_Processing, and VerifyDnsLength set to false.
-
If result is a failure value, return failure.
-
Return result.
The domain to Unicode given a domain domain, runs these steps:
-
Let result be the result of running Unicode ToUnicode with domain_name set to domain, UseSTD3ASCIIRules set to false.
-
Return result, ignoring any returned errors.
User agents are encouraged to report errors through a developer console.
3.2. Host writing
A host must be a domain, an IPv4 address, or
"[
", followed by an IPv6 address, followed by "]
".
A domain is a valid domain if these steps return success:
-
Let result be the result of running Unicode ToASCII with domain_name set to domain, UseSTD3ASCIIRules set to true, processing_option set to Nontransitional_Processing, and VerifyDnsLength set to true.
-
If result is a failure value, return failure.
-
Set result to the result of running Unicode ToUnicode with domain_name set to result, UseSTD3ASCIIRules set to true.
-
If result contains any errors, return failure.
-
Return success.
Ideally we define this in terms of a sequence of code points that make up a valid domain rather than through a whack-a-mole: bug 25334.
A domain must be a string that is a valid domain.
An IPv4 address must be four sequences of up to three ASCII digits
per sequence, each representing a number no greater than 255, and separated from each
other by ".
".
An IPv6 address is defined in the "Text Representation of Addresses" chapter of IP Version 6 Addressing Architecture. [RFC4291]
3.3. Host parsing
The host parser takes a string input and an optional Unicode flag (unset unless stated otherwise), and then runs these steps:
-
If input starts with "
[
", run these substeps:-
If input does not end with "
]
", parse error, return failure. -
Return the result of IPv6 parsing input with its leading "
[
" and trailing "]
" removed.
-
-
Let domain be the result of utf-8 decode without BOM on the percent decoding of utf-8 encode on input.
-
Let asciiDomain be the result of running domain to ASCII on domain.
-
If asciiDomain is failure, return failure.
-
If asciiDomain contains one of U+0000, U+0009, U+000A, U+000D, U+0020, "
#
", "%
", "/
", ":
", "?
", "@
", "[
", "\
", and "]
", return failure. -
Let ipv4Host be the result of IPv4 parsing asciiDomain.
-
If ipv4Host is an IPv4 address or failure, return ipv4Host.
-
Return asciiDomain if the Unicode flag is unset, and the result of running domain to Unicode on asciiDomain otherwise.
The IPv4 number parser takes a string input and then runs these steps:
-
Let R be 10.
-
If input contains at least two code points and the first two code points are either "
0x
" or "0X
", run these substeps:-
Remove the first two code points from input.
-
Set R to 16.
-
-
Otherwise, if input contains at least one code point and the first code point is "
0
", run these substeps:-
Remove the first code point from input.
-
Set R to 8.
-
-
If input contains a code point that is not a radix-R digit, return failure.
-
Return the mathematical integer value that is represented by input in radix-R notation, using ASCII hex digits for digits with values 0 through 15.
The IPv4 parser takes a string input and then runs these steps:
-
Let parts be input split on "
.
". -
If the last item in parts is the empty string, remove it from parts.
-
If parts has more than four items, return input.
-
Let numbers be the empty list.
-
For each part in parts:
-
Let n be the result of parsing part.
-
If n is failure, return input.
-
Append n to numbers.
-
-
If any but the last item in numbers is greater than 255, return failure.
-
If the last item in numbers is greater than or equal to 256(5 − the number of items in numbers), return failure.
-
Let ipv4 be the last item in numbers.
-
Remove the last item from numbers.
-
Let counter be zero.
-
For each n in numbers:
-
Increment ipv4 by n × 256(3 − counter).
-
Increment counter by one.
-
-
Return ipv4.
The IPv6 parser takes a string input and then runs these steps:
-
Let address be a new IPv6 address with its 16-bit pieces initialized to 0.
-
Let piece pointer be a pointer into address’s 16-bit pieces, initially zero (pointing to the first 16-bit piece), and let piece be the 16-bit piece it points to.
-
Let compress pointer be another pointer into address’s 16-bit pieces, initially null and pointing to nothing.
-
Let pointer be a pointer into input, initially zero (pointing to the first code point).
-
If c is "
:
", run these substeps:-
If remaining does not start with "
:
", parse error, return failure. -
Increase pointer by two.
-
Increase piece pointer by one and then set compress pointer to piece pointer.
-
-
Main: While c is not the EOF code point, run these substeps:
-
If piece pointer is eight, parse error, return failure.
-
If c is "
:
", run these inner substeps:-
If compress pointer is not null, parse error, return failure.
- Increase pointer and piece pointer by one, set compress pointer to piece pointer, and then jump to Main.
-
-
Let value and length be 0.
-
While length is less than 4 and c is an ASCII hex digit, set value to value × 0x10 + c interpreted as hexadecimal number, and increase pointer and length by one.
-
Based on c:
- "
.
" -
If length is 0, parse error, return failure.
Decrease pointer by length.
Jump to IPv4.
- "
:
" -
Increase pointer by one.
If c is the EOF code point, parse error, return failure.
- Anything but the EOF code point
-
Parse error, return failure.
- "
-
Set piece to value.
-
Increase piece pointer by one.
-
-
If c is the EOF code point, jump to Finale.
-
IPv4: If piece pointer is greater than six, parse error, return failure.
-
Let dots seen be 0.
-
While c is not the EOF code point, run these substeps:
-
Let value be null.
-
If c is not an ASCII digit, parse error, return failure.
-
While c is an ASCII digit, run these subsubsteps:
-
Let number be c interpreted as decimal number.
-
If value is null, set value to number.
Otherwise, if value is 0, parse error, return failure.
Otherwise, set value to value × 10 + number.
-
Increase pointer by one.
-
If value is greater than 255, parse error, return failure.
-
-
If dots seen is less than 3 and c is not a "
.
", parse error, return failure. -
Set piece to piece × 0x100 + value.
-
If dots seen is 1 or 3, increase piece pointer by one.
-
If c is not the EOF code point, increase pointer by one.
-
If dots seen is 3 and c is not the EOF code point, parse error, return failure.
-
Increase dots seen by one.
-
-
Finale: If compress pointer is not null, run these substeps:
-
Let swaps be piece pointer − compress pointer.
-
Set piece pointer to seven.
-
While piece pointer is not zero and swaps is greater than zero, swap piece with the piece at pointer compress pointer + swaps − 1, and then decrease both piece pointer and swaps by one.
-
-
Otherwise, if compress pointer is null and piece pointer is not eight, parse error, return failure.
-
Return address.
3.4. Host serializing
The host serializer takes a host host and then runs these steps:
-
If host is an IPv4 address, return the result of running the IPv4 serializer on host.
-
Otherwise, if host is an IPv6 address, return "
[
", followed by the result of running the IPv6 serializer on host, followed by "]
". -
Otherwise, host is a domain, return host.
The IPv4 serializer takes an IPv4 address address and then runs these steps:
-
Let output be the empty string.
-
Let n be the value of address.
-
Repeat four times:
-
Prepend n % 256, represented as the shortest possible decimal number, to output.
-
Unless this is the fourth time, prepend "
.
" to output. -
Set n to n / 256.
-
-
Return output.
The IPv6 serializer takes an IPv6 address address and then runs these steps:
-
Let output be the empty string.
-
Let compress pointer be a pointer to the first 16-bit piece in the first longest sequences of address’s 16-bit pieces that are 0.
-
If there is no sequence of address’s 16-bit pieces that are 0 longer than one, set compress pointer to null.
-
For each piece in address’s pieces, run these substeps:
-
If compress pointer points to piece, append "
::
" to output if piece is address’s first piece and append ":
" otherwise, and then run these substeps again with all subsequent pieces in address’s pieces that are 0 skipped or go the next step in the overall set of steps if that leaves no pieces. -
Append piece, represented as the shortest possible lowercase hexadecimal number, to output.
-
If piece is not address’s last piece, append "
:
" to output.
-
-
Return output.
This algorithm requires the recommendation from A Recommendation for IPv6 Address Text Representation. [RFC5952]
4. URLs
A URL is a universal identifier.
A URL consists of components, namely a scheme, username, password, host, port, path, query, and fragment.
A URL’s scheme is an ASCII string that identifies the type of URL and can be used to dispatch a URL for further processing after parsing. It is initially the empty string.
A URL’s username is an ASCII string identifying a user. It is initially the empty string.
A URL’s password is either null or an ASCII string identifying a user’s credentials. It is initially null.
A URL’s host is either null or a host. It is initially null.
A URL’s port is an ASCII string that identifies a networking port. It is initially the empty string.
A URL’s path is a list of zero or more ASCII string holding data, usually identifying a location in hierarchical form. It is initially the empty list.
A URL’s query is either null or an ASCII string holding data. It is initially null.
A URL’s fragment is either null or a string holding data that can be used for further processing on the resource the URL’s other components identify. It is initially null.
This is not an ASCII string on purpose.
A URL also has an associated non-relative flag. It is initially unset.
A URL also has an associated
object that is either null or a
Blob
object. It is initially null.
[FILEAPI]
At this point this is used primarily to support
"blob
" URLs, but others can be added going forward, hence "object".
A special scheme is a scheme listed in the first column of the following table. A default port is a special scheme’s optional corresponding port and is listed in the second column on the same row.
| scheme | port |
|---|---|
"ftp "
| "21 "
|
"file "
| |
"gopher "
| "70 "
|
"http "
| "80 "
|
"https "
| "443 "
|
"ws "
| "80 "
|
"wss "
| "443 "
|
A URL is special if its scheme is a special scheme.
A local scheme is a scheme that is one of
"about
", "blob
", "data
", and
"filesystem
".
A URL is local if its scheme is a local scheme.
This definition is used externally. E.g., by the Fetch Standard and Referrer Policy. [FETCH] [REFERRER-POLICY]
A URL includes credentials if either its username is not the empty string or its password is non-null.
A URL can be designated as base URL.
A base URL is useful for the URL parser when the input might be a relative URL.
4.1. URL writing
A URL must be written as either a relative URL or an absolute URL,
optionally followed by "#
" and a fragment.
An absolute URL must be a
scheme, followed by ":
", followed by either a
scheme-relative URL, or if URL
is not special, a path, optionally
followed by "?
" and a query.
A scheme must be one ASCII alpha, followed by zero or
more of ASCII alphanumeric, "+
", "-
", and
".
". A scheme must be registered
....
A relative URL must be either a
scheme-relative URL, or a path that does not start with a
scheme and ":
", optionally followed by a
"?
" and a query.
When a relative URL is parsed, a base URL must be in scope.
A scheme-relative URL must be
"//
", followed by a host, optionally followed by ":
" and
a port, optionally followed by a path that
starts with "/
".
A port must be zero or more ASCII digits.
A path must be zero or more URL units, excluding
"?
".
A query must be zero or more URL units.
A fragment must be zero or more URL units.
The URL code points are ASCII alphanumeric,
"!
",
"$
",
"&
",
"'
",
"(
",
")
",
"*
",
"+
",
",
",
"-
",
".
",
"/
",
":
",
";
",
"=
",
"?
",
"@
",
"_
",
"~
",
and code points in the ranges
U+00A0 to U+D7FF,
U+E000 to U+FDCF,
U+FDF0 to U+FFFD,
U+10000 to U+1FFFD,
U+20000 to U+2FFFD,
U+30000 to U+3FFFD,
U+40000 to U+4FFFD,
U+50000 to U+5FFFD,
U+60000 to U+6FFFD,
U+70000 to U+7FFFD,
U+80000 to U+8FFFD,
U+90000 to U+9FFFD,
U+A0000 to U+AFFFD,
U+B0000 to U+BFFFD,
U+C0000 to U+CFFFD,
U+D0000 to U+DFFFD,
U+E0000 to U+EFFFD,
U+F0000 to U+FFFFD,
U+100000 to U+10FFFD.
Code points higher than U+009F will be converted to percent-encoded bytes by the URL parser, except for code points appearing in fragments.
The URL units are URL code points and percent-encoded bytes.
There is no conforming way to express a username or password within a URL.
4.2. URL parsing
Add the ability to halt on the first conformance error.
The URL parser takes a string input, with an optional base URL base and an optional encoding encoding override, and then runs these steps:
Non-web-browser implementations only need to implement the basic URL parser.
-
Let url be the result of running the basic URL parser on input with base, and encoding override as provided.
-
If url is failure, return failure.
-
If url’s scheme is not "
blob
", return url. -
If the first string in url’s path is not in the blob URL store, return url. [FILEAPI]
-
Set url’s object to a structured clone of the entry in the blob URL store corresponding to the first string in url’s path. [HTML]
-
Return url.
The basic URL parser takes a string input, optionally with a base URL base, optionally with an encoding encoding override, optionally with an URL url and a state override state override, and then runs these steps:
The encoding override argument is a legacy concept only relevant for
HTML. The url and state override arguments are only for use by
objects implementing the URLUtils
interface.
[HTML]
When the url and state override arguments are not passed, the basic URL parser returns either a new URL or failure. If they are passed the algorithm simply modifies the passed url and can terminate without returning anything.
-
If url is not given:
-
Set url to a new URL.
-
Remove any leading and trailing C0 controls and space from input.
-
-
Let state be state override if given, or scheme start state otherwise.
-
If base is not given, set it to null.
-
If encoding override is not given, set it to utf-8.
-
Let buffer be the empty string.
-
Let the @ flag and the [] flag be unset.
-
Let pointer be a pointer to first code point in input.
-
Keep running the following state machine by switching on state. If after a run pointer points to the EOF code point, go to the next step. Otherwise, increase pointer by one and continue with the state machine.
- scheme start state
-
-
If c is an ASCII alpha, append c, lowercased, to buffer, and set state to scheme state.
-
Otherwise, if state override is not given, set state to no scheme state, and decrease pointer by one.
-
Otherwise, parse error, terminate this algorithm.
-
- scheme state
-
-
If c is an ASCII alphanumeric, "
+
", "-
", or ".
", append c, lowercased, to buffer. -
Otherwise, if c is "
:
", run these substeps:-
If state override is given, run these subsubsteps:
-
If url’s scheme is a special scheme and buffer is not, terminate this algorithm.
-
If url’s scheme is not a special scheme and buffer is, terminate this algorithm.
-
-
Set url’s scheme to buffer.
-
Set buffer to the empty string.
-
If state override is given, terminate this algorithm.
-
If url’s scheme is "
file
", set state to relative state. -
Otherwise, if url is special, base is not null, and base’s scheme is equal to url’s scheme, set state to special relative or authority state.
-
Otherwise, if url is special, set state to special authority slashes state.
-
Otherwise, if remaining starts with an "
/
", set state to path or authority state, and increase pointer by one. -
Otherwise, set url’s non-relative flag, append an empty string to url’s path, and set state to non-relative path state.
-
-
Otherwise, if state override is not given, set buffer to the empty string, state to no scheme state, and start over (from the first code point in input).
-
Otherwise, parse error, terminate this algorithm.
-
- no scheme state
-
If base is null, or base’s non-relative flag is set and c is not "
#
", parse error, return failure.Otherwise, if base’s non-relative flag is set and c is "
#
", set url’s scheme to base’s scheme, url’s path to base’s path, url’s query to base’s query, url’s fragment to the empty string, set url’s non-relative flag, and set state to fragment state.Otherwise, set state to relative state, and decrease pointer by one.
- special relative or authority state
-
If c is "
/
" and remaining starts with "/
", set state to special authority ignore slashes state and increase pointer by one.Otherwise, parse error, set state to relative state and decrease pointer by one.
- path or authority state
-
If c is "
/
", set state to authority state.Otherwise, set state to path state, and decrease pointer by one.
- relative state
-
Set url’s scheme to base’s scheme if url’s scheme is not "
file
", and then, based on c:- EOF code point
-
Set url’s username to base’s username, url’s password to base’s password, url’s host to base’s host, url’s port to base’s port, url’s path to base’s path, and url’s query to base’s query.
- "
/
" -
Set state to relative slash state.
- "
?
" -
Set url’s username to base’s username, url’s password to base’s password, url’s host to base’s host, url’s port to base’s port, url’s path to base’s path, url’s query to the empty string, and state to query state.
- "
#
" -
Set url’s username to base’s username, url’s password to base’s password, url’s host to base’s host, url’s port to base’s port, url’s path to base’s path, url’s query to base’s query, url’s fragment to the empty string, and state to fragment state.
- Otherwise
-
If url is special and c is "
\
", parse error, set state to relative slash state.Otherwise, run these steps:
-
If url’s scheme is not "
file
", or c is not an ASCII alpha, or remaining does not start with either ":
" or "|
", or remaining consists of one code point, or remaining’s second code point is not one of "/
", "\
", "?
", and "#
", then set url’s username to base’s username, url’s password to base’s password, url’s host to base’s host, url’s port to base’s port, url’s path to base’s path, and then remove url’s path’s last entry.This is a (platform-independent) Windows drive letter quirk. When found at the start of a
file
URL it is treated as an absolute path rather than one relative to base’s path. -
Set state to path state, and decrease pointer by one.
-
- relative slash state
-
If either c is "
/
", or url is special and c is "\
", run these steps:-
If c is "
\
", parse error. -
If url’s scheme is "
file
", set state to file host state. -
Otherwise, set state to special authority ignore slashes state.
Otherwise, run these steps:
-
- special authority slashes state
-
If c is "
/
" and remaining starts with "/
", set state to special authority ignore slashes state, and increase pointer by one.Otherwise, parse error, set state to special authority ignore slashes state, and decrease pointer by one.
- special authority ignore slashes state
-
If c is neither "
/
" nor "\
", set state to authority state, and decrease pointer by one.Otherwise, parse error.
- authority state
-
-
If c is "
@
", run these substeps:-
If the @ flag is set, prepend "
%40
" to buffer. -
Set the @ flag.
-
For each code point in buffer, run these substeps:
-
If code point is U+0009, U+000A, or U+000D, continue.
-
If code point is "
:
" and url’s password is null, set url’s password to the empty string and continue. -
If url’s password is non-null, utf-8 percent encode code point using the password encode set and append the result to url’s password.
-
Otherwise, utf-8 percent encode code point using the username encode set and append the result to url’s username.
-
-
Set buffer to the empty string.
-
Otherwise, if either c is one of EOF code point, "
/
", "?
", and "#
", or url is special and c is "\
", decrease pointer by the number of code points in buffer plus one, set buffer to the empty string, and state to host state. -
Otherwise, append c to buffer.
-
- host state
- hostname state
-
-
If c is "
:
" and the [] flag is unset, run these substeps:-
If url is special and buffer is the empty string, return failure.
-
Let host be the result of host parsing buffer.
-
If host is failure, return failure.
-
Set url’s host to host, buffer to the empty string, and state to port state.
-
If state override is hostname state, terminate this algorithm.
-
-
Otherwise, if either c is one of EOF code point, "
/
", "?
", and "#
", or url is special and c is "\
", decrease pointer by one, and run these substeps:-
If url is special and buffer is the empty string, return failure.
-
Let host be the result of host parsing buffer.
-
If host is failure, return failure.
-
Set url’s host to host, buffer to the empty string, and state to path start state.
-
If state override is given, terminate this algorithm.
-
-
Otherwise, if c is U+0009, U+000A, or U+000D, parse error.
-
Otherwise, run these substeps:
-
- file host state
-
-
If c is one of EOF code point, "
/
", "\
", "?
", and "#
", decrease pointer by one, and run these substeps:-
If buffer consists of two code points, of which the first is an ASCII alpha and the second is either "
:
" or "|
", set state to path state.This is a (platform-independent) Windows drive letter quirk. buffer is not reset here and instead used in the path state.
-
Otherwise, if buffer is the empty string, set state to path start state.
-
Otherwise, run these steps:
-
Let host be the result of host parsing buffer.
-
If host is failure, return failure.
-
Set url’s host to host, buffer to the empty string, and state to path start state.
-
-
-
Otherwise, if c is U+0009, U+000A, or U+000D, parse error.
-
Otherwise, append c to buffer.
-
- port state
-
-
If c is an ASCII digit, append c to buffer.
-
Otherwise, if c is one of EOF code point, "
/
", "?
", and "#
", or url is special and c is "\
", or state override is given, run these substeps:-
Remove leading U+0030 code points from buffer until either the leading code point is not U+0030 or buffer is one code point.
-
If buffer is equal to url’s scheme’s default port, set buffer to the empty string.
-
Set url’s port to buffer.
-
If state override is given, terminate this algorithm.
-
Set buffer to the empty string, state to path start state, and decrease pointer by one.
-
-
Otherwise, if c is U+0009, U+000A, or U+000D, parse error.
-
Otherwise, parse error, return failure.
-
- path start state
-
-
If url is special and c is "
\
", parse error. -
Set state to path state, and if neither c is "
/
", nor url is special and c is "\
", decrease pointer by one.
-
- path state
-
-
If c is EOF code point or "
/
", or url is special and c is "\
", or state override is not given and c is "?
" or "#
", run these substeps:-
If url is special and c is "
\
", parse error. -
If buffer, lowercased, matches any row in the first column of the following table, set buffer to the contents of the cell in the second column of the matched row:
" %2e
"" .
"" .%2e
"" ..
"" %2e.
"" %2e%2e
" -
If buffer is "
..
", remove url’s path’s last string, if any, and then if neither c is "/
", nor url is special and c is "\
", append the empty string to url’s path. -
Otherwise, if buffer is "
.
" and if neither c is "/
", nor url is special and c is "\
", append the empty string to url’s path. -
Otherwise, if buffer is not "
.
", run these subsubsteps:-
If url’s scheme is "
file
", url’s path is empty, buffer consists of two code points, of which the first is an ASCII alpha, and the second is "|
", replace the second code point in buffer with ":
".This is a (platform-independent) Windows drive letter quirk. They are beautiful, no?
-
Append buffer to url’s path.
-
-
Set buffer to the empty string.
-
If c is "
?
", set url’s query to the empty string, and state to query state. -
If c is "
#
", set url’s fragment to the empty string, and state to fragment state.
-
-
Otherwise, if c is U+0009, U+000A, or U+000D, parse error.
-
Otherwise, run these steps:
-
If c is not a URL code point and not "
%
", parse error. -
If c is "
%
" and remaining does not start with two ASCII hex digits, parse error. -
utf-8 percent encode c using the default encode set, and append the result to buffer.
-
-
- non-relative path state
-
-
If c is "
?
", set url’s query to the empty string and state to query state. -
Otherwise, if c is "
#
", set url’s fragment to the empty string and state to fragment state. -
Otherwise, run these substeps:
-
If c is not the EOF code point, not a URL code point, and not "
%
", parse error. -
If c is "
%
" and remaining does not start with two ASCII hex digits, parse error. -
If c is none of EOF code point, U+0009, U+000A, and U+000D, utf-8 percent encode c using the simple encode set, and append the result to the first string in url’s path.
-
-
- query state
-
-
If c is the EOF code point, or state override is not given and c is "
#
", run these substeps:-
If url is not special or url’s scheme is either "
ws
" or "wss
", set encoding override to utf-8. -
Set buffer to the result of encoding buffer using encoding override.
-
For each byte in buffer run these subsubsteps:
-
If byte is less than 0x21, greater than 0x7E, or is one of 0x22, 0x23, 0x3C, and 0x3E, append byte, percent encoded, to url’s query.
-
Otherwise, append a code point whose value is byte to url’s query.
-
-
Set buffer to the empty string.
-
If c is "
#
", set url’s fragment to the empty string, and state to fragment state.
-
-
Otherwise, if c is U+0009, U+000A, or U+000D, parse error.
-
Otherwise, run these substeps:
-
If c is not a URL code point and not "
%
", parse error. -
If c is "
%
" and remaining does not start with two ASCII hex digits, parse error. -
Append c to buffer.
-
-
- fragment state
-
Based on c:
- EOF code point
-
Do nothing.
- U+0000
- U+0009
- U+000A
- U+000D
- U+0009
- Otherwise
-
-
If c is not a URL code point and not "
%
", parse error. -
If c is "
%
" and remaining does not start with two ASCII hex digits, parse error. -
Unfortunately not using percent-encoding is intentional as implementations with majority market share exhibit this behavior.
-
-
Return url.
To set the username given a url and username, run these steps:
-
Set url’s username to the empty string.
-
For each code point in username, utf-8 percent encode it using the username encode set, and append the result to url’s username.
To set the password given a url and password, run these steps:
-
If password is the empty string, set url’s password to null.
-
Otherwise, run these substeps:
-
Set url’s password to the empty string.
-
For each code point in password, utf-8 percent encode it using the password encode set, and append the result to url’s password.
-
4.3. URL serializing
The URL serializer takes a URL url, an optional exclude fragment flag, and then runs these steps:
-
Let output be url’s scheme and "
:
" concatenated. -
If url’s host is non-null:
-
If url’s non-relative flag is set, append the first string in url’s path to output.
-
Otherwise, append "
/
", followed by the strings in url’s path (including empty strings), separated from each other by "/
", to output. -
If url’s query is non-null, append "
?
", followed by url’s query, to output. -
If the exclude fragment flag is unset and url’s fragment is non-null, append "
#
", followed by url’s fragment, to output. -
Return output.
4.4. Origin
See origin’s definition in HTML for the necessary background information. [HTML]
A URL’s origin is the origin returned by running these steps, switching on URL’s scheme:
- "
blob
" -
Let url be the result of parsing the first string in URL’s path.
If url is failure, return a new globally unique identifier. Otherwise, return url’s origin.
The origin of
blob:https://whatwg.org/d0360e2f-caee-469f-9a2f-87d5b0456f6f
is the tuple (https
,whatwg.org
,443
). - "
ftp
"- "
gopher
"- "
http
"- "
https
"- "
ws
"- "
wss
" - "
-
Return a tuple consisting of URL’s scheme, its host, and its default port if its port is the empty string, and its port otherwise.
- "
file
" -
Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new globally unique identifier.
- Otherwise
-
Return a new globally unique identifier.
5. application/x-www-form-urlencoded
The application/x-www-form-urlencoded
format is a simple way to
encode name-value pairs in a byte sequence where all bytes are in the 0x00 to 0x7F range.
While this description makes
application/x-www-form-urlencoded
sound dated — and really, it is — the
format is in widespread use due to its prevalence of HTML forms.
[HTML]
5.1. application/x-www-form-urlencoded
parsing
The features provided by the
application/x-www-form-urlencoded
parser
are mainly relevant for server-oriented implementations. A browser-based implementation
only needs what the
application/x-www-form-urlencoded
string parser
requires.
The
application/x-www-form-urlencoded
parser
takes a byte sequence input, optionally with an
encoding encoding override,
optionally with a use _charset_ flag, and optionally with an
isindex flag, and then runs these steps:
-
If encoding override is not given, set it to utf-8.
-
If encoding override is not utf-8 and input contains bytes whose value is greater than 0x7F, return failure.
This can only happen if input was not generated through the serializer or
URLSearchParams
. -
Let sequences be the result of splitting input on `
&
`. -
If the isindex flag is set and the first byte sequence in sequences does not contain a `
=
`, prepend `=
` to the first byte sequence in sequences. -
Let pairs be an empty list of name-value pairs where both name and value hold a byte sequence.
-
For each byte sequence bytes in sequences, run these substeps:
-
If bytes is the empty byte sequence, run these substeps for the next byte sequence.
-
If bytes contains a `
=
`, then let name be the bytes from the start of bytes up to but excluding its first `=
`, and let value be the bytes, if any, after the first `=
` up to the end of bytes. If `=
` is the first byte, then name will be the empty byte sequence. If it is the last, then value will be the empty byte sequence. -
Otherwise, let name have the value of bytes and let value be the empty byte sequence.
-
Replace any `
+
` in name and value with 0x20. -
If use _charset_ flag is set and name is `
_charset_
`, run these substeps:-
Let result be the result of getting an encoding for value, decoded.
-
If result is not failure, unset use _charset_ flag and set encoding override to result.
-
-
Add a pair consisting of name and value to pairs.
-
-
Let output be an empty list of name-value pairs where both name and value hold a string.
-
For each name-value pair in pairs, append a name-value pair to output where the new name and value appended to output are the result of running encoding override’s decoder on the percent decoding of the name and value from pairs, respectively.
-
Return output.
5.2. application/x-www-form-urlencoded
serializing
The
application/x-www-form-urlencoded
byte serializer
takes a byte sequence input and then runs these steps:
-
Let output be the empty string.
-
For each byte in input, depending on byte:
- 0x20
-
Append U+002B to output.
- 0x2A
- 0x2D
- 0x2E
- 0x30 to 0x39
- 0x41 to 0x5A
- 0x5F
- 0x61 to 0x7A
- 0x2D
-
Append a code point whose value is byte to output.
- Otherwise
-
Append byte, percent encoded, to output.
-
Return output.
The
application/x-www-form-urlencoded
serializer
takes a list of name-value pairs pairs, optionally with an
encoding
encoding override, and then runs these steps:
-
If encoding override is not given, set it to utf-8.
-
Let output be the empty string.
-
For each pair in pairs, run these substeps:
-
Let outputPair be a copy of pair.
-
Replace outputPair’s name and value with the result of running encode on them using encoding override, respectively.
-
Replace outputPair’s name and value with their serialization.
-
If pair is not the first pair in pairs, append "
&
" to output. -
Append outputPair’s name, followed by "
=
", followed by outputPair’s value to output.
-
- Return output.
5.3. Hooks
The
application/x-www-form-urlencoded
string parser
takes a string input,
utf-8 encodes it, and then
returns the result of
application/x-www-form-urlencoded
parsing
it.
6. API
[Constructor(USVString url, optional USVString base), Exposed=(Window,Worker)] interface URL { static USVString domainToASCII(USVString domain); static USVString domainToUnicode(USVString domain); }; URL implements URLUtils; URL implements URLUtilsSearchParams; [NoInterfaceObject, Exposed=(Window,Worker)] interface URLUtils { stringifier attribute USVString href; readonly attribute USVString origin; attribute USVString protocol; attribute USVString username; attribute USVString password; attribute USVString host; attribute USVString hostname; attribute USVString port; attribute USVString pathname; attribute USVString search; attribute USVString hash; }; [NoInterfaceObject, Exposed=(Window, Worker)] interface URLUtilsSearchParams { attribute URLSearchParams searchParams; }; [NoInterfaceObject, Exposed=(Window,Worker)] interface URLUtilsReadOnly { stringifier readonly attribute USVString href; readonly attribute USVString origin; readonly attribute USVString protocol; readonly attribute USVString host; readonly attribute USVString hostname; readonly attribute USVString port; readonly attribute USVString pathname; readonly attribute USVString search; readonly attribute USVString hash; };
Except where different objects implementing URLUtilsReadOnly
are identical to
objects implementing URLUtils
. searchParams
is on its own
interface since Location
cannot support it. [HTML]
Since all members are readonly and certain members from URLUtils
are not
exposed a number of potential optimizations is possible compared to objects implementing
URLUtils
. These are left as an exercise to the reader.
Specifications defining objects implementing URLUtils
/URLUtilsSearchParams
or
URLUtilsReadOnly
must define a
get the base algorithm, which must return the
appropriate base URL for the object.
Specifications defining objects implementing URLUtils
may define
update steps to make it
possible for an underlying string (such as an
attribute value)
to be updated. The update steps are passed a string
value for this purpose.
An object implementing URLUtils
or URLUtilsReadOnly
has an
associated input (a string),
query encoding
(an encoding),
query object
(a URLSearchParams
object or null), and a
url (a URL or null).
Unless stated otherwise, query encoding is utf-8 and query object is null. The others follow from the set the input algorithm.
The associated query encoding is a legacy concept only relevant for HTML. [HTML]
Specifications defining objects implementing URLUtils
/URLUtilsSearchParams
or
URLUtilsReadOnly
must use the set the input
algorithms to set input, url, and
query object. To
set the input
given input and optionally a url, run these steps:
-
Otherwise, run these substeps:
-
Set url to null.
-
If input is null, set input to the empty string.
-
Otherwise, run these subsubsteps:
-
Set input to input.
-
Let url be the result of running the URL parser on input with base URL being the result of running get the base and query encoding as encoding override.
-
If url is not failure, set url to url.
-
-
-
Let query be url’s query if url and its query are non-null, and the empty string otherwise.
-
If query object is null, set query object to a new
URLSearchParams
object using query, and then append the context object to query object’s list of url objects. -
Otherwise, set query object’s list to the result of parsing query.
To run the pre-update steps for an object implementing URLUtils
,
optionally given a value, run these steps:
-
If value is not given, let value be the result of serializing the associated url.
-
Run the update steps with value.
6.1. Constructors
The
URL(url, base)
constructor, when invoked, must run these steps:
-
Let parsedBase be null.
-
If base is given, run these substeps:
-
Let parsedBase be the result of running the basic URL parser on base.
-
If parsedBase is failure, throw a
TypeError
exception.
-
-
Let parsedURL be the result of running the basic URL parser on url with parsedBase.
-
If parsedURL is failure, throw a
TypeError
exception. -
Let result be a new
URL
object. -
Let result’s get the base return parsedBase.
-
Run result’s set the input given the empty string and parsedURL.
-
Return result.
To Basic URL parse a string into a URL without using a base URL, invoke the constructor with a single argument:
var input = "https://example.org/💩", url = new URL(input) url.pathname // "/%F0%9F%92%A9"
Alternatively you can use the base URL of a
document through
baseURI
:
var input = "/💩", url = new URL(input, document.baseURI) url.href // "https://url.spec.whatwg.org/%F0%9F%92%A9"
6.2. URL
statics
The
domainToASCII(domain)
static method, when invoked, must run these steps:
-
Let asciiDomain be the result of host parsing domain.
-
If asciiDomain is an IPv4 address, IPv6 address, or failure, return the empty string.
-
Return asciiDomain.
The
domainToUnicode(domain)
static method, when invoked, must run these steps:
-
Let unicodeDomain be the result of host parsing domain with the Unicode flag set.
-
If unicodeDomain is an IPv4 address, IPv6 address, or failure, return the empty string.
-
Return unicodeDomain.
Add domainToUI() which follows the UA conventions for when to use the Unicode representation?
6.3. URLUtils
/URLUtilsSearchParams
and URLUtilsReadOnly
members
The URLUtils
/URLUtilsSearchParams
and URLUtilsReadOnly
interfaces are not exposed on the global object. They are mixins for other objects, such
as URL
.
The href
attribute’s getter must run these steps:
-
Return the serialization of url.
The href
attribute’s
setter must run these steps:
-
Let input be the given value.
-
If the
context object
is aURL
object, run these substeps:-
Let parsedURL be the result of running the basic URL parser on input with base URL being the result of running get the base.
-
If parsedURL is failure, throw a
TypeError
exception. -
Run set the input given the empty string and parsedURL.
-
-
Otherwise, run these substeps:
-
Run the set the input algorithm for input.
-
Run the pre-update steps with the input.
This means that if the
href
attribute is set to value that would cause the URL parser to return failure, that value is still passed through unchanged. This is one of those unfortunate legacy incidents.var a = document.createElement("a"), input = "https://test:test/" // invalid port makes the parser return failure a.href = test a.href === test // true
-
The origin
attribute’s getter must run these steps:
-
If url is null, return the empty string.
-
Return the Unicode serialization of url’s origin. [HTML]
It returns the Unicode rather than the ASCII serialization for
compatibility with HTML’s MessageEvent
feature.
[HTML]
The protocol
attribute’s getter must run these steps:
The protocol
attribute’s setter must run
these steps:
-
If url is null, terminate these steps.
-
Basic URL parse the given value, followed by "
:
", with url as url and scheme start state as state override. -
Run the pre-update steps.
The username
attribute’s getter must run these steps:
The username
attribute’s setter must
run these steps:
-
If url is null, its host is null, or its non-relative flag is set, terminate these steps.
-
Set the username given url and the given value.
-
Run the pre-update steps.
The password
attribute’s getter must run these steps:
The password
attribute’s setter must
run these steps:
-
If url is null, its host is null, or its non-relative flag is set, terminate these steps.
-
Set the password given url and the given value.
-
Run the pre-update steps.
The host
attribute’s
getter must run these steps:
-
If url is null, or its host is null, return the empty string.
-
If port is the empty string, return host, serialized.
-
Return host, serialized, followed by "
:
" and port.
The host
attribute’s setter must run these
steps:
-
If url is null, or its non-relative flag is set, terminate these steps.
-
Basic URL parse the given value with url as url and host state as state override.
-
Run the pre-update steps.
The hostname
attribute’s getter must run these steps:
-
If url is null, or its host is null, return the empty string.
-
Return host, serialized.
The hostname
attribute’s setter must
run these steps:
-
If url is null, or its non-relative flag is set, terminate these steps.
-
Basic URL parse the given value with url as url and hostname state as state override.
-
Run the pre-update steps.
The port
attribute’s getter must run
these steps:
The port
attribute’s setter must run these
steps:
-
If url is null, its host is null, its non-relative flag is set, or its scheme is "
file
", terminate these steps. -
Otherwise, Basic URL parse the given value with url as url and port state as state override.
-
Run the pre-update steps.
The pathname
attribute’s getter must run these steps:
-
If url is null, return the empty string.
-
If the non-relative flag is set, return the first string in path.
-
Return "
/
", followed by the strings in path (including empty strings), separated from each other by "/
".
The pathname
attribute’s setter must
run these steps:
-
If url is null, or its non-relative flag is set, terminate these steps.
-
Empty path.
-
Basic URL parse the given value with url as url and path start state as state override.
-
Run the pre-update steps.
The search
attribute’s getter must run these steps:
-
If url is null, or its query is either null or the empty string, return the empty string.
-
Return "
?
", followed by query.
The search
attribute’s setter must run these
steps:
-
If url is null, terminate these steps.
-
If the given value is the empty string, set query to null, empty query object’s list, run its update steps, and terminate these steps.
-
Let input be the given value with a single leading "
?
" removed, if any. -
Set query to the empty string.
-
Basic URL parse input with url as url, query state as state override, and the associated query encoding as encoding override.
-
Set query object’s list to the result of parsing input.
-
Run query object’s update steps.
The update steps of query object are run to ensure all url objects remain synchronized.
The searchParams
attribute’s
getter must return the query object.
The searchParams
attribute’s
setter must run these steps:
-
Let object be the given value.
-
Remove the context object from query object’s list of url objects.
-
Append the context object to object’s list of url objects.
-
Set query object to object.
-
Set query to the serialization of the query object’s list.
-
Run the pre-update steps.
The hash
attribute’s
getter must run these steps:
-
If url is null, or its fragment is either null or the empty string, return the empty string.
-
Return "
#
", followed by fragment.
The hash
attribute’s setter must run these
steps:
-
If url is null, or its scheme is "
javascript
", terminate these steps. -
If the given value is the empty string, set fragment to null, run the pre-update steps, and terminate these steps.
-
Let input be the given value with a single leading "
#
" removed, if any. -
Set fragment to the empty string.
-
Basic URL parse input with url as url and fragment state as state override.
-
Run the pre-update steps.
6.4. Interface URLSearchParams
[Constructor(optional (USVString or URLSearchParams) init = ""), Exposed=(Window,Worker)] interface URLSearchParams { void append(USVString name, USVString value); void delete(USVString name); USVString? get(USVString name); sequence<USVString> getAll(USVString name); boolean has(USVString name); void set(USVString name, USVString value); iterable<USVString, USVString>; stringifier; };
A URLSearchParams
object has an associated
list of name-value pairs, which is initially
empty.
A URLSearchParams
object has an associated list of zero or more
url objects, which is initially empty.
URLSearchParams
objects always use utf-8 as encoding,
despite the existence of concepts such as
query encoding. This is to
encourage developers to migrate towards
utf-8, which they really ought to
have done a long time ago now.
To create a
new URLSearchParams
object,
optionally using init, run these steps:
-
Let query be a new
URLSearchParams
object. -
If init is a string, set query’s list to the result of parsing init.
-
If init is a
URLSearchParams
object, set query’s list to a copy of init’s list. -
Return query.
A URLSearchParams
object’s
update steps are to run these steps for
each associated url object
urlObject, in order:
-
Set urlObject’s url’s query to the serialization of
URLSearchParams
object’s list. -
Run urlObject’s pre-update steps.
The
URLSearchParams(init)
constructor, when invoked, must return a
new URLSearchParams
object
using init if given.
The
append(name, value)
method, when invoked, must run these steps:
-
Append a new name-value pair whose name is name and value is value, to list.
-
Run the update steps.
The
delete(name)
method, when invoked, must run these steps:
-
Remove all name-value pairs whose name is name from list.
-
Run the update steps.
The
get(name)
method, when invoked, must return the value of the first name-value pair whose name is
name in list, and null if
there is no such pair.
The
getAll(name)
method, when invoked, must return the values of all name-value pairs whose name is
name, in list,
in list order, and the empty sequence otherwise.
The
set(name, value)
method, when invoked, must run these steps:
-
If there are any name-value pairs whose name is name, in list, set the value of the first such name-value pair to value and remove the others.
-
Otherwise, append a new name-value pair whose name is name and value is value, to list.
-
Run the update steps.
The
has(name)
method, when invoked, must return true if there is a name-value pair whose name is
name in list, and false
otherwise.
The value pairs to iterate over are the list name-value pairs with the key being the name and the value being the value.
The stringification behavior must return the
serialization of the
URLSearchParams
object’s
list.
6.5. URL APIs elsewhere
A standard that exposes URLs, should expose the
URL as a string (by serializing an internal
URL). A standard should not expose a URL using a
URL
object. URL
objects are
meant for URL manipulation. In IDL the USVString type should be used.
The higher-level notion here is that values are to be exposed as immutable data structures.
If a standard decides to use a variant of the name "URL" for a feature it defines, it should name such a feature "url" (i.e. lowercase and with an "l" at the end). Names such as "URL", "URI", and "IRI" should not be used. However, if the name is a compound, "URL" (i.e. uppercase) is preferred, e.g. "newURL" and "oldURL".
The EventSource
and
HashChangeEvent
interfaces in HTML are examples of
proper naming. [HTML]
Acknowledgments
There have been a lot of people that have helped make URLs more interoperable over the years and thereby furthered the goals of this standard. Likewise many people have helped making this standard what it is today.
With that, many thanks to Adam Barth, Albert Wiersch, Alexandre Morgaut, Arkadiusz Michalski, Behnam Esfahbod, Bobby Holley, Boris Zbarsky, Brandon Ross, Chris Rebert, Dan Appelquist, Daniel Bratell, David Håsäther, David Sheets, David Singer, David Walp, Erik Arvidsson, Gavin Carothers, Geoff Richards, Glenn Maynard, Henri Sivonen, Ian Hickson, James Graham, James Manger, James Ross, Joshua Bell, Jxck, Kevin Grandon, Larry Masinter, Mark Davis, Marcos Cáceres, Martin Dürst, Mathias Bynens, Michael Peick, Michael™ Smith, Michel Suignard, Peter Occil, Rodney Rehm, Roy Fielding, Santiago M. Mola, Sebastian Mayr, Simon Pieters, Simon Sapin, Stuart Cook, Sven Uhlig, Tab Atkins, Tantek Çelik, Tim Berners-Lee, Tomek Wytrębowicz, Valentin Gosu, Vyacheslav Matva, and 成瀬ゆい (Yui Naruse) for being awesome!
This standard is written by Anne van Kesteren (Mozilla<EMAIL_ADDRESS>and Sam Ruby (IBM, rubys@intertwingly.net).
Per CC0, to the extent possible under law, the editors have waived all copyright and related or neighboring rights to this work.


Module jumper.core.path
The path
class.
The path class represents a path from a start
location to a goal
.
An instance from this class would be a result of a request addressed to pathfinder:getPath
.
A path is basically a set of nodes
, aligned in a specific order, defining a way to follow for moving agents.
Info:
- Copyright: 2012-2013
- License: MIT
- Author: Roland Yonaba
Functions
| path:new () | Inits a new path object. |
| path:iter () | Iterates on each single node along a path . |
| path:nodes () | Iterates on each single node along a path . |
| path:getLength () | Evaluates the path length |
| path:fill () | Path filling function. |
| path:filter () | Path compression. |
Tables
| path | The path class |
Functions
- path:new ()
-
Inits a new path object.
Returns:
- path:iter ()
-
Iterates on each single node along a path . At each step of iteration,
returns a node and plus a count value. Aliased as path:nodes
Returns:
see also:
- path:nodes ()
-
Iterates on each single node along a path . At each step of iteration,
returns a node and plus a count value. Aliased for path:iter
Returns:
see also:
- path:getLength ()
-
Evaluates the path length
Returns:
-
number
the path length
- path:fill ()
-
Path filling function. Interpolates between non contiguous locations along a path
to build a fully continuous path . This maybe useful when using
Jump Point Search
finder. Does the opposite of path:filtersee also:
- path:filter ()
-
Path compression. Given a path , eliminates useless nodes to return a lighter path . Does
the opposite of path:fill
see also:
Tables
- path
- The path class


The Pet Adoption Web Server was created to allow animal shelters, animal foster homes, volunteers and customers to connect through a simple website where customers can easily browse and find nearby shelters or fosterhomes to adopt pets.
You should include links to each of the following Google Docs: Requirements, Design, Implementation Plan.


A simple and fast way to create a data region in the Apache Geode cache is to use the gfsh
command-line tool.
Before you start, configure your Cache
or ClientCache
and determine the region shortcut and other attributes settings your region needs.
Region creation is subject to attribute consistency checks, both internal to the cache and, if the region is not local, between all caches where the region is defined. The requirements for consistency between region attributes are detailed in the online Java API documentation.
Start a
gfsh
prompt.Connect to a server that is currently acting as a JMX Manager node.
Enter the
create region
command providing any desired region attributes as arguments. For example:pre gfsh>create region --name=region1 --type=REPLICATE
Add data into the region by using the import data command or put gfsh command.
After you modify data in the region you can use the export data command to generate a snapshot of the current region’s data for later use.
Export the configuration files of your server so that you can save your region’s configuration and recreate the region with the same attributes the next time you start up your cache server. See export config for details.
Note: The cluster configuration service, which is enabled by default, automatically saves the configuration on the locators in the distributed system. After you use the gfsh create region command, any new servers that you start that attach to the same locator receive the same configuration. You can also create alternate configurations within a distributed system by specifying a group when creating the region and starting servers. See Overview of the Cluster Configuration Service.


6:00am - 8:00pm
123 Pike st
6:00am - 8:00pm
By the cinnabon!
6:00am - 8:00pm
In the Armory
6:00am - 8:00pm
234 Broadway
6:00am - 8:00pm
Right on the beach!
Every purchase you make goes to help save salmon habitats.
$100.00


Dragnnorr is a leading game company which is renowned to produce remarkable games
Dragnnorr is not just a development company, but a publisher too! We publish idie games developed by you!
Contact for publishing your game
Want to publish you game? Contact us, and after a look on your game, er'll publish it.
Games published by usDragnnor Inc.


| Request type |
Response |
Description |
| register |
ok |
Registration was successful |
| {error, missing_fields} |
Fields missing in the request |
| {error, not_allowed} |
Registration is not allowed |
| {error, exists} |
Movie already exists |
| {error, Error} |
Registration failed |
| reserve |
ok |
Reservation was successful |
| {error, missing_fields} |
Fields missing in the request |
| {error, not_exists} |
Movie was not registered |
| {error, not_allowed} |
Reservation is not allowed |
| {error, not_available} | Seat not available for movie |
| {error, Error} | Reservation failed |
| retrieve |
{ok, |
Retrieval was successful |
| {"imdbId": "tt0111161", | IMDB movie identifier |
| "screenId": "screen_123456", | Externally managed identifier |
| "movieTitle": "The Movie", | Movie title
|
| "availableSeats": 100, | Total seats available |
| "reservedSeats": 50 | Total seats reserved |
| } | |
| } | |
| {error, missing_fields} | Fields missing in the request |
| {error, not_exists} | Movie was not registered |
| {error, not_allowed} | Retrieval is not allowed |
| {error, Error} | Retrieval failed |


Welcome to Vending Vote
Over half of the items in the vending machines on campus are liked by absolutely no one. Based on what’s left in
the vending machine at the end of the day, it’s clear to every student and the staff who restocks the vending
machine what sells and what doesn’t. Unfortunately, making changes to the vending machine will be at best,
random, without input from the students themselves.
Introducing Vending Vote: the democratic solution for UH Manoa students to get their favorite items inside of
the vending machine. Staff will no longer be guessing as to what next hot item they should be putting for the
week, now students will help the staff decide. Students who create an account in Vending Vote will participate
in a monthly “voting game."


YaaS Bite: Handling risky connections with Hystrix
When the network problem is active, the nethod invoked by both riskyConnection and veryRiskyConnection takes 15 seconds to copmlete - an unacceptable user experience.
One endpoint wraps this method with hystrix to limit the response time to 2 seconds, the other not.
Toggle Simulated Network/Service Problem @ /toggleProblem
Simulating Network Problem Inactive
Simulating Network Problem Active
Ping the service @ /ping
When the network problem is
Call Risky Connection protected by Hystrix @ /riskyConnection
Call Risky Connection unprotected by Hystrix @ /veryRiskyConnection
Response:
{{rd|json}}
{{errorMessage|json}}


--- layout: default title: News --- {% for post in paginator.posts %}
{{ post.excerpt }} -- read more


GDB to LLDB Command Map
Below is a table of GDB commands with the LLDB counterparts. The built in GDB-compatibility aliases in LLDB are also listed. The full lldb command names are often long, but any unique short form can be used. Instead of "breakpoint set", "br se" is also acceptable.
Execution Commands
| GDB | LLDB |
| Launch a process no arguments. |
(gdb) run (gdb) r |
(lldb) process launch (lldb) run (lldb) r |
Launch a process with arguments <args> . |
(gdb) run <args> (gdb) r <args> |
(lldb) process launch -- <args> (lldb) r <args> |
Launch a process for with arguments a.out 1 2 3 without having to supply the args every time. |
% gdb --args a.out 1 2 3 (gdb) run ... (gdb) run ... |
% lldb -- a.out 1 2 3 (lldb) run ... (lldb) run ... |
| Or: |
(gdb) set args 1 2 3 (gdb) run ... (gdb) run ... |
(lldb) settings set target.run-args 1 2 3 (lldb) run ... (lldb) run ... |
| Launch a process with arguments in new terminal window (Mac OS X only). |
(lldb) process launch --tty -- <args> (lldb) pro la -t -- <args> |
| Launch a process with arguments in existing terminal |
(lldb) process launch --tty=/dev/ttys006 -- <args> (lldb) pro la -t/dev/ttys006 -- <args> |
| Set environment variables for process before launching. |
(gdb) set env DEBUG 1 |
(lldb) settings set target.env-vars DEBUG=1 (lldb) set se target.env-vars DEBUG=1 (lldb) env DEBUG=1 |
| Show the arguments that will be or were passed to the program when run. |
(gdb) show args Argument list to give program being debugged when it is started is "1 2 3". |
(lldb) settings show target.run-args target.run-args (array of strings) = [0]: "1" [1]: "2" [2]: "3" |
| Set environment variables for process and launch process in one command. |
(lldb) process launch -v DEBUG=1 |
| Attach to a process with process ID 123. | |
| (gdb) attach 123 |
(lldb) process attach --pid 123 (lldb) attach -p 123 |
| Attach to a process named "a.out". | |
| (gdb) attach a.out |
(lldb) process attach --name a.out (lldb) pro at -n a.out |
| Wait for a process named "a.out" to launch and attach. | |
| (gdb) attach -waitfor a.out |
(lldb) process attach --name a.out --waitfor (lldb) pro at -n a.out -w |
| Attach to a remote gdb protocol server running on system "eorgadd", port 8000. | |
| (gdb) target remote eorgadd:8000 | (lldb) gdb-remote eorgadd:8000 |
| Attach to a remote gdb protocol server running on the local system, port 8000. | |
| (gdb) target remote localhost:8000 | (lldb) gdb-remote 8000 |
| Attach to a Darwin kernel in kdp mode on system "eorgadd". | |
| (gdb) kdp-reattach eorgadd | (lldb) kdp-remote eorgadd |
| Do a source level single step in the currently selected thread. | |
|
(gdb) step (gdb) s |
(lldb) thread step-in (lldb) step (lldb) s |
| Do a source level single step over in the currently selected thread. | |
|
(gdb) next (gdb) n |
(lldb) thread step-over (lldb) next (lldb) n |
| Do an instruction level single step in the currently selected thread. | |
|
(gdb) stepi (gdb) si |
(lldb) thread step-inst (lldb) si |
| Do an instruction level single step over in the currently selected thread. | |
|
(gdb) nexti (gdb) ni |
(lldb) thread step-inst-over (lldb) ni |
| Step out of the currently selected frame. | |
|
(gdb) finish |
(lldb) thread step-out (lldb) finish |
| Return immediately from the currently selected frame, with an optional return value. | |
|
(gdb) return <RETURN EXPRESSION> |
(lldb) thread return <RETURN EXPRESSION> |
| Backtrace and disassemble every time you stop. | |
|
(lldb) target stop-hook add Enter your stop hook command(s). Type 'DONE' to end. > bt > disassemble --pc > DONE Stop hook #1 added. |
Breakpoint Commands
| GDB | LLDB |
| Set a breakpoint at all functions named main. | |
| (gdb) break main |
(lldb) breakpoint set --name main (lldb) br s -n main (lldb) b main |
| Set a breakpoint in file test.c at line 12. | |
| (gdb) break test.c:12 |
(lldb) breakpoint set --file test.c --line 12 (lldb) br s -f test.c -l 12 (lldb) b test.c:12 |
| Set a breakpoint at all C++ methods whose basename is main. | |
|
(gdb) break main (Hope that there are no C funtions named main). |
(lldb) breakpoint set --method main (lldb) br s -M main |
| Set a breakpoint at and object C function: -[NSString stringWithFormat:]. | |
|
(gdb) break -[NSString stringWithFormat:] |
(lldb) breakpoint set --name "-[NSString stringWithFormat:]" (lldb) b -[NSString stringWithFormat:] |
| Set a breakpoint at all Objective C methods whose selector is count. | |
|
(gdb) break count (Hope that there are no C or C++ funtions named count). |
(lldb) breakpoint set --selector count (lldb) br s -S count |
| Set a breakpoint by regular expression on function name. | |
|
(gdb) rbreak regular-expression |
(lldb) breakpoint set --func-regex regular-expression (lldb) br s -r regular-expression |
| Ensure that breakpoints by file and line work for #included .c/.cpp/.m files. | |
|
(gdb) b foo.c:12 |
(lldb) settings set target.inline-breakpoint-strategy always (lldb) br s -f foo.c -l 12 |
| Set a breakpoint by regular expression on source file contents. | |
|
(gdb) shell grep -e -n pattern source-file (gdb) break source-file:CopyLineNumbers |
(lldb) breakpoint set --source-pattern regular-expression --file SourceFile (lldb) br s -p regular-expression -f file |
| List all breakpoints. | |
|
(gdb) info break |
(lldb) breakpoint list (lldb) br l |
| Delete a breakpoint. | |
|
(gdb) delete 1 |
(lldb) breakpoint delete 1 (lldb) br del 1 |
Watchpoint Commands
| GDB | LLDB |
| Set a watchpoint on a variable when it is written to. | |
| (gdb) watch global_var |
(lldb) watchpoint set variable global_var (lldb) wa s v global_var |
| Set a watchpoint on a memory location when it is written into. The size of the region to watch for defaults to the pointer size if no '-x byte_size' is specified. This command takes raw input, evaluated as an expression returning an unsigned integer pointing to the start of the region, after the '--' option terminator. | |
| (gdb) watch -location g_char_ptr |
(lldb) watchpoint set expression -- my_ptr (lldb) wa s e -- my_ptr |
| Set a condition on a watchpoint. | |
|
(lldb) watch set var global (lldb) watchpoint modify -c '(global==5)' (lldb) c ... (lldb) bt * thread #1: tid = 0x1c03, 0x0000000100000ef5 a.out`modify + 21 at main.cpp:16, stop reason = watchpoint 1 frame #0: 0x0000000100000ef5 a.out`modify + 21 at main.cpp:16 frame #1: 0x0000000100000eac a.out`main + 108 at main.cpp:25 frame #2: 0x00007fff8ac9c7e1 libdyld.dylib`start + 1 (lldb) frame var global (int32_t) global = 5 |
|
| List all watchpoints. | |
|
(gdb) info break |
(lldb) watchpoint list (lldb) watch l |
| Delete a watchpoint. | |
|
(gdb) delete 1 |
(lldb) watchpoint delete 1 (lldb) watch del 1 |
Examining Variables
| GDB | LLDB |
| Show the arguments and local variables for the current frame. | |
|
(gdb) info args and (gdb) info locals |
(lldb) frame variable (lldb) fr v |
| Show the local variables for the current frame. | |
|
(gdb) info locals |
(lldb) frame variable --no-args (lldb) fr v -a |
| Show the contents of local variable "bar". | |
|
(gdb) p bar |
(lldb) frame variable bar (lldb) fr v bar (lldb) p bar |
| Show the contents of local variable "bar" formatted as hex. | |
|
(gdb) p/x bar |
(lldb) frame variable --format x bar (lldb) fr v -f x bar |
| Show the contents of global variable "baz". | |
|
(gdb) p baz |
(lldb) target variable baz (lldb) ta v baz |
| Show the global/static variables defined in the current source file. | |
|
n/a |
(lldb) target variable (lldb) ta v |
| Display a the variable "argc" and "argv" every time you stop. | |
|
(gdb) display argc (gdb) display argv |
(lldb) target stop-hook add --one-liner "frame variable argc argv" (lldb) ta st a -o "fr v argc argv" (lldb) display argc (lldb) display argv |
| Display a the variable "argc" and "argv" only when you stop in the function named main. | |
|
(lldb) target stop-hook add --name main --one-liner "frame variable argc argv" (lldb) ta st a -n main -o "fr v argc argv" |
|
| Display the variable "*this" only when you stop in c class named MyClass. | |
|
(lldb) target stop-hook add --classname MyClass --one-liner "frame variable *this" (lldb) ta st a -c MyClass -o "fr v *this" |
Evaluating expressions
| GDB | LLDB |
| Evaluating a generalized expression in the current frame. | |
|
(gdb) print (int) printf ("Print nine: %d.", 4 + 5) or if you don't want to see void returns: (gdb) call (int) printf ("Print nine: %d.", 4 + 5) |
(lldb) expr (int) printf ("Print nine: %d.", 4 + 5) or using the print alias: (lldb) print (int) printf ("Print nine: %d.", 4 + 5) |
| Creating and assigning a value to a convenience variable. | |
|
(gdb) set $foo = 5 (gdb) set variable $foo = 5 or using the print command (gdb) print $foo = 5 or using the call command (gdb) call $foo = 5 and if you want to specify the type of the variable: (gdb) set $foo = (unsigned int) 5 |
In lldb you evaluate a variable declaration expression as you would write it in C: (lldb) expr unsigned int $foo = 5 |
| Printing the ObjC "description" of an object. | |
|
(gdb) po [SomeClass returnAnObject] |
(lldb) expr -o -- [SomeClass returnAnObject] or using the po alias: (lldb) po [SomeClass returnAnObject] |
| Print the dynamic type of the result of an expression. | |
|
(gdb) set print object 1 (gdb) p someCPPObjectPtrOrReference only works for C++ objects. |
(lldb) expr -d 1 -- [SomeClass returnAnObject] (lldb) expr -d 1 -- someCPPObjectPtrOrReference or set dynamic type printing to be the default: (lldb) settings set target.prefer-dynamic run-target |
| Calling a function so you can stop at a breakpoint in the function. | |
|
(gdb) set unwindonsignal 0 (gdb) p function_with_a_breakpoint() |
(lldb) expr -i 0 -- function_with_a_breakpoint() |
| Calling a function that crashes, and stopping when the function crashes. | |
|
(gdb) set unwindonsignal 0 (gdb) p function_which_crashes() |
(lldb) expr -u 0 -- function_which_crashes() |
Examining Thread State
| GDB | LLDB |
| Show the stack backtrace for the current thread. | |
|
(gdb) bt |
(lldb) thread backtrace (lldb) bt |
| Show the stack backtraces for all threads. | |
| (gdb) thread apply all bt |
(lldb) thread backtrace all (lldb) bt all |
| Backtrace the first five frames of the current thread. | |
| (gdb) bt 5 |
(lldb) thread backtrace -c 5 (lldb) bt 5 (lldb-169 and later) (lldb) bt -c 5 (lldb-168 and earlier) |
| Select a different stack frame by index for the current thread. | |
| (gdb) frame 12 |
(lldb) frame select 12 (lldb) fr s 12 (lldb) f 12 |
| List information about the currently selected frame in the current thread. | |
|
(lldb) frame info |
|
| Select the stack frame that called the current stack frame. | |
| (gdb) up |
(lldb) up (lldb) frame select --relative=1 |
| Select the stack frame that is called by the current stack frame. | |
| (gdb) down |
(lldb) down (lldb) frame select --relative=-1 (lldb) fr s -r-1 |
| Select a different stack frame using a relative offset. | |
|
(gdb) up 2 (gdb) down 3 |
(lldb) frame select --relative 2 (lldb) fr s -r2 (lldb) frame select --relative -3 (lldb) fr s -r-3 |
| Show the general purpose registers for the current thread. | |
|
(gdb) info registers |
(lldb) register read |
| Write a new decimal value '123' to the current thread register 'rax'. | |
|
(gdb) p $rax = 123 |
(lldb) register write rax 123 |
| Skip 8 bytes ahead of the current program counter (instruction pointer). Note that we use backticks to evaluate an expression and insert the scalar result in LLDB. | |
|
(gdb) jump *$pc+8 |
(lldb) register write pc `$pc+8` |
| Show the general purpose registers for the current thread formatted as signed decimal. LLDB tries to use the same format characters as printf(3) when possible. Type "help format" to see the full list of format specifiers. | |
|
(lldb) register read --format i (lldb) re r -f i LLDB now supports the GDB shorthand format syntax but there can't be space after the command: (lldb) register read/d |
|
| Show all registers in all register sets for the current thread. | |
|
(gdb) info all-registers |
(lldb) register read --all (lldb) re r -a |
| Show the values for the registers named "rax", "rsp" and "rbp" in the current thread. | |
|
(gdb) info all-registers rax rsp rbp |
(lldb) register read rax rsp rbp |
| Show the values for the register named "rax" in the current thread formatted as binary. | |
|
(gdb) p/t $rax |
(lldb) register read --format binary rax (lldb) re r -f b rax LLDB now supports the GDB shorthand format syntax but there can't be space after the command: (lldb) register read/t rax (lldb) p/t $rax |
| Read memory from address 0xbffff3c0 and show 4 hex uint32_t values. | |
|
(gdb) x/4xw 0xbffff3c0 |
(lldb) memory read --size 4 --format x --count 4 0xbffff3c0 (lldb) me r -s4 -fx -c4 0xbffff3c0 (lldb) x -s4 -fx -c4 0xbffff3c0 LLDB now supports the GDB shorthand format syntax but there can't be space after the command: (lldb) memory read/4xw 0xbffff3c0 (lldb) x/4xw 0xbffff3c0 (lldb) memory read --gdb-format 4xw 0xbffff3c0 |
| Read memory starting at the expression "argv[0]". | |
|
(gdb) x argv[0] |
(lldb) memory read `argv[0]` NOTE: any command can inline a scalar expression result (as long as the target is stopped) using backticks around any expression: (lldb) memory read --size `sizeof(int)` `argv[0]` |
| Read 512 bytes of memory from address 0xbffff3c0 and save results to a local file as text. | |
|
(gdb) set logging on (gdb) set logging file /tmp/mem.txt (gdb) x/512bx 0xbffff3c0 (gdb) set logging off |
(lldb) memory read --outfile /tmp/mem.txt --count 512 0xbffff3c0 (lldb) me r -o/tmp/mem.txt -c512 0xbffff3c0 (lldb) x/512bx -o/tmp/mem.txt 0xbffff3c0 |
| Save binary memory data starting at 0x1000 and ending at 0x2000 to a file. | |
| (gdb) dump memory /tmp/mem.bin 0x1000 0x2000 |
(lldb) memory read --outfile /tmp/mem.bin --binary 0x1000 0x1200 (lldb) me r -o /tmp/mem.bin -b 0x1000 0x1200 |
| Get information about a specific heap allocation (available on Mac OS X only). | |
| (gdb) info malloc 0x10010d680 |
(lldb) command script import lldb.macosx.heap (lldb) process launch --environment MallocStackLogging=1 -- [ARGS] (lldb) malloc_info --stack-history 0x10010d680 |
| Get information about a specific heap allocation and cast the result to any dynamic type that can be deduced (available on Mac OS X only) | |
|
(lldb) command script import lldb.macosx.heap (lldb) malloc_info --type 0x10010d680 |
|
| Find all heap blocks that contain a pointer specified by an expression EXPR (available on Mac OS X only). | |
|
(lldb) command script import lldb.macosx.heap (lldb) ptr_refs EXPR |
|
| Find all heap blocks that contain a C string anywhere in the block (available on Mac OS X only). | |
|
(lldb) command script import lldb.macosx.heap (lldb) cstr_refs CSTRING |
|
| Disassemble the current function for the current frame. | |
| (gdb) disassemble |
(lldb) disassemble --frame (lldb) di -f |
| Disassemble any functions named main. | |
| (gdb) disassemble main |
(lldb) disassemble --name main (lldb) di -n main |
| Disassemble an address range. | |
| (gdb) disassemble 0x1eb8 0x1ec3 |
(lldb) disassemble --start-address 0x1eb8 --end-address 0x1ec3 (lldb) di -s 0x1eb8 -e 0x1ec3 |
| Disassemble 20 instructions from a given address. | |
| (gdb) x/20i 0x1eb8 |
(lldb) disassemble --start-address 0x1eb8 --count 20 (lldb) di -s 0x1eb8 -c 20 |
| Show mixed source and disassembly for the current function for the current frame. | |
| n/a |
(lldb) disassemble --frame --mixed (lldb) di -f -m |
| Disassemble the current function for the current frame and show the opcode bytes. | |
| n/a |
(lldb) disassemble --frame --bytes (lldb) di -f -b |
| Disassemble the current source line for the current frame. | |
| n/a |
(lldb) disassemble --line (lldb) di -l |
Executable and Shared Library Query Commands
| GDB | LLDB |
| List the main executable and all dependent shared libraries. | |
|
(gdb) info shared |
(lldb) image list |
| Look up information for a raw address in the executable or any shared libraries. | |
|
(gdb) info symbol 0x1ec4 |
(lldb) image lookup --address 0x1ec4 (lldb) im loo -a 0x1ec4 |
| Look up functions matching a regular expression in a binary. | |
|
(gdb) info function <FUNC_REGEX> |
This one finds debug symbols: (lldb) image lookup -r -n <FUNC_REGEX> This one finds non-debug symbols: (lldb) image lookup -r -s <FUNC_REGEX> Provide a list of binaries as arguments to limit the search. |
| Find full souce line information. | |
|
(gdb) info line 0x1ec4 |
This one is a bit messy at present. Do: (lldb) image lookup -v --address 0x1ec4 and look for the LineEntry line, which will have the full source path and line range information. |
| Look up information for an address in a.out only. | |
|
(lldb) image lookup --address 0x1ec4 a.out (lldb) im loo -a 0x1ec4 a.out |
|
Look up information for for a type Point by name. | |
|
(gdb) ptype Point |
(lldb) image lookup --type Point (lldb) im loo -t Point |
| Dump all sections from the main executable and any shared libraries. | |
|
(gdb) maintenance info sections |
(lldb) image dump sections |
| Dump all sections in the a.out module. | |
|
(lldb) image dump sections a.out |
|
| Dump all symbols from the main executable and any shared libraries. | |
|
(lldb) image dump symtab |
|
| Dump all symbols in a.out and liba.so. | |
|
(lldb) image dump symtab a.out liba.so |
Miscellaneous
| GDB | LLDB |
| Echo text to the screen. | |
|
(gdb) echo Here is some text\n |
(lldb) script print "Here is some text" |
| Remap source file pathnames for the debug session. If your source files are no longer located in the same location as when the program was built --- maybe the program was built on a different computer --- you need to tell the debugger how to find the sources at their local file path instead of the build system's file path. | |
|
(gdb) set pathname-substitutions /buildbot/path /my/path |
(lldb) settings set target.source-map /buildbot/path /my/path |
| Supply a catchall directory to search for source files in. | |
|
(gdb) directory /my/path |
(No equivalent command - use the source-map instead.) |


Networking Virtual Machines
Sean Robinson, Jacob Ward, and Tyler Mumford
Questions:
Define "virtual machine"
Define "server"
What type of software is Apache?
What command would connect via ssh to the host "test.example.com" as user "john"?
What advantages do virtual machines offer over physical hardware?


Select category :
I'm scanning the repository. This can take seconds, minutes or even longer based on the quantity of code, commits and branches.


This application helps configuring VIPER base frame position and ground link (TF). Refresh page to start all over again.
Viper IP:
A. Connect to the VIPER.
If connection is successfull you shall start seeing a point cloud.
B. Define VIPER position on the robot.
It's 6 coordinates in Cartesian XYZ for translation and R-XYZ for rotation. Usually the position comes from CAD data of the robot design but in many cases a simple ruler can help measuring approximate values. Keep in mind that VIPER base is the tripod mounting hole at the bottom of the body and distance must be measured to the robot base point (e.g. center point of diff-drive construct).
Below are controls for setting VIPER base exact position. Remember: you can set them any time in dynamic configuration of VIPER ('cvm_description/parent_link'):
A. Click on the ground in pointcloud
At least 3 points are needed on the ground, but more is better. Click several times on the ground and the plane shall be calculated automatically:
B. Alternatively: Enter exact ground coordinates
In the VIPER configuration it's the distance from VIPER base to ground links (TF transforms). The pointcloud-projected laser-scan shall be simulated on the ground.
C. Adjust ground height.
The noise from the pointcloud might produce undesired obstacles in laserscan so it is advised to lift the actual ground plane slightly up (5-10cm). Place small obstacles on the ground and adjust the plane until noise is gone, but the obstacles are still visible
A. Specify point cloud volume
Laserscan is a projection of points onto a ground plane. Specify what points should be taken into account - min/max height with respect to the ground. Also min/max range - a distance from the camera
B. Specify laserscan min/max angles
Laserscan has a field of view specified by min and max angles - make sure that this FOV is not bigger than pointcloud and not too small so that more obstacles can be detected


The World's Largest Selection of Label Shaker Bottles, Pill organizers, and other Promotional Fitness Items. Customize your company logo and colors.
Our shaker bottles comes in various shapes and sizes, and can be custom-designed from over 20 molds.
All shakers are customizable with your logo and any color on lid and body, and we provide free mockups of your shaker prior to sampling.
Our shaker bottles comes in various shapes and sizes, and can be custom-designed from over 20 molds.
All shakers are customizable with your logo and any color on lid and body, and we provide free mockups of your shaker prior to sampling.


Swaran Jain & Associates, a Company Secretary firm was established in Aug, 2002 with an objective of providing Corporate and Business Advisory Services to Corporate Clients so as to enable them to comply with Corporate Laws and adopt practices of good Corporate Governance.
Learn MoreThe firm firmly believes that Corporate Compliance is an event but excellence in Corporate Compliance is spirit. Corporate Excellence can be achieved in every field by giving Proper Directions, Dedication, Determination, Discipline and completion of all Deadlines. The Management Approach of Firm is Dedication, Commitment and Satisfaction of Clients.
A special emphasis has been laid by the Firm to provide services in the areas of Legal Drafting & Documentation, Consulting & Counseling on legal matters & Compliances, handling mergers & demergers, carrying out Due Diligence and Legal Audits, and a host of other related services.


Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim.
There are many variations of passages of Lorem Ipsum available, but the majority have suffered.
There are many variations of passages of Lorem Ipsum available, but the majority have suffered.
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration .
There are many variations of passages of Lorem Ipsum available, but the majority have suffered.
There are many variations of passages of Lorem Ipsum available, but the majority have suffered.
Aenean rutrum, lorem sed cursus tristique, turpis velit ullamcorper ligula, id pretium elit augue in libero. Suspendisse in porttitor orci. Pellentesque vel gravida augue,
when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim.
There are many variations of passages of Lorem Ipsum available, but the majority.
Aenean rutrum, lorem sed cursus tristique, turpis velit ullamcorper ligula, id pretium elit augue in libero. Suspendisse in porttitor orci. Pellentesque vel gravida augue.
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum.
Android App StoreLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim.
Lorem ipsum dolor sit amet, to consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna to liqua.
It is a long established fact that a reader will be dis-tracted by the readable content.
It is a long established fact that a reader will be dis-tracted by the readable content.
It is a long established fact that a reader will be dis-tracted by the readable content.


class: center, middle # Python Short Course ## Part 1: Introduction *Lucas H. Gabrielli* .small[[lucashg@fee.unicamp.br](mailto:lucashg@fee.unicamp.br)] --- # Agenda 1. REPL and scripts 1. Data types 1. Conditionals 1. Functions 1. Loops 1. Classes and objects --- # REPL *Read-eval-print loop* (REPL): interactive Python interpreter ```python >>> 1 + 2 3 >>> 5 / 3 1.6666666666666667 ``` Try out a few operators: * `2 ** 0.5` * `1j ** 2` * `'Hello' + ' World!'` If you don't have local access to Python 3, try https://repl.it/N6pu/latest ??? Prints the return value of the last expression Integer division and modulo Difference between python 2 and 3 regarding division -- IPython (https://ipython.readthedocs.io/): * syntax highlighting * tab completion * easy access to documentation * input history * other *magics* --- # Assigning Variables ```python x = 1 y = 2 z = x + y z ``` -- ```python x = -1 z ``` -- ```python z = z + 3 ``` -- ```python z += 3 ``` -- ```python text = 'word' texts = text + 's' two_text = 2 * a ``` -- ```python vx = vy = 0 ``` --- # Scripts * Text files (usually with the `.py` extension) * Run full programs with or without user interaction * No values are printed by default: use the `print` function ??? Getting help: `help(print)` on the REPL -- Write and run a script with: ```python for i in [0, 1, 2, 3]: print(i) ``` ??? Modify the script to print 0, 2, 4, and 6 -- #### Exercise: Write a script to find the roots of a quadratic polynomial and print them. Try a few different coefficients to understand the limitations of your program. ```python # This line is a comment. Comments are good. # Find the roots of the polynomial P(x) = ax² + bx + c a = 1 b = 5 c = 4 # First calculate Δ: delta = ... ``` --- # Jupyter Notebook Create documents with live code, equations and visualizations straight from the browser. Works with Python, R, Julia, Ruby, Scala... .center[http://jupyter.org/] Jupyter notebooks will be used in Part 2. --- # Data Types * Python has quite powerful and *efficient* built-in data types. * Information about the type can be found with the function `type`: ```python type(1) x = 1 / 2 type(x) ``` --- # Numerical types * bool: `True`, `False` * int: `0`, `-2`, `0x1f`, `0b11`, `0o17` * float: `0.0`, `-0.5`, `1e2`, `-.9` * complex: `1j`, `0.9e-2j` *Feature:* ints do not overflow! ```python >>> 2 **<PHONE_NUMBER>89237316195423570985008687907853269984665640564039457584007913129639936 ``` Type conversion: ```python x = 42 float(x) int(3.1 / 3) complex(3, 0.1) ``` --- layout: true # Sequence types --- ## List: ordered collection ```python a = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7] type(a) ``` -- ```python a[1] ``` -- ```python len(a) a[len(a) - 1] a[-1] ``` -- ```python a[2] = "two" a[3] = -2 * a[0] + a[1] ``` -- ```python a[1:3] a[3:] a[:4] a[1:6:2] ``` ??? Try: ```python a[:] a[::-1] ``` --- ## Tuple: immutable ordered collection ```python b = (1, 1, 2, 3) b[0] = 0 ``` -- ## Operations ```python ['a', 'b', 'c'] + ['d', 'e'] a[:3] + a[4:] ``` -- ```python [1, 2, 3] * 3 ``` ??? ```python [(1, 2)] * 2 ``` -- ```python 0 in b 'one' not in a ``` --- layout: false # Text sequence type ```python a = 'Double quoted "text" in single quotes' b = "Single quoted 'text' in double quotes' ``` ??? Test `'This' is "This"` -- ```python >>> wow = '''Triple ... quoted ... text ... is neat!''' >>> wow 'Triple\nquoted\n text\n is neat!' >>> print(wow) Triple quoted text is neat! ``` --- layout: true # Conditionals --- ```python a = [1, 3, 5] i = 2 if a[i] == 3: print("Found 3") print("Done testing") ``` ??? Use of tabs or spaces to define blocks --- ```python a = [1, 3, 5] i = 2 if a[i] == 3: print("Found 3") else: print("Not a 3") print("Done testing") ``` --- ```python a = [1, 3, 5] i = 2 if a[i] == 3: print("Found 3") elif 3 in a: print("Not a 3, but it is there... somewhere.") else: print("No 3 in a") print("Done testing") ``` -- #### Exercise: Modify your root-finding script to handle degenerate cases, e.g. `a = 0`. ??? What if `a = b = 0`? --- layout: true # Functions --- ```python def greet(name): print(name) s = 'Hello ' + name return s greeting = greet('World') print(greeting) ``` --- ```python def greet(name='Kitty'): print(name) s = 'Hello ' + name return s greeting = greet('World') print(greeting) print(greet()) ``` --- ```python def greet(name='Kitty'): print(name) s = 'Hello ' + name return s greeting = greet('World') print(greeting) print(greet()) ``` #### Exercise: Define a function to find the roots of a quadratic polynomial. It should return all solutions in a sequence. ```python def roots(a, b, c): # Return the roots of the polynomial P(x) = ax² + bx + c ... sol = roots(1, 5, 4) print(sol) ``` ??? Well-behaved functions always return the same type. --- layout: false # String formatting ```python a = 1 / 3 b = 2e-3 s = 'a = ' + str(a) + '\nb = ' + str(b) print(s) ``` -- `Format` method ```python 'a = {} | b = {}'.format(a, b) 'b = {1} | a = {0}'.format(a, b) 'a = {0} = {0:.3g} | b = {1} = {1:.1e}'.format(a, b) ``` ??? C-style `printf` formating codes. -- F-strings ```python f'a = {a} | b = {b} | c = {3 * a - b}' ``` ??? ```python f'a = {a:.3g} | b = {b:.1e}' ``` Old-style `%` formating. -- .center[*Now go back and improve your script output!*] --- # Dict: mapping type ```python d = {'one': 1, 'two': 2, 'three': 3} d['one'] d['four'] ``` ??? `'four' in d` -- ```python d['four'] = 4 d[4] = 'four' ``` -- ```python key = [1, 2, 3] d[key] = 'Nope!' ``` ??? Keys must be hashable: tuple works -- Dictionaries are used everywhere internally in Python, so they are memory-efficient and well optimized. --- # Unpacking It's possible to separate the items from a sequence during assignment: ```python a, b = (1, 2) x1, x2 = roots(2, 1, 0) ``` ??? a, b = b, a -- # Function Arguments ```python args = [2, 1, 0] roots(*args) bc = [1, 0] roots(2, *bc) ``` -- ```python roots(2, c=0, b=1) ``` -- ```python kwargs = {'a': 2, 'c': 0} kwargs['b'] = 1 roots(**kwargs) ``` --- # Loops ```python x = 100 while x > 1: print(x) x /= 2 print(f'Exited on {x}') ``` -- ```python a = [1, 2, 4, 8, 16] b = [] for x in a: b.append(2 * x) print(b) ``` -- #### Exercise: Write a function that returns the factorial of a positive integer. ??? Solution with `for` and `range` -- ## Comprehension ```python c = [2 * x for x in range(10)] ``` ??? ```python c = [2 * x for x in range(10) if x % 2 == 0] ``` --- # Collatz Conjecture Let a₀ be any positive integer. The sequence a₁, a₂, ... is constructed as follows: * a
n+1
= a
n
/ 2, if a
n
is even * a
n+1
= 3a
n
+ 1, otherwise The conjecture is that the sequence always reaches the value 1 for any choice of a₀. -- #### Exercise: Create a function `collatzlen(n)` that calculates the number of steps required to reach the end of the sequence (value 1) for a given starting value `n`. Tests: * `collatzlen(1) == 0` * `collatzlen(2) == 1` * `collatzlen(3) == 7` * `collatzlen(4) == 2` * `collatzlen(5) == 5` * `collatzlen(9) == 19` --- # Classes and Objects Classes can be understood as *complex* types. They describe the data and behaviour of their instance objects. In fact, *everything* in Python is an object! To access the attributes of an object we use the "." (dot) operator: ```python s = 'My sample tExT' s.upper() i = s.find('l') s[i:] ``` Use `dir(...)` to list the attributes of any object. ```python dir(s) dir(i) ``` There is no need to name variables to access an objects attributes: ```python (3 - 4j).conjugate() 'Format is {} of my methods'.format('one') ``` --- # Modules Modules contain definitions and statements that can be imported into other programs. Python includes several built-in modules. Look into the documentation before reinventing the wheel. #### Example: Given a list of fruits, pick a random combination with `num` different choices. ```python import random import itertools def fruit_chooser(fruits, num): choices = list(itertools.combinations(fruits, num)) index = random.randint(0, len(choices) - 1) print('The fruits {} were picked among {} possible choices.' .format(choices[index], len(choices))) fruit_list = ['apple', 'banana', 'orange', 'papaya'] fruit_chooser(fruit_list, 2) ``` ??? Check out `turtle` --- # Practice at Home Implement the *Cows and Bulls* game. A secret 4-digit number is randomly chosen with no repeating digits. Each turn the player guesses the number and the computer informs how many digits are correct but in the wrong position (*cows*) and how many are correct and in the right position (*bulls*), until the player guesses the correct number. For example: * Secret number: 9845 * Player guess: 5804 * Reply: 1 bull, 2 cows *Tip:* take a look at the `input` function to ask for the player guess. --- class: center, middle # End of Part 1


Fluidable
A Swift library that allows you to create a custom transition conforming to Fluid Interfaces.
Features & To-Do
- [x] Support
UINavigationControllerDelegate
andUIViewControllerTransitioningDelegate
- [x] Interactive and intrruptible transition with
UIScrollView
,UITableView
, andUICollectionView
- [x] Additional animations for view controllers that can be defined in the delegate method (supports both
UIViewPropertyAnimator
andCore Animation
) - [x] Monitor transition states and progress with delegate methods
- [x] Customizable presentation style (Fluid, Drawer, and Slide)
- [x] Resizable drawer
- [x] Customizable style (rounded corner, shadow, and background effect)
- [x] Customizable animation easing and duration
- [ ] Interact with underlying views like Apple Maps
- [ ] Custom transitions with user-definable plug-ins
- [ ] Support iOS 10
| Fluid | Drawer | Slide |
|---|---|---|
Requirements
- iOS 11.0 or later
- Swift 4.2
Installation
Carthage
Add the following to your Cartfile
and follow these instructions.
github "gumob/Fluidable"
CocoaPods
To integrate Fluidable into your project, add the following to your Podfile
.
platform :ios, '10.0'
use_frameworks!
pod 'Fluidable'
Example application
Repository contains example sources under Example directory. Structure of the application is simple, but the project contains mutiple case of UI petterns to showcase capabilities of the library.
You can build an example app by choosing FluidableExample
from the Xcode schemes.
Usage
Full documentation is available at https://gumob.github.io/Fluidable/.
You can find more specific implementations by searching the Example sources with `IMPORTANT: 🌊`
.
Custom transition using UIViewControllerTransitioningDelegate
1) Import Fluidable
framework to your project files:
import UIKit
import Fluidable
2) Initialze Fluidable
framework in AppDelegate
:
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FluidableInit()
return true
}
}
3) Conform to Fluidable
protocol in the source view controller:
class RootViewController: UICollectionViewController, Fluidable {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.fluidDelegate = self
}
}
4) Conform to FluidTransitionSourceConfigurationDelegate
and FluidTransitionSourceActionDelegate
protocols in the source view controller:
extension RootViewController: FluidTransitionSourceConfigurationDelegate {
/* Implement delegate methods */
}
extension RootViewController: FluidTransitionSourceActionDelegate {
/* Implement delegate methods */
}
5) Conform to Fluidable
protocol in the destination view controller:
class TransitionScrollViewController: TransitionBaseViewController, Fluidable {
var fluidableTransitionDelegate: FluidViewControllerTransitioningDelegate = FluidViewControllerTransitioningDelegate()
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.transitioningDelegate = self.fluidableTransitionDelegate
self.fluidDelegate = self
}
}
6) Conform to FluidTransitionDestinationConfigurationDelegate
and FluidTransitionDestinationActionDelegate
protocols in the destination view controller:
extension TransitionScrollViewController: FluidTransitionDestinationConfigurationDelegate {
/* Implement delegate methods */
}
extension TransitionScrollViewController: FluidTransitionDestinationActionDelegate {
/* Implement delegate methods */
}
Custom transition using UINavigationControllerDelegate
1) Import Fluidable
framework to your project files:
import UIKit
import Fluidable
2) Initialze Fluidable
framework in AppDelegate
:
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FluidableInit()
return true
}
}
3) Conform to Fluidable
protocol in the source view controller:
class RootViewController: UICollectionViewController, Fluidable {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.fluidDelegate = self
}
}
4) Conform to FluidTransitionSourceConfigurationDelegate
and FluidTransitionSourceActionDelegate
protocols in the source view controller:
extension RootViewController: FluidTransitionSourceConfigurationDelegate {
/* Implement delegate methods */
}
extension RootViewController: FluidTransitionSourceActionDelegate {
/* Implement delegate methods */
}
5) Conform to Fluidable
protocol in the destination view controller:
class TransitionScrollViewController: TransitionBaseViewController, Fluidable {
var fluidableTransitionDelegate: FluidViewControllerTransitioningDelegate = FluidViewControllerTransitioningDelegate()
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.transitioningDelegate = self.fluidableTransitionDelegate
self.fluidDelegate = self
}
}
6) Conform to FluidTransitionDestinationConfigurationDelegate
and FluidTransitionDestinationActionDelegate
protocols in the destination view controller:
extension TransitionScrollViewController: FluidTransitionDestinationConfigurationDelegate {
/* Implement delegate methods */
}
extension TransitionScrollViewController: FluidTransitionDestinationActionDelegate {
/* Implement delegate methods */
}
Resizable drawer
The FluidResizableTransitionDelegate
is available for only bottom drawer.
1) Conform to FluidResizableTransitionDelegate
protocol in the destination view controller:
class TransitionScrollViewController: TransitionBaseViewController, Fluidable, FluidResizable {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.transitioningDelegate = self.fluidableTransitionDelegate
self.fluidDelegate = self
self.fluidResizableDelegate = self
}
}
extension TransitionScrollViewController: FluidResizableTransitionDelegate {
func transitionShouldPerformResizing() -> Bool { return true }
func transitionMinimumMarginForResizing() -> CGFloat { return 64 }
func transitionSnapPositionsForResizing() -> [CGFloat]? { return [0.0, 0.5, 1.0] }
func transitionInteractiveResizeDidProgress(state: FluidProgressState, position: CGFloat, info: FluidGestureInfo) {
}
}
Copyright
Fluidable is released under MIT license, which means you can modify it, redistribute it or use it however you like.
All image embedded in the example project are downloaded from Pexels.