# Latest

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

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

**Page:** 517

---

## [Gurobi: best bound 0.0e+00, gap 100.0000%](https://discourse.julialang.org/t/gurobi-best-bound-0-0e-00-gap-100-0000/108191)

<div class="topic-metadata">

**Author:** [@quais](https://discourse.julialang.org/u/quais)\
**Replies:** 7\
**Last updated:** [January 6, 2024, 9:13pm UTC](https://discourse.julialang.org/t/gurobi-best-bound-0-0e-00-gap-100-0000/108191 "2024-01-06T21:13:28Z")

</div>

Hi, I am currently working on a cost minimization model. However, I have the problem when solving with Gurobi (v10) that my best bounds is stuck at 0.0 all the time. As a result, my gap remains constant at 100%. Addition…

---

## [How to address an error?](https://discourse.julialang.org/t/how-to-address-an-error/93191)

<div class="topic-metadata">

**Author:** [@Kanishk](https://discourse.julialang.org/u/Kanishk)\
**Replies:** 4\
**Last updated:** [January 6, 2024, 8:05pm UTC](https://discourse.julialang.org/t/how-to-address-an-error/93191 "2024-01-06T20:05:21Z")

</div>

Hello, I am trying to find the steady state (or roots) of a system with 9 states using the Krawczyk method. For that I need to find a Jacobian, but I am getting the following error- " BoundsError: attempt to access 0-e…

---

## [Trying to write a convert() for a complicated type](https://discourse.julialang.org/t/trying-to-write-a-convert-for-a-complicated-type/108419)

<div class="topic-metadata">

**Author:** [@GlenHenshaw](https://discourse.julialang.org/u/GlenHenshaw)\
**Replies:** 11\
**Last updated:** [January 6, 2024, 7:59pm UTC](https://discourse.julialang.org/t/trying-to-write-a-convert-for-a-complicated-type/108419 "2024-01-06T19:59:38Z")

</div>

Stepping back into Julia after a year’s absence. I’m using RigibBodyDynamics to model a double pendulum. Simulating the system should return an array of system states, ideally an Array{Float64} or similar. The type that…

---

## [Keyword arguments not assigned](https://discourse.julialang.org/t/keyword-arguments-not-assigned/108420)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 3\
**Last updated:** [January 6, 2024, 4:15pm UTC](https://discourse.julialang.org/t/keyword-arguments-not-assigned/108420 "2024-01-06T16:15:26Z")

</div>

I see functions invoked as a, b = fun(x; year=1000, rate) The keyward argument ‘rate’ is not assigned a value. So it will take its preassigned value, right?

---

## [PProf doesnt open in the web](https://discourse.julialang.org/t/pprof-doesnt-open-in-the-web/107492)

<div class="topic-metadata">

**Author:** [@Helectus](https://discourse.julialang.org/u/Helectus)\
**Replies:** 1\
**Last updated:** [January 6, 2024, 4:43pm UTC](https://discourse.julialang.org/t/pprof-doesnt-open-in-the-web/107492 "2024-01-06T16:43:47Z")

</div>

I try to use PProf but it doesnt seem to open the ui in firefox. The error message is profile.pb.gz: malformed profile: found location with reserved id=0 pprof: failed to fetch any source profiles I used @profile my\_f…

---

## [New method for 'Base.sum'](https://discourse.julialang.org/t/new-method-for-base-sum/108427)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 5\
**Last updated:** [January 6, 2024, 4:28pm UTC](https://discourse.julialang.org/t/new-method-for-base-sum/108427 "2024-01-06T16:28:19Z")

</div>

function Base.sum(f, v::MyType) return sum(f, values(v)) end In the Github package I am reading, the author introduced a lot of new methods for julia builtin functions. Is this a common practice in programming, esp…

---

## [A keyword argument must have a default value?](https://discourse.julialang.org/t/a-keyword-argument-must-have-a-default-value/108421)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 7\
**Last updated:** [January 6, 2024, 2:55pm UTC](https://discourse.julialang.org/t/a-keyword-argument-must-have-a-default-value/108421 "2024-01-06T14:55:30Z")

</div>

This seems a common practice in the codes I saw. Is it required or not?

---

## [How to improve performance in a function that repeatedly defines and multiplies matrices](https://discourse.julialang.org/t/how-to-improve-performance-in-a-function-that-repeatedly-defines-and-multiplies-matrices/108153)

<div class="topic-metadata">

**Author:** [@Uranium238](https://discourse.julialang.org/u/Uranium238)\
**Replies:** 64\
**Last updated:** [January 6, 2024, 2:22pm UTC](https://discourse.julialang.org/t/how-to-improve-performance-in-a-function-that-repeatedly-defines-and-multiplies-matrices/108153 "2024-01-06T14:22:15Z")

</div>

I am trying to write a code that involves running 3 nested loops, and calling a computationally expensive function within the loop. The expense mainly comes from defining , multiplying and inverting large \[~100x100\] matr…

---

## [\[ANN\] RepeatingDecimalNotations.jl](https://discourse.julialang.org/t/ann-repeatingdecimalnotations-jl/108011)

<div class="topic-metadata">

**Author:** [@hyrodium](https://discourse.julialang.org/u/hyrodium)\
**Replies:** 1\
**Last updated:** [January 6, 2024, 6:54am UTC](https://discourse.julialang.org/t/ann-repeatingdecimalnotations-jl/108011 "2024-01-06T06:54:35Z")

</div>

Hi all, I’m pleased to announce my package RepeatingDecimalNotations.jl (repo, docs). This package has some operations with repeating decimals. Define rational number with string macro like rd"123.4(56)". Convert R…

---

## [Checkpointing and adjoints for custom kernels](https://discourse.julialang.org/t/checkpointing-and-adjoints-for-custom-kernels/108281)

<div class="topic-metadata">

**Author:** [@smartalecH](https://discourse.julialang.org/u/smartalecH)\
**Replies:** 2\
**Last updated:** [January 6, 2024, 12:32am UTC](https://discourse.julialang.org/t/checkpointing-and-adjoints-for-custom-kernels/108281 "2024-01-06T00:32:52Z")

</div>

I’ve written a PDE finite-difference solver that uses KernelAbstractions.jl to update my stencil each time step. In my previous life, when I’d write this stuff in C/C++, I’d roll my own adjoints, and then hook them up t…

---

## [Article - How fast is your programming language](https://discourse.julialang.org/t/article-how-fast-is-your-programming-language/108405)

<div class="topic-metadata">

**Author:** [@djholiver](https://discourse.julialang.org/u/djholiver)\
**Replies:** 6\
**Last updated:** [January 5, 2024, 9:13pm UTC](https://discourse.julialang.org/t/article-how-fast-is-your-programming-language/108405 "2024-01-05T21:13:02Z")

</div>

Hi, I’m sure some will find this interesting. The last paragraph: "Python remains one of the two most used scripting languages despite its poor performance,” the developer reflects. “Will there be a language to displac…

---

## [Billion-row benchmark?](https://discourse.julialang.org/t/billion-row-benchmark/108417)

<div class="topic-metadata">

**Author:** [@djholiver](https://discourse.julialang.org/u/djholiver)\
**Replies:** 1\
**Last updated:** [January 5, 2024, 10:45pm UTC](https://discourse.julialang.org/t/billion-row-benchmark/108417 "2024-01-05T22:45:03Z")

</div>

You’re correct - I had no intention to compare with Python or start a debate - the extract was to highlight that he either didnt know of Julia or didnt consider it (despite aggrievances with Python). In so far as the be…

---

## [Obtaining coefficients of polynomial with SymEngine.jl](https://discourse.julialang.org/t/obtaining-coefficients-of-polynomial-with-symengine-jl/108371)

<div class="topic-metadata">

**Author:** [@MAB](https://discourse.julialang.org/u/MAB)\
**Replies:** 5\
**Last updated:** [January 5, 2024, 11:11pm UTC](https://discourse.julialang.org/t/obtaining-coefficients-of-polynomial-with-symengine-jl/108371 "2024-01-05T23:11:56Z")

</div>

I am trying to obtain a dictionary that contains monomials (keys) and coefficients (values) for a multi-variate polynomial in SymEngine. This function exists in Symbolics.jl Symbolics.polynomial\_coeffs but I would rath…

---

## [Plotting points and boxplots on the same graph in Gadfly](https://discourse.julialang.org/t/plotting-points-and-boxplots-on-the-same-graph-in-gadfly/108413)

<div class="topic-metadata">

**Author:** [@bottaw](https://discourse.julialang.org/u/bottaw)\
**Replies:** 0\
**Last updated:** [January 5, 2024, 10:48pm UTC](https://discourse.julialang.org/t/plotting-points-and-boxplots-on-the-same-graph-in-gadfly/108413 "2024-01-05T22:48:23Z")

</div>

I am trying to make a gadfly graph that includes a series of data points on it with a minimalist boxplot of those points right next to it for statistical comparison. Something like this graph here: I have come pretty…

---

## [Group profiling flame graph tiles](https://discourse.julialang.org/t/group-profiling-flame-graph-tiles/108384)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 4\
**Last updated:** [January 5, 2024, 9:17pm UTC](https://discourse.julialang.org/t/group-profiling-flame-graph-tiles/108384 "2024-01-05T21:17:01Z")

</div>

An integration + optimization code I’m working on generates flame graphs like this one, which are very hard to parse. Indeed, the same underlying function is called by several different lines of the code, so even if I sp…

---

## [Return (; a, b )](https://discourse.julialang.org/t/return-a-b/108388)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 4\
**Last updated:** [January 5, 2024, 8:54pm UTC](https://discourse.julialang.org/t/return-a-b/108388 "2024-01-05T20:54:57Z")

</div>

This is the last line of a function. What does the ; mean here? I know return (a,b) is to return a tuple. But what does return (; a,b) mean?

---

## [Customizing Julia Installation Directory on Linux](https://discourse.julialang.org/t/customizing-julia-installation-directory-on-linux/108362)

<div class="topic-metadata">

**Author:** [@marllos](https://discourse.julialang.org/u/marllos)\
**Replies:** 5\
**Last updated:** [January 5, 2024, 8:31pm UTC](https://discourse.julialang.org/t/customizing-julia-installation-directory-on-linux/108362 "2024-01-05T20:31:42Z")

</div>

Hello everyone! I’m currently working on installing Julia on my Linux system using the standard installation script (curl -fsSL https://install.julialang.org | sh ). I’m looking to customize the installation directory, b…

---

## [\[ANN\] Malt.jl – Distributed alternative (used internally by Pluto)](https://discourse.julialang.org/t/ann-malt-jl-distributed-alternative-used-internally-by-pluto/108401)

<div class="topic-metadata">

**Author:** [@fonsp](https://discourse.julialang.org/u/fonsp)\
**Replies:** 3\
**Last updated:** [January 5, 2024, 7:14pm UTC](https://discourse.julialang.org/t/ann-malt-jl-distributed-alternative-used-internally-by-pluto/108401 "2024-01-05T19:14:42Z")

</div>

We are happy to announce Malt.jl 1.0 – simple multiprocessing for Julia. Malt allows the creation and remote control of other Julia “worker” processes. Pluto uses Malt behind the scenes, using a Malt worker for every not…

---

## [Difference between 'x.=y' and 'x=y'](https://discourse.julialang.org/t/difference-between-x-y-and-x-y/108366)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 6\
**Last updated:** [January 5, 2024, 7:12pm UTC](https://discourse.julialang.org/t/difference-between-x-y-and-x-y/108366 "2024-01-05T19:12:36Z")

</div>

I see codes like this x.= x./maximum(abs.(x)) Here x is a vector. Personally, I would write x = x./maximum(abs.(x)) Is there any significant difference between the two?

---

## [Precompilation takes ages](https://discourse.julialang.org/t/precompilation-takes-ages/108377)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 14\
**Last updated:** [January 5, 2024, 7:04pm UTC](https://discourse.julialang.org/t/precompilation-takes-ages/108377 "2024-01-05T19:04:55Z")

</div>

Hey, I am having some kind of an issue that does not match what I see here and what others reports. I have an environment with the following Project.toml: \[deps\] BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"…

---

## [Capturing SIGHUP or SIGUSR1/2](https://discourse.julialang.org/t/capturing-sighup-or-sigusr1-2/69771)

<div class="topic-metadata">

**Author:** [@bluesmoon](https://discourse.julialang.org/u/bluesmoon)\
**Replies:** 1\
**Last updated:** [January 5, 2024, 6:59pm UTC](https://discourse.julialang.org/t/capturing-sighup-or-sigusr1-2/69771 "2024-01-05T18:59:28Z")

</div>

I know how to capture SIGINT via an InterruptException and how to attach a signal handler using atexit, but neither of those solves my requirement. I need to capture either of SIGHUP, SIGUSR1, or SIGUSR2 so that I can r…

---

## [How to avoid collect an iterator returning a vector of Any](https://discourse.julialang.org/t/how-to-avoid-collect-an-iterator-returning-a-vector-of-any/108400)

<div class="topic-metadata">

**Author:** [@FemtoTrader](https://discourse.julialang.org/u/FemtoTrader)\
**Replies:** 1\
**Last updated:** [January 5, 2024, 6:05pm UTC](https://discourse.julialang.org/t/how-to-avoid-collect-an-iterator-returning-a-vector-of-any/108400 "2024-01-05T18:05:45Z")

</div>

Hello, I have the following code using OnlineStatsBase using IncTA using IncTA: TechnicalIndicator using IncTA.SampleData: OPEN\_TMPL, HIGH\_TMPL, LOW\_TMPL, CLOSE\_TMPL, VOLUME\_TMPL, DATE\_TMPL mutable struct TechnicalIn…

---

## [Redefining print method changes variable scoping in loop](https://discourse.julialang.org/t/redefining-print-method-changes-variable-scoping-in-loop/108010)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 9\
**Last updated:** [January 5, 2024, 2:20pm UTC](https://discourse.julialang.org/t/redefining-print-method-changes-variable-scoping-in-loop/108010 "2024-01-05T14:20:18Z")

</div>

Why does the first loop work but the second does not? The MWE: Summaryusing Printf for n in 1:10 if n == 1 flag = true idx\_last = 1 else flag = false idx\_last = ifelse(flag, n, idx\_last) end # P…

---

## [Getting current scene azimuth and elevation](https://discourse.julialang.org/t/getting-current-scene-azimuth-and-elevation/108380)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 2\
**Last updated:** [January 5, 2024, 2:05pm UTC](https://discourse.julialang.org/t/getting-current-scene-azimuth-and-elevation/108380 "2024-01-05T14:05:05Z")

</div>

Makie 0.20 has added a method update\_cam!(scene, azimuth, elevation). Is there an easy way to go in the other direction, to get the azimuth and elevation values corresponding to the current scene configuration? These va…

---

## [Function or struct？](https://discourse.julialang.org/t/function-or-struct/108376)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 3\
**Last updated:** [January 5, 2024, 12:45pm UTC](https://discourse.julialang.org/t/function-or-struct/108376 "2024-01-05T12:45:58Z")

</div>

struct MyType{T} label::T x::Float64 y::Float64 end function MyType(; label = 1000, x = 0, y = 0) return MyType(label, x, y) end I am a bit confused. Here we have a function and a struct, both of wh…

---

## [Swap cols/rows of a matrix](https://discourse.julialang.org/t/swap-cols-rows-of-a-matrix/47904)

<div class="topic-metadata">

**Author:** [@hytonwons](https://discourse.julialang.org/u/hytonwons)\
**Replies:** 15\
**Last updated:** [January 5, 2024, 8:57am UTC](https://discourse.julialang.org/t/swap-cols-rows-of-a-matrix/47904 "2024-01-05T08:57:03Z")

</div>

Hi, I need to swap columns or rows of a matrix. I have two ideas: (1). Create a new matrix and copy cols/rows to the new matrix. We may use @view. (2). Multiply by a permutation matrix. Of course, we also need to crea…

---

## [Equivalent Fortran function is about 4.6 times faster](https://discourse.julialang.org/t/equivalent-fortran-function-is-about-4-6-times-faster/108344)

<div class="topic-metadata">

**Author:** [@jabru](https://discourse.julialang.org/u/jabru)\
**Replies:** 17\
**Last updated:** [January 5, 2024, 8:02am UTC](https://discourse.julialang.org/t/equivalent-fortran-function-is-about-4-6-times-faster/108344 "2024-01-05T08:02:08Z")

</div>

Hey there, for my current project, I wrote a function in plane Julia. It reads #Kappa squared or the square of the inverse debye length Debyelengthinnversesquared(is) = e^2\*beta\*2\*is\*n\_a/(epsilon\*epsilon\_r) #Kappa in …

---

## [Function at the beginning of a script or at the end?](https://discourse.julialang.org/t/function-at-the-beginning-of-a-script-or-at-the-end/108372)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 2\
**Last updated:** [January 5, 2024, 7:29am UTC](https://discourse.julialang.org/t/function-at-the-beginning-of-a-script-or-at-the-end/108372 "2024-01-05T07:29:56Z")

</div>

x = rand(5) x .=f.(x) function f(x) return 2 \* x end This is a test script. In vs code, I got an error /ERROR: AUndefVarError: \`f\` not definedn Stacktrace:a c o\[1\]n dtop-level scopea / @S cUntitled-3:5ri julia\> …

---

## [Array comprehension in a quote](https://discourse.julialang.org/t/array-comprehension-in-a-quote/108333)

<div class="topic-metadata">

**Author:** [@lstagner](https://discourse.julialang.org/u/lstagner)\
**Replies:** 4\
**Last updated:** [January 5, 2024, 4:33am UTC](https://discourse.julialang.org/t/array-comprehension-in-a-quote/108333 "2024-01-05T04:33:13Z")

</div>

I want to do an array comprehension from a list of ranges in a quote but I get a syntax error. loops = \[:(i=1:2), :(j=1:3)\] :(\[i+j for :(loops...)\]) # ideally maps to \[i+j for i=1:2, j=1:3\] syntax: invalid iteration spe…

---

## [@ccall: returning a pointer to an array](https://discourse.julialang.org/t/ccall-returning-a-pointer-to-an-array/108329)

<div class="topic-metadata">

**Author:** [@rmfritz](https://discourse.julialang.org/u/rmfritz)\
**Replies:** 4\
**Last updated:** [January 5, 2024, 4:13am UTC](https://discourse.julialang.org/t/ccall-returning-a-pointer-to-an-array/108329 "2024-01-05T04:13:09Z")

</div>

I am trying to wrap a C function that returns a pointer to an array of UInt8, and I can’t quite figure out how to pass that pointer in. The C function signature is: int tmMapPicture(uby8 \*\*psp, int \*xp, int \*yp, … A p…

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

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