This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julia> addprocs(1) | |
1-element Array{Int64,1}: | |
2 | |
julia> pmap([rand(2) for i in 1:2]) do x | |
map(typeof, x) | |
end | |
2-element Array{Any,1}: | |
[Float64,Float64] | |
[Float64,Float64] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julia> using Combinatorics | |
julia> function foo() | |
ts = filter(x->isa(x, DataType), map(eval, names(Base))) | |
for x in ts | |
end | |
permutations(ts, 2) | |
end | |
foo (generic function with 1 method) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ | |
_ _ _(_)_ | A fresh approach to technical computing | |
(_) | (_) (_) | Documentation: http://docs.julialang.org | |
_ _ _| |_ __ _ | Type "?help" for help. | |
| | | | | | |/ _` | | | |
| | |_| | | | (_| | | Version 0.5.0-dev+3825 (2016-05-01 18:02 UTC) | |
_/ |\__'_|_|_|\__'_| | Commit 89775a5 (0 days old master) | |
|__/ | x86_64-apple-darwin15.4.0 | |
julia> function foo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ | |
_ _ _(_)_ | A fresh approach to technical computing | |
(_) | (_) (_) | Documentation: http://docs.julialang.org | |
_ _ _| |_ __ _ | Type "?help" for help. | |
| | | | | | |/ _` | | | |
| | |_| | | | (_| | | Version 0.5.0-dev+3875 (2016-05-04 06:47 UTC) | |
_/ |\__'_|_|_|\__'_| | Commit 90de028 (0 days old master) | |
|__/ | x86_64-apple-darwin15.4.0 | |
julia> using LightGraphs # Requires throws error, but running it again after seems to work fine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julia> import Base.push! | |
julia> import Base.getindex | |
julia> type Accumulator{T, V<:Number} | |
map::Dict{T,V} | |
end | |
julia> Accumulator{T,V<:Number}(::Type{T}, ::Type{V}) = Accumulator{T,V}(Dict{T,V}()) | |
Accumulator{T,V<:Number} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julia> import Base.push! | |
julia> import Base.getindex | |
julia> type Accumulator{T, V<:Number} | |
map::Dict{T,V} | |
end | |
julia> Accumulator{T,V<:Number}(::Type{T}, ::Type{V}) = Accumulator{T,V}(Dict{T,V}()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flattenall(a::AbstractArray) | |
while any(x->typeof(x)<:AbstractArray, a) | |
a = collect(Base.flatten(a)) | |
end | |
return a | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Untitled</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Untitled</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> |
OlderNewer