# Latest

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

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

**Page:** 1973

---

## [Making a type of AbstractDict](https://discourse.julialang.org/t/making-a-type-of-abstractdict/25590)

<div class="topic-metadata">

**Author:** [@wherrera](https://discourse.julialang.org/u/wherrera)\
**Replies:** 1\
**Last updated:** [June 25, 2019, 12:00am UTC](https://discourse.julialang.org/t/making-a-type-of-abstractdict/25590 "2019-06-25T00:00:56Z")

</div>

I am trying to create a fixed dictionary with builtin restore to a default state: module BackedUpImmutable export BackedUpImmutableDict, getindex, setindex!, get!, get, restore! struct BackedUpImmutableDict{K, V} \<: …

---

## [Status of Registrator.jl (getting an invalid Project.toml error)](https://discourse.julialang.org/t/status-of-registrator-jl-getting-an-invalid-project-toml-error/25546)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 11\
**Last updated:** [June 24, 2019, 10:33pm UTC](https://discourse.julialang.org/t/status-of-registrator-jl-getting-an-invalid-project-toml-error/25546 "2019-06-24T22:33:44Z")

</div>

What is the status of package registration? I was under the impression that Registrator.jl works but I’m getting a “Project.toml is invalid” error when attempting to register the package. Leaving aside the unactionable …

---

## [Multi-headed Network on GPU with Flux](https://discourse.julialang.org/t/multi-headed-network-on-gpu-with-flux/25623)

<div class="topic-metadata">

**Author:** [@noumea](https://discourse.julialang.org/u/noumea)\
**Replies:** 0\
**Last updated:** [June 24, 2019, 7:59pm UTC](https://discourse.julialang.org/t/multi-headed-network-on-gpu-with-flux/25623 "2019-06-24T19:59:51Z")

</div>

I just started learning Flux.jl. I would like to setup a network that only takes part of the input data in the initial layer and then concatenates the output later. It looks like my code works fine on the CPU, however wh…

---

## [How to pass variable into loop?](https://discourse.julialang.org/t/how-to-pass-variable-into-loop/25602)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 6\
**Last updated:** [June 24, 2019, 7:36pm UTC](https://discourse.julialang.org/t/how-to-pass-variable-into-loop/25602 "2019-06-24T19:36:31Z")

</div>

Hello, I have created some variable in the mainstream of a Julia stream; in order to pass them (to be modified) inside a for loop, I first declared them as global. For instance; global a = 10 for i in 1:100 b = a\*2 …

---

## [Speeding up sparse matrix multiplication and assembly](https://discourse.julialang.org/t/speeding-up-sparse-matrix-multiplication-and-assembly/25452)

<div class="topic-metadata">

**Author:** [@thehalfspace](https://discourse.julialang.org/u/thehalfspace)\
**Replies:** 8\
**Last updated:** [June 24, 2019, 6:37pm UTC](https://discourse.julialang.org/t/speeding-up-sparse-matrix-multiplication-and-assembly/25452 "2019-06-24T18:37:47Z")

</div>

I am trying to solve a large linear system using IterativeSolvers and AlgebraicMultigrid. Let my elemental stiffness matrix be Ke (size = 25x25xNe) where Ne is number of elements. The index for assembly is iglob (size =…

---

## [How to adjust legend width to display the entire linestyle?](https://discourse.julialang.org/t/how-to-adjust-legend-width-to-display-the-entire-linestyle/25618)

<div class="topic-metadata">

**Author:** [@biona001](https://discourse.julialang.org/u/biona001)\
**Replies:** 0\
**Last updated:** [June 24, 2019, 6:09pm UTC](https://discourse.julialang.org/t/how-to-adjust-legend-width-to-display-the-entire-linestyle/25618 "2019-06-24T18:09:10Z")

</div>

In the legend below, the linestyle for Neg Bin (nd) and Matrix size is indistinguishable without color. Is there a way to increase the width of the displayed legend? Or is there another line style to choose from? Edit:…

---

## [Parallel computing: calling module failed](https://discourse.julialang.org/t/parallel-computing-calling-module-failed/25571)

<div class="topic-metadata">

**Author:** [@FujiwaraTakumiEH](https://discourse.julialang.org/u/FujiwaraTakumiEH)\
**Replies:** 1\
**Last updated:** [June 24, 2019, 5:22pm UTC](https://discourse.julialang.org/t/parallel-computing-calling-module-failed/25571 "2019-06-24T17:22:59Z")

</div>

Background: I wrote a module myself, where the function requires parallel computing.Here is my code: module sds using Distributed @everywhere using SharedArrays export test function test(N) S …

---

## [Matrix (dense) vector (sparse) product improvement](https://discourse.julialang.org/t/matrix-dense-vector-sparse-product-improvement/25579)

<div class="topic-metadata">

**Author:** [@davidbp](https://discourse.julialang.org/u/davidbp)\
**Replies:** 7\
**Last updated:** [June 24, 2019, 4:28pm UTC](https://discourse.julialang.org/t/matrix-dense-vector-sparse-product-improvement/25579 "2019-06-24T16:28:15Z")

</div>

Products W'\*x\_sp seem very slow when W is a dense array and x\_sp is an sparse vector. Odly enough this does not happen if we don’t have and adjoint (W\*x\_sp is fast but W'\*x\_sp is very slow). Is there an easy way to o…

---

## [Select a device for the entire program](https://discourse.julialang.org/t/select-a-device-for-the-entire-program/25603)

<div class="topic-metadata">

**Author:** [@samo](https://discourse.julialang.org/u/samo)\
**Replies:** 3\
**Last updated:** [June 24, 2019, 4:22pm UTC](https://discourse.julialang.org/t/select-a-device-for-the-entire-program/25603 "2019-06-24T16:22:20Z")

</div>

Question: To my understanding, CuArrays/CUDAnative/CUDAdrv selects the device 0 by default. How can I select a different device at the beginning of my program, that will be used in the rest of the program for any GPU op…

---

## [Bad link to FAQ](https://discourse.julialang.org/t/bad-link-to-faq/25541)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 2\
**Last updated:** [June 24, 2019, 4:05pm UTC](https://discourse.julialang.org/t/bad-link-to-faq/25541 "2019-06-24T16:05:29Z")

</div>

About the General Usage category suggests trying the FAQ. But the link, http://docs.julialang.org/en/stable/manual/faq/ gets me a 404, not found, error.

---

## [Gadfly for Julia version 1.1.1](https://discourse.julialang.org/t/gadfly-for-julia-version-1-1-1/25495)

<div class="topic-metadata">

**Author:** [@Julia\_coder](https://discourse.julialang.org/u/Julia_coder)\
**Replies:** 3\
**Last updated:** [June 24, 2019, 2:32pm UTC](https://discourse.julialang.org/t/gadfly-for-julia-version-1-1-1/25495 "2019-06-24T14:32:53Z")

</div>

Is Gadfly be available for Julia version 1.1.1? I have tried various ways of adding it (including pkg"add Gadfly#master", Pkg.clone(“Gadfly”), pkg"dev Gadfly") without success. With the master copy, I receive an error st…

---

## [Does using ccall(...) in a module prevent its precompilation?](https://discourse.julialang.org/t/does-using-ccall-in-a-module-prevent-its-precompilation/22546)

<div class="topic-metadata">

**Author:** [@RonK](https://discourse.julialang.org/u/RonK)\
**Replies:** 7\
**Last updated:** [June 24, 2019, 2:07pm UTC](https://discourse.julialang.org/t/does-using-ccall-in-a-module-prevent-its-precompilation/22546 "2019-06-24T14:07:55Z")

</div>

I’m getting constant warnings for one module among many: ┌ Warning: Module my\_module\_1 with build ID 54547777901434 is missing from the cache. │ This may mean my\_module\_1 \[top-level\] does not support precompilation but…

---

## [Autodiff on image convolution](https://discourse.julialang.org/t/autodiff-on-image-convolution/25574)

<div class="topic-metadata">

**Author:** [@francesco.alemanno](https://discourse.julialang.org/u/francesco.alemanno)\
**Replies:** 6\
**Last updated:** [June 24, 2019, 1:55pm UTC](https://discourse.julialang.org/t/autodiff-on-image-convolution/25574 "2019-06-24T13:55:15Z")

</div>

Hello everyone, i was trying to leverage julia Autodiff tools, to solve this problem: I have two images A,B and a convolution kernel K i tried to use Flux.tracker, ForwardDiff, Zygote, and Knet.AutoGrad to minimize th…

---

## [Julia v1.2.0-rc1 is now available](https://discourse.julialang.org/t/julia-v1-2-0-rc1-is-now-available/24788)

<div class="topic-metadata">

**Author:** [@jeff.bezanson](https://discourse.julialang.org/u/jeff.bezanson)\
**Replies:** 16\
**Last updated:** [June 24, 2019, 1:48pm UTC](https://discourse.julialang.org/t/julia-v1-2-0-rc1-is-now-available/24788 "2019-06-24T13:48:01Z")

</div>

Hello Julians, The first release candidate for Julia v1.2.0 is now available. Binaries can be found at the usual download page Download Julia. There are source tarballs available as github releases, or of course you can…

---

## [Using Distributed: computational efficiency](https://discourse.julialang.org/t/using-distributed-computational-efficiency/25570)

<div class="topic-metadata">

**Author:** [@FujiwaraTakumiEH](https://discourse.julialang.org/u/FujiwaraTakumiEH)\
**Replies:** 5\
**Last updated:** [June 24, 2019, 12:50pm UTC](https://discourse.julialang.org/t/using-distributed-computational-efficiency/25570 "2019-06-24T12:50:12Z")

</div>

Background: I want to add elements to the matrix and want to use @distributed for acceleration,here is my code: function fill(N) S = zeros(N,N) for i in 1:length(S) S\[i\] = i end end @btime fill(10…

---

## [How layout scatter plots on a grid layout?](https://discourse.julialang.org/t/how-layout-scatter-plots-on-a-grid-layout/25601)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 5\
**Last updated:** [June 24, 2019, 12:42pm UTC](https://discourse.julialang.org/t/how-layout-scatter-plots-on-a-grid-layout/25601 "2019-06-24T12:42:24Z")

</div>

Say I have 3 scatter plots and I want to lay them out in a 3 by 1 grid. How do I achiege that with Plots.jl? The @layout only shows examples of random data, but if I want to do it using specified plots e.g. x = rand(10…

---

## [How to plot a scatter plot where the each specifies of the iris data set is given a different colour?](https://discourse.julialang.org/t/how-to-plot-a-scatter-plot-where-the-each-specifies-of-the-iris-data-set-is-given-a-different-colour/25600)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 2\
**Last updated:** [June 24, 2019, 12:16pm UTC](https://discourse.julialang.org/t/how-to-plot-a-scatter-plot-where-the-each-specifies-of-the-iris-data-set-is-given-a-different-colour/25600 "2019-06-24T12:16:32Z")

</div>

This seem quite easy with R’s ggplot2 but I can’t seem to figure it out with Plots.jl I want to do a scatter plot of two numeric columns of the iris dataset and have the Species be the colour of each point. Of courses, …

---

## [How to manage dependencies of developed packages](https://discourse.julialang.org/t/how-to-manage-dependencies-of-developed-packages/25481)

<div class="topic-metadata">

**Author:** [@bsxfan](https://discourse.julialang.org/u/bsxfan)\
**Replies:** 5\
**Last updated:** [June 24, 2019, 11:50am UTC](https://discourse.julialang.org/t/how-to-manage-dependencies-of-developed-packages/25481 "2019-06-24T11:50:50Z")

</div>

I’m sorry, I tried to read docs and various related discourse posts, but I still can’t figure out how to handle dependencies in developed packages. (I’m using Julia 1.1.1 on windows.) I am working with an environment th…

---

## [Sampling and Reconstructing a signal](https://discourse.julialang.org/t/sampling-and-reconstructing-a-signal/25597)

<div class="topic-metadata">

**Author:** [@zarkopafilis](https://discourse.julialang.org/u/zarkopafilis)\
**Replies:** 0\
**Last updated:** [June 24, 2019, 10:20am UTC](https://discourse.julialang.org/t/sampling-and-reconstructing-a-signal/25597 "2019-06-24T10:20:21Z")

</div>

I did post on code review stackexchange but got no response (a week has passed), so, here is an effective copy-paste of the question: I am a newcomer to the Julia world, so I started trying to implement a very simple pr…

---

## [Interaction of macros and comments with ; in REPL](https://discourse.julialang.org/t/interaction-of-macros-and-comments-with-in-repl/25544)

<div class="topic-metadata">

**Author:** [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Replies:** 5\
**Last updated:** [June 24, 2019, 10:16am UTC](https://discourse.julialang.org/t/interaction-of-macros-and-comments-with-in-repl/25544 "2019-06-24T10:16:27Z")

</div>

I was quite surprised to see the following in REPL: julia\> macro g(ex) "Some value" end @g (macro with 1 method) julia\> @g 1 "Some value" julia\> @g 1; julia\> @g 1 # comment "Some value" julia\> @g 1; # …

---

## [Registrator.jl says looking up of tree hash failed?](https://discourse.julialang.org/t/registrator-jl-says-looking-up-of-tree-hash-failed/25583)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 3\
**Last updated:** [June 24, 2019, 8:23am UTC](https://discourse.julialang.org/t/registrator-jl-says-looking-up-of-tree-hash-failed/25583 "2019-06-24T08:23:07Z")

</div>

i tried to register my package https://github.com/floswald/MomentOpt.jl/releases/tag/v1.4.0 it says ERROR: Looking up the tree hash failed. what does that mean?

---

## [How to dispatch method based on input function argument type](https://discourse.julialang.org/t/how-to-dispatch-method-based-on-input-function-argument-type/25582)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 2\
**Last updated:** [June 24, 2019, 7:32am UTC](https://discourse.julialang.org/t/how-to-dispatch-method-based-on-input-function-argument-type/25582 "2019-06-24T07:32:25Z")

</div>

I know there is FunctionWrapper.jl but is it possible to use some design pattern to workaround this without letting user write the wrapper themselves? e.g I’d like to dispatch the following function sample(f::Function{…

---

## [How to sort eigenvectors from lowest to highest corresponding eigenvalue?](https://discourse.julialang.org/t/how-to-sort-eigenvectors-from-lowest-to-highest-corresponding-eigenvalue/25586)

<div class="topic-metadata">

**Author:** [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Replies:** 3\
**Last updated:** [June 24, 2019, 5:48am UTC](https://discourse.julialang.org/t/how-to-sort-eigenvectors-from-lowest-to-highest-corresponding-eigenvalue/25586 "2019-06-24T05:48:50Z")

</div>

I’m solving a Sturm-Liouville problem numerically, and in order to use the eigenvectors and eigenvalues I get out of it, it would be handy to be able to order the eigenvalues in order of ascending absolute value, and sim…

---

## [Estimate parameters of a Delay Differential Equation](https://discourse.julialang.org/t/estimate-parameters-of-a-delay-differential-equation/25159)

<div class="topic-metadata">

**Author:** [@Farnazmdi](https://discourse.julialang.org/u/Farnazmdi)\
**Replies:** 6\
**Last updated:** [June 24, 2019, 4:53am UTC](https://discourse.julialang.org/t/estimate-parameters-of-a-delay-differential-equation/25159 "2019-06-24T04:53:54Z")

</div>

Hi! I am new to Julia and I’m trying to fit my data to a DDE, but have a problem with optimize(). It is not recognized, here is my code, and the error. I would appreciate if anyone could provide a toy example for how t…

---

## [Interpolation in macro calls](https://discourse.julialang.org/t/interpolation-in-macro-calls/25530)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 10\
**Last updated:** [June 23, 2019, 10:22pm UTC](https://discourse.julialang.org/t/interpolation-in-macro-calls/25530 "2019-06-23T22:22:49Z")

</div>

Now and again, I see macros that are able to interpolate their arguments. Here’s an example with BenchmarkTools: julia\> using BenchmarkTools julia\> ex = :(sin(3)) :(sin(3)) julia\> f(x) = @btime cos($x) f (generic func…

---

## [Struct construction in own built modules](https://discourse.julialang.org/t/struct-construction-in-own-built-modules/25553)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 5\
**Last updated:** [June 23, 2019, 9:14pm UTC](https://discourse.julialang.org/t/struct-construction-in-own-built-modules/25553 "2019-06-23T21:14:23Z")

</div>

Hi everyone, I am wondering how everyone properly defines structs for their own modules. I read that in Julia, one usually defines one base module where general packages are imported, file dependencies to own functions …

---

## [Simpler identifier for last result than ans](https://discourse.julialang.org/t/simpler-identifier-for-last-result-than-ans/25568)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 15\
**Last updated:** [June 23, 2019, 9:08pm UTC](https://discourse.julialang.org/t/simpler-identifier-for-last-result-than-ans/25568 "2019-06-23T21:08:12Z")

</div>

Hello, With ans I can refer to the last result in Julia. In ipython you can do the same with \_ (just an underscore). Is there a way to use a different identifier than ans to refer to the last result? Preferably using…

---

## [Irrational optimized away?](https://discourse.julialang.org/t/irrational-optimized-away/25577)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 4\
**Last updated:** [June 23, 2019, 7:38pm UTC](https://discourse.julialang.org/t/irrational-optimized-away/25577 "2019-06-23T19:38:09Z")

</div>

I found this a little interesting. It seems that the add operation has been optimized away for irrational. How does it do that? julia\> koo(v) = v + 10 koo (generic function with 1 method) julia\> @code\_llvm koo(1) ; …

---

## [Importing a macro within another macro](https://discourse.julialang.org/t/importing-a-macro-within-another-macro/25550)

<div class="topic-metadata">

**Author:** [@phrmoy](https://discourse.julialang.org/u/phrmoy)\
**Replies:** 6\
**Last updated:** [June 23, 2019, 7:17pm UTC](https://discourse.julialang.org/t/importing-a-macro-within-another-macro/25550 "2019-06-23T19:17:20Z")

</div>

Why doesn’t this work? macro verify() return esc(quote using julia\_utils: @add\_default\_constructor mutable struct A a::Int A() = new() end @add\_default\_constru…

---

## [\`String\` returns true for \`isstructtype\`](https://discourse.julialang.org/t/string-returns-true-for-isstructtype/25559)

<div class="topic-metadata">

**Author:** [@phrmoy](https://discourse.julialang.org/u/phrmoy)\
**Replies:** 10\
**Last updated:** [June 23, 2019, 6:59pm UTC](https://discourse.julialang.org/t/string-returns-true-for-isstructtype/25559 "2019-06-23T18:59:36Z")

</div>

help?\> isstructtypesearch: isstructtype Base.isstructtype(T) -\> Bool Determine whether type T was declared as a struct type (i.e. using the struct or mutable struct keyword). julia\> xs = "test"; isstructtype(typeo…

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

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