Define a function such that it only executes its body once. The value from first execution is memoized at the module level.
module X
export once
let x = Ref{Any}()
global function once(f::Function)
isassigned(x) && return x[]
function getMaxEatenDiscountCount_foreach(N, D, K) { | |
let eaten = new Set(); | |
let eatSum = 0; | |
let eatCounter = 0; | |
D.forEach((dish) => { | |
if (!eaten.has(dish)) { | |
eatSum++; | |
eaten.add(dish); | |
eatCounter++; | |
} |
function getMaxEatenDiscountCount_foreach(N, D, K) { | |
let eaten = new Set(); | |
let eatSum = 0; | |
let eatCounter = 0; | |
D.forEach((dish) => { | |
if (!eaten.has(dish)) { | |
eatSum++; | |
eaten.add(dish); | |
eatCounter++; | |
} |
function getMaxEatenDiscountCount_foreach(N, D, K) { | |
let eaten = new Set(); | |
let eatSum = 0; | |
let eatCounter = 0; | |
D.forEach((dish) => { | |
if (!eaten.has(dish)) { | |
eatSum++; | |
eaten.add(dish); | |
eatCounter++; | |
} |
using BenchmarkTools | |
function apply_filter_jl(E, wx) | |
Xest = 0.0 + 0.0im | |
@inbounds for j = 1:size(E, 2) | |
for i = 1:size(E, 1) | |
Xest += E[i, j] * wx[i, j]' | |
end | |
end | |
return Xest |
# Modified from @frank's code at Discord | |
function koch_curve!(X, Y, x1, y1, x2, y2, level) | |
if level == 0 | |
push!(X, x1) | |
push!(X, x2) | |
push!(Y, y1) | |
push!(Y, y2) | |
else | |
Ξx = x2 - x1 |
HoJBot lost connection to Discord | |
β Info: Reconnecting | |
β time = 2022-02-24T04:58:52.571 | |
β conn = 29 | |
β resume = true | |
β zombie = true | |
β Error: Getting gateway URL failed | |
β time = 2022-02-24T04:59:51.869 | |
β exception = |
Hi SciML attendees, | |
We will use Discord as the primary chat platform during the conference. | |
The Humans of Julia community already has a server, so we will leverage the same server | |
and use a dedicated channel there (#scimlcon) for the SciML conference. | |
Please click on the link below to join the server: | |
https://discord.gg/PRqc3NehEr | |
For more information about the Discord platform, please visit their web site at https://discord.com/ |
function stream_user_input(c::Channel) | |
while true | |
line = readline() | |
if line == "" | |
put!(c, ">>bye") | |
break | |
else | |
put!(c, line) | |
end | |
end |
Define a function such that it only executes its body once. The value from first execution is memoized at the module level.
module X
export once
let x = Ref{Any}()
global function once(f::Function)
isassigned(x) && return x[]
The following are valid timezones that can be used for JuliaCon bot's jc command.
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui