# Latest

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

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

**Page:** 1144

---

## [Issue with node\_count() - type of return](https://discourse.julialang.org/t/issue-with-node-count-type-of-return/74872)

<div class="topic-metadata">

**Author:** [@arkanver](https://discourse.julialang.org/u/arkanver)\
**Replies:** 4\
**Last updated:** [January 24, 2022, 2:09pm UTC](https://discourse.julialang.org/t/issue-with-node-count-type-of-return/74872 "2022-01-24T14:09:36Z")

</div>

Hello all, I’ve run into an issue with JuMP function node\_count(). This function seems to check the type of value returned by the solver and expects it to be Int64, however with some solvers this isn’t the case. For exa…

---

## [PGFPlotsX a matrix of RGB](https://discourse.julialang.org/t/pgfplotsx-a-matrix-of-rgb/24709)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 9\
**Last updated:** [June 7, 2019, 11:58am UTC](https://discourse.julialang.org/t/pgfplotsx-a-matrix-of-rgb/24709 "2019-06-07T11:58:44Z")

</div>

I have an image – a matrix of RGBs. The number of pixels is relatively small (e.g. 20×20), so I want to plot it as an array of colored squares. This way the dimensions of the resulting figure won’t be dictated by the low…

---

## [Jacobian matrix](https://discourse.julialang.org/t/jacobian-matrix/75117)

<div class="topic-metadata">

**Author:** [@pcmk1](https://discourse.julialang.org/u/pcmk1)\
**Replies:** 1\
**Last updated:** [January 24, 2022, 1:54pm UTC](https://discourse.julialang.org/t/jacobian-matrix/75117 "2022-01-24T13:54:12Z")

</div>

I calculated the Jacobian matrix. I guess one of the line should be full of -0.97 since one of the function is 29.927071171061 - 0.97\*t and the derivative of it is just -0.97. But only one element of the Jacobian matri…

---

## [Speeding up maximization](https://discourse.julialang.org/t/speeding-up-maximization/74298)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 4\
**Last updated:** [January 24, 2022, 4:12am UTC](https://discourse.julialang.org/t/speeding-up-maximization/74298 "2022-01-24T04:12:15Z")

</div>

I am trying to speed up this code. The maximization is very time consuming. Perhaps I am also not doing the allocations efficiently. I have a core with 64 threads, but if I use multithread I incur in an error (the result…

---

## [How to increase the maximum number of iterations in Ipopt?](https://discourse.julialang.org/t/how-to-increase-the-maximum-number-of-iterations-in-ipopt/75109)

<div class="topic-metadata">

**Author:** [@oxox](https://discourse.julialang.org/u/oxox)\
**Replies:** 2\
**Last updated:** [January 24, 2022, 12:09pm UTC](https://discourse.julialang.org/t/how-to-increase-the-maximum-number-of-iterations-in-ipopt/75109 "2022-01-24T12:09:31Z")

</div>

I got stuck while solving a problem with Ipopt, showing EXIT: Maximum Number of Iterations Exceeded. Its maximum number of iterations is 3000, how can I increase the maximum number of iterations？？？

---

## [Zero gradients with Zygote vs correct gradients with ReverseDiff using DiffEqFlux](https://discourse.julialang.org/t/zero-gradients-with-zygote-vs-correct-gradients-with-reversediff-using-diffeqflux/74398)

<div class="topic-metadata">

**Author:** [@JordiBolibar](https://discourse.julialang.org/u/JordiBolibar)\
**Replies:** 4\
**Last updated:** [January 24, 2022, 11:05am UTC](https://discourse.julialang.org/t/zero-gradients-with-zygote-vs-correct-gradients-with-reversediff-using-diffeqflux/74398 "2022-01-24T11:05:07Z")

</div>

I’m having some issues (again) with Zygote trying to differentiate a UDE using DiffEqFlux. I already encountered an error with Zygote gradients with the sqrt function. For this new issue I still haven’t been able to isol…

---

## [Plots.jl legend box](https://discourse.julialang.org/t/plots-jl-legend-box/18433)

<div class="topic-metadata">

**Author:** [@monty](https://discourse.julialang.org/u/monty)\
**Replies:** 8\
**Last updated:** [January 24, 2022, 10:16am UTC](https://discourse.julialang.org/t/plots-jl-legend-box/18433 "2022-01-24T10:16:09Z")

</div>

How to remove surrounding box of the legend in Plots.jl?

---

## [ProfileView's @profview generates blank window](https://discourse.julialang.org/t/profileviews-profview-generates-blank-window/74997)

<div class="topic-metadata">

**Author:** [@kaitlyn-loftus](https://discourse.julialang.org/u/kaitlyn-loftus)\
**Replies:** 5\
**Last updated:** [January 24, 2022, 10:06am UTC](https://discourse.julialang.org/t/profileviews-profview-generates-blank-window/74997 "2022-01-24T10:06:59Z")

</div>

I am trying to use ProfileView’s @profview, but it’s only generating a blank window instead of a flamegraph. For a minimum working example, this behavior occurs for me with the ProfileView tutorial example: function pro…

---

## [What am I doing wrong with \`unsafe\_wrap()\`?](https://discourse.julialang.org/t/what-am-i-doing-wrong-with-unsafe-wrap/75105)

<div class="topic-metadata">

**Author:** [@heyx3](https://discourse.julialang.org/u/heyx3)\
**Replies:** 10\
**Last updated:** [January 24, 2022, 8:38am UTC](https://discourse.julialang.org/t/what-am-i-doing-wrong-with-unsafe-wrap/75105 "2022-01-24T08:38:16Z")

</div>

Trying to write some test code with unsafe\_wrap(), and getting unexpected garbage results. julia\> function f() r = Ref(tuple(5.0, 2.0, 1.0, 6.0)) p = Base.unsafe\_convert(Ptr{Float64}, r) u …

---

## [Is there any function in julia equivalent to pandas explode function](https://discourse.julialang.org/t/is-there-any-function-in-julia-equivalent-to-pandas-explode-function/75096)

<div class="topic-metadata">

**Author:** [@Frankiewaang](https://discourse.julialang.org/u/Frankiewaang)\
**Replies:** 5\
**Last updated:** [January 24, 2022, 7:42am UTC](https://discourse.julialang.org/t/is-there-any-function-in-julia-equivalent-to-pandas-explode-function/75096 "2022-01-24T07:42:19Z")

</div>

Hi Guys, Say I have a dataset like this: x = DataFrame(a=\[1,3,4,5\],b=\["a;b;c;d","a;c;d","a;c","b;d"\]) I want to first split the column b and then explode it to a long dataset. In python the code is like this: x\['b'\]…

---

## [Using Dependency inversion to avoid depending on volatile/heavy packages](https://discourse.julialang.org/t/using-dependency-inversion-to-avoid-depending-on-volatile-heavy-packages/74181)

<div class="topic-metadata">

**Author:** [@bgctw](https://discourse.julialang.org/u/bgctw)\
**Replies:** 1\
**Last updated:** [January 24, 2022, 8:02am UTC](https://discourse.julialang.org/t/using-dependency-inversion-to-avoid-depending-on-volatile-heavy-packages/74181 "2022-01-24T08:02:45Z")

</div>

I want to use a simple optimization of an univariate function in my package DistributionFits.jl, but I want to avoid the package dependency on the heavy-weight package Optim.jl. So far, I tried implementing Dependency i…

---

## [Could a command like MATLAB’s \`type\` exist in Julia](https://discourse.julialang.org/t/could-a-command-like-matlab-s-type-exist-in-julia/75107)

<div class="topic-metadata">

**Author:** [@chart](https://discourse.julialang.org/u/chart)\
**Replies:** 2\
**Last updated:** [January 24, 2022, 7:26am UTC](https://discourse.julialang.org/t/could-a-command-like-matlab-s-type-exist-in-julia/75107 "2022-01-24T07:26:56Z")

</div>

As a new Julia user I make frequent use of REPL help prompt, and have found @which, typeof() and fieldnames() to be helpful in cases where docstrings don’t have much to offer. In many cases I find I still need to turn to…

---

## [BenchmarkTools: How to use different random array on each run (esp. for mutating functions)?](https://discourse.julialang.org/t/benchmarktools-how-to-use-different-random-array-on-each-run-esp-for-mutating-functions/75061)

<div class="topic-metadata">

**Author:** [@rakeshvar](https://discourse.julialang.org/u/rakeshvar)\
**Replies:** 6\
**Last updated:** [January 24, 2022, 6:24am UTC](https://discourse.julialang.org/t/benchmarktools-how-to-use-different-random-array-on-each-run-esp-for-mutating-functions/75061 "2022-01-24T06:24:07Z")

</div>

I am implementing a routine to find ‘a’ median of an integer array. The algorithm is based on quicksort, and both implementations below partially search/sort about half the array. They both have the same O(n) average com…

---

## [Vector of Flux Model Parameters Sharing Underlying Data](https://discourse.julialang.org/t/vector-of-flux-model-parameters-sharing-underlying-data/75091)

<div class="topic-metadata">

**Author:** [@RS-Coop](https://discourse.julialang.org/u/RS-Coop)\
**Replies:** 2\
**Last updated:** [January 24, 2022, 3:12am UTC](https://discourse.julialang.org/t/vector-of-flux-model-parameters-sharing-underlying-data/75091 "2022-01-24T03:12:04Z")

</div>

I am trying to extract the parameters of a Flux model in a single vector such that they share the same underlying data, i.e. making changes to the vector changes the model parameters. The following is based on the Flux.d…

---

## [How iteratively/numerically solve for a value](https://discourse.julialang.org/t/how-iteratively-numerically-solve-for-a-value/75019)

<div class="topic-metadata">

**Author:** [@CentraCep](https://discourse.julialang.org/u/CentraCep)\
**Replies:** 9\
**Last updated:** [January 23, 2022, 11:40pm UTC](https://discourse.julialang.org/t/how-iteratively-numerically-solve-for-a-value/75019 "2022-01-23T23:40:02Z")

</div>

I wrote a program intended to calculate the plasma beta of a hydrostatic solar atmosphere: B\_0 = 0.02 # base magnetic field \[T\] p\_0 = 0.015 # base pressure \[J/m^-3\] h\_D = 7.5E7 # dipole depth \[m\] R\_☉ = 6.96E8 # solar ra…

---

## [Reading other peoples Julia code](https://discourse.julialang.org/t/reading-other-peoples-julia-code/75085)

<div class="topic-metadata">

**Author:** [@Schneeschaufel](https://discourse.julialang.org/u/Schneeschaufel)\
**Replies:** 5\
**Last updated:** [January 23, 2022, 10:05pm UTC](https://discourse.julialang.org/t/reading-other-peoples-julia-code/75085 "2022-01-23T22:05:09Z")

</div>

(I am not criticising Julia I am starting of learning Julia with a clean slate). There is this site with tips and tricks by a knowledgeable member and expert programmer of the Julia community: Functional One-Liners in J…

---

## [PyCall stdout buffer processing not doing what I expected](https://discourse.julialang.org/t/pycall-stdout-buffer-processing-not-doing-what-i-expected/75086)

<div class="topic-metadata">

**Author:** [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Replies:** 10\
**Last updated:** [January 23, 2022, 9:37pm UTC](https://discourse.julialang.org/t/pycall-stdout-buffer-processing-not-doing-what-i-expected/75086 "2022-01-23T21:37:57Z")

</div>

Hi all I am using PyCall to run a simple python script that prints out the ascii table. #test\_stdout\_pycall.py digit = 0 while digit\<=255: print("%d = %c" %(digit, chr(digit))) digit += 1 print("done") I w…

---

## [Julia passing a string to Fortran](https://discourse.julialang.org/t/julia-passing-a-string-to-fortran/74781)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 11\
**Last updated:** [January 23, 2022, 9:17pm UTC](https://discourse.julialang.org/t/julia-passing-a-string-to-fortran/74781 "2022-01-23T21:17:08Z")

</div>

How can I pass a string to Fortran? The following methods doesn’t seem to work julia\> T = Ref{Char} Ref{Char} julia\> Base.unsafe\_convert(T, Base.cconvert(T, "foo")) ERROR: MethodError: Cannot \`convert\` an object of typ…

---

## [Need help fixing an sqrt related error](https://discourse.julialang.org/t/need-help-fixing-an-sqrt-related-error/75084)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 2\
**Last updated:** [January 23, 2022, 8:24pm UTC](https://discourse.julialang.org/t/need-help-fixing-an-sqrt-related-error/75084 "2022-01-23T20:24:29Z")

</div>

Here is the error message: ERROR: LoadError: DomainError with -0.038468373019053814: sqrt will only return a complex result if called with a complex argument. Try sqrt(Complex(x)). \[12\] CO2SYS(PAR1::Vector{Float64}, P…

---

## [Why code stops working after seemingly trivial function redefinition?](https://discourse.julialang.org/t/why-code-stops-working-after-seemingly-trivial-function-redefinition/75083)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 2\
**Last updated:** [January 23, 2022, 8:32pm UTC](https://discourse.julialang.org/t/why-code-stops-working-after-seemingly-trivial-function-redefinition/75083 "2022-01-23T20:32:07Z")

</div>

I am puzzled by this one, spent a lot of time trying to figure it out. I have two alternative definitions for a pair of functions. Some code using groupby/combine works with one pair of definitions, not with the other o…

---

## [Links to Julia taught in Master Program Chemical Engineering](https://discourse.julialang.org/t/links-to-julia-taught-in-master-program-chemical-engineering/74974)

<div class="topic-metadata">

**Author:** [@ziolai](https://discourse.julialang.org/u/ziolai)\
**Replies:** 2\
**Last updated:** [January 23, 2022, 7:59pm UTC](https://discourse.julialang.org/t/links-to-julia-taught-in-master-program-chemical-engineering/74974 "2022-01-23T19:59:33Z")

</div>

I am arguing for the replacement of mainstream Python with younger Julia to teach a course in the numerical methods in the master program chemical engineering at the TU Delft. Links to courses in computational chemical …

---

## [Problem about Makie Legend](https://discourse.julialang.org/t/problem-about-makie-legend/75064)

<div class="topic-metadata">

**Author:** [@aachener](https://discourse.julialang.org/u/aachener)\
**Replies:** 1\
**Last updated:** [January 23, 2022, 7:46pm UTC](https://discourse.julialang.org/t/problem-about-makie-legend/75064 "2022-01-23T19:46:33Z")

</div>

Hi, guys I am trying to replicate the following code from the book Julia Data Science. I got a problem when I wanted to add a legend for the chart of the series() part, and put it below the chart horizontally, not in …

---

## [CSV.jl fails precompling, TypeError: in Type{...} expression, expected UnionAll, got Type{Parsers.Options}](https://discourse.julialang.org/t/csv-jl-fails-precompling-typeerror-in-type-expression-expected-unionall-got-type-parsers-options/67195)

<div class="topic-metadata">

**Author:** [@erickn](https://discourse.julialang.org/u/erickn)\
**Replies:** 19\
**Last updated:** [December 8, 2021, 4:48am UTC](https://discourse.julialang.org/t/csv-jl-fails-precompling-typeerror-in-type-expression-expected-unionall-got-type-parsers-options/67195 "2021-12-08T04:48:04Z")

</div>

Hi all, Yesterday I found that CSV.jl is failing in precompiling when it is imported in a Jupyter notebook. For testing, it is tried in a new environment only with CSV, but it failed the same way. See below for the erro…

---

## [Equating ModelingToolkit parameters and variables?](https://discourse.julialang.org/t/equating-modelingtoolkit-parameters-and-variables/74642)

<div class="topic-metadata">

**Author:** [@AndreaRH](https://discourse.julialang.org/u/AndreaRH)\
**Replies:** 4\
**Last updated:** [January 23, 2022, 6:11pm UTC](https://discourse.julialang.org/t/equating-modelingtoolkit-parameters-and-variables/74642 "2022-01-23T18:11:35Z")

</div>

Hi! I have a first ODESystem with a parameter gNa and a second ODESystem with a variable g(t). How to create a third system that links the two together so that every time gNa appears in the first system we actually take…

---

## [Franklin.jl relative links](https://discourse.julialang.org/t/franklin-jl-relative-links/75074)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 1\
**Last updated:** [January 23, 2022, 5:17pm UTC](https://discourse.julialang.org/t/franklin-jl-relative-links/75074 "2022-01-23T17:17:53Z")

</div>

I am migrating a site from Hugo to Franklin. Hugo has a special syntax for links, but in for Franklin.jl would one just use Markdown for both absolute or relative links? Eg as in \[some page within the site\](/pages/blog/…

---

## [Boolean function minimization / reduction](https://discourse.julialang.org/t/boolean-function-minimization-reduction/36463)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 4\
**Last updated:** [January 23, 2022, 4:53pm UTC](https://discourse.julialang.org/t/boolean-function-minimization-reduction/36463 "2022-01-23T16:53:20Z")

</div>

Hi All, I am working on explanation of neural networks for computer security. Specifically, I would like to combine several alternative explanations together in one logical formula. I would like to ask, if anyone has ex…

---

## [CUDA/AMD/CPU device agnostic array creation best practice](https://discourse.julialang.org/t/cuda-amd-cpu-device-agnostic-array-creation-best-practice/75059)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 9\
**Last updated:** [January 23, 2022, 3:42pm UTC](https://discourse.julialang.org/t/cuda-amd-cpu-device-agnostic-array-creation-best-practice/75059 "2022-01-23T15:42:43Z")

</div>

Dear Julianners, What is the best practice to do a device agnostic array initialisation. I believe this package written by many person already. For example: get\_worker\_type() = :CUDA # This is actually a function tha…

---

## [Using Makie with Threads.@spawn](https://discourse.julialang.org/t/using-makie-with-threads-spawn/54618)

<div class="topic-metadata">

**Author:** [@tt1234567](https://discourse.julialang.org/u/tt1234567)\
**Replies:** 12\
**Last updated:** [January 23, 2022, 2:00pm UTC](https://discourse.julialang.org/t/using-makie-with-threads-spawn/54618 "2022-01-23T14:00:38Z")

</div>

I’d like to plot a stream of data in a separate thread. Using Makie works up to a point, but the axis labels seem to come out wrong and it occasionally crashes. I don’t know if I’m doing something wrong or if it’s a limi…

---

## [How to delploy Documenter-generated documentation on a project that is not a package?](https://discourse.julialang.org/t/how-to-delploy-documenter-generated-documentation-on-a-project-that-is-not-a-package/75006)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [January 23, 2022, 1:37pm UTC](https://discourse.julialang.org/t/how-to-delploy-documenter-generated-documentation-on-a-project-that-is-not-a-package/75006 "2022-01-23T13:37:38Z")

</div>

Hello, I am trying to use Documenter (and Literate) for a github-based Julia course (so, not a package) When I run the documentation building script locally, I got it without problem and the documentation is built local…

---

## [On the LU factorization](https://discourse.julialang.org/t/on-the-lu-factorization/75066)

<div class="topic-metadata">

**Author:** [@scheiber\_erno](https://discourse.julialang.org/u/scheiber_erno)\
**Replies:** 1\
**Last updated:** [January 23, 2022, 1:29pm UTC](https://discourse.julialang.org/t/on-the-lu-factorization/75066 "2022-01-23T13:29:20Z")

</div>

What is wrong with my code ? It works well six years ago. It is the case of a singular matrix. I review the following exercise: Compute the LU factorization of the matrix A=\[1 2 -1 3 2;2 4 -2 5 1;-1 -2 1 -3 -4;3 6 2 …

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

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