diff --git a/doc/stdlib/arrays.rst b/doc/stdlib/arrays.rst index b134a27686d86..644e7bb89ab0d 100644 --- a/doc/stdlib/arrays.rst +++ b/doc/stdlib/arrays.rst @@ -51,7 +51,9 @@ Basic functions .. function:: eachindex(A...) - Creates an iterable object for visiting each index of an AbstractArray "A" in an efficient manner. For array types that have opted into fast linear indexing (like "Array"), this is simply the range "1:length(A)". For other array types, this returns a specialized Cartesian range to efficiently index into the array with indices specified for every dimension. Example for a sparse 2-d array: + Creates an iterable object for visiting each index of an AbstractArray "A" in an efficient manner. For array types that have opted into fast linear indexing (like "Array"), this is simply the range "1:length(A)". For other array types, this returns a specialized Cartesian range to efficiently index into the array with indices specified for every dimension. For other iterables, including strings and dictionaries, this returns an iterator object supporting arbitrary index types (e.g. unevenly spaced or non-integer indices). + + Example for a sparse 2-d array: :: diff --git a/doc/stdlib/base.rst b/doc/stdlib/base.rst index c680710f47c01..f3fbc3fcedf24 100644 --- a/doc/stdlib/base.rst +++ b/doc/stdlib/base.rst @@ -835,10 +835,22 @@ System Alternate syntax for open, where a string-based mode specifier is used instead of the five booleans. The values of "mode" correspond to those from "fopen(3)" or Perl "open", and are equivalent to setting the following boolean groups: - +–––+–––––––––––––––––-+ | r | read | +–––+–––––––––––––––––-+ | r+ | read, write | +–––+–––––––––––––––––-+ | w | write, create, truncate | +–––+–––––––––––––––––-+ | w+ | read, write, create, truncate | +–––+–––––––––––––––––-+ | a | write, create, append | +–––+–––––––––––––––––-+ | a+ | read, write, create, append | +–––+–––––––––––––––––-+ - :: + +------+-----------------------------------+ + | r | read | + +------+-----------------------------------+ + | r+ | read, write | + +------+-----------------------------------+ + | w | write, create, truncate | + +------+-----------------------------------+ + | w+ | read, write, create, truncate | + +------+-----------------------------------+ + | a | write, create, append | + +------+-----------------------------------+ + | a+ | read, write, create, append | + +------+-----------------------------------+ + open(f::function, args...) Apply the function "f" to the result of "open(args...)" and close the resulting file descriptor upon completion. @@ -868,10 +880,22 @@ System Alternate syntax for open, where a string-based mode specifier is used instead of the five booleans. The values of "mode" correspond to those from "fopen(3)" or Perl "open", and are equivalent to setting the following boolean groups: - +–––+–––––––––––––––––-+ | r | read | +–––+–––––––––––––––––-+ | r+ | read, write | +–––+–––––––––––––––––-+ | w | write, create, truncate | +–––+–––––––––––––––––-+ | w+ | read, write, create, truncate | +–––+–––––––––––––––––-+ | a | write, create, append | +–––+–––––––––––––––––-+ | a+ | read, write, create, append | +–––+–––––––––––––––––-+ - :: + +------+-----------------------------------+ + | r | read | + +------+-----------------------------------+ + | r+ | read, write | + +------+-----------------------------------+ + | w | write, create, truncate | + +------+-----------------------------------+ + | w+ | read, write, create, truncate | + +------+-----------------------------------+ + | a | write, create, append | + +------+-----------------------------------+ + | a+ | read, write, create, append | + +------+-----------------------------------+ + open(f::function, args...) Apply the function "f" to the result of "open(args...)" and close the resulting file descriptor upon completion. diff --git a/doc/stdlib/collections.rst b/doc/stdlib/collections.rst index 24ceb54a14caa..0667609dd2a47 100644 --- a/doc/stdlib/collections.rst +++ b/doc/stdlib/collections.rst @@ -1160,7 +1160,7 @@ Given a dictionary ``D``, the syntax ``D[x]`` returns the value of key ``x`` (if .. function:: merge(collection, others...) - Construct a merged collection from the given collections. If necessary, the types of the resulting collection will be promoted to accommodate the types of the merged collections. + Construct a merged collection from the given collections. If necessary, the types of the resulting collection will be promoted to accommodate the types of the merged collections. If the same key is present in another collection, the value for that key will be the value it has in the last collection listed. :: @@ -1169,14 +1169,19 @@ Given a dictionary ``D``, the syntax ``D[x]`` returns the value of key ``x`` (if "bar" => 42.0 "foo" => 0.0 - julia> b = Dict(utf8("baz") => 17, utf8("qux") => 4711) + julia> b = Dict(utf8("baz") => 17, utf8("bar") => 4711) Dict{UTF8String,Int64} with 2 entries: + "bar" => 4711 "baz" => 17 - "qux" => 4711 julia> merge(a, b) - Dict{UTF8String,Float64} with 4 entries: - "qux" => 4711.0 + Dict{UTF8String,Float64} with 3 entries: + "bar" => 4711.0 + "baz" => 17.0 + "foo" => 0.0 + + julia> merge(b, a) + Dict{UTF8String,Float64} with 3 entries: "bar" => 42.0 "baz" => 17.0 "foo" => 0.0 diff --git a/doc/stdlib/dates.rst b/doc/stdlib/dates.rst index f030bc103d17e..ecd898fe5f0d2 100644 --- a/doc/stdlib/dates.rst +++ b/doc/stdlib/dates.rst @@ -81,7 +81,35 @@ alternatively, you could call ``using Dates`` to bring all exported functions in Construct a DateTime type by parsing the "dt" date string following the pattern given in the "format" string. The following codes can be used for constructing format strings: - +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | Code | Matches | Comment | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "y" | 1996, 96 | Returns year of 1996, 0096 | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "m" | 1, 01 | Matches 1 or 2-digit months | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "u" | Jan | Matches abbreviated months according to the "locale" keyword | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "U" | January | Matches full month names according to the "locale" keyword | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "d" | 1, 01 | Matches 1 or 2-digit days | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "H" | 00 | Matches hours | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "M" | 00 | Matches minutes | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "S" | 00 | Matches seconds | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "s" | .500 | Matches milliseconds | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "e" | Mon, Tues | Matches abbreviated days of the week | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "E" | Monday | Matches full name days of the week | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "yyyymmdd" | 19960101 | Matches fixed-width year, month, and day | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ + :: + + +-----------------+-----------+-----------------------------------------------------------------+ + | Code | Matches | Comment | + +-----------------+-----------+-----------------------------------------------------------------+ + | "y" | 1996, 96 | Returns year of 1996, 0096 | + +-----------------+-----------+-----------------------------------------------------------------+ + | "m" | 1, 01 | Matches 1 or 2-digit months | + +-----------------+-----------+-----------------------------------------------------------------+ + | "u" | Jan | Matches abbreviated months according to the "locale" keyword | + +-----------------+-----------+-----------------------------------------------------------------+ + | "U" | January | Matches full month names according to the "locale" keyword | + +-----------------+-----------+-----------------------------------------------------------------+ + | "d" | 1, 01 | Matches 1 or 2-digit days | + +-----------------+-----------+-----------------------------------------------------------------+ + | "H" | 00 | Matches hours | + +-----------------+-----------+-----------------------------------------------------------------+ + | "M" | 00 | Matches minutes | + +-----------------+-----------+-----------------------------------------------------------------+ + | "S" | 00 | Matches seconds | + +-----------------+-----------+-----------------------------------------------------------------+ + | "s" | .500 | Matches milliseconds | + +-----------------+-----------+-----------------------------------------------------------------+ + | "e" | Mon, Tues | Matches abbreviated days of the week | + +-----------------+-----------+-----------------------------------------------------------------+ + | "E" | Monday | Matches full name days of the week | + +-----------------+-----------+-----------------------------------------------------------------+ + | "yyyymmdd" | 19960101 | Matches fixed-width year, month, and day | + +-----------------+-----------+-----------------------------------------------------------------+ All characters not listed above are treated as delimiters between date and time slots. So a "dt" string of "1996-01-15T00:00:00.0" would have a "format" string like "y-m-dTH:M:S.s". @@ -126,7 +154,35 @@ alternatively, you could call ``using Dates`` to bring all exported functions in Construct a DateTime type by parsing the "dt" date string following the pattern given in the "format" string. The following codes can be used for constructing format strings: - +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | Code | Matches | Comment | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "y" | 1996, 96 | Returns year of 1996, 0096 | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "m" | 1, 01 | Matches 1 or 2-digit months | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "u" | Jan | Matches abbreviated months according to the "locale" keyword | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "U" | January | Matches full month names according to the "locale" keyword | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "d" | 1, 01 | Matches 1 or 2-digit days | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "H" | 00 | Matches hours | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "M" | 00 | Matches minutes | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "S" | 00 | Matches seconds | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "s" | .500 | Matches milliseconds | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "e" | Mon, Tues | Matches abbreviated days of the week | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "E" | Monday | Matches full name days of the week | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "yyyymmdd" | 19960101 | Matches fixed-width year, month, and day | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ + :: + + +-----------------+-----------+-----------------------------------------------------------------+ + | Code | Matches | Comment | + +-----------------+-----------+-----------------------------------------------------------------+ + | "y" | 1996, 96 | Returns year of 1996, 0096 | + +-----------------+-----------+-----------------------------------------------------------------+ + | "m" | 1, 01 | Matches 1 or 2-digit months | + +-----------------+-----------+-----------------------------------------------------------------+ + | "u" | Jan | Matches abbreviated months according to the "locale" keyword | + +-----------------+-----------+-----------------------------------------------------------------+ + | "U" | January | Matches full month names according to the "locale" keyword | + +-----------------+-----------+-----------------------------------------------------------------+ + | "d" | 1, 01 | Matches 1 or 2-digit days | + +-----------------+-----------+-----------------------------------------------------------------+ + | "H" | 00 | Matches hours | + +-----------------+-----------+-----------------------------------------------------------------+ + | "M" | 00 | Matches minutes | + +-----------------+-----------+-----------------------------------------------------------------+ + | "S" | 00 | Matches seconds | + +-----------------+-----------+-----------------------------------------------------------------+ + | "s" | .500 | Matches milliseconds | + +-----------------+-----------+-----------------------------------------------------------------+ + | "e" | Mon, Tues | Matches abbreviated days of the week | + +-----------------+-----------+-----------------------------------------------------------------+ + | "E" | Monday | Matches full name days of the week | + +-----------------+-----------+-----------------------------------------------------------------+ + | "yyyymmdd" | 19960101 | Matches fixed-width year, month, and day | + +-----------------+-----------+-----------------------------------------------------------------+ All characters not listed above are treated as delimiters between date and time slots. So a "dt" string of "1996-01-15T00:00:00.0" would have a "format" string like "y-m-dTH:M:S.s". @@ -171,7 +227,35 @@ alternatively, you could call ``using Dates`` to bring all exported functions in Construct a DateTime type by parsing the "dt" date string following the pattern given in the "format" string. The following codes can be used for constructing format strings: - +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | Code | Matches | Comment | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "y" | 1996, 96 | Returns year of 1996, 0096 | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "m" | 1, 01 | Matches 1 or 2-digit months | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "u" | Jan | Matches abbreviated months according to the "locale" keyword | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "U" | January | Matches full month names according to the "locale" keyword | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "d" | 1, 01 | Matches 1 or 2-digit days | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "H" | 00 | Matches hours | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "M" | 00 | Matches minutes | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "S" | 00 | Matches seconds | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "s" | .500 | Matches milliseconds | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "e" | Mon, Tues | Matches abbreviated days of the week | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "E" | Monday | Matches full name days of the week | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "yyyymmdd" | 19960101 | Matches fixed-width year, month, and day | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ + :: + + +-----------------+-----------+-----------------------------------------------------------------+ + | Code | Matches | Comment | + +-----------------+-----------+-----------------------------------------------------------------+ + | "y" | 1996, 96 | Returns year of 1996, 0096 | + +-----------------+-----------+-----------------------------------------------------------------+ + | "m" | 1, 01 | Matches 1 or 2-digit months | + +-----------------+-----------+-----------------------------------------------------------------+ + | "u" | Jan | Matches abbreviated months according to the "locale" keyword | + +-----------------+-----------+-----------------------------------------------------------------+ + | "U" | January | Matches full month names according to the "locale" keyword | + +-----------------+-----------+-----------------------------------------------------------------+ + | "d" | 1, 01 | Matches 1 or 2-digit days | + +-----------------+-----------+-----------------------------------------------------------------+ + | "H" | 00 | Matches hours | + +-----------------+-----------+-----------------------------------------------------------------+ + | "M" | 00 | Matches minutes | + +-----------------+-----------+-----------------------------------------------------------------+ + | "S" | 00 | Matches seconds | + +-----------------+-----------+-----------------------------------------------------------------+ + | "s" | .500 | Matches milliseconds | + +-----------------+-----------+-----------------------------------------------------------------+ + | "e" | Mon, Tues | Matches abbreviated days of the week | + +-----------------+-----------+-----------------------------------------------------------------+ + | "E" | Monday | Matches full name days of the week | + +-----------------+-----------+-----------------------------------------------------------------+ + | "yyyymmdd" | 19960101 | Matches fixed-width year, month, and day | + +-----------------+-----------+-----------------------------------------------------------------+ All characters not listed above are treated as delimiters between date and time slots. So a "dt" string of "1996-01-15T00:00:00.0" would have a "format" string like "y-m-dTH:M:S.s". @@ -216,7 +300,35 @@ alternatively, you could call ``using Dates`` to bring all exported functions in Construct a DateTime type by parsing the "dt" date string following the pattern given in the "format" string. The following codes can be used for constructing format strings: - +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | Code | Matches | Comment | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "y" | 1996, 96 | Returns year of 1996, 0096 | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "m" | 1, 01 | Matches 1 or 2-digit months | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "u" | Jan | Matches abbreviated months according to the "locale" keyword | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "U" | January | Matches full month names according to the "locale" keyword | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "d" | 1, 01 | Matches 1 or 2-digit days | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "H" | 00 | Matches hours | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "M" | 00 | Matches minutes | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "S" | 00 | Matches seconds | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "s" | .500 | Matches milliseconds | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "e" | Mon, Tues | Matches abbreviated days of the week | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "E" | Monday | Matches full name days of the week | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "yyyymmdd" | 19960101 | Matches fixed-width year, month, and day | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ + :: + + +-----------------+-----------+-----------------------------------------------------------------+ + | Code | Matches | Comment | + +-----------------+-----------+-----------------------------------------------------------------+ + | "y" | 1996, 96 | Returns year of 1996, 0096 | + +-----------------+-----------+-----------------------------------------------------------------+ + | "m" | 1, 01 | Matches 1 or 2-digit months | + +-----------------+-----------+-----------------------------------------------------------------+ + | "u" | Jan | Matches abbreviated months according to the "locale" keyword | + +-----------------+-----------+-----------------------------------------------------------------+ + | "U" | January | Matches full month names according to the "locale" keyword | + +-----------------+-----------+-----------------------------------------------------------------+ + | "d" | 1, 01 | Matches 1 or 2-digit days | + +-----------------+-----------+-----------------------------------------------------------------+ + | "H" | 00 | Matches hours | + +-----------------+-----------+-----------------------------------------------------------------+ + | "M" | 00 | Matches minutes | + +-----------------+-----------+-----------------------------------------------------------------+ + | "S" | 00 | Matches seconds | + +-----------------+-----------+-----------------------------------------------------------------+ + | "s" | .500 | Matches milliseconds | + +-----------------+-----------+-----------------------------------------------------------------+ + | "e" | Mon, Tues | Matches abbreviated days of the week | + +-----------------+-----------+-----------------------------------------------------------------+ + | "E" | Monday | Matches full name days of the week | + +-----------------+-----------+-----------------------------------------------------------------+ + | "yyyymmdd" | 19960101 | Matches fixed-width year, month, and day | + +-----------------+-----------+-----------------------------------------------------------------+ All characters not listed above are treated as delimiters between date and time slots. So a "dt" string of "1996-01-15T00:00:00.0" would have a "format" string like "y-m-dTH:M:S.s". @@ -261,7 +373,35 @@ alternatively, you could call ``using Dates`` to bring all exported functions in Construct a DateTime type by parsing the "dt" date string following the pattern given in the "format" string. The following codes can be used for constructing format strings: - +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | Code | Matches | Comment | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "y" | 1996, 96 | Returns year of 1996, 0096 | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "m" | 1, 01 | Matches 1 or 2-digit months | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "u" | Jan | Matches abbreviated months according to the "locale" keyword | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "U" | January | Matches full month names according to the "locale" keyword | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "d" | 1, 01 | Matches 1 or 2-digit days | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "H" | 00 | Matches hours | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "M" | 00 | Matches minutes | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "S" | 00 | Matches seconds | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "s" | .500 | Matches milliseconds | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "e" | Mon, Tues | Matches abbreviated days of the week | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "E" | Monday | Matches full name days of the week | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "yyyymmdd" | 19960101 | Matches fixed-width year, month, and day | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ + :: + + +-----------------+-----------+-----------------------------------------------------------------+ + | Code | Matches | Comment | + +-----------------+-----------+-----------------------------------------------------------------+ + | "y" | 1996, 96 | Returns year of 1996, 0096 | + +-----------------+-----------+-----------------------------------------------------------------+ + | "m" | 1, 01 | Matches 1 or 2-digit months | + +-----------------+-----------+-----------------------------------------------------------------+ + | "u" | Jan | Matches abbreviated months according to the "locale" keyword | + +-----------------+-----------+-----------------------------------------------------------------+ + | "U" | January | Matches full month names according to the "locale" keyword | + +-----------------+-----------+-----------------------------------------------------------------+ + | "d" | 1, 01 | Matches 1 or 2-digit days | + +-----------------+-----------+-----------------------------------------------------------------+ + | "H" | 00 | Matches hours | + +-----------------+-----------+-----------------------------------------------------------------+ + | "M" | 00 | Matches minutes | + +-----------------+-----------+-----------------------------------------------------------------+ + | "S" | 00 | Matches seconds | + +-----------------+-----------+-----------------------------------------------------------------+ + | "s" | .500 | Matches milliseconds | + +-----------------+-----------+-----------------------------------------------------------------+ + | "e" | Mon, Tues | Matches abbreviated days of the week | + +-----------------+-----------+-----------------------------------------------------------------+ + | "E" | Monday | Matches full name days of the week | + +-----------------+-----------+-----------------------------------------------------------------+ + | "yyyymmdd" | 19960101 | Matches fixed-width year, month, and day | + +-----------------+-----------+-----------------------------------------------------------------+ All characters not listed above are treated as delimiters between date and time slots. So a "dt" string of "1996-01-15T00:00:00.0" would have a "format" string like "y-m-dTH:M:S.s". @@ -310,7 +450,35 @@ alternatively, you could call ``using Dates`` to bring all exported functions in Construct a DateTime type by parsing the "dt" date string following the pattern given in the "format" string. The following codes can be used for constructing format strings: - +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | Code | Matches | Comment | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "y" | 1996, 96 | Returns year of 1996, 0096 | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "m" | 1, 01 | Matches 1 or 2-digit months | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "u" | Jan | Matches abbreviated months according to the "locale" keyword | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "U" | January | Matches full month names according to the "locale" keyword | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "d" | 1, 01 | Matches 1 or 2-digit days | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "H" | 00 | Matches hours | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "M" | 00 | Matches minutes | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "S" | 00 | Matches seconds | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "s" | .500 | Matches milliseconds | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "e" | Mon, Tues | Matches abbreviated days of the week | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "E" | Monday | Matches full name days of the week | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ | "yyyymmdd" | 19960101 | Matches fixed-width year, month, and day | +––––––––-+–––––-+––––––––––––––––––––––––––––––––-+ + :: + + +-----------------+-----------+-----------------------------------------------------------------+ + | Code | Matches | Comment | + +-----------------+-----------+-----------------------------------------------------------------+ + | "y" | 1996, 96 | Returns year of 1996, 0096 | + +-----------------+-----------+-----------------------------------------------------------------+ + | "m" | 1, 01 | Matches 1 or 2-digit months | + +-----------------+-----------+-----------------------------------------------------------------+ + | "u" | Jan | Matches abbreviated months according to the "locale" keyword | + +-----------------+-----------+-----------------------------------------------------------------+ + | "U" | January | Matches full month names according to the "locale" keyword | + +-----------------+-----------+-----------------------------------------------------------------+ + | "d" | 1, 01 | Matches 1 or 2-digit days | + +-----------------+-----------+-----------------------------------------------------------------+ + | "H" | 00 | Matches hours | + +-----------------+-----------+-----------------------------------------------------------------+ + | "M" | 00 | Matches minutes | + +-----------------+-----------+-----------------------------------------------------------------+ + | "S" | 00 | Matches seconds | + +-----------------+-----------+-----------------------------------------------------------------+ + | "s" | .500 | Matches milliseconds | + +-----------------+-----------+-----------------------------------------------------------------+ + | "e" | Mon, Tues | Matches abbreviated days of the week | + +-----------------+-----------+-----------------------------------------------------------------+ + | "E" | Monday | Matches full name days of the week | + +-----------------+-----------+-----------------------------------------------------------------+ + | "yyyymmdd" | 19960101 | Matches fixed-width year, month, and day | + +-----------------+-----------+-----------------------------------------------------------------+ All characters not listed above are treated as delimiters between date and time slots. So a "dt" string of "1996-01-15T00:00:00.0" would have a "format" string like "y-m-dTH:M:S.s". diff --git a/doc/stdlib/file.rst b/doc/stdlib/file.rst index 533142175c277..84d4f7b647fbe 100644 --- a/doc/stdlib/file.rst +++ b/doc/stdlib/file.rst @@ -68,7 +68,33 @@ Returns a structure whose fields contain information about the file. The fields of the structure are: - +–––––-+––––––––––––––––––––––––––––––––––––+ | size | The size (in bytes) of the file | +–––––-+––––––––––––––––––––––––––––––––––––+ | device | ID of the device that contains the file | +–––––-+––––––––––––––––––––––––––––––––––––+ | inode | The inode number of the file | +–––––-+––––––––––––––––––––––––––––––––––––+ | mode | The protection mode of the file | +–––––-+––––––––––––––––––––––––––––––––––––+ | nlink | The number of hard links to the file | +–––––-+––––––––––––––––––––––––––––––––––––+ | uid | The user id of the owner of the file | +–––––-+––––––––––––––––––––––––––––––––––––+ | gid | The group id of the file owner | +–––––-+––––––––––––––––––––––––––––––––––––+ | rdev | If this file refers to a device, the ID of the device it refers to | +–––––-+––––––––––––––––––––––––––––––––––––+ | blksize | The file-system preferred block size for the file | +–––––-+––––––––––––––––––––––––––––––––––––+ | blocks | The number of such blocks allocated | +–––––-+––––––––––––––––––––––––––––––––––––+ | mtime | Unix timestamp of when the file was last modified | +–––––-+––––––––––––––––––––––––––––––––––––+ | ctime | Unix timestamp of when the file was created | +–––––-+––––––––––––––––––––––––––––––––––––+ + :: + + +-----------+------------------------------------------------------------------------+ + | size | The size (in bytes) of the file | + +-----------+------------------------------------------------------------------------+ + | device | ID of the device that contains the file | + +-----------+------------------------------------------------------------------------+ + | inode | The inode number of the file | + +-----------+------------------------------------------------------------------------+ + | mode | The protection mode of the file | + +-----------+------------------------------------------------------------------------+ + | nlink | The number of hard links to the file | + +-----------+------------------------------------------------------------------------+ + | uid | The user id of the owner of the file | + +-----------+------------------------------------------------------------------------+ + | gid | The group id of the file owner | + +-----------+------------------------------------------------------------------------+ + | rdev | If this file refers to a device, the ID of the device it refers to | + +-----------+------------------------------------------------------------------------+ + | blksize | The file-system preferred block size for the file | + +-----------+------------------------------------------------------------------------+ + | blocks | The number of such blocks allocated | + +-----------+------------------------------------------------------------------------+ + | mtime | Unix timestamp of when the file was last modified | + +-----------+------------------------------------------------------------------------+ + | ctime | Unix timestamp of when the file was created | + +-----------+------------------------------------------------------------------------+ .. function:: lstat(file) @@ -100,7 +126,15 @@ Gets the permissions of the owner of the file as a bitfield of - +–––+–––––––––––-+ | 01 | Execute Permission | +–––+–––––––––––-+ | 02 | Write Permission | +–––+–––––––––––-+ | 04 | Read Permission | +–––+–––––––––––-+ + :: + + +------+-----------------------+ + | 01 | Execute Permission | + +------+-----------------------+ + | 02 | Write Permission | + +------+-----------------------+ + | 04 | Read Permission | + +------+-----------------------+ For allowed arguments, see "stat". diff --git a/doc/stdlib/io-network.rst b/doc/stdlib/io-network.rst index 90f805ff6db2f..5c4b947c8995b 100644 --- a/doc/stdlib/io-network.rst +++ b/doc/stdlib/io-network.rst @@ -41,10 +41,22 @@ General I/O Alternate syntax for open, where a string-based mode specifier is used instead of the five booleans. The values of "mode" correspond to those from "fopen(3)" or Perl "open", and are equivalent to setting the following boolean groups: - +–––+–––––––––––––––––-+ | r | read | +–––+–––––––––––––––––-+ | r+ | read, write | +–––+–––––––––––––––––-+ | w | write, create, truncate | +–––+–––––––––––––––––-+ | w+ | read, write, create, truncate | +–––+–––––––––––––––––-+ | a | write, create, append | +–––+–––––––––––––––––-+ | a+ | read, write, create, append | +–––+–––––––––––––––––-+ - :: + +------+-----------------------------------+ + | r | read | + +------+-----------------------------------+ + | r+ | read, write | + +------+-----------------------------------+ + | w | write, create, truncate | + +------+-----------------------------------+ + | w+ | read, write, create, truncate | + +------+-----------------------------------+ + | a | write, create, append | + +------+-----------------------------------+ + | a+ | read, write, create, append | + +------+-----------------------------------+ + open(f::function, args...) Apply the function "f" to the result of "open(args...)" and close the resulting file descriptor upon completion. @@ -74,10 +86,22 @@ General I/O Alternate syntax for open, where a string-based mode specifier is used instead of the five booleans. The values of "mode" correspond to those from "fopen(3)" or Perl "open", and are equivalent to setting the following boolean groups: - +–––+–––––––––––––––––-+ | r | read | +–––+–––––––––––––––––-+ | r+ | read, write | +–––+–––––––––––––––––-+ | w | write, create, truncate | +–––+–––––––––––––––––-+ | w+ | read, write, create, truncate | +–––+–––––––––––––––––-+ | a | write, create, append | +–––+–––––––––––––––––-+ | a+ | read, write, create, append | +–––+–––––––––––––––––-+ - :: + +------+-----------------------------------+ + | r | read | + +------+-----------------------------------+ + | r+ | read, write | + +------+-----------------------------------+ + | w | write, create, truncate | + +------+-----------------------------------+ + | w+ | read, write, create, truncate | + +------+-----------------------------------+ + | a | write, create, append | + +------+-----------------------------------+ + | a+ | read, write, create, append | + +------+-----------------------------------+ + open(f::function, args...) Apply the function "f" to the result of "open(args...)" and close the resulting file descriptor upon completion. @@ -107,10 +131,22 @@ General I/O Alternate syntax for open, where a string-based mode specifier is used instead of the five booleans. The values of "mode" correspond to those from "fopen(3)" or Perl "open", and are equivalent to setting the following boolean groups: - +–––+–––––––––––––––––-+ | r | read | +–––+–––––––––––––––––-+ | r+ | read, write | +–––+–––––––––––––––––-+ | w | write, create, truncate | +–––+–––––––––––––––––-+ | w+ | read, write, create, truncate | +–––+–––––––––––––––––-+ | a | write, create, append | +–––+–––––––––––––––––-+ | a+ | read, write, create, append | +–––+–––––––––––––––––-+ - :: + +------+-----------------------------------+ + | r | read | + +------+-----------------------------------+ + | r+ | read, write | + +------+-----------------------------------+ + | w | write, create, truncate | + +------+-----------------------------------+ + | w+ | read, write, create, truncate | + +------+-----------------------------------+ + | a | write, create, append | + +------+-----------------------------------+ + | a+ | read, write, create, append | + +------+-----------------------------------+ + open(f::function, args...) Apply the function "f" to the result of "open(args...)" and close the resulting file descriptor upon completion. diff --git a/doc/stdlib/linalg.rst b/doc/stdlib/linalg.rst index a3816e63ed0dd..ffb8fcef1c47f 100644 --- a/doc/stdlib/linalg.rst +++ b/doc/stdlib/linalg.rst @@ -141,6 +141,10 @@ Linear algebra functions in Julia are largely implemented by calling functions f +--------------------+--------+--------------------------+---------------+ | "det" | ✓ | ✓ | ✓ | +--------------------+--------+--------------------------+---------------+ + | "logdet" | ✓ | ✓ | | + +--------------------+--------+--------------------------+---------------+ + | "logabsdet" | ✓ | ✓ | | + +--------------------+--------+--------------------------+---------------+ | "size" | ✓ | ✓ | | +--------------------+--------+--------------------------+---------------+ @@ -1224,60 +1228,61 @@ Linear algebra functions in Julia are largely implemented by calling functions f Computes eigenvalues "d" of "A" using Lanczos or Arnoldi iterations for real symmetric or general nonsymmetric matrices respectively. If "B" is provided, the generalized eigenproblem is solved. - The following keyword arguments are supported: * "nev": Number of eigenvalues + The following keyword arguments are supported: * "nev": Number of eigenvalues * "ncv": Number of Krylov vectors used in the computation; should satisfy :: - * "ncv": Number of Krylov vectors used in the computation; - should satisfy + "nev+1 <= ncv <= n" for real symmetric problems and + "nev+2 <= ncv <= n" for other problems, where "n" is + the size of the input matrix "A". The default is "ncv = + max(20,2*nev+1)". Note that these restrictions limit the + input matrix "A" to be of dimension at least 2. - "nev+1 <= ncv <= n" for real symmetric problems and - "nev+2 <= ncv <= n" for other problems, where "n" is - the size of the input matrix "A". The default is "ncv = - max(20,2*nev+1)". Note that these restrictions limit the - input matrix "A" to be of dimension at least 2. + * "which": type of eigenvalues to compute. See the note below. - * "which": type of eigenvalues to compute. See the note - below. + :: - +-----------+-----------------------------------------------------------------------------------------------------------------------------+ - | "which" | type of eigenvalues | - +-----------+-----------------------------------------------------------------------------------------------------------------------------+ - | ":LM" | eigenvalues of largest magnitude (default) | - +-----------+-----------------------------------------------------------------------------------------------------------------------------+ - | ":SM" | eigenvalues of smallest magnitude | - +-----------+-----------------------------------------------------------------------------------------------------------------------------+ - | ":LR" | eigenvalues of largest real part | - +-----------+-----------------------------------------------------------------------------------------------------------------------------+ - | ":SR" | eigenvalues of smallest real part | - +-----------+-----------------------------------------------------------------------------------------------------------------------------+ - | ":LI" | eigenvalues of largest imaginary part (nonsymmetric or complex "A" only) | - +-----------+-----------------------------------------------------------------------------------------------------------------------------+ - | ":SI" | eigenvalues of smallest imaginary part (nonsymmetric or complex "A" only) | - +-----------+-----------------------------------------------------------------------------------------------------------------------------+ - | ":BE" | compute half of the eigenvalues from each end of the spectrum, biased in favor of the high end. (real symmetric "A" only) | - +-----------+-----------------------------------------------------------------------------------------------------------------------------+ + +-----------+-----------------------------------------------------------------------------------------------------------------------------+ + | "which" | type of eigenvalues | + +-----------+-----------------------------------------------------------------------------------------------------------------------------+ + | ":LM" | eigenvalues of largest magnitude (default) | + +-----------+-----------------------------------------------------------------------------------------------------------------------------+ + | ":SM" | eigenvalues of smallest magnitude | + +-----------+-----------------------------------------------------------------------------------------------------------------------------+ + | ":LR" | eigenvalues of largest real part | + +-----------+-----------------------------------------------------------------------------------------------------------------------------+ + | ":SR" | eigenvalues of smallest real part | + +-----------+-----------------------------------------------------------------------------------------------------------------------------+ + | ":LI" | eigenvalues of largest imaginary part (nonsymmetric or complex "A" only) | + +-----------+-----------------------------------------------------------------------------------------------------------------------------+ + | ":SI" | eigenvalues of smallest imaginary part (nonsymmetric or complex "A" only) | + +-----------+-----------------------------------------------------------------------------------------------------------------------------+ + | ":BE" | compute half of the eigenvalues from each end of the spectrum, biased in favor of the high end. (real symmetric "A" only) | + +-----------+-----------------------------------------------------------------------------------------------------------------------------+ - * "tol": tolerance (tol \le 0.0 defaults to - "DLAMCH('EPS')") + * "tol": tolerance (tol \le 0.0 defaults to "DLAMCH('EPS')") - * "maxiter": Maximum number of iterations (default = 300) + * "maxiter": Maximum number of iterations (default = 300) - * "sigma": Specifies the level shift used in inverse - iteration. If "nothing" (default), defaults to ordinary - (forward) iterations. Otherwise, find eigenvalues close to - "sigma" using shift and invert iterations. + * "sigma": Specifies the level shift used in inverse iteration. If "nothing" (default), defaults to ordinary (forward) iterations. Otherwise, find eigenvalues close to "sigma" using shift and invert iterations. - * "ritzvec": Returns the Ritz vectors "v" (eigenvectors) - if "true" + * "ritzvec": Returns the Ritz vectors "v" (eigenvectors) if "true" - * "v0": starting vector from which to start the iterations + * "v0": starting vector from which to start the iterations "eigs" returns the "nev" requested eigenvalues in "d", the corresponding Ritz vectors "v" (only if "ritzvec=true"), the number of converged eigenvalues "nconv", the number of iterations "niter" and the number of matrix vector multiplications "nmult", as well as the final residual vector "resid". - Note: The "sigma" and "which" keywords interact: the description of eigenvalues searched for by "which" do _not_ necessarily refer to the eigenvalues of "A", but rather the linear operator constructed by the specification of the iteration mode implied by "sigma". + Note: The "sigma" and "which" keywords interact: the description of eigenvalues searched for by "which" do _not_ necessarily refer to the eigenvalues of "A", but rather the linear operator constructed by the specification of the iteration mode implied by "sigma". + + :: - +––––––––-+––––––––––––––––––+––––––––––––––––––+ | "sigma" | iteration mode | "which" refers to eigenvalues of | +––––––––-+––––––––––––––––––+––––––––––––––––––+ | "nothing" | ordinary (forward) | A | +––––––––-+––––––––––––––––––+––––––––––––––––––+ | real or complex | inverse with level shift "sigma" | (A - \sigma I )^{-1} | +––––––––-+––––––––––––––––––+––––––––––––––––––+ + +-----------------+------------------------------------+------------------------------------+ + | "sigma" | iteration mode | "which" refers to eigenvalues of | + +-----------------+------------------------------------+------------------------------------+ + | "nothing" | ordinary (forward) | A | + +-----------------+------------------------------------+------------------------------------+ + | real or complex | inverse with level shift "sigma" | (A - \\sigma I )^{-1} | + +-----------------+------------------------------------+------------------------------------+ .. function:: svds(A; nsv=6, ritzvec=true, tol=0.0, maxiter=1000) -> (left_sv, s, right_sv, nconv, niter, nmult, resid) diff --git a/doc/stdlib/parallel.rst b/doc/stdlib/parallel.rst index cd4b92ab4225e..ae253ce1a646d 100644 --- a/doc/stdlib/parallel.rst +++ b/doc/stdlib/parallel.rst @@ -597,16 +597,11 @@ Cluster Manager Interface Implemented by cluster managers. It is called on the master process, during a worker's lifetime, with appropriate "op" values: - :: - - * with ":register"/":deregister" when a worker is added / - removed from the Julia worker pool. + * with ":register"/":deregister" when a worker is added / removed from the Julia worker pool. - * with ":interrupt" when "interrupt(workers)" is called. - The "ClusterManager" should signal the appropriate worker - with an interrupt signal. + * with ":interrupt" when "interrupt(workers)" is called. The "ClusterManager" should signal the appropriate worker with an interrupt signal. - * with ":finalize" for cleanup purposes. + * with ":finalize" for cleanup purposes. .. function:: kill(p::Process, signum=SIGTERM)