# Latest

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

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

**Page:** 1254

---

## [Linear constraint optimisation on GPU](https://discourse.julialang.org/t/linear-constraint-optimisation-on-gpu/68692)

<div class="topic-metadata">

**Author:** [@Huy\_Nguyen](https://discourse.julialang.org/u/Huy_Nguyen)\
**Replies:** 5\
**Last updated:** [September 29, 2021, 9:45am UTC](https://discourse.julialang.org/t/linear-constraint-optimisation-on-gpu/68692 "2021-09-29T09:45:33Z")

</div>

I currently use JuMP and Ipopt to solve Linear Constraints Optimisation problems, primarily with linear equality and inequality constraints. I would like to either solve many of these problems in parallel, or sequentiall…

---

## [Display (a different) value under scatter point](https://discourse.julialang.org/t/display-a-different-value-under-scatter-point/10821)

<div class="topic-metadata">

**Author:** [@biona001](https://discourse.julialang.org/u/biona001)\
**Replies:** 12\
**Last updated:** [September 29, 2021, 7:54am UTC](https://discourse.julialang.org/t/display-a-different-value-under-scatter-point/10821 "2021-09-29T07:54:43Z")

</div>

Plotlyjs is giving me a plot that doesn’t seem to be finding the closest scatter point to my cursor (indicated by black arrow): using Plots plotlyjs() scatter(x1, x2) My question is: How can I display the name…

---

## [Strange behavior (Revise and other stuff)](https://discourse.julialang.org/t/strange-behavior-revise-and-other-stuff/68833)

<div class="topic-metadata">

**Author:** [@Ribeiro](https://discourse.julialang.org/u/Ribeiro)\
**Replies:** 7\
**Last updated:** [September 29, 2021, 7:25am UTC](https://discourse.julialang.org/t/strange-behavior-revise-and-other-stuff/68833 "2021-09-29T07:25:14Z")

</div>

Hi, folks. I use Revise all the time while using Julia, as I often modify the code I’m running. Sometimes (and I’m not sure how to repeat this), Revise throws a bunch of errors and becomes yellow, as if I made big modi…

---

## [Distinguishing macros of the same name](https://discourse.julialang.org/t/distinguishing-macros-of-the-same-name/68905)

<div class="topic-metadata">

**Author:** [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Replies:** 1\
**Last updated:** [September 29, 2021, 6:53am UTC](https://discourse.julialang.org/t/distinguishing-macros-of-the-same-name/68905 "2021-09-29T06:53:00Z")

</div>

Both JuMP and Julia Symbolics define @variables macro. How can I distinguish them? For example jump.@variables?

---

## [Improving Julia packaging workflow with Conventional Commits and Semantic-release](https://discourse.julialang.org/t/improving-julia-packaging-workflow-with-conventional-commits-and-semantic-release/68442)

<div class="topic-metadata">

**Author:** [@jaantollander](https://discourse.julialang.org/u/jaantollander)\
**Replies:** 1\
**Last updated:** [September 29, 2021, 6:50am UTC](https://discourse.julialang.org/t/improving-julia-packaging-workflow-with-conventional-commits-and-semantic-release/68442 "2021-09-29T06:50:58Z")

</div>

Hey! I have been testing Semantic-release for a Julia package with GitHub actions, inspired by @bauglir’s (Joris Kraak) JuliaCon2021 presentation “Semantically Releasing Julia Packages”. As a result, I created a minimal …

---

## [How to convert DataFrame into Array{T,2}?](https://discourse.julialang.org/t/how-to-convert-dataframe-into-array-t-2/22487)

<div class="topic-metadata">

**Author:** [@Eric\_Chen](https://discourse.julialang.org/u/Eric_Chen)\
**Replies:** 7\
**Last updated:** [September 29, 2021, 6:02am UTC](https://discourse.julialang.org/t/how-to-convert-dataframe-into-array-t-2/22487 "2021-09-29T06:02:17Z")

</div>

Let’s say I have a dataframe that only holds number or missings. How can I convert it to a Array{T, 2} ? Without the names / header Thank you using DataFrames df = DataFrame(a=\[ 1, 2, 3, 4, missing\], b= \[1, 2, 3, 4, 5…

---

## [Broadcasting Imputed Values](https://discourse.julialang.org/t/broadcasting-imputed-values/68897)

<div class="topic-metadata">

**Author:** [@WawerOS](https://discourse.julialang.org/u/WawerOS)\
**Replies:** 0\
**Last updated:** [September 29, 2021, 1:10am UTC](https://discourse.julialang.org/t/broadcasting-imputed-values/68897 "2021-09-29T01:10:32Z")

</div>

Hello, I’m new to Turing so this might just be a beginners error but when I try following code using Turing @model function gdemo(x, y) s² ~ InverseGamma(2, 3) m ~ Normal(0, sqrt(s²)) x .~ Normal(m, sqrt(s…

---

## [Expression as single fraction in Symbolics.jl](https://discourse.julialang.org/t/expression-as-single-fraction-in-symbolics-jl/68816)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 4\
**Last updated:** [September 28, 2021, 11:04pm UTC](https://discourse.julialang.org/t/expression-as-single-fraction-in-symbolics-jl/68816 "2021-09-28T23:04:32Z")

</div>

I am using Symbolics.jl to automate some tedious mathematical operations in a large expression. I would like to express the result as a single fraction rather than the sum of several fractions. I tried to accomplish this…

---

## [Advice on using unsafe\_wrap to view integers as atomic integers](https://discourse.julialang.org/t/advice-on-using-unsafe-wrap-to-view-integers-as-atomic-integers/67918)

<div class="topic-metadata">

**Author:** [@orenbenkiki](https://discourse.julialang.org/u/orenbenkiki)\
**Replies:** 16\
**Last updated:** [September 28, 2021, 7:45pm UTC](https://discourse.julialang.org/t/advice-on-using-unsafe-wrap-to-view-integers-as-atomic-integers/67918 "2021-09-28T19:45:21Z")

</div>

I’m trying to view the same memory region as a vector of different types of the same size. The goal is to view a (large) vector of integers as a vector of atomic integers (counts), to allow parallel threads to perform at…

---

## [Calling Flux.params() inside gradient changes output?](https://discourse.julialang.org/t/calling-flux-params-inside-gradient-changes-output/68829)

<div class="topic-metadata">

**Author:** [@AlexLewandowski](https://discourse.julialang.org/u/AlexLewandowski)\
**Replies:** 2\
**Last updated:** [September 28, 2021, 6:32pm UTC](https://discourse.julialang.org/t/calling-flux-params-inside-gradient-changes-output/68829 "2021-09-28T18:32:16Z")

</div>

Could anyone help me understand why calling Flux.params() inside a gradient, changes the gradient? Below is a minimal example where, in get\_grad\_2, I instantiate a variable prowling\_variable = Flux.params(m). The gradie…

---

## [From papers to Julia code: examples wanted](https://discourse.julialang.org/t/from-papers-to-julia-code-examples-wanted/62704)

<div class="topic-metadata">

**Author:** [@miguelraz](https://discourse.julialang.org/u/miguelraz)\
**Replies:** 10\
**Last updated:** [September 28, 2021, 5:44pm UTC](https://discourse.julialang.org/t/from-papers-to-julia-code-examples-wanted/62704 "2021-09-28T17:44:51Z")

</div>

Ian Weaver Started a very nice discussion in Slack that could use some more community input: We want examples were Julia code matches the paper pseudo code or mathematical specification. Here are some examples people f…

---

## [Problems with gr()](https://discourse.julialang.org/t/problems-with-gr/53910)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 10\
**Last updated:** [September 28, 2021, 5:26pm UTC](https://discourse.julialang.org/t/problems-with-gr/53910 "2021-09-28T17:26:59Z")

</div>

Dear all, When I compile using Plots import Contour: contours, levels, level, lines, coordinates f(x,y) = 2 - (x^2 + y^2) xs = range(-5, stop=5, length=100) ys = range(-5, stop=5, length=100) zs = \[f(x,y) for y in ys, …

---

## [Using Flux to construct a CES function](https://discourse.julialang.org/t/using-flux-to-construct-a-ces-function/68842)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 3\
**Last updated:** [September 28, 2021, 4:32pm UTC](https://discourse.julialang.org/t/using-flux-to-construct-a-ces-function/68842 "2021-09-28T16:32:13Z")

</div>

I’m wondering if I Flux.jl can be used to construct a multi layer CES function. I won’t be training the function in Flux, just leverage its multi layer flexibility. For example, consider the function F(x; a, \\rho) = \\l…

---

## [Is there a direct way in Julia to format a number e.g. 9999999999 as a String object "9,999,999,999" for making it convenient to read?](https://discourse.julialang.org/t/is-there-a-direct-way-in-julia-to-format-a-number-e-g-9999999999-as-a-string-object-9-999-999-999-for-making-it-convenient-to-read/68861)

<div class="topic-metadata">

**Author:** [@shubh\_b](https://discourse.julialang.org/u/shubh_b)\
**Replies:** 3\
**Last updated:** [September 28, 2021, 10:16am UTC](https://discourse.julialang.org/t/is-there-a-direct-way-in-julia-to-format-a-number-e-g-9999999999-as-a-string-object-9-999-999-999-for-making-it-convenient-to-read/68861 "2021-09-28T10:16:45Z")

</div>

Is there any Julia function or a straightforward way that can format a large integer number as a String object in which every 3 digits can become delimited by comma (,) from the end? This thing we can do in Python using…

---

## [Pkg.update() does not update, but Pkg.add() does](https://discourse.julialang.org/t/pkg-update-does-not-update-but-pkg-add-does/68877)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 1\
**Last updated:** [September 28, 2021, 2:05pm UTC](https://discourse.julialang.org/t/pkg-update-does-not-update-but-pkg-add-does/68877 "2021-09-28T14:05:45Z")

</div>

I recently released a patch update of a registered package (say PackageA). The version number increased from 0.3.1 to 0.3.2. On a different computer, I installed PackageB that depends on PackageA. PackageA was not ins…

---

## [Plots jl plotlyjs ignores aspect ratio for pdf](https://discourse.julialang.org/t/plots-jl-plotlyjs-ignores-aspect-ratio-for-pdf/68634)

<div class="topic-metadata">

**Author:** [@Ribeiro](https://discourse.julialang.org/u/Ribeiro)\
**Replies:** 5\
**Last updated:** [September 28, 2021, 1:46pm UTC](https://discourse.julialang.org/t/plots-jl-plotlyjs-ignores-aspect-ratio-for-pdf/68634 "2021-09-28T13:46:30Z")

</div>

Hi, folks. I might be messing up, but it seems that if I plot something with size=(200,400) and then savefig to PDF, plotlyjs makes my file square-ish. Is this a limitation, something I can work around, or me doing som…

---

## [Randomness in initialization](https://discourse.julialang.org/t/randomness-in-initialization/68822)

<div class="topic-metadata">

**Author:** [@joe\_sonic](https://discourse.julialang.org/u/joe_sonic)\
**Replies:** 10\
**Last updated:** [September 28, 2021, 1:20pm UTC](https://discourse.julialang.org/t/randomness-in-initialization/68822 "2021-09-28T13:20:25Z")

</div>

Hi, I have a simple model, which I know there exists multiplicity in results. When I start Ipopt to optimize this model, I found out that every time the optimizer gives me different results. The question is: Is there a …

---

## [FLoops composable way of multithreading nested loops?](https://discourse.julialang.org/t/floops-composable-way-of-multithreading-nested-loops/68832)

<div class="topic-metadata">

**Author:** [@PatrickMcFarlane](https://discourse.julialang.org/u/PatrickMcFarlane)\
**Replies:** 2\
**Last updated:** [September 28, 2021, 12:23pm UTC](https://discourse.julialang.org/t/floops-composable-way-of-multithreading-nested-loops/68832 "2021-09-28T12:23:04Z")

</div>

I’m writing an algorithm for a discrete time dynamic programming problem in economics. The algorithm involves nested looping over 4 state variables - 2 exogenous, 2 endogenous. The solution to the problem 4 dimensional…

---

## [Is there any package similar to python's decimal in Julia? Where we can use any precision?](https://discourse.julialang.org/t/is-there-any-package-similar-to-pythons-decimal-in-julia-where-we-can-use-any-precision/68834)

<div class="topic-metadata">

**Author:** [@aburousan](https://discourse.julialang.org/u/aburousan)\
**Replies:** 10\
**Last updated:** [September 28, 2021, 12:12pm UTC](https://discourse.julialang.org/t/is-there-any-package-similar-to-pythons-decimal-in-julia-where-we-can-use-any-precision/68834 "2021-09-28T12:12:11Z")

</div>

I have written this piece of code in python. from decimal import \* def pi\_chudn(n): getcontext().prec = n+50 k=0 pi\_chud = 0 while k\<n: pi\_chud+=(((Decimal(-1))\*\*k ) \* (Decimal(mp.factorial(6\*k))…

---

## [Julia function for replacing nothings with default values?](https://discourse.julialang.org/t/julia-function-for-replacing-nothings-with-default-values/68863)

<div class="topic-metadata">

**Author:** [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Replies:** 2\
**Last updated:** [September 28, 2021, 9:57am UTC](https://discourse.julialang.org/t/julia-function-for-replacing-nothings-with-default-values/68863 "2021-09-28T09:57:33Z")

</div>

Does Julia have a built-in function akin to the following? replace\_nothing(given,default) = given replace\_nothing(::Nothing, default) = default

---

## [Efficiently create large array of structs without allocations](https://discourse.julialang.org/t/efficiently-create-large-array-of-structs-without-allocations/68843)

<div class="topic-metadata">

**Author:** [@torrance](https://discourse.julialang.org/u/torrance)\
**Replies:** 5\
**Last updated:** [September 28, 2021, 7:39am UTC](https://discourse.julialang.org/t/efficiently-create-large-array-of-structs-without-allocations/68843 "2021-09-28T07:39:58Z")

</div>

I want to create a very large array of a custom struct type. However, I am finding that the loop that fills the (pre-allocated array) is requiring a large amount of memory allocations and is very slow as a result. I ass…

---

## [Return vector when broadcasting over mean vector to generate random numbers](https://discourse.julialang.org/t/return-vector-when-broadcasting-over-mean-vector-to-generate-random-numbers/68851)

<div class="topic-metadata">

**Author:** [@conorhassan](https://discourse.julialang.org/u/conorhassan)\
**Replies:** 2\
**Last updated:** [September 28, 2021, 7:16am UTC](https://discourse.julialang.org/t/return-vector-when-broadcasting-over-mean-vector-to-generate-random-numbers/68851 "2021-09-28T07:16:39Z")

</div>

Hi there, I am wanting to use something like rand.(Normal.(\[5;10\],1),1) where we have two different mean values \\mu\_1=5, \\mu\_2=10 which we broadcast over to generate 2 random numbers total. I would like the output to …

---

## [LoadError: UndefVarError: Test not defined](https://discourse.julialang.org/t/loaderror-undefvarerror-test-not-defined/68853)

<div class="topic-metadata">

**Author:** [@joseph\_s](https://discourse.julialang.org/u/joseph_s)\
**Replies:** 1\
**Last updated:** [September 28, 2021, 7:11am UTC](https://discourse.julialang.org/t/loaderror-undefvarerror-test-not-defined/68853 "2021-09-28T07:11:31Z")

</div>

I’m trying to do the run unit test using Base.Test @test 1 + 1 == 2 julia runtests.jl gives me the error “LoadError: UndefVarError: Test not defined” I’m using julia version 1.6.2, What am I missing?

---

## [Compile Julia using experimental GNU GCC for apple silicon](https://discourse.julialang.org/t/compile-julia-using-experimental-gnu-gcc-for-apple-silicon/59374)

<div class="topic-metadata">

**Author:** [@luis-perez-one](https://discourse.julialang.org/u/luis-perez-one)\
**Replies:** 8\
**Last updated:** [June 3, 2021, 9:29pm UTC](https://discourse.julialang.org/t/compile-julia-using-experimental-gnu-gcc-for-apple-silicon/59374 "2021-06-03T21:29:04Z")

</div>

Hello everyone! This is my first post in the forum. :grinning: I was wondering, have any of you been able to compile Julia using the experimental GCC - Fortan compiler from Iain Sanode for apple silicon? I just pulled …

---

## [How to ccall struct array from C?](https://discourse.julialang.org/t/how-to-ccall-struct-array-from-c/68805)

<div class="topic-metadata">

**Author:** [@kimmolinna](https://discourse.julialang.org/u/kimmolinna)\
**Replies:** 4\
**Last updated:** [September 28, 2021, 3:43am UTC](https://discourse.julialang.org/t/how-to-ccall-struct-array-from-c/68805 "2021-09-28T03:43:11Z")

</div>

I would like read call directly duckdb c-api, but I have some difficulties with structs. I try to do the following c-code in Julia. #include "duckdb.h" #include \<stdio.h\> int main() { duckdb\_database db = NULL; duckd…

---

## [What to put in \[compat\] section of Project.toml](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 10\
**Last updated:** [September 28, 2021, 2:25am UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800 "2021-09-28T02:25:21Z")

</div>

Hi all, I’m just trying to make a few changes to a registered package of mine DependentBootstrap. Unfortunately, every time I do this (once a year or so) I seem to end up here because something goes wrong. Note, I’m bla…

---

## [Taking gradients in Julia](https://discourse.julialang.org/t/taking-gradients-in-julia/68731)

<div class="topic-metadata">

**Author:** [@ZHEN\_LIN](https://discourse.julialang.org/u/ZHEN_LIN)\
**Replies:** 7\
**Last updated:** [September 28, 2021, 1:26am UTC](https://discourse.julialang.org/t/taking-gradients-in-julia/68731 "2021-09-28T01:26:55Z")

</div>

I’m looking for a fast package that can take gradients of functions I write in Julia. Similar to the autograd package for Python. It seems that there are a few different options such as Zygote, ForwardDiff.jl, ReverseDi…

---

## [What does the architecture of Flux.RNN look like?](https://discourse.julialang.org/t/what-does-the-architecture-of-flux-rnn-look-like/44119)

<div class="topic-metadata">

**Author:** [@XiaodongMa-MRI](https://discourse.julialang.org/u/XiaodongMa-MRI)\
**Replies:** 2\
**Last updated:** [September 27, 2021, 10:06pm UTC](https://discourse.julialang.org/t/what-does-the-architecture-of-flux-rnn-look-like/44119 "2021-09-27T22:06:17Z")

</div>

Hi all, I am confused about the architecture of RNN in Flux.jl. If I define a RNN using the code RNN(3,3), will it be like the left one or the right one in the picture below? Based on the documentation, I think it is…

---

## [Choosing the number of worker processes](https://discourse.julialang.org/t/choosing-the-number-of-worker-processes/63389)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 6\
**Last updated:** [September 27, 2021, 11:08pm UTC](https://discourse.julialang.org/t/choosing-the-number-of-worker-processes/63389 "2021-09-27T23:08:49Z")

</div>

I have a job that needs to run in multiple processors. How should I decide what n should be in addprocs(n)? I assume the right number will depend on the tasks and the number of cores and RAM. Is there a way to automate …

---

## [Number in LatexStrings](https://discourse.julialang.org/t/number-in-latexstrings/68840)

<div class="topic-metadata">

**Author:** [@Liwei17](https://discourse.julialang.org/u/Liwei17)\
**Replies:** 2\
**Last updated:** [September 27, 2021, 10:29pm UTC](https://discourse.julialang.org/t/number-in-latexstrings/68840 "2021-09-27T22:29:39Z")

</div>

I want to show something like “ \\sigma = NUMBER ” in the legend of the plot. How can I manage to do that? Thanks!

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

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