Vancouver Julia Meetup
04/20/2021
Shashi Gowda
PhD candidate in
Computational Science and Engineering
| using Tullio | |
| using Dagger | |
| using Dagger: DArray, chunks, Thunk, ArrayDomain | |
| struct Zero end | |
| Base.zero(::Type{Thunk}) = delayed(()->Zero())() | |
| Base.zero(::Type{Union{Zero, ArrayDomain}}) = Zero() | |
| Base.:(+)(z::Zero, x) = x | |
| Base.:(+)(x, z::Zero) = x | |
| Base.:(+)(z::Zero, x::Zero) = z |
| immutable IRef{T} | |
| value::T | |
| IRef() = new() | |
| IRef(value) = new(value) | |
| end | |
| immutable Result{T,S} | |
| issuccess::Bool | |
| value::IRef{T} | |
| error::IRef{S} |
| using Lazy | |
| function methoddoc(name, sign, doc) | |
| vbox( | |
| fontweight(bold, code(string(name) * "(" * join(map(string, sign.types), ", ") *")" )), | |
| doc | |
| ) | |
| end | |
| function showdoc(fn::Function, fndoc) |
| (function() { | |
| function Sneaky (node) { | |
| var lightNode = Polymer.dom(node) | |
| this.lightNode = lightNode | |
| this.node = lightNode.node | |
| } | |
| Sneaky.prototype = Polymer.dom() | |
| Object.defineProperties(Sneaky.prototype, { |
| # An infinite number of mathematicians walk into a bar... | |
| using Color | |
| colors = distinguishable_colors(9) | |
| box(w, h, n) = | |
| empty |> fillcolor(colors[n % 9 + 1]) |> size(w, h) |