# Latest

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

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

**Page:** 1506

---

## [Scoping issues with Macro in Module](https://discourse.julialang.org/t/scoping-issues-with-macro-in-module/54383)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 3\
**Last updated:** [February 1, 2021, 5:43pm UTC](https://discourse.julialang.org/t/scoping-issues-with-macro-in-module/54383 "2021-02-01T17:43:55Z")

</div>

Hi everyone, I need to create a mutable struct where I do not know the number of fields a priori. I could alternatively just use a NamedTuple for this, but in this case the struct is preferable to me. I can do this wond…

---

## [Flux.@nograd equivalence in forwarddiff.jl?](https://discourse.julialang.org/t/flux-nograd-equivalence-in-forwarddiff-jl/54395)

<div class="topic-metadata">

**Author:** [@DeepQ](https://discourse.julialang.org/u/DeepQ)\
**Replies:** 1\
**Last updated:** [February 1, 2021, 5:25pm UTC](https://discourse.julialang.org/t/flux-nograd-equivalence-in-forwarddiff-jl/54395 "2021-02-01T17:25:36Z")

</div>

What is the equivalence of Flux.@nograd macro in forwarddiff.jl package?

---

## [Is there a package for loading SVG files?](https://discourse.julialang.org/t/is-there-a-package-for-loading-svg-files/54376)

<div class="topic-metadata">

**Author:** [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Replies:** 2\
**Last updated:** [February 1, 2021, 5:07pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-loading-svg-files/54376 "2021-02-01T17:07:44Z")

</div>

Is there is a package for loading SVG files? I have checked the usual suspects (Images, ImageMagick, FileIO, and ImageIO) and none of them provide loading of SVG, just writing apparently.

---

## [How to include resource files in a package](https://discourse.julialang.org/t/how-to-include-resource-files-in-a-package/54391)

<div class="topic-metadata">

**Author:** [@ollecram](https://discourse.julialang.org/u/ollecram)\
**Replies:** 2\
**Last updated:** [February 1, 2021, 4:51pm UTC](https://discourse.julialang.org/t/how-to-include-resource-files-in-a-package/54391 "2021-02-01T16:51:01Z")

</div>

I am writing a simple CAD-like system in Julia where, among other things, I have functions that produce LaTeX commands for drawing 2D shapes. These are just fragments that need to be include-d in a main.tex LaTeX file wi…

---

## [Implementation of an implace Hessian of a vector-valued function?](https://discourse.julialang.org/t/implementation-of-an-implace-hessian-of-a-vector-valued-function/33720)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 5\
**Last updated:** [February 1, 2021, 4:45pm UTC](https://discourse.julialang.org/t/implementation-of-an-implace-hessian-of-a-vector-valued-function/33720 "2021-02-01T16:45:05Z")

</div>

HI, i’m looking to implement an implace hessian of a vector-valued function, for example: f(x) = \[x\[1\],x\[2\],sin(x\[1\]),sum(x)\] The ForwardDiff Documentation gives an out of place example (slightly wrong, as size(f(x)) …

---

## [Is there a way to tell if a function was \`@inline\`’d?](https://discourse.julialang.org/t/is-there-a-way-to-tell-if-a-function-was-inline-d/54392)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 1, 2021, 4:23pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-tell-if-a-function-was-inline-d/54392 "2021-02-01T16:23:44Z")

</div>

Is there a way to tell if a function was @inline’d? Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the appropriate answer back to Slack, or pinging the poster he…

---

## [VFI algorithm (Econ) on the GPU tutorial](https://discourse.julialang.org/t/vfi-algorithm-econ-on-the-gpu-tutorial/21680)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 5\
**Last updated:** [February 1, 2021, 4:18pm UTC](https://discourse.julialang.org/t/vfi-algorithm-econ-on-the-gpu-tutorial/21680 "2021-02-01T16:18:58Z")

</div>

I wrote a simple extension of the CuArrays.jl tutorial section on how to iterate a value function on the gpu. https://floswald.github.io/html/vfi.html

---

## [Question about square brackets with for and f.() calls](https://discourse.julialang.org/t/question-about-square-brackets-with-for-and-f-calls/54389)

<div class="topic-metadata">

**Author:** [@Volodymyr\_Pakholok](https://discourse.julialang.org/u/Volodymyr_Pakholok)\
**Replies:** 2\
**Last updated:** [February 1, 2021, 3:55pm UTC](https://discourse.julialang.org/t/question-about-square-brackets-with-for-and-f-calls/54389 "2021-02-01T15:55:09Z")

</div>

Hi there! Who can explain, how it works? A = \[i + 3\*j for i=0:2, j=1:3\] f.(A) f.(A)

---

## [StructArrays creating a lot of allocations compared to arrays](https://discourse.julialang.org/t/structarrays-creating-a-lot-of-allocations-compared-to-arrays/54377)

<div class="topic-metadata">

**Author:** [@MrRobot](https://discourse.julialang.org/u/MrRobot)\
**Replies:** 2\
**Last updated:** [February 1, 2021, 3:28pm UTC](https://discourse.julialang.org/t/structarrays-creating-a-lot-of-allocations-compared-to-arrays/54377 "2021-02-01T15:28:21Z")

</div>

I am converting a molecular dynamics code from passing arrays, to instead holding information in StructArray’s. Unfortunately, the code is now 20 times slower. Below I have two identical MWE, one doing the force calcula…

---

## [Likelihood Ratio Test?](https://discourse.julialang.org/t/likelihood-ratio-test/38217)

<div class="topic-metadata">

**Author:** [@bjoerges](https://discourse.julialang.org/u/bjoerges)\
**Replies:** 10\
**Last updated:** [February 1, 2021, 3:23pm UTC](https://discourse.julialang.org/t/likelihood-ratio-test/38217 "2021-02-01T15:23:57Z")

</div>

Hey everyone, I am looking for a way to do Likelihood Ratio Tests in Julia. I have found a function in MixedModels.jl (which is also what I am using to fit my models), but it doesn’t seem to work for Generalized Linear …

---

## [Hello, could I get help with why Julia isn't able to find a file?\`\`\`pk\_df = DataF](https://discourse.julialang.org/t/hello-could-i-get-help-with-why-julia-isnt-able-to-find-a-file-pk-df-dataf/54382)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 1, 2021, 3:02pm UTC](https://discourse.julialang.org/t/hello-could-i-get-help-with-why-julia-isnt-able-to-find-a-file-pk-df-dataf/54382 "2021-02-01T15:02:55Z")

</div>

Hello, could I get help with why Julia isn’t able to find a file? pk\_df = DataFrame(CSV.File( "./Data/data\_all\_mice\_all\_humans\_corrected\_3SA\_DEL.csv", missingstrings = \["", "NA"\])) \`ArgumentError: “./Data/data\_a…

---

## [What's needed for a HPC cluster & Julia?](https://discourse.julialang.org/t/whats-needed-for-a-hpc-cluster-julia/54211)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 6\
**Last updated:** [February 1, 2021, 2:58pm UTC](https://discourse.julialang.org/t/whats-needed-for-a-hpc-cluster-julia/54211 "2021-02-01T14:58:55Z")

</div>

I have been asked to describe what I would like in a new HPC environment that my University might contribute to. 90% of my work is now done in Julia. Mostly modelling (GLM.jl, Turing.jl, MixedModels.jl, and Gibbs sampler…

---

## [\[ANN\] Krippendorff.jl](https://discourse.julialang.org/t/ann-krippendorff-jl/54261)

<div class="topic-metadata">

**Author:** [@FPGro](https://discourse.julialang.org/u/FPGro)\
**Replies:** 1\
**Last updated:** [February 1, 2021, 1:40pm UTC](https://discourse.julialang.org/t/ann-krippendorff-jl/54261 "2021-02-01T13:40:59Z")

</div>

Hey folks, I just wanted to present a small, currently unregistered package that I cleaned up in the last days: Krippendorff.jl - efficient computation of Krippendorff’s alpha in Julia. What is it doing? Krippendorf…

---

## [ReverseDiff.jl gives zeros when using fill](https://discourse.julialang.org/t/reversediff-jl-gives-zeros-when-using-fill/54369)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 1\
**Last updated:** [February 1, 2021, 11:53am UTC](https://discourse.julialang.org/t/reversediff-jl-gives-zeros-when-using-fill/54369 "2021-02-01T11:53:15Z")

</div>

Hey, the following MWE: function g(x) out = fill(0.0, size(x)) for i = 1:size(x)\[1\] out\[i, :\] .= x\[i, :\] end return out end ReverseDiff.gradient(x -\> sum(g(x)), randn((5, 5))) which returns 5×…

---

## [How to subset dataframe by multiple rows with same value?](https://discourse.julialang.org/t/how-to-subset-dataframe-by-multiple-rows-with-same-value/54294)

<div class="topic-metadata">

**Author:** [@Shazman](https://discourse.julialang.org/u/Shazman)\
**Replies:** 6\
**Last updated:** [February 1, 2021, 11:48am UTC](https://discourse.julialang.org/t/how-to-subset-dataframe-by-multiple-rows-with-same-value/54294 "2021-02-01T11:48:01Z")

</div>

Hi I want to subset a dataframe(df) by multiple rows with value (10004). I tried the command, but it does not work, I am wondering why ? df\[in(\[10004\]).(df.HWG), :\] 28,960 rows × 11 columns (omitted printing of 2 co…

---

## [Julia is busy on one thread all the time](https://discourse.julialang.org/t/julia-is-busy-on-one-thread-all-the-time/53428)

<div class="topic-metadata">

**Author:** [@Xijiang\_Yu](https://discourse.julialang.org/u/Xijiang_Yu)\
**Replies:** 4\
**Last updated:** [February 1, 2021, 11:12am UTC](https://discourse.julialang.org/t/julia-is-busy-on-one-thread-all-the-time/53428 "2021-02-01T11:12:25Z")

</div>

Julia 1.7.0-DEV.320 There is always one thread almost always 100% occupied on my machine. I have only a REPL running, and I called no function.

---

## [Is it worth it to check if a collection is empty before iterating?](https://discourse.julialang.org/t/is-it-worth-it-to-check-if-a-collection-is-empty-before-iterating/54360)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 5\
**Last updated:** [February 1, 2021, 9:23am UTC](https://discourse.julialang.org/t/is-it-worth-it-to-check-if-a-collection-is-empty-before-iterating/54360 "2021-02-01T09:23:22Z")

</div>

Is it worth checking if a collection is empty before iterating? That is, is there any argument for preferring option 2 in the following example? # Collection that may or may not be empty data = filter(x -\> x \> 0.75, ran…

---

## [Matrix multiplication with CPU and CUDA](https://discourse.julialang.org/t/matrix-multiplication-with-cpu-and-cuda/54364)

<div class="topic-metadata">

**Author:** [@ymtoo](https://discourse.julialang.org/u/ymtoo)\
**Replies:** 2\
**Last updated:** [February 1, 2021, 9:04am UTC](https://discourse.julialang.org/t/matrix-multiplication-with-cpu-and-cuda/54364 "2021-02-01T09:04:23Z")

</div>

Matrix multiplication yields slightly different results with CPU and CUDA. Is this a normal behaviour? julia\> using CUDA julia\> X = randn(Float32, 8, 16) 8×16 Array{Float32,2}: 0.933839 0.535854 0.054124 … -0.…

---

## [Initialization of Packages on import](https://discourse.julialang.org/t/initialization-of-packages-on-import/13633)

<div class="topic-metadata">

**Author:** [@azraq27](https://discourse.julialang.org/u/azraq27)\
**Replies:** 6\
**Last updated:** [February 1, 2021, 8:40am UTC](https://discourse.julialang.org/t/initialization-of-packages-on-import/13633 "2021-02-01T08:40:54Z")

</div>

I’m still getting used to the new v0.7 Pkg (Pkg3), but I kind of wish I had more documentation on it. Overall looks cool, I’m just getting confused about some things. One specific change I’m struggling with is that it s…

---

## [3d graph error](https://discourse.julialang.org/t/3d-graph-error/54224)

<div class="topic-metadata">

**Author:** [@Evan](https://discourse.julialang.org/u/Evan)\
**Replies:** 7\
**Last updated:** [February 1, 2021, 8:38am UTC](https://discourse.julialang.org/t/3d-graph-error/54224 "2021-02-01T08:38:31Z")

</div>

I’m getting an error from simple 3d plots, example of plot and error is below. What am i doing wrong? using Plots; pyplot() x=range(-2,stop=2,length=100) y=range(sqrt(2),stop=2,length=100) f(x,y) = x\*y-x-y+1 plot(x,…

---

## [Why doesn't convert(Symbol, "foo") work?](https://discourse.julialang.org/t/why-doesnt-convert-symbol-foo-work/54357)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [February 1, 2021, 5:56am UTC](https://discourse.julialang.org/t/why-doesnt-convert-symbol-foo-work/54357 "2021-02-01T05:56:42Z")

</div>

Since the Symbol constructor works, is there a reason why convert(Symbol, "foo") shouldn’t work? julia\> Symbol("foo") :foo julia\> convert(Symbol, "foo") ERROR: MethodError: Cannot \`convert\` an object of type String to …

---

## [Sr. HPC Software Engineer at Liquid Analytics](https://discourse.julialang.org/t/sr-hpc-software-engineer-at-liquid-analytics/54358)

<div class="topic-metadata">

**Author:** [@Vish\_Canaran](https://discourse.julialang.org/u/Vish_Canaran)\
**Replies:** 0\
**Last updated:** [February 1, 2021, 4:49am UTC](https://discourse.julialang.org/t/sr-hpc-software-engineer-at-liquid-analytics/54358 "2021-02-01T04:49:35Z")

</div>

Are you a seasoned Sr. Software Engineer with a mathematical mind, eager to build HPC business solutions with Julia? Join Team Liquid. We are looking to develop a complete Julia team to solve difficult sales distribution…

---

## [Nteract troubles](https://discourse.julialang.org/t/nteract-troubles/54356)

<div class="topic-metadata">

**Author:** [@jebej](https://discourse.julialang.org/u/jebej)\
**Replies:** 0\
**Last updated:** [February 1, 2021, 3:50am UTC](https://discourse.julialang.org/t/nteract-troubles/54356 "2021-02-01T03:50:08Z")

</div>

I can use nteract, but the syntax highlighting is wrong, and autocompletion (ctrl-space) does not work at all. From seeing a few posts here it appears that these should work. Is any special configuration needed? This is…

---

## [Global constants that cannot be defined until runtime because they depend on specifics of the CPU architecture](https://discourse.julialang.org/t/global-constants-that-cannot-be-defined-until-runtime-because-they-depend-on-specifics-of-the-cpu-architecture/54077)

<div class="topic-metadata">

**Author:** [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Replies:** 7\
**Last updated:** [February 1, 2021, 2:23am UTC](https://discourse.julialang.org/t/global-constants-that-cannot-be-defined-until-runtime-because-they-depend-on-specifics-of-the-cpu-architecture/54077 "2021-02-01T02:23:32Z")

</div>

@elrod and I are running into problems when trying to make LoopVectorization.jl relocatable. (for example, compiling a sysimage that includes LoopVectorization.jl on machine A, and then using that sysimage on machine B). …

---

## [ERROR: LoadError: UndefVarError: getValue not defined](https://discourse.julialang.org/t/error-loaderror-undefvarerror-getvalue-not-defined/54350)

<div class="topic-metadata">

**Author:** [@Prottay\_Adhikari](https://discourse.julialang.org/u/Prottay_Adhikari)\
**Replies:** 9\
**Last updated:** [February 1, 2021, 1:52am UTC](https://discourse.julialang.org/t/error-loaderror-undefvarerror-getvalue-not-defined/54350 "2021-02-01T01:52:52Z")

</div>

I was trying to run the power system example to execute the economic load dispatch operation. The original code was reported here. However when I try to run this code (with the modifications to make the code compliant …

---

## [What’s the correct way to convert \`Dates.unix2datetime(mtime(fpath))\` to a datetim](https://discourse.julialang.org/t/what-s-the-correct-way-to-convert-dates-unix2datetime-mtime-fpath-to-a-datetim/54353)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 1, 2021, 1:50am UTC](https://discourse.julialang.org/t/what-s-the-correct-way-to-convert-dates-unix2datetime-mtime-fpath-to-a-datetim/54353 "2021-02-01T01:50:19Z")

</div>

What’s the correct way to convert Dates.unix2datetime(mtime(fpath)) to a datetime with the correct time zone for my system? I get a time 5 hours in the future, so I assume it’s returning UTC. julia&gt; Dates.unix2datet…

---

## [\`&\` does not appear to shortcircuit but \`&&\` does not work, is ther](https://discourse.julialang.org/t/does-not-appear-to-shortcircuit-but-does-not-work-is-ther/54345)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 3\
**Last updated:** [January 31, 2021, 10:36pm UTC](https://discourse.julialang.org/t/does-not-appear-to-shortcircuit-but-does-not-work-is-ther/54345 "2021-01-31T22:36:36Z")

</div>

& does not appear to shortcircuit but && does not work, is there another operator for broadcasted short-circuiting logical AND? Note that the poster on Slack cannot see your response here on Discourse. Consider answeri…

---

## [Released version vs. source compiled - optimizations?](https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329)

<div class="topic-metadata">

**Author:** [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Replies:** 6\
**Last updated:** [January 31, 2021, 9:32pm UTC](https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329 "2021-01-31T21:32:40Z")

</div>

One “bug” I recently found appears to differ between the packaged and released version of Julia and the one I compile from source. Extra allocations associated with unused ArgumentError · Issue #37639 · JuliaLang/julia …

---

## [Problem with setting start value for PATH solver(PATH.jl) when solving a complementarity problem](https://discourse.julialang.org/t/problem-with-setting-start-value-for-path-solver-path-jl-when-solving-a-complementarity-problem/53918)

<div class="topic-metadata">

**Author:** [@jshengdb](https://discourse.julialang.org/u/jshengdb)\
**Replies:** 6\
**Last updated:** [January 31, 2021, 9:12pm UTC](https://discourse.julialang.org/t/problem-with-setting-start-value-for-path-solver-path-jl-when-solving-a-complementarity-problem/53918 "2021-01-31T21:12:23Z")

</div>

Hello, I am now having a problem with setting initial value for PATH solver(PATH.jl). I am trying to solve a linear complementarity problem with a chosen initial point. The problem is following: A = Dict( (1,1) =\> …

---

## [Can I modify Flux parameters manually?](https://discourse.julialang.org/t/can-i-modify-flux-parameters-manually/54344)

<div class="topic-metadata">

**Author:** [@DevJac](https://discourse.julialang.org/u/DevJac)\
**Replies:** 1\
**Last updated:** [January 31, 2021, 8:45pm UTC](https://discourse.julialang.org/t/can-i-modify-flux-parameters-manually/54344 "2021-01-31T20:45:38Z")

</div>

I want to be able to manually modify my Flux parameters, but when I have a Zygote.Params object, I can’t seem to change anything about it. I am trying to average the parameters of two networks that are the same shape (Po…

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

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