Skip to content

Instantly share code, notes, and snippets.

@ivarne
Created September 16, 2013 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivarne/047711ccc285335e4468 to your computer and use it in GitHub Desktop.
Save ivarne/047711ccc285335e4468 to your computer and use it in GitHub Desktop.
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" to list help topics
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.2.0-prerelease+3743
_/ |\__'_|_|_|\__'_| | Commit fc445f8 2013-09-16 05:29:41 UTC
|__/ | x86_64-apple-darwin12.5.0
julia> A = rand(5,8)
5x8 Array{Float64,2}:
0.669738 0.219683 0.720173 0.0880016 0.820235 0.658567 0.867968 0.394466
0.490362 0.171479 0.892448 0.685094 0.286041 0.785584 0.35776 0.17698
0.740654 0.159471 0.183929 0.896872 0.985829 0.22438 0.197732 0.931789
0.117073 0.439403 0.731015 0.875355 0.0813128 0.245268 0.762892 0.841012
0.0712886 0.258684 0.0367603 0.377599 0.980551 0.911098 0.85105 0.59745
julia> Ra
RadixSort Range Range1 RangeIndex Ranges Rational RawFD
julia> Ran
Range Range1 RangeIndex Ranges
julia> help(Range1)
Loading help data...
DataType : Range1{T<:Real} (use methods(Range1) to see constructors)
supertype: Ranges{T<:Real}
fields : (:start,:len)
julia> help(Range)
DataType : Range{T<:Real} (use methods(Range) to see constructors)
supertype: Ranges{T<:Real}
fields : (:start,:step,:len)
julia> B = slice(A, 1:5, 1:8)
5x8 SubArray{Float64,2,Array{Float64,2},(Range1{Int64},Range1{Int64})}:
0.669738 0.219683 0.720173 0.0880016 0.820235 0.658567 0.867968 0.394466
0.490362 0.171479 0.892448 0.685094 0.286041 0.785584 0.35776 0.17698
0.740654 0.159471 0.183929 0.896872 0.985829 0.22438 0.197732 0.931789
0.117073 0.439403 0.731015 0.875355 0.0813128 0.245268 0.762892 0.841012
0.0712886 0.258684 0.0367603 0.377599 0.980551 0.911098 0.85105 0.59745
julia> C = slice(B, 1:5, 1:8)
5x8 SubArray{Float64,2,Array{Float64,2},(Range{Int64},Range{Int64})}:
0.669738 0.219683 0.720173 0.0880016 0.820235 0.658567 0.867968 0.394466
0.490362 0.171479 0.892448 0.685094 0.286041 0.785584 0.35776 0.17698
0.740654 0.159471 0.183929 0.896872 0.985829 0.22438 0.197732 0.931789
0.117073 0.439403 0.731015 0.875355 0.0813128 0.245268 0.762892 0.841012
0.0712886 0.258684 0.0367603 0.377599 0.980551 0.911098 0.85105 0.59745
julia>
ivarne~/dev/julia$ git pull
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 4 (delta 3), reused 4 (delta 3)
Unpacking objects: 100% (4/4), done.
From https://github.com/JuliaLang/julia
fc445f8..a4088e0 master -> origin/master
Updating fc445f8..a4088e0
Fast-forward
base/subarray.jl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
ivarne~/dev/julia$ make
PERL base/build_h.jl.phony
Warning: replacing module Base
ivarne~/dev/julia$ julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" to list help topics
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.2.0-prerelease+3744
_/ |\__'_|_|_|\__'_| | Commit a4088e0 2013-09-16 11:17:11 UTC
|__/ | x86_64-apple-darwin12.5.0
julia> A = rand(5,8)
5x8 Array{Float64,2}:
0.394125 0.811652 0.96094 0.83513 0.635893 0.760678 0.0705092 0.665622
0.615882 0.326839 0.0699907 0.397596 0.00281069 0.377241 0.274225 0.767861
0.99621 0.171725 0.436486 0.0528753 0.58882 0.706728 0.197889 0.410697
0.52494 0.217541 0.478669 0.392408 0.163646 0.752737 0.219446 0.593175
0.937438 0.199635 0.677287 0.631529 0.430406 0.486206 0.874652 0.0647776
julia> B = slice(A, 1:5, 1:8)
5x8 SubArray{Float64,2,Array{Float64,2},(Range1{Int64},Range1{Int64})}:
0.394125 0.811652 0.96094 0.83513 0.635893 0.760678 0.0705092 0.665622
0.615882 0.326839 0.0699907 0.397596 0.00281069 0.377241 0.274225 0.767861
0.99621 0.171725 0.436486 0.0528753 0.58882 0.706728 0.197889 0.410697
0.52494 0.217541 0.478669 0.392408 0.163646 0.752737 0.219446 0.593175
0.937438 0.199635 0.677287 0.631529 0.430406 0.486206 0.874652 0.0647776
julia> C = slice(B, 1:5, 1:8)
5x8 SubArray{Float64,2,Array{Float64,2},(Range{Int64},Range{Int64})}:
0.394125 0.811652 0.96094 0.83513 0.635893 0.760678 0.0705092 0.665622
0.615882 0.326839 0.0699907 0.397596 0.00281069 0.377241 0.274225 0.767861
0.99621 0.171725 0.436486 0.0528753 0.58882 0.706728 0.197889 0.410697
0.52494 0.217541 0.478669 0.392408 0.163646 0.752737 0.219446 0.593175
0.937438 0.199635 0.677287 0.631529 0.430406 0.486206 0.874652 0.0647776
julia>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment