# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1961

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 1962

---

## [Macros vs. Functions with @eval(return )](https://discourse.julialang.org/t/macros-vs-functions-with-eval-return/26247)

<div class="topic-metadata">

**Author:** [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Replies:** 8\
**Last updated:** [July 12, 2019, 5:00pm UTC](https://discourse.julialang.org/t/macros-vs-functions-with-eval-return/26247 "2019-07-12T17:00:07Z")

</div>

For my use case (generating a struct of four FunctionWrappers from a parsed string) I can use the following two syntaxes interchangeably, and the resulting FunctionWrappers themselves benchmark to the same thing using Be…

---

## [Gumbel Softmax in Julia](https://discourse.julialang.org/t/gumbel-softmax-in-julia/26190)

<div class="topic-metadata">

**Author:** [@Elita\_Lobo](https://discourse.julialang.org/u/Elita_Lobo)\
**Replies:** 4\
**Last updated:** [July 12, 2019, 4:13pm UTC](https://discourse.julialang.org/t/gumbel-softmax-in-julia/26190 "2019-07-12T16:13:29Z")

</div>

Can someone please point me to some implementation of gumbel softmax in julia or an equivalent of the following function? https://pytorch.org/docs/master/tensors.html#torch.Tensor.scatter\_

---

## [Indexing a const array with a JuMP variable](https://discourse.julialang.org/t/indexing-a-const-array-with-a-jump-variable/26283)

<div class="topic-metadata">

**Author:** [@bocc](https://discourse.julialang.org/u/bocc)\
**Replies:** 2\
**Last updated:** [July 12, 2019, 2:41pm UTC](https://discourse.julialang.org/t/indexing-a-const-array-with-a-jump-variable/26283 "2019-07-12T14:41:16Z")

</div>

Hello, let’s assume I have multiple 2D arrays (maps, tables…), each row of those belongs to a single design in a Pareto set (objective & parameter values). I want to optimize on the combinations of those, therefore (I …

---

## [How to programmatically check optimisation status in JuMP \>= 0.19](https://discourse.julialang.org/t/how-to-programmatically-check-optimisation-status-in-jump-0-19/26289)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [July 12, 2019, 2:04pm UTC](https://discourse.julialang.org/t/how-to-programmatically-check-optimisation-status-in-jump-0-19/26289 "2019-07-12T14:04:41Z")

</div>

Which is the equivalent of status=solve(model); if status == :Optimal in JuMP \>= 0.19 ? optimize!(model); if termination\_status(model) == ????

---

## [How to use minimum and maximum for a Vector{SVector{3}}](https://discourse.julialang.org/t/how-to-use-minimum-and-maximum-for-a-vector-svector-3/26235)

<div class="topic-metadata">

**Author:** [@CFBaptista](https://discourse.julialang.org/u/CFBaptista)\
**Replies:** 6\
**Last updated:** [July 12, 2019, 2:04pm UTC](https://discourse.julialang.org/t/how-to-use-minimum-and-maximum-for-a-vector-svector-3/26235 "2019-07-12T14:04:21Z")

</div>

If I want to determine the smallest values in the rows of A::Matrix it’s as easy as: min = minimum(A, dims=2) However, if I have a Vector of SVector{3}'s it’s a bit more complicated. This using StaticArrays function …

---

## [What function do we use in Julia in place of cin\>\> in C++? how to input number in Julia from keyboard? Can I create vector from keyboard in Julia?](https://discourse.julialang.org/t/what-function-do-we-use-in-julia-in-place-of-cin-in-c-how-to-input-number-in-julia-from-keyboard-can-i-create-vector-from-keyboard-in-julia/26285)

<div class="topic-metadata">

**Author:** [@Dito](https://discourse.julialang.org/u/Dito)\
**Replies:** 3\
**Last updated:** [July 12, 2019, 1:04pm UTC](https://discourse.julialang.org/t/what-function-do-we-use-in-julia-in-place-of-cin-in-c-how-to-input-number-in-julia-from-keyboard-can-i-create-vector-from-keyboard-in-julia/26285 "2019-07-12T13:04:43Z")

</div>

function F(a=parse(Float64,readline())) @show a end F()

---

## [Julia test if number is Inf](https://discourse.julialang.org/t/julia-test-if-number-is-inf/26287)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 1\
**Last updated:** [July 12, 2019, 12:42pm UTC](https://discourse.julialang.org/t/julia-test-if-number-is-inf/26287 "2019-07-12T12:42:12Z")

</div>

Hello is there a simple way to test if a variable is Inf? something like isnan(x)?

---

## [Converting UInt8 Array to BigInt, and back](https://discourse.julialang.org/t/converting-uint8-array-to-bigint-and-back/19110)

<div class="topic-metadata">

**Author:** [@roshii](https://discourse.julialang.org/u/roshii)\
**Replies:** 19\
**Last updated:** [July 12, 2019, 12:17pm UTC](https://discourse.julialang.org/t/converting-uint8-array-to-bigint-and-back/19110 "2019-07-12T12:17:56Z")

</div>

I am writing functions that would convert Array{UInt8,1} to BigInt and vice versa. From BigInt to Array I use to do as follows, through an hexadecimal string. function int2bytes(x::Integer) hex = string(x, base=16…

---

## [CUDAnative: simple and nice way to define type for all integer/float literals?; size() returning UInt32?](https://discourse.julialang.org/t/cudanative-simple-and-nice-way-to-define-type-for-all-integer-float-literals-size-returning-uint32/26227)

<div class="topic-metadata">

**Author:** [@samo](https://discourse.julialang.org/u/samo)\
**Replies:** 5\
**Last updated:** [July 12, 2019, 10:37am UTC](https://discourse.julialang.org/t/cudanative-simple-and-nice-way-to-define-type-for-all-integer-float-literals-size-returning-uint32/26227 "2019-07-12T10:37:15Z")

</div>

The following code is the computation kernel of a small heat diffusion application in 3-D: function diffusion3D\_kernel!(Te2, Te, Ci, lam, dt, dx, dy, dz) \_dx = 1.0/dx; # \_dx could obviously be passed as argument ins…

---

## [ANN: Juno 0.8.8](https://discourse.julialang.org/t/ann-juno-0-8-8/26214)

<div class="topic-metadata">

**Author:** [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Replies:** 8\
**Last updated:** [July 12, 2019, 10:14am UTC](https://discourse.julialang.org/t/ann-juno-0-8-8/26214 "2019-07-12T10:14:00Z")

</div>

Hey folks, Juno 0.8.8 is out and brings a few new features as well as a couple of bugfixes (thanks to @aviatesk for implementing most of those) : Features Better conditional breakpoint UX (#562). Custom layouts (#561)…

---

## [Compatibility issues: How to read the error?](https://discourse.julialang.org/t/compatibility-issues-how-to-read-the-error/26188)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 3\
**Last updated:** [July 12, 2019, 9:55am UTC](https://discourse.julialang.org/t/compatibility-issues-how-to-read-the-error/26188 "2019-07-12T09:55:17Z")

</div>

I encountered this problem several times. I have absolutely no idea how to read the compatibility problems when installing a package doesn’t work. (v1.1) pkg\> add FreeTypeAbstraction Resolving package versions... ERROR…

---

## [What is the criterion to be supported in Unicode Input in Julia REPL?](https://discourse.julialang.org/t/what-is-the-criterion-to-be-supported-in-unicode-input-in-julia-repl/26277)

<div class="topic-metadata">

**Author:** [@paalon](https://discourse.julialang.org/u/paalon)\
**Replies:** 4\
**Last updated:** [July 12, 2019, 9:03am UTC](https://discourse.julialang.org/t/what-is-the-criterion-to-be-supported-in-unicode-input-in-julia-repl/26277 "2019-07-12T09:03:10Z")

</div>

What is the criterion to be adopted in Unicode Input in Julia REPL? The list (Unicode Input · The Julia Language) shows most of the famous LaTeX completion sequences are supported but some alternative names (such as \\lo…

---

## [Improving performance due to setting types of the fields of a struct](https://discourse.julialang.org/t/improving-performance-due-to-setting-types-of-the-fields-of-a-struct/24965)

<div class="topic-metadata">

**Author:** [@Volker](https://discourse.julialang.org/u/Volker)\
**Replies:** 10\
**Last updated:** [July 12, 2019, 8:03am UTC](https://discourse.julialang.org/t/improving-performance-due-to-setting-types-of-the-fields-of-a-struct/24965 "2019-07-12T08:03:49Z")

</div>

Hi, I have a question about improving the performance of Julia. In the Julia documentation is something explained about setting types of a structs. " You can do better by declaring the type of a . Here, we are focused…

---

## [Make first call faster](https://discourse.julialang.org/t/make-first-call-faster/22845)

<div class="topic-metadata">

**Author:** [@KestutisMa](https://discourse.julialang.org/u/KestutisMa)\
**Replies:** 6\
**Last updated:** [July 12, 2019, 7:53am UTC](https://discourse.julialang.org/t/make-first-call-faster/22845 "2019-07-12T07:53:24Z")

</div>

Hello, I just started using Julia, I noticed that commands using Plotly plot(rand(10)) perform slowly ~30s in first run, but faster ~2s in second run. Could it be possible to cache that process to make it fast after …

---

## [MultivariateNormal with trackedArray Mean and standard Deviation and clamping tracked array](https://discourse.julialang.org/t/multivariatenormal-with-trackedarray-mean-and-standard-deviation-and-clamping-tracked-array/26259)

<div class="topic-metadata">

**Author:** [@Elita\_Lobo](https://discourse.julialang.org/u/Elita_Lobo)\
**Replies:** 2\
**Last updated:** [July 12, 2019, 6:46am UTC](https://discourse.julialang.org/t/multivariatenormal-with-trackedarray-mean-and-standard-deviation-and-clamping-tracked-array/26259 "2019-07-12T06:46:05Z")

</div>

I am trying to create multivariate distributions from mean and standard deviation obtained from neural network. But I am getting the following error: MethodError: no method matching MvNormal(::TrackedArray{…,Array{Flo…

---

## [How can I add to ML model together in Flux](https://discourse.julialang.org/t/how-can-i-add-to-ml-model-together-in-flux/26271)

<div class="topic-metadata">

**Author:** [@Lyupinpin](https://discourse.julialang.org/u/Lyupinpin)\
**Replies:** 2\
**Last updated:** [July 12, 2019, 5:43am UTC](https://discourse.julialang.org/t/how-can-i-add-to-ml-model-together-in-flux/26271 "2019-07-12T05:43:21Z")

</div>

Like I have two model now M1=Chain( Dense(2,10), Dense(10,10,relu), Dense(10,10,relu), Dense(10,10,relu), Dense(10,1) ) M2=Chain( Dense(2,10), Dense(10,10,relu), Dense(10,10,relu), Dense(10,10,relu), Dense(1…

---

## [Non scalar indexing in Julia](https://discourse.julialang.org/t/non-scalar-indexing-in-julia/26269)

<div class="topic-metadata">

**Author:** [@Elita\_Lobo](https://discourse.julialang.org/u/Elita_Lobo)\
**Replies:** 6\
**Last updated:** [July 12, 2019, 4:44am UTC](https://discourse.julialang.org/t/non-scalar-indexing-in-julia/26269 "2019-07-12T04:44:55Z")

</div>

How do I achieve non scalar indexing in Julia? julia\> l 3×2 Array{Int64,2}: 1 2 2 3 4 5 julia\> l\[\[1,2,3\],\[1,2,1\]\] 3×3 Array{Int64,2}: 1 2 1 2 3 2 4 5 4 I want to assign be able to assign values to diff…

---

## [Nested Ranges in Generator](https://discourse.julialang.org/t/nested-ranges-in-generator/26268)

<div class="topic-metadata">

**Author:** [@milesf](https://discourse.julialang.org/u/milesf)\
**Replies:** 1\
**Last updated:** [July 12, 2019, 2:50am UTC](https://discourse.julialang.org/t/nested-ranges-in-generator/26268 "2019-07-12T02:50:35Z")

</div>

What is the generator syntax where the value of variables from one range can be used as limits for another range? collect(\[a,b\] for a=1:2, b=a:a+1) ERROR: UndefVarError: a not defined Expecting \[1, 1\] \[1, 2\] \[2, 2\]…

---

## [Optim; Hessian or Hessian free?](https://discourse.julialang.org/t/optim-hessian-or-hessian-free/26209)

<div class="topic-metadata">

**Author:** [@krenova](https://discourse.julialang.org/u/krenova)\
**Replies:** 15\
**Last updated:** [July 11, 2019, 9:51pm UTC](https://discourse.julialang.org/t/optim-hessian-or-hessian-free/26209 "2019-07-11T21:51:28Z")

</div>

Hi, In the documentation for the Optim package I note the following statement with regards to the choice of algorithm: When you do not have an explicit Hessian or when the dimension becomes large enough that the linea…

---

## [Controlling the type of anonymous functions](https://discourse.julialang.org/t/controlling-the-type-of-anonymous-functions/26264)

<div class="topic-metadata">

**Author:** [@Nathaniel](https://discourse.julialang.org/u/Nathaniel)\
**Replies:** 5\
**Last updated:** [July 11, 2019, 8:44pm UTC](https://discourse.julialang.org/t/controlling-the-type-of-anonymous-functions/26264 "2019-07-11T20:44:57Z")

</div>

I have a function with the following form: function make\_func() return x -\> x\*10 end I would like to change it so that it will return a function that takes Cint and returns Cint, in order to pass it to C code as a cal…

---

## [Interact & Plotly in Juliabox stopped working](https://discourse.julialang.org/t/interact-plotly-in-juliabox-stopped-working/26206)

<div class="topic-metadata">

**Author:** [@Nigel\_Adams](https://discourse.julialang.org/u/Nigel_Adams)\
**Replies:** 2\
**Last updated:** [July 11, 2019, 6:45pm UTC](https://discourse.julialang.org/t/interact-plotly-in-juliabox-stopped-working/26206 "2019-07-11T18:45:22Z")

</div>

I have created some notebooks in Juliabox that use ‘Interact’ for widget interaction and ‘Plotly’ for interactive 2d and 3d scatter plots. They’ve been working really well and I was hoping to demo them at an upcoming pr…

---

## [Variables on remote processes](https://discourse.julialang.org/t/variables-on-remote-processes/26256)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 0\
**Last updated:** [July 11, 2019, 5:32pm UTC](https://discourse.julialang.org/t/variables-on-remote-processes/26256 "2019-07-11T17:32:05Z")

</div>

The following uses always the locally defined variable: using Distributed addprocs(1) @everywhere c = 10 c = 3 pmap(1:1) do i c end # 3 @everywhere f(x) = c pmap(f, 1:1) # 3 How can I guarantee that my functi…

---

## [Large memory allocation in function within function](https://discourse.julialang.org/t/large-memory-allocation-in-function-within-function/26229)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 7\
**Last updated:** [July 11, 2019, 5:25pm UTC](https://discourse.julialang.org/t/large-memory-allocation-in-function-within-function/26229 "2019-07-11T17:25:18Z")

</div>

Hey everyone, Apologies for the frequent questions, but I just dont quite get behind the compiler as of yet. I have the following problem: I have a custom struct and some data, and I want to call functions based on the …

---

## [Channel gets emptied and stays that way](https://discourse.julialang.org/t/channel-gets-emptied-and-stays-that-way/26237)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 11\
**Last updated:** [July 11, 2019, 4:54pm UTC](https://discourse.julialang.org/t/channel-gets-emptied-and-stays-that-way/26237 "2019-07-11T16:54:43Z")

</div>

I want to use a @async task to put! video frames (from VideoIO) in a Channel and use that channel as a buffer of frames to update a Makie.Scene with. The idea is that while the user plays with the slider to explore a vid…

---

## [ANN: LightQuery tutorial](https://discourse.julialang.org/t/ann-lightquery-tutorial/20262)

<div class="topic-metadata">

**Author:** [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Replies:** 43\
**Last updated:** [July 11, 2019, 4:45pm UTC](https://discourse.julialang.org/t/ann-lightquery-tutorial/20262 "2019-07-11T16:45:03Z")

</div>

I’ve put out a 1.0 version of LightQuery, and with it I’ve done a tutorial. This tutorial matches the one for dplyr as closely as possible. See https://bramtayl.github.io/LightQuery.jl/latest/#Tutorial-1 for the tutorial…

---

## [Thousands of matrix multiplications using CuArray](https://discourse.julialang.org/t/thousands-of-matrix-multiplications-using-cuarray/26222)

<div class="topic-metadata">

**Author:** [@joseph\_bouvard](https://discourse.julialang.org/u/joseph_bouvard)\
**Replies:** 5\
**Last updated:** [July 11, 2019, 2:49pm UTC](https://discourse.julialang.org/t/thousands-of-matrix-multiplications-using-cuarray/26222 "2019-07-11T14:49:02Z")

</div>

Using CuArray.jl it was possible to improve the following code at about 7x when compare to the analogue computation executed on host. However, it is still disappointing for my purposes (53.122 s running on a Tesla K40c w…

---

## [Syntactic sugar for many arguments with same type annotation but separately dispatchable?](https://discourse.julialang.org/t/syntactic-sugar-for-many-arguments-with-same-type-annotation-but-separately-dispatchable/26249)

<div class="topic-metadata">

**Author:** [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Replies:** 2\
**Last updated:** [July 11, 2019, 2:39pm UTC](https://discourse.julialang.org/t/syntactic-sugar-for-many-arguments-with-same-type-annotation-but-separately-dispatchable/26249 "2019-07-11T14:39:18Z")

</div>

Is there a syntactic sugar for a function where the arguments must all have a type T\<:SomeType, but each one could be a different type? What I want to do might be clearer by example. So at the moment I might write a fun…

---

## [Pass command line arguments to a sub-script loaded by a script](https://discourse.julialang.org/t/pass-command-line-arguments-to-a-sub-script-loaded-by-a-script/26242)

<div class="topic-metadata">

**Author:** [@jamblejoe](https://discourse.julialang.org/u/jamblejoe)\
**Replies:** 10\
**Last updated:** [July 11, 2019, 2:10pm UTC](https://discourse.julialang.org/t/pass-command-line-arguments-to-a-sub-script-loaded-by-a-script/26242 "2019-07-11T14:10:22Z")

</div>

Hi, I have scripts, which do some calculation and I have scripts which setup workers, on a local machine, on remote machines, with a machinefile, etc. I want to pass arguments from the command line, which are in Base.AR…

---

## [How to make own type explanation in Workspace?](https://discourse.julialang.org/t/how-to-make-own-type-explanation-in-workspace/26191)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 7\
**Last updated:** [July 11, 2019, 1:47pm UTC](https://discourse.julialang.org/t/how-to-make-own-type-explanation-in-workspace/26191 "2019-07-11T13:47:58Z")

</div>

How to make own type explanation in Workspace for my type like HypothsisTest or GLM. I see only type name and variable names, but for other types like GLM there are prety text output.

---

## [Function type declaration](https://discourse.julialang.org/t/function-type-declaration/26203)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 8\
**Last updated:** [July 11, 2019, 1:07pm UTC](https://discourse.julialang.org/t/function-type-declaration/26203 "2019-07-11T13:07:15Z")

</div>

Hi guys, I read that one should typically try to declare types from variables in functions directly at the beginning of the function definition, something like: #OPTION1 fun1 = function(feat1::Vector{Float64}, feat2::M…

[Previous page](https://discourse.julialang.org/latest.md?page=1960)

[Next page](https://discourse.julialang.org/latest.md?page=1962)
