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
using DataFrames, DataFramesMeta, Plots, StatsPlots, StatsBase | |
# HACK: | |
# integrate StatsPlots.@df into @linq chain in a way data frame keeps to be passed even after plot | |
# but, the `names` part might be too dangerous | |
for n in names(StatsPlots) | |
function DataFramesMeta.linq(::DataFramesMeta.SymbolParameter{n}, d, args...) | |
plotcall = Expr(:call, n, args...) | |
return quote let d = $d | |
display(@df d $plotcall) |
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
using MacroTools | |
function decompose_forblk(forblk) | |
spec, body = forblk.args | |
i, itr = spec.args | |
return i, itr, body | |
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
const ACS = Union{AbstractChar, AbstractString} | |
(l::ACS)(f::Function, rs::ACS...) = f(l, rs...) | |
(l::ACS)(rs::ACS...) = l(*, rs...) | |
'1'("23") # "123" | |
']' .|> collect("julia") .|> '[' |> join # "[j][u][l][i][a]" |
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
(q = :(println("(q = $(repr(q))) |> eval"))) |> eval |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# %% defines | |
function isabranch(numsary) | |
s = 0 | |
for (n1, n2) ∈ numsary | |
if n1 isa Int8 && n2 isa Int8 | |
s += 1 | |
elseif n1 isa Int8 && n2 isa Int16 | |
s += 2 | |
elseif n1 isa Int8 && n2 isa Int32 | |
s += 3 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder