# Latest

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

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

**Page:** 1708

---

## [Pytest-covid](https://discourse.julialang.org/t/pytest-covid/42025)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 0\
**Last updated:** [June 25, 2020, 7:06am UTC](https://discourse.julialang.org/t/pytest-covid/42025 "2020-06-25T07:06:31Z")

</div>

The more failures you get, the more tests it will skip.

---

## [Reference to two vectors?](https://discourse.julialang.org/t/reference-to-two-vectors/42024)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 3\
**Last updated:** [June 25, 2020, 5:24am UTC](https://discourse.julialang.org/t/reference-to-two-vectors/42024 "2020-06-25T05:24:57Z")

</div>

suppose I have two vectors: a = \[1, 2\]; b = \[3, 4\] how could I create a single “reference” vector c, which is a concatenation of a and b, so that any changes in each would be reflected in the others?? for example, bel…

---

## [ERROR: MethodError: no method matching -(::StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}, ::Float64)](https://discourse.julialang.org/t/error-methoderror-no-method-matching-steprangelen-float64-base-twiceprecision-float64-base-twiceprecision-float64-float64/41993)

<div class="topic-metadata">

**Author:** [@hafez\_ahmad](https://discourse.julialang.org/u/hafez_ahmad)\
**Replies:** 6\
**Last updated:** [June 25, 2020, 2:35am UTC](https://discourse.julialang.org/t/error-methoderror-no-method-matching-steprangelen-float64-base-twiceprecision-float64-base-twiceprecision-float64-float64/41993 "2020-06-25T02:35:45Z")

</div>

why I am getting error? any help appreciated T=0.5; Parameters of ODE system a=\[N, x0 ,xN ,c\]; x=range(x0,step=xN,stop=N); Exact solution uexc=exp.(-(x-T-2).\*(x-T-2)); ERROR: MethodError: no method matching -(::Step…

---

## [Adding parameters to custom layers in Flux](https://discourse.julialang.org/t/adding-parameters-to-custom-layers-in-flux/42018)

<div class="topic-metadata">

**Author:** [@jmurray](https://discourse.julialang.org/u/jmurray)\
**Replies:** 0\
**Last updated:** [June 25, 2020, 1:01am UTC](https://discourse.julialang.org/t/adding-parameters-to-custom-layers-in-flux/42018 "2020-06-25T01:01:17Z")

</div>

At the output of my Flux model, I need to un-normalize one of the outputs. I only need to store a single variable value somewhere (I think the best place is in a custom layer), but I don’t know how to store an ancillary …

---

## [Flux: Custom Layer](https://discourse.julialang.org/t/flux-custom-layer/41481)

<div class="topic-metadata">

**Author:** [@jmurray](https://discourse.julialang.org/u/jmurray)\
**Replies:** 3\
**Last updated:** [June 25, 2020, 12:42am UTC](https://discourse.julialang.org/t/flux-custom-layer/41481 "2020-06-25T00:42:26Z")

</div>

In Flux, I need to create a custom layer (named Nonneg) and then train the model with Train. I tried replicating the Dense layer, following @LudiWin’s example and looking at the definition of the Dense layer. When I try…

---

## [What does "k for k = 1:3" expands out to be?](https://discourse.julialang.org/t/what-does-k-for-k-1-3-expands-out-to-be/42014)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 5\
**Last updated:** [June 24, 2020, 11:55pm UTC](https://discourse.julialang.org/t/what-does-k-for-k-1-3-expands-out-to-be/42014 "2020-06-24T23:55:51Z")

</div>

I am confused here julia\> sum(\[1,2,3\]) 6 julia\> sum(\[k for k = 1:3\]) 6 julia\> sum(k for k = 1:3) 6 But when I expand out “k for k = 1:3” manually it does not work julia\> sum(1,2,3) ERROR: MethodError: no method matc…

---

## [Getting started with mixed models](https://discourse.julialang.org/t/getting-started-with-mixed-models/41998)

<div class="topic-metadata">

**Author:** [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Replies:** 4\
**Last updated:** [June 24, 2020, 10:36pm UTC](https://discourse.julialang.org/t/getting-started-with-mixed-models/41998 "2020-06-24T22:36:18Z")

</div>

I think I’m missing something very basic with MixedModels… julia\> using MixedModels, StatsBase julia\> t = (y = rand(100), x = rand(100)); julia\> fit(MixedModel, @formula(y ~ x), t) ERROR: MethodError: no method matchi…

---

## [Mixed multi-membership models in Julia](https://discourse.julialang.org/t/mixed-multi-membership-models-in-julia/42005)

<div class="topic-metadata">

**Author:** [@dhalpern](https://discourse.julialang.org/u/dhalpern)\
**Replies:** 4\
**Last updated:** [June 24, 2020, 10:23pm UTC](https://discourse.julialang.org/t/mixed-multi-membership-models-in-julia/42005 "2020-06-24T22:23:27Z")

</div>

I was wondering if it was possible to fit a multi-membership model with MixedModels in Julia, as described by Ben Bolker for lme4 here. It seems like it should be in principle possible by editing the random effects matri…

---

## [Package publishing documentation](https://discourse.julialang.org/t/package-publishing-documentation/17926)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 5\
**Last updated:** [June 24, 2020, 10:19pm UTC](https://discourse.julialang.org/t/package-publishing-documentation/17926 "2020-06-24T22:19:55Z")

</div>

Is there any documentation for the publishing of new Julia packages? I couldn’t find anything. Thanks!

---

## [Sum isn't faster than a loop?](https://discourse.julialang.org/t/sum-isnt-faster-than-a-loop/42008)

<div class="topic-metadata">

**Author:** [@tautomer](https://discourse.julialang.org/u/tautomer)\
**Replies:** 11\
**Last updated:** [June 24, 2020, 9:53pm UTC](https://discourse.julialang.org/t/sum-isnt-faster-than-a-loop/42008 "2020-06-24T21:53:34Z")

</div>

Hi guys, I’m computing a derivative from a summation. I thought vectorizing the function would be faster than a loop, but it isn’t the case. using BenchmarkTools, Random ωc = 0.05 chi = 0.01 const k = ωc^2 const coupl…

---

## [How to add weights parameter to Generalized Mixed Model](https://discourse.julialang.org/t/how-to-add-weights-parameter-to-generalized-mixed-model/41984)

<div class="topic-metadata">

**Author:** [@laut](https://discourse.julialang.org/u/laut)\
**Replies:** 33\
**Last updated:** [June 24, 2020, 8:51pm UTC](https://discourse.julialang.org/t/how-to-add-weights-parameter-to-generalized-mixed-model/41984 "2020-06-24T20:51:48Z")

</div>

How do you add the weight of an observation to a Mixed Model? I thought I could add the Freq column to wt argument, but apparently not. using RDatasets MixedModels titanic = RDatasets.dataset("datasets", "Titanic") tita…

---

## [The order of multiple dispatch](https://discourse.julialang.org/t/the-order-of-multiple-dispatch/41979)

<div class="topic-metadata">

**Author:** [@mitsuruk](https://discourse.julialang.org/u/mitsuruk)\
**Replies:** 13\
**Last updated:** [June 24, 2020, 8:40pm UTC](https://discourse.julialang.org/t/the-order-of-multiple-dispatch/41979 "2020-06-24T20:40:19Z")

</div>

Hi, I am learning Julialang on Mac and Windwos. I have a question about the order of multiple dispatch. function dfunc(args::Int64) println(“Int64”) end function dfunc(args::Any) println(“Any”) end julia\> dfunc(2…

---

## [Problems reading data with JLD (edited title)](https://discourse.julialang.org/t/problems-reading-data-with-jld-edited-title/41775)

<div class="topic-metadata">

**Author:** [@jbpatzer](https://discourse.julialang.org/u/jbpatzer)\
**Replies:** 27\
**Last updated:** [June 24, 2020, 8:18pm UTC](https://discourse.julialang.org/t/problems-reading-data-with-jld-edited-title/41775 "2020-06-24T20:18:38Z")

</div>

I have a working code that consists of lots of separate .jl files. I have a file “Code.jl” that includes them all in the form using Package1, Package2 include("Function1.jl") include("Function2.jl") I type include("C…

---

## [Struct with abstract-type field](https://discourse.julialang.org/t/struct-with-abstract-type-field/8743)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 22\
**Last updated:** [June 24, 2020, 7:49pm UTC](https://discourse.julialang.org/t/struct-with-abstract-type-field/8743 "2020-06-24T19:49:08Z")

</div>

If I define a field inside a struct with an abstract type (for instance AbstractArray), am I making it unnecessarily hard for inference to guess the type?

---

## [Dictionary is changing its values with matrices](https://discourse.julialang.org/t/dictionary-is-changing-its-values-with-matrices/41997)

<div class="topic-metadata">

**Author:** [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Replies:** 2\
**Last updated:** [June 24, 2020, 6:13pm UTC](https://discourse.julialang.org/t/dictionary-is-changing-its-values-with-matrices/41997 "2020-06-24T18:13:45Z")

</div>

Hello World ! I would to share an experience that google did not provide useful answers at first. Therefore, maybe someone in the future can save your time reading this words. I’m coding a program of orbits of planets …

---

## [Convert hex to base64](https://discourse.julialang.org/t/convert-hex-to-base64/42003)

<div class="topic-metadata">

**Author:** [@pihive](https://discourse.julialang.org/u/pihive)\
**Replies:** 2\
**Last updated:** [June 24, 2020, 6:06pm UTC](https://discourse.julialang.org/t/convert-hex-to-base64/42003 "2020-06-24T18:06:36Z")

</div>

Hi, I’m new to Julia and want to try solving the cryptopals challenges using Julia: The Cryptopals Crypto Challenges However, I’m already struggling on the first task to convert hex to base64. This hex string should b…

---

## [Correct way to transparently use SQLite.jl responses or (legacy) text files as a data source](https://discourse.julialang.org/t/correct-way-to-transparently-use-sqlite-jl-responses-or-legacy-text-files-as-a-data-source/41825)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 3\
**Last updated:** [June 24, 2020, 5:51pm UTC](https://discourse.julialang.org/t/correct-way-to-transparently-use-sqlite-jl-responses-or-legacy-text-files-as-a-data-source/41825 "2020-06-24T17:51:02Z")

</div>

I’ve really been enjoying SQLight.jl as a back end that just works. Is there any high level documentation on the relationship between SQLight.jl, Tables.jl, and DataFrames.jl? Background: Unfortunately, the package I’m…

---

## [Deparametrising types](https://discourse.julialang.org/t/deparametrising-types/41939)

<div class="topic-metadata">

**Author:** [@mhauru](https://discourse.julialang.org/u/mhauru)\
**Replies:** 4\
**Last updated:** [June 24, 2020, 5:15pm UTC](https://discourse.julialang.org/t/deparametrising-types/41939 "2020-06-24T17:15:57Z")

</div>

I’m running into trouble having parametric types that I would sometimes like to refer to by their deparametrised UnionAll versions, while only having instances of the types available. Here’s a heavily simplified mock-up…

---

## [Processing audio streams in Julia](https://discourse.julialang.org/t/processing-audio-streams-in-julia/41957)

<div class="topic-metadata">

**Author:** [@Phil\_Tomson](https://discourse.julialang.org/u/Phil_Tomson)\
**Replies:** 1\
**Last updated:** [June 24, 2020, 4:42pm UTC](https://discourse.julialang.org/t/processing-audio-streams-in-julia/41957 "2020-06-24T16:42:17Z")

</div>

I’m looking for a way to process audio streams in Julia. Specifically I’d like to be able to open up a stream from web radio stations and do some machine learning on the data stream. It looks like AudioIO.jl used to be …

---

## [Package TextAnalysis, how to use most up to date version?](https://discourse.julialang.org/t/package-textanalysis-how-to-use-most-up-to-date-version/41983)

<div class="topic-metadata">

**Author:** [@stej](https://discourse.julialang.org/u/stej)\
**Replies:** 2\
**Last updated:** [June 24, 2020, 3:38pm UTC](https://discourse.julialang.org/t/package-textanalysis-how-to-use-most-up-to-date-version/41983 "2020-06-24T15:38:45Z")

</div>

Hi all, I wanted to use TextAnalysis package. I added it, the version is 0.6.0. This versions is the last one according to github. (@v1.4) pkg\> update TextAnalysis Updating registry at \`C:\\Users\\u\\.julia\\registries\\G…

---

## [Declare vector type or not / views / subarrays](https://discourse.julialang.org/t/declare-vector-type-or-not-views-subarrays/41975)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 5\
**Last updated:** [June 24, 2020, 2:44pm UTC](https://discourse.julialang.org/t/declare-vector-type-or-not-views-subarrays/41975 "2020-06-24T14:44:01Z")

</div>

Consider the example, in which I want to perform some calculations on a part of vector: julia\> f( x :: Vector{Float64} ) = (x\[1\]^2 + x\[2\]^2 + x\[3\]^2) f (generic function with 1 method) julia\> g( x :: AbstractArray ) = …

---

## [PIC (particle-in-cell), space charge tracking simulation?](https://discourse.julialang.org/t/pic-particle-in-cell-space-charge-tracking-simulation/26077)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 32\
**Last updated:** [June 24, 2020, 2:29pm UTC](https://discourse.julialang.org/t/pic-particle-in-cell-space-charge-tracking-simulation/26077 "2020-06-24T14:29:44Z")

</div>

There’s a lot of demand in plasma/accelerator science to simulate space charge through so-called particle-in-cell model (which is somewhat like finite element analysis in structural dynamics etc) Many of them, for examp…

---

## [Is there a way to set Ipopt's intemediate callback from JuMP?](https://discourse.julialang.org/t/is-there-a-way-to-set-ipopts-intemediate-callback-from-jump/41976)

<div class="topic-metadata">

**Author:** [@pjssilva](https://discourse.julialang.org/u/pjssilva)\
**Replies:** 3\
**Last updated:** [June 24, 2020, 1:03pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-set-ipopts-intemediate-callback-from-jump/41976 "2020-06-24T13:03:11Z")

</div>

Hello, I was looking at the Ipopt.jl MOI interface and I could not find an easy way to set the intermediate callback (to stop iteration if needed). Is there any workaround? Maybe grab the Ipopt Optimizer struct directly…

---

## [How to determine if an object is callable?](https://discourse.julialang.org/t/how-to-determine-if-an-object-is-callable/2897)

<div class="topic-metadata">

**Author:** [@TsurHerman](https://discourse.julialang.org/u/TsurHerman)\
**Replies:** 21\
**Last updated:** [June 24, 2020, 6:54am UTC](https://discourse.julialang.org/t/how-to-determine-if-an-object-is-callable/2897 "2020-06-24T06:54:22Z")

</div>

How do I determine if an object is callable?

---

## [VSCode Plugin - Minimalist configuration](https://discourse.julialang.org/t/vscode-plugin-minimalist-configuration/41942)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 7\
**Last updated:** [June 24, 2020, 6:54am UTC](https://discourse.julialang.org/t/vscode-plugin-minimalist-configuration/41942 "2020-06-24T06:54:06Z")

</div>

Hi, I have a laptop with i5 and 4GB RAM. When I tried to use Julia with VSCode plugin, the CPU utilization went up to near 100% and consumed almost my entire RAM. From what I understand, this because of the package inde…

---

## [Segmentation fault: 11 caused by Pkg.update()](https://discourse.julialang.org/t/segmentation-fault-11-caused-by-pkg-update/41926)

<div class="topic-metadata">

**Author:** [@nmatzke](https://discourse.julialang.org/u/nmatzke)\
**Replies:** 1\
**Last updated:** [June 24, 2020, 6:43am UTC](https://discourse.julialang.org/t/segmentation-fault-11-caused-by-pkg-update/41926 "2020-06-24T06:43:25Z")

</div>

Hi folks! I just installed Julia 1.4 on my Mac OSX 10.13. It seems to work fine, but then when I type Pkg.update() I get: \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | …

---

## [A bug with diff() for a UnitRange input?](https://discourse.julialang.org/t/a-bug-with-diff-for-a-unitrange-input/41963)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 2\
**Last updated:** [June 24, 2020, 4:12am UTC](https://discourse.julialang.org/t/a-bug-with-diff-for-a-unitrange-input/41963 "2020-06-24T04:12:39Z")

</div>

I ran across the following bug in Julia 1.5.0-beta1.0 in diff() when the input is of type UnitRange. The output is also very weird for StepRangeLen inputs. My understanding is that UnitRange is an AbstractArray type. I t…

---

## [Diff! (in-place or preallocated output version of diff)](https://discourse.julialang.org/t/diff-in-place-or-preallocated-output-version-of-diff/41949)

<div class="topic-metadata">

**Author:** [@JeffFessler](https://discourse.julialang.org/u/JeffFessler)\
**Replies:** 2\
**Last updated:** [June 24, 2020, 3:16am UTC](https://discourse.julialang.org/t/diff-in-place-or-preallocated-output-version-of-diff/41949 "2020-06-24T03:16:31Z")

</div>

The Julia manual nicely makes the case for pre-allocating outputs: https://docs.julialang.org/en/latest/manual/performance-tips/#Pre-allocating-outputs-1 Yet the function diff that is used extensively in scientific com…

---

## [Compiling sys.o: Segmentation fault in expression starting at none:0](https://discourse.julialang.org/t/compiling-sys-o-segmentation-fault-in-expression-starting-at-none-0/41838)

<div class="topic-metadata">

**Author:** [@German\_Salazar](https://discourse.julialang.org/u/German_Salazar)\
**Replies:** 1\
**Last updated:** [June 24, 2020, 2:47am UTC](https://discourse.julialang.org/t/compiling-sys-o-segmentation-fault-in-expression-starting-at-none-0/41838 "2020-06-24T02:47:25Z")

</div>

Say, I was following the instructions from the PackageCompiler on how to manually compile an app; but, I am getting an error right away with no hint as to what’s wrong: julia --startup-file=no -J"/path/to/julia/1.4.2/…

---

## [Is it possible to use an image (eg. jpg) as a 'marker' in plots?](https://discourse.julialang.org/t/is-it-possible-to-use-an-image-eg-jpg-as-a-marker-in-plots/41491)

<div class="topic-metadata">

**Author:** [@mantzaris](https://discourse.julialang.org/u/mantzaris)\
**Replies:** 2\
**Last updated:** [June 24, 2020, 1:52am UTC](https://discourse.julialang.org/t/is-it-possible-to-use-an-image-eg-jpg-as-a-marker-in-plots/41491 "2020-06-24T01:52:16Z")

</div>

I have a plot with a time series and another with a shapefile, and would like to plot some markers to highlight some parts of the figure. I would like those markers to be ‘images’ loaded from a file; eg png or jpg. Is th…

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

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