# Latest

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

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

**Page:** 1264

---

## [I've made a small step-by-step tutorial to using Flux for image recognition](https://discourse.julialang.org/t/ive-made-a-small-step-by-step-tutorial-to-using-flux-for-image-recognition/68261)

<div class="topic-metadata">

**Author:** [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)\
**Replies:** 6\
**Last updated:** [September 17, 2021, 4:09pm UTC](https://discourse.julialang.org/t/ive-made-a-small-step-by-step-tutorial-to-using-flux-for-image-recognition/68261 "2021-09-17T16:09:55Z")

</div>

I was trying to model a simple character recognition in Flux and almost lost my sanity due to the lack of tutorials and the ones that do exist were quite outdated. So after some head banging I’ve made a small tutorial to…

---

## [A Recap of the state of the Symbolics ecosystem](https://discourse.julialang.org/t/a-recap-of-the-state-of-the-symbolics-ecosystem/68022)

<div class="topic-metadata">

**Author:** [@0x0f0f0f](https://discourse.julialang.org/u/0x0f0f0f)\
**Replies:** 7\
**Last updated:** [September 17, 2021, 3:52pm UTC](https://discourse.julialang.org/t/a-recap-of-the-state-of-the-symbolics-ecosystem/68022 "2021-09-17T15:52:24Z")

</div>

The introduction of TermInterface.jl has allowed for large potential in generalization of term rewriting and symbolic analysis and manipulation features. Also, it’s been a few months we’ve been talking about the integrat…

---

## [Threaded loop far slower than sequential loop (+ high compilation time)](https://discourse.julialang.org/t/threaded-loop-far-slower-than-sequential-loop-high-compilation-time/68338)

<div class="topic-metadata">

**Author:** [@StefanMathis](https://discourse.julialang.org/u/StefanMathis)\
**Replies:** 3\
**Last updated:** [September 17, 2021, 3:16pm UTC](https://discourse.julialang.org/t/threaded-loop-far-slower-than-sequential-loop-high-compilation-time/68338 "2021-09-17T15:16:32Z")

</div>

Hello, when trying to parallelize a loop, the performance got absolutely thrashed - roundabout by a factor of 1000. I tried to replicate the problem with a MWE and found something interesting: main() = loop(Vector{Floa…

---

## [HDF5 error occuring when using MAT package](https://discourse.julialang.org/t/hdf5-error-occuring-when-using-mat-package/68335)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 2\
**Last updated:** [September 17, 2021, 2:38pm UTC](https://discourse.julialang.org/t/hdf5-error-occuring-when-using-mat-package/68335 "2021-09-17T14:38:11Z")

</div>

I am getting the following error when trying to use the MAT package. I have no clue about how to interpret it. Any help would be appreciated. julia\> file = matopen("t.mat", "w"); HDF5-DIAG: Error detected in HDF5 (1.12.…

---

## [ProgressMeter on a @distributed for loop](https://discourse.julialang.org/t/progressmeter-on-a-distributed-for-loop/68315)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 2\
**Last updated:** [September 17, 2021, 2:18pm UTC](https://discourse.julialang.org/t/progressmeter-on-a-distributed-for-loop/68315 "2021-09-17T14:18:08Z")

</div>

Hi all, I am having trouble using ProgressMeter with a @distributed for loop. Here is an MWE Any ideas why this is not working?

---

## [How to create a system image with Makie.jl](https://discourse.julialang.org/t/how-to-create-a-system-image-with-makie-jl/55493)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 8\
**Last updated:** [September 17, 2021, 2:17pm UTC](https://discourse.julialang.org/t/how-to-create-a-system-image-with-makie-jl/55493 "2021-09-17T14:17:10Z")

</div>

I created a system image containing Makie.jl using the following steps: julia --project \]add PackageCompiler add MakieGallery exit() julia --project using MakieGallery exit() julia --project using Makie using PackageC…

---

## [UnitRange in 1.7-rc1, bug?](https://discourse.julialang.org/t/unitrange-in-1-7-rc1-bug/68327)

<div class="topic-metadata">

**Author:** [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Replies:** 7\
**Last updated:** [September 17, 2021, 2:01pm UTC](https://discourse.julialang.org/t/unitrange-in-1-7-rc1-bug/68327 "2021-09-17T14:01:37Z")

</div>

(1:5) .- 1/7 in 1.7-rc1 (Win64) gives 0.8571428571428572:1.0:3.857142857142857, while 1.6.2 gives (the more reasonable) 0.8571428571428572:1.0:4.857142857142858 Can anyone confirm? If so, I’ll file an issue.

---

## [Unable to change the tick font size when using ticks = :native with Plots.jl and pgfplotsx backend](https://discourse.julialang.org/t/unable-to-change-the-tick-font-size-when-using-ticks-native-with-plots-jl-and-pgfplotsx-backend/68106)

<div class="topic-metadata">

**Author:** [@deepakvinod](https://discourse.julialang.org/u/deepakvinod)\
**Replies:** 15\
**Last updated:** [September 17, 2021, 1:34pm UTC](https://discourse.julialang.org/t/unable-to-change-the-tick-font-size-when-using-ticks-native-with-plots-jl-and-pgfplotsx-backend/68106 "2021-09-17T13:34:45Z")

</div>

I am relatively new to Julia (coming from python and matplotlib) and have been trying to generate some plots for a project I am working on. It seems to be a known issue that Plots.jl does not produce ticks when there ar…

---

## [Interactive plotting via web](https://discourse.julialang.org/t/interactive-plotting-via-web/68304)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 5\
**Last updated:** [September 17, 2021, 1:10pm UTC](https://discourse.julialang.org/t/interactive-plotting-via-web/68304 "2021-09-17T13:10:31Z")

</div>

Hi, I’m looking for a way of interactively plot some figures through a website. A representative example might be PlutoUI.jl but it requires Pluto. I wanna do this from my terminal. Other package I found is Interact.…

---

## [@distributed is not sharing the work as I would expect](https://discourse.julialang.org/t/distributed-is-not-sharing-the-work-as-i-would-expect/68325)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 1\
**Last updated:** [September 17, 2021, 12:52pm UTC](https://discourse.julialang.org/t/distributed-is-not-sharing-the-work-as-i-would-expect/68325 "2021-09-17T12:52:54Z")

</div>

Hi I have a monte carlo simulation which I run with 289 different parameter sets. I now realize that @distributed is not as smart as I thought (at least that is my current understanding). The issue is that not every i…

---

## [Conversion of an array of tuples into a dictionary](https://discourse.julialang.org/t/conversion-of-an-array-of-tuples-into-a-dictionary/68329)

<div class="topic-metadata">

**Author:** [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Replies:** 4\
**Last updated:** [September 17, 2021, 12:46pm UTC](https://discourse.julialang.org/t/conversion-of-an-array-of-tuples-into-a-dictionary/68329 "2021-09-17T12:46:00Z")

</div>

Sorry for this easy question but I’m lost. I want to convert this array of tuples: ls = \[(\['A' 'B'\], 1) (\['Z'\], 2)\] into this dictionary Dict('A' =\> 1, 'B' =\> 1, 'Z' =\> 2) I tried this d1 = \[ls\[i\]\[1\] .=\> l…

---

## [Fast hash for custom type](https://discourse.julialang.org/t/fast-hash-for-custom-type/68135)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 10\
**Last updated:** [September 17, 2021, 12:45pm UTC](https://discourse.julialang.org/t/fast-hash-for-custom-type/68135 "2021-09-17T12:45:34Z")

</div>

We have a custom type and we are not satisfied with the Base.hash performance. See here for the real world example. What are the best practice for defining a custom hash? This is what we did: julia\> struct S{T}; value…

---

## [How well does Julia support distributed processing?](https://discourse.julialang.org/t/how-well-does-julia-support-distributed-processing/68312)

<div class="topic-metadata">

**Author:** [@stefkuypers](https://discourse.julialang.org/u/stefkuypers)\
**Replies:** 6\
**Last updated:** [September 17, 2021, 12:36pm UTC](https://discourse.julialang.org/t/how-well-does-julia-support-distributed-processing/68312 "2021-09-17T12:36:34Z")

</div>

Hi, We’re looking at using Julia for large scale simulations and are wondering how well Julia supports distributed processing. Where do we need to look for libraries supporting this? Are there any example projects we co…

---

## [Turing.jl or SciML?: training and testing on different datasets](https://discourse.julialang.org/t/turing-jl-or-sciml-training-and-testing-on-different-datasets/68330)

<div class="topic-metadata">

**Author:** [@James\_Gorman](https://discourse.julialang.org/u/James_Gorman)\
**Replies:** 0\
**Last updated:** [September 17, 2021, 12:23pm UTC](https://discourse.julialang.org/t/turing-jl-or-sciml-training-and-testing-on-different-datasets/68330 "2021-09-17T12:23:04Z")

</div>

I am new to doing Bayesian inference, so I wanted to start off with doing a simple regression (here, assumed to be a linear regression). I decided to use Turing.jl, and through the tutorials and previous questions I was …

---

## [Can I disable overloaded Base.show() and print the raw form of an object?](https://discourse.julialang.org/t/can-i-disable-overloaded-base-show-and-print-the-raw-form-of-an-object/68286)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 4\
**Last updated:** [September 17, 2021, 12:37am UTC](https://discourse.julialang.org/t/can-i-disable-overloaded-base-show-and-print-the-raw-form-of-an-object/68286 "2021-09-17T00:37:37Z")

</div>

Sometimes I’d like to see the “raw” form of a custom struct. Can I print it using the default Base.show(), ignoring my own custom definitions which print prettier results but may hide details useful for debugging?

---

## [Julia Performance - Help Needed](https://discourse.julialang.org/t/julia-performance-help-needed/68004)

<div class="topic-metadata">

**Author:** [@way2toronto](https://discourse.julialang.org/u/way2toronto)\
**Replies:** 40\
**Last updated:** [September 17, 2021, 11:37am UTC](https://discourse.julialang.org/t/julia-performance-help-needed/68004 "2021-09-17T11:37:59Z")

</div>

Hello. Given the promises of performance, I’ve started my Julia work with a translation of a simple deep learning algo to Julia. My Julia code is below and the original Python code network.py is from the book by Michael …

---

## [Sort an array according other array](https://discourse.julialang.org/t/sort-an-array-according-other-array/68295)

<div class="topic-metadata">

**Author:** [@maoc](https://discourse.julialang.org/u/maoc)\
**Replies:** 6\
**Last updated:** [September 17, 2021, 10:13am UTC](https://discourse.julialang.org/t/sort-an-array-according-other-array/68295 "2021-09-17T10:13:06Z")

</div>

I am trying to sort an array according other array. More specifically, sort ε\_ according Z. NN = 6 Z = rand(NN) ε\_= rand(NN) teste = \[ Z\[sortperm(Z)\] ε\_\[sortperm(ε\_)\] \] test\_f(Z) = teste\[teste\[:,1\] .== Z , 2\] ε\_ …

---

## [Setting up a small compute cluster](https://discourse.julialang.org/t/setting-up-a-small-compute-cluster/50622)

<div class="topic-metadata">

**Author:** [@maxfreu](https://discourse.julialang.org/u/maxfreu)\
**Replies:** 16\
**Last updated:** [September 17, 2021, 9:54am UTC](https://discourse.julialang.org/t/setting-up-a-small-compute-cluster/50622 "2021-09-17T09:54:59Z")

</div>

Hi everybody! I would like to set up a “compute cluster” with 4-5 computers in my workgroup. It should be able to run more or less arbitrary code, so it’s maybe not a totally julia-specific question, but in the end I wo…

---

## [DiffEqFlux, Neural ODEs: Unable to run example code](https://discourse.julialang.org/t/diffeqflux-neural-odes-unable-to-run-example-code/66349)

<div class="topic-metadata">

**Author:** [@Christoforos\_Kass](https://discourse.julialang.org/u/Christoforos_Kass)\
**Replies:** 3\
**Last updated:** [September 17, 2021, 9:42am UTC](https://discourse.julialang.org/t/diffeqflux-neural-odes-unable-to-run-example-code/66349 "2021-09-17T09:42:54Z")

</div>

Hi all, I’ve recently started using Julia for machine learning purposes. I’ve just started playing around with neural networks using Flux and DiffEqFlux. I am trying to run some of the example code from the DiffEqFlux b…

---

## [Unexpected behavior of similar](https://discourse.julialang.org/t/unexpected-behavior-of-similar/68318)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 3\
**Last updated:** [September 17, 2021, 8:40am UTC](https://discourse.julialang.org/t/unexpected-behavior-of-similar/68318 "2021-09-17T08:40:32Z")

</div>

I find this behavior of similar unexpected: julia\> r = \[rand(2, 2) for i in 1:3\] julia\> x = similar(r) 3-element Vector{Matrix{Float64}}: #undef #undef #undef julia\> x\[1\] ERROR: UndefRefError: access to undefined r…

---

## [Can I use pkg protocol to download artifacts manually?](https://discourse.julialang.org/t/can-i-use-pkg-protocol-to-download-artifacts-manually/68311)

<div class="topic-metadata">

**Author:** [@melonedo](https://discourse.julialang.org/u/melonedo)\
**Replies:** 0\
**Last updated:** [September 17, 2021, 6:28am UTC](https://discourse.julialang.org/t/can-i-use-pkg-protocol-to-download-artifacts-manually/68311 "2021-09-17T06:28:04Z")

</div>

Julia now installs artifacts very quickly, with the help of pkg protocol. But if I want to install artifacts manually instead of intalling JLL wrappers, e.g. install an artifact as a build dependency (Clang.jl uses this …

---

## [Sort rows in a dataframe based on a predefined order](https://discourse.julialang.org/t/sort-rows-in-a-dataframe-based-on-a-predefined-order/68272)

<div class="topic-metadata">

**Author:** [@Xiao](https://discourse.julialang.org/u/Xiao)\
**Replies:** 5\
**Last updated:** [September 17, 2021, 6:14am UTC](https://discourse.julialang.org/t/sort-rows-in-a-dataframe-based-on-a-predefined-order/68272 "2021-09-17T06:14:03Z")

</div>

New to Julia, and have taken (much) effort in seeking a solution to the ‘simple’ question but failed. julia\> df = DataFrame(col1= \['a', 'b', 'c'\], col2 = \[1,2,3\]) 3×2 DataFrame Row │ col1 col2 │ Char Int64 ──…

---

## [JuMP+Ipopt producing infeasible solutions for constraints with small upper bounds](https://discourse.julialang.org/t/jump-ipopt-producing-infeasible-solutions-for-constraints-with-small-upper-bounds/68306)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 2\
**Last updated:** [September 17, 2021, 5:30am UTC](https://discourse.julialang.org/t/jump-ipopt-producing-infeasible-solutions-for-constraints-with-small-upper-bounds/68306 "2021-09-17T05:30:19Z")

</div>

using JuMP, Ipopt function parametertest() m = Model(Ipopt.Optimizer) set\_silent(m) a = \[0.15, 0.16, 0.72, -0.80, -12.0\] @variable(m, x\[1:5\]) @variable(m, abs\_x\[1:5\]) for i in 1:5 …

---

## [Unable to run Makie in VS Code + WSL 2](https://discourse.julialang.org/t/unable-to-run-makie-in-vs-code-wsl-2/68305)

<div class="topic-metadata">

**Author:** [@tmwatchanan](https://discourse.julialang.org/u/tmwatchanan)\
**Replies:** 0\
**Last updated:** [September 17, 2021, 4:56am UTC](https://discourse.julialang.org/t/unable-to-run-makie-in-vs-code-wsl-2/68305 "2021-09-17T04:56:35Z")

</div>

I could be able to run Makie, say plot a simple line, by executing the Julia code in WSL 2. However, when I tried to run the same code with VS Code REPL, it didn’t work. So, I decided to give Persistent Session a try. I …

---

## [Named Array from DataFrame?](https://discourse.julialang.org/t/named-array-from-dataframe/68303)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 0\
**Last updated:** [September 17, 2021, 4:48am UTC](https://discourse.julialang.org/t/named-array-from-dataframe/68303 "2021-09-17T04:48:17Z")

</div>

Is it possible to convert a DataFrame to NamedArray ? Similar to DataFrame unstack ? Something like x = NamedArray( DataFrame=df, dimensions=\[:D1, :D2\], value = :v) Full example. Current code: df = DataFrame( \[ …

---

## [Paste an image onto another image?](https://discourse.julialang.org/t/paste-an-image-onto-another-image/68033)

<div class="topic-metadata">

**Author:** [@vshesh](https://discourse.julialang.org/u/vshesh)\
**Replies:** 2\
**Last updated:** [September 17, 2021, 12:08am UTC](https://discourse.julialang.org/t/paste-an-image-onto-another-image/68033 "2021-09-17T00:08:13Z")

</div>

What is Julia’s equivalent of python PIL Image.paste? And how would I paste a rotated image onto a background image? (everything below is just context, that’s the question) I am trying to use Julia to make a dataset of…

---

## [Faster sorting of DataFrames.jl via background ordering](https://discourse.julialang.org/t/faster-sorting-of-dataframes-jl-via-background-ordering/45084)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 0\
**Last updated:** [August 17, 2020, 8:18am UTC](https://discourse.julialang.org/t/faster-sorting-of-dataframes-jl-via-background-ordering/45084 "2020-08-17T08:18:08Z")

</div>

I have had this idea for a long time, now I finally gave it a go and the results are amazing. So here’s the idea. Here sorting a large dataframe the algorithm roughly goes like this Perform a sortperm on the columns t…

---

## [NaN returned by gauss()](https://discourse.julialang.org/t/nan-returned-by-gauss/68260)

<div class="topic-metadata">

**Author:** [@trg818](https://discourse.julialang.org/u/trg818)\
**Replies:** 6\
**Last updated:** [September 16, 2021, 7:33pm UTC](https://discourse.julialang.org/t/nan-returned-by-gauss/68260 "2021-09-16T19:33:37Z")

</div>

I’m using the function gauss() from QuadGK in order to calculate a non-adaptive quadrature and am irritated about the appearance of NaN beyond a certain N. Specifically, gauss(1093,38.68598671891722,150000.0) returns an …

---

## [How can I arrange to only use @threads if the number of iteration is higher than minimum?](https://discourse.julialang.org/t/how-can-i-arrange-to-only-use-threads-if-the-number-of-iteration-is-higher-than-minimum/68177)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 17\
**Last updated:** [September 16, 2021, 11:02pm UTC](https://discourse.julialang.org/t/how-can-i-arrange-to-only-use-threads-if-the-number-of-iteration-is-higher-than-minimum/68177 "2021-09-16T23:02:23Z")

</div>

I need to run @threads before “for loop” only if the number of iteration is bigger than a predetermined value (called min\_iter here ), such as @threads min\_iter for i in ..., Any idea?

---

## [How to avoid using global variable in "for loop" inside a function?](https://discourse.julialang.org/t/how-to-avoid-using-global-variable-in-for-loop-inside-a-function/68288)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 9\
**Last updated:** [September 16, 2021, 10:40pm UTC](https://discourse.julialang.org/t/how-to-avoid-using-global-variable-in-for-loop-inside-a-function/68288 "2021-09-16T22:40:37Z")

</div>

I have two questions please: 1- Are r, s global or local variables in the below main code? function ss(r, s) u =r+s; a =r\*s; return u, a end #main code r=5; s=9; q,w = ss(r, s) 2- How to get ride of defining iter as …

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

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