# Latest

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

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

**Page:** 1148

---

## [Clear dict?](https://discourse.julialang.org/t/clear-dict/74742)

<div class="topic-metadata">

**Author:** [@unis](https://discourse.julialang.org/u/unis)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 5:58am UTC](https://discourse.julialang.org/t/clear-dict/74742 "2022-01-20T05:58:33Z")

</div>

In Python, one may a clear a dict as follows d = {1:'a'} d.clear() In Julia, I’d have expected a similar workflow along the lines of d = Dict(1=\>'a') clear!(d) To my surprise, there seems to be no such function clear…

---

## [What's a good and easy way to parallelize this?](https://discourse.julialang.org/t/whats-a-good-and-easy-way-to-parallelize-this/74893)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 3\
**Last updated:** [January 20, 2022, 5:35am UTC](https://discourse.julialang.org/t/whats-a-good-and-easy-way-to-parallelize-this/74893 "2022-01-20T05:35:21Z")

</div>

Ultimately, I want to speed up fullsys!, and as you can see there are functions that fill arrays. I thought those filling operations could be parallelized. How can I get started with that? const szAge = 64 - 19 + 1 cons…

---

## [How to concatenate vectors to be a matrix, not a vector](https://discourse.julialang.org/t/how-to-concatenate-vectors-to-be-a-matrix-not-a-vector/74726)

<div class="topic-metadata">

**Author:** [@Xiao](https://discourse.julialang.org/u/Xiao)\
**Replies:** 7\
**Last updated:** [January 20, 2022, 1:12am UTC](https://discourse.julialang.org/t/how-to-concatenate-vectors-to-be-a-matrix-not-a-vector/74726 "2022-01-20T01:12:33Z")

</div>

Hi, I tried a few solutions(vcat, hcat, \[;\], \[,\], etc), but haven’t got what I want. julia\> function minesweeper(input) allarr = \[\] for line in input arr = split(line, "") …

---

## [Pass Fortran array of unknown size to Julia](https://discourse.julialang.org/t/pass-fortran-array-of-unknown-size-to-julia/74784)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 1:12am UTC](https://discourse.julialang.org/t/pass-fortran-array-of-unknown-size-to-julia/74784 "2022-01-20T01:12:46Z")

</div>

I need to read some binary data (a few arrays, stored in, say, WS2.HSX) that is handled by a Fortran module. I would like to call the Fortran module from Julia. However, the sizes of the arrays are not known in advance. …

---

## [Where is this one allocation coming from?](https://discourse.julialang.org/t/where-is-this-one-allocation-coming-from/72693)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 16\
**Last updated:** [January 20, 2022, 1:11am UTC](https://discourse.julialang.org/t/where-is-this-one-allocation-coming-from/72693 "2022-01-20T01:11:47Z")

</div>

I have to run functions like this many times. I’m interested in reducing allocations and don’t see where that one allocation is coming from. using BenchmarkTools using ComponentArrays using UnPack α0 = rand(2, 2, 5) α …

---

## [Zygote terribly slow. What am I doing wrong?](https://discourse.julialang.org/t/zygote-terribly-slow-what-am-i-doing-wrong/74877)

<div class="topic-metadata">

**Author:** [@shiroghost](https://discourse.julialang.org/u/shiroghost)\
**Replies:** 12\
**Last updated:** [January 19, 2022, 10:39pm UTC](https://discourse.julialang.org/t/zygote-terribly-slow-what-am-i-doing-wrong/74877 "2022-01-19T22:39:18Z")

</div>

Hi all, I have been using ReverseDiff.jl for a project for quite some time. Now I have switched to Zygote because I need to determine derivative w.r.t. custom types and this seems straightforward with Zygote (see Evalua…

---

## [Fastest way to get CodeInfo from a function call](https://discourse.julialang.org/t/fastest-way-to-get-codeinfo-from-a-function-call/74813)

<div class="topic-metadata">

**Author:** [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Replies:** 2\
**Last updated:** [January 19, 2022, 10:30pm UTC](https://discourse.julialang.org/t/fastest-way-to-get-codeinfo-from-a-function-call/74813 "2022-01-19T22:30:33Z")

</div>

Given a function f and its arguments args, Is there a faster way to get corresponding CodeInfo than code\_lowered(f, map(typeof, args))? I don’t care about type inference and compiler optimizations - in fact, the closer t…

---

## [Ssh cluster julia host address issue](https://discourse.julialang.org/t/ssh-cluster-julia-host-address-issue/63814)

<div class="topic-metadata">

**Author:** [@grandemundo82](https://discourse.julialang.org/u/grandemundo82)\
**Replies:** 7\
**Last updated:** [January 19, 2022, 10:09pm UTC](https://discourse.julialang.org/t/ssh-cluster-julia-host-address-issue/63814 "2022-01-19T22:09:06Z")

</div>

I am getting some error adding processors to a university cluster. When I ssh to the cluster and start Julia, when I run using Distributed addprocs(\[("username@compute-6-300",1)\], tunnel=true, max\_parallel=1, exename="…

---

## [How to give a parameter list to Gurobi](https://discourse.julialang.org/t/how-to-give-a-parameter-list-to-gurobi/74878)

<div class="topic-metadata">

**Author:** [@fksayaci](https://discourse.julialang.org/u/fksayaci)\
**Replies:** 4\
**Last updated:** [January 19, 2022, 9:25pm UTC](https://discourse.julialang.org/t/how-to-give-a-parameter-list-to-gurobi/74878 "2022-01-19T21:25:57Z")

</div>

Hi all, I use Gurobi to solve an optimization problem. I might need to try different Gurobi parameters. Currently, I write parameters and their values inside the model directly, like Expansion\_Model = Model(optimizer…

---

## [What is Ref?](https://discourse.julialang.org/t/what-is-ref/47610)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 26\
**Last updated:** [January 19, 2022, 8:54pm UTC](https://discourse.julialang.org/t/what-is-ref/47610 "2022-01-19T20:54:58Z")

</div>

I was trying to do something like this: x = in.(\[1,2\], \[1,3,4\]) (BTW, what really want is an array of all the items that are in array 1 AND array 2. Is a broadcasted in the best way to do that ? ) Wanting a list of in…

---

## [A macro to unroll by hand but not by hand?](https://discourse.julialang.org/t/a-macro-to-unroll-by-hand-but-not-by-hand/74633)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 24\
**Last updated:** [January 19, 2022, 7:43pm UTC](https://discourse.julialang.org/t/a-macro-to-unroll-by-hand-but-not-by-hand/74633 "2022-01-19T19:43:34Z")

</div>

Hey, I have a computation that we already discussed there and which still takes up more than half of my total runtime (so days…). I did found a very clunky way to cut in half it’s runtime by manually unrolling a loop, …

---

## [Evaluate gradient (backpropagation) on a user defined type](https://discourse.julialang.org/t/evaluate-gradient-backpropagation-on-a-user-defined-type/74434)

<div class="topic-metadata">

**Author:** [@shiroghost](https://discourse.julialang.org/u/shiroghost)\
**Replies:** 4\
**Last updated:** [January 19, 2022, 6:20pm UTC](https://discourse.julialang.org/t/evaluate-gradient-backpropagation-on-a-user-defined-type/74434 "2022-01-19T18:20:02Z")

</div>

Hi all, I have the following problem. Given a function f(x::Vector) I know that I can evaluate the gradient using any AD package (In particular I use ReverseDiff.jl). What I need now is to evaluate the gradient on a cus…

---

## [2D DFFT: wrong order along the second dimension](https://discourse.julialang.org/t/2d-dfft-wrong-order-along-the-second-dimension/74869)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 1\
**Last updated:** [January 19, 2022, 4:14pm UTC](https://discourse.julialang.org/t/2d-dfft-wrong-order-along-the-second-dimension/74869 "2022-01-19T16:14:36Z")

</div>

Let us consider a 2D discrete fast Fourier transform of a separable function: using FFTW xs = collect(0.0:0.1:0.9) ys = xs zs = cos.(xs).^2\*sin.(ys') fzs = fft(zs) The result of 2D DFF transform of zs is On the oth…

---

## [CatViews with Flux optimize!](https://discourse.julialang.org/t/catviews-with-flux-optimize/74759)

<div class="topic-metadata">

**Author:** [@lineycroc](https://discourse.julialang.org/u/lineycroc)\
**Replies:** 4\
**Last updated:** [January 19, 2022, 3:35pm UTC](https://discourse.julialang.org/t/catviews-with-flux-optimize/74759 "2022-01-19T15:35:08Z")

</div>

Flux’s update!(opt, x, x̄) function errors when x and x̄ are of type CatView with the following message: TypeError: in typeassert, expected Tuple{CatView{1, Float64}, CatView{1, Float64}, Vector{Float64}}, got a value o…

---

## [IJulia notebook using a system image?](https://discourse.julialang.org/t/ijulia-notebook-using-a-system-image/74797)

<div class="topic-metadata">

**Author:** [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Replies:** 7\
**Last updated:** [January 19, 2022, 2:53pm UTC](https://discourse.julialang.org/t/ijulia-notebook-using-a-system-image/74797 "2022-01-19T14:53:38Z")

</div>

I’m starting to explore using notebooks for teaching (econometrics) purposes. There are some nice resources out there to steal ideas from, for example, GitHub - PaulSoderlind/JuliaTutorial: Julia Tutorial for Finance …

---

## [Add a prefix to every \`println()\` output](https://discourse.julialang.org/t/add-a-prefix-to-every-println-output/74463)

<div class="topic-metadata">

**Author:** [@Sushant-Padha](https://discourse.julialang.org/u/Sushant-Padha)\
**Replies:** 7\
**Last updated:** [January 19, 2022, 2:51pm UTC](https://discourse.julialang.org/t/add-a-prefix-to-every-println-output/74463 "2022-01-19T14:51:25Z")

</div>

When using logging macros with Julia, I noticed that the output is framed, i.e., it uses certain unicode characters as prefix to create a one-sided frame, like so: julia\> warning = """Lorem ipsum dolor sit amet, consect…

---

## [Generate function with keyword arguments from \`Symbolics\` expression](https://discourse.julialang.org/t/generate-function-with-keyword-arguments-from-symbolics-expression/74556)

<div class="topic-metadata">

**Author:** [@adomasbaliuka](https://discourse.julialang.org/u/adomasbaliuka)\
**Replies:** 3\
**Last updated:** [January 19, 2022, 1:14pm UTC](https://discourse.julialang.org/t/generate-function-with-keyword-arguments-from-symbolics-expression/74556 "2022-01-19T13:14:31Z")

</div>

In what is now clearly a fool’s errand, I’m trying to copy and type out equations from publications, render them as LaTeX and then transform them into Julia code, with as little room for accidental errors as possible. (M…

---

## [Inheritance in Parametric Types](https://discourse.julialang.org/t/inheritance-in-parametric-types/74811)

<div class="topic-metadata">

**Author:** [@davibarreira](https://discourse.julialang.org/u/davibarreira)\
**Replies:** 7\
**Last updated:** [January 19, 2022, 12:56pm UTC](https://discourse.julialang.org/t/inheritance-in-parametric-types/74811 "2022-01-19T12:56:38Z")

</div>

Friends, I have a small conundrum in terms on code design, and some input is more than welcomed. So, I’m developing a plotting library, and I have a struct called Marker. Now, the code implements different markers, e.g.…

---

## [Knet on Julia 1.7.0 (?)](https://discourse.julialang.org/t/knet-on-julia-1-7-0/74860)

<div class="topic-metadata">

**Author:** [@mazzanti](https://discourse.julialang.org/u/mazzanti)\
**Replies:** 2\
**Last updated:** [January 19, 2022, 12:07pm UTC](https://discourse.julialang.org/t/knet-on-julia-1-7-0/74860 "2022-01-19T12:07:12Z")

</div>

Hi, I just wanted to give Knet a go in my ubuntu machine running Julia 1.7.0, but surprisingly things fail… I just installed it as standard @(v1.7) pkg\> add Knet @(v1.7) pkg\> test Knet @(v1.7) pkg\> test Knet … Test…

---

## [Julia - not able to capture looped back UDP packets in Wireshark](https://discourse.julialang.org/t/julia-not-able-to-capture-looped-back-udp-packets-in-wireshark/74553)

<div class="topic-metadata">

**Author:** [@VinodV](https://discourse.julialang.org/u/VinodV)\
**Replies:** 2\
**Last updated:** [January 19, 2022, 11:09am UTC](https://discourse.julialang.org/t/julia-not-able-to-capture-looped-back-udp-packets-in-wireshark/74553 "2022-01-19T11:09:53Z")

</div>

I have a UDP sender program here: #UDPSender.jl using Sockets sock = UDPSocket() bind(sock,IPv4(200,120,1,1),1025) data = \[0x00, 0x20, 0x00, 0x10, 0x00, 0x01, 0x00, 0x3f, 0x00, 0x08, 0x00, 0x00, 0x0b, 0xb8, 0x64, 0x00\]…

---

## [Embedded Julia segmentation fault when loading BSON file](https://discourse.julialang.org/t/embedded-julia-segmentation-fault-when-loading-bson-file/74795)

<div class="topic-metadata">

**Author:** [@AnHeuermann](https://discourse.julialang.org/u/AnHeuermann)\
**Replies:** 3\
**Last updated:** [January 19, 2022, 10:49am UTC](https://discourse.julialang.org/t/embedded-julia-segmentation-fault-when-loading-bson-file/74795 "2022-01-19T10:49:32Z")

</div>

Description I have some Julia function that I want to call from C. I have saved some Julia variable inside a BSON file that needs to be loaded before that Julia function is called. Calling Julia from C works and loading…

---

## [Postdoc (12 months) - differential equations at University of Bristol, UK](https://discourse.julialang.org/t/postdoc-12-months-differential-equations-at-university-of-bristol-uk/74857)

<div class="topic-metadata">

**Author:** [@dawbarton](https://discourse.julialang.org/u/dawbarton)\
**Replies:** 0\
**Last updated:** [January 19, 2022, 9:26am UTC](https://discourse.julialang.org/t/postdoc-12-months-differential-equations-at-university-of-bristol-uk/74857 "2022-01-19T09:26:36Z")

</div>

I’ve got a postdoctoral position open at the University of Bristol, UK: https://www.bristol.ac.uk/jobs/find/details/?jobId=264809. It’s a one year position that must finish at some point before end June 2023 (end of gran…

---

## [How to emit :macro\_param in quote in macro?](https://discourse.julialang.org/t/how-to-emit-macro-param-in-quote-in-macro/74855)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 1\
**Last updated:** [January 19, 2022, 8:56am UTC](https://discourse.julialang.org/t/how-to-emit-macro-param-in-quote-in-macro/74855 "2022-01-19T08:56:18Z")

</div>

I’m trying to have a macro output: f(:arg) where arg is passed into the macro. So: @mac1 Blue should emit: f(:Blue). And more importantly, how would I have found the information in the docs or somewhere? macro mac1(x) …

---

## [Scientific Programmer](https://discourse.julialang.org/t/scientific-programmer/74854)

<div class="topic-metadata">

**Author:** [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Replies:** 0\
**Last updated:** [January 19, 2022, 8:12am UTC](https://discourse.julialang.org/t/scientific-programmer/74854 "2022-01-19T08:12:00Z")

</div>

Some nice to have Julia expertise is needed here, plus some other requirements, as usual :smile: https://www.bgc-jena.mpg.de/www/uploads/Career/OpenPositions/20220112\_\_Scientific%20Programmer.pdf

---

## [Solving HJB PDE using deep learning](https://discourse.julialang.org/t/solving-hjb-pde-using-deep-learning/60639)

<div class="topic-metadata">

**Author:** [@Honza9723](https://discourse.julialang.org/u/Honza9723)\
**Replies:** 16\
**Last updated:** [January 19, 2022, 4:44am UTC](https://discourse.julialang.org/t/solving-hjb-pde-using-deep-learning/60639 "2022-01-19T04:44:50Z")

</div>

Dear All, sorry for bothering with a possibly stupid question. I would like to ask for some advice about solving the Hamilton-Jacobi-Bellman equation using deep learning. I am trying to solve an HJB equation of a simpl…

---

## [Best practice for developing Julia packages with multi-language supports (Python)](https://discourse.julialang.org/t/best-practice-for-developing-julia-packages-with-multi-language-supports-python/74847)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 0\
**Last updated:** [January 19, 2022, 4:38am UTC](https://discourse.julialang.org/t/best-practice-for-developing-julia-packages-with-multi-language-supports-python/74847 "2022-01-19T04:38:56Z")

</div>

Hi, I’m trying to make a Julia package that has multi-language supports, especially Python. Background The following repo exports some predefined neural networks, compatible with Flux.jl. I’d like to make the neural n…

---

## [JuliaOptics performance discussion](https://discourse.julialang.org/t/juliaoptics-performance-discussion/74835)

<div class="topic-metadata">

**Author:** [@martin.d.maas](https://discourse.julialang.org/u/martin.d.maas)\
**Replies:** 7\
**Last updated:** [January 19, 2022, 4:20am UTC](https://discourse.julialang.org/t/juliaoptics-performance-discussion/74835 "2022-01-19T04:20:24Z")

</div>

Hi! I just happened to remember that this abandoned package came out in this forum during a discussion of performance benchmarks, and users’ expectations of performance in Julia vs other languages. As I happened to be …

---

## [Subset using symbol from function input](https://discourse.julialang.org/t/subset-using-symbol-from-function-input/74806)

<div class="topic-metadata">

**Author:** [@Frankiewaang](https://discourse.julialang.org/u/Frankiewaang)\
**Replies:** 4\
**Last updated:** [January 19, 2022, 3:52am UTC](https://discourse.julialang.org/t/subset-using-symbol-from-function-input/74806 "2022-01-19T03:52:26Z")

</div>

Hi Guys, I’m a newbie to use Julia for data manipulation. When I try to convert some of my Python Pandas code to Julia code, I got some problem. function remove\_outliers(data::DataFrame,variable::Symbol;lower=-Inf,upp…

---

## [Issue with (2+1)D Diffusion Reaction PDE with DiffEqOperators.jl](https://discourse.julialang.org/t/issue-with-2-1-d-diffusion-reaction-pde-with-diffeqoperators-jl/74840)

<div class="topic-metadata">

**Author:** [@ash](https://discourse.julialang.org/u/ash)\
**Replies:** 0\
**Last updated:** [January 19, 2022, 1:25am UTC](https://discourse.julialang.org/t/issue-with-2-1-d-diffusion-reaction-pde-with-diffeqoperators-jl/74840 "2022-01-19T01:25:47Z")

</div>

I am studying a (2+1)D diffusion-reaction PDE. I have asked about this before and got plenty of help and that resolved my issues. However, I just realized I was getting the wrong results because the model should be in tw…

---

## [Why are there allocations in my loop depending upon how I set a variable?](https://discourse.julialang.org/t/why-are-there-allocations-in-my-loop-depending-upon-how-i-set-a-variable/74819)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 18\
**Last updated:** [January 18, 2022, 11:32pm UTC](https://discourse.julialang.org/t/why-are-there-allocations-in-my-loop-depending-upon-how-i-set-a-variable/74819 "2022-01-18T23:32:46Z")

</div>

A little demo: The thing I am trying to wrap my head around is that I observed that a broadcast to combine three vectors would allocate in a loop: @time for step in 1:nsteps @. U1 = U0 + dt\*V0 + ((dt^2)/2)\*A0…

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

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