Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
|||
sorttable(T; ordering=<, column=1, reverse=false) =
|
||||
sort(T, by = t -> t[column], lt = reverse ? (a,b) -> ordering(b,a) : ordering)
|
||||
sorttable(T, ordering=<, column=1, reverse=false) =
|
||||
sorttable(T, ordering=ordering, column=column, reverse=reverse)
|
||||
17
Task/Optional-parameters/Julia/optional-parameters-2.julia
Normal file
17
Task/Optional-parameters/Julia/optional-parameters-2.julia
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
julia> data = {["a", "b", "c"], ["", "q", "z"], ["zap", "zip", "Zot"]}
|
||||
3-element Array{Any,1}:
|
||||
["a","b","c"]
|
||||
["","q","z"]
|
||||
["zap","zip","Zot"]
|
||||
|
||||
julia> sorttable(data, column=2, reverse=true) # named arguments
|
||||
3-element Array{Any,1}:
|
||||
["zap","zip","Zot"]
|
||||
["","q","z"]
|
||||
["a","b","c"]
|
||||
|
||||
julia> sorttable(data, >, 2) # the same thing, with positional arguments
|
||||
3-element Array{Any,1}:
|
||||
["zap","zip","Zot"]
|
||||
["","q","z"]
|
||||
["a","b","c"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue