# Latest

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

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

**Page:** 1394

---

## [How to use macros to install and load a package?](https://discourse.julialang.org/t/how-to-use-macros-to-install-and-load-a-package/61076)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 5\
**Last updated:** [May 13, 2021, 1:10pm UTC](https://discourse.julialang.org/t/how-to-use-macros-to-install-and-load-a-package/61076 "2021-05-13T13:10:18Z")

</div>

I was thinking of writing something like macro use(ex) quote Pkg.add(string($ex)) using $ex end end but I fear that’s not how to use it. How do I write a macro taking in a nonexisting module na…

---

## [Do block syntax examples](https://discourse.julialang.org/t/do-block-syntax-examples/40757)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 36\
**Last updated:** [May 13, 2021, 12:09pm UTC](https://discourse.julialang.org/t/do-block-syntax-examples/40757 "2021-05-13T12:09:43Z")

</div>

I know there are some people who are really big fans of the do block syntax for things like map etc. I am trying to get on board but it is usually never the first thing to come to mind when I’m writing code. The only ins…

---

## [Correct preallocation for different Autodiff libraries](https://discourse.julialang.org/t/correct-preallocation-for-different-autodiff-libraries/60707)

<div class="topic-metadata">

**Author:** [@triceert](https://discourse.julialang.org/u/triceert)\
**Replies:** 3\
**Last updated:** [May 13, 2021, 12:07pm UTC](https://discourse.julialang.org/t/correct-preallocation-for-different-autodiff-libraries/60707 "2021-05-13T12:07:59Z")

</div>

I have some quite complex Julia package which I would like to tweak for performance. As I understand, the key for this will be to make the code type-stable and reusing memory, especially for repeatedly called expensive f…

---

## [ODEFunction throwing "ERROR: LoadError: mul\_float: types of a and b must match"](https://discourse.julialang.org/t/odefunction-throwing-error-loaderror-mul-float-types-of-a-and-b-must-match/61024)

<div class="topic-metadata">

**Author:** [@ap2013](https://discourse.julialang.org/u/ap2013)\
**Replies:** 5\
**Last updated:** [May 13, 2021, 12:04pm UTC](https://discourse.julialang.org/t/odefunction-throwing-error-loaderror-mul-float-types-of-a-and-b-must-match/61024 "2021-05-13T12:04:38Z")

</div>

What does the following error mean: “ERROR: LoadError: mul\_float: types of a and b must match”? I am running a code that repeatedly calls a function that creates an ODE problem and solves it. The function is called in a…

---

## [Can I have a UInt12?](https://discourse.julialang.org/t/can-i-have-a-uint12/60935)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 11\
**Last updated:** [May 13, 2021, 11:59am UTC](https://discourse.julialang.org/t/can-i-have-a-uint12/60935 "2021-05-13T11:59:11Z")

</div>

I need to use a number that has 2^12 discrete levels, i.e. a UInt12. Is there a package that does this (I tried BitIntegers but no joy)?

---

## [Pluto.run() to open a specific notebook](https://discourse.julialang.org/t/pluto-run-to-open-a-specific-notebook/61071)

<div class="topic-metadata">

**Author:** [@maajdl](https://discourse.julialang.org/u/maajdl)\
**Replies:** 2\
**Last updated:** [May 13, 2021, 11:55am UTC](https://discourse.julialang.org/t/pluto-run-to-open-a-specific-notebook/61071 "2021-05-13T11:55:55Z")

</div>

I could not find out how to open a specific notebook instead of just starting the server. Is that possible? Thanks Michel

---

## [HTTP POST xml request with headers and authentification](https://discourse.julialang.org/t/http-post-xml-request-with-headers-and-authentification/61026)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 6\
**Last updated:** [May 13, 2021, 11:48am UTC](https://discourse.julialang.org/t/http-post-xml-request-with-headers-and-authentification/61026 "2021-05-13T11:48:23Z")

</div>

Hi, I have the following R code that I use to query an API: httr::RETRY(verb="POST", url= "https://mywebsite.net/view", body = xml\_payload, httr::authenticate("myname","mypassword"), httr::content\_…

---

## [Can you pull a line number from a caught error?](https://discourse.julialang.org/t/can-you-pull-a-line-number-from-a-caught-error/61066)

<div class="topic-metadata">

**Author:** [@ligert123](https://discourse.julialang.org/u/ligert123)\
**Replies:** 4\
**Last updated:** [May 13, 2021, 11:30am UTC](https://discourse.julialang.org/t/can-you-pull-a-line-number-from-a-caught-error/61066 "2021-05-13T11:30:21Z")

</div>

Can you pull a line number from a caught error? Im running multiple threads and when an error is found the Task dies, i was wondering if it is possible to get the line number and module or file from an error that has be…

---

## [Logo design](https://discourse.julialang.org/t/logo-design/61063)

<div class="topic-metadata">

**Author:** [@chriscoey](https://discourse.julialang.org/u/chriscoey)\
**Replies:** 4\
**Last updated:** [May 13, 2021, 10:45am UTC](https://discourse.julialang.org/t/logo-design/61063 "2021-05-13T10:45:16Z")

</div>

Hi, I noticed various package logos like to incorporate their own take on the colored Julia dots, and I’m just wondering if it is OK to use the following logo that I made for Hypatia.jl: (the Y part is relevant to w…

---

## [Animate with While loop in Julia](https://discourse.julialang.org/t/animate-with-while-loop-in-julia/61069)

<div class="topic-metadata">

**Author:** [@Minimum-Pollution-96](https://discourse.julialang.org/u/Minimum-Pollution-96)\
**Replies:** 4\
**Last updated:** [May 13, 2021, 10:27am UTC](https://discourse.julialang.org/t/animate-with-while-loop-in-julia/61069 "2021-05-13T10:27:24Z")

</div>

Is it possible to implement plot animation within while loop in Julia? I’m trying to translate a code that my professor gave me in Matlab. (Top Opt - Sigmund 99 line matlab code) It seems both @gif and @animate support …

---

## [Disable secret for pluto.jl notebook](https://discourse.julialang.org/t/disable-secret-for-pluto-jl-notebook/61065)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 4\
**Last updated:** [May 13, 2021, 9:41am UTC](https://discourse.julialang.org/t/disable-secret-for-pluto-jl-notebook/61065 "2021-05-13T09:41:20Z")

</div>

Pluto-notebooks are launched in the default browser. If I want to open the notebook in a different browser, I have to copy the localhost adress from the terminal to include the nessecary secret. I however want to be able…

---

## [Broadcasting a function that returns a tuple](https://discourse.julialang.org/t/broadcasting-a-function-that-returns-a-tuple/61064)

<div class="topic-metadata">

**Author:** [@alessio](https://discourse.julialang.org/u/alessio)\
**Replies:** 1\
**Last updated:** [May 13, 2021, 7:37am UTC](https://discourse.julialang.org/t/broadcasting-a-function-that-returns-a-tuple/61064 "2021-05-13T07:37:22Z")

</div>

I would like to broadcast the JarqueBeraTest from package HypothesisTests. Without broadcasting I can do something like: Pkg.add(\["HypothesisTests"\]); using HypothesisTests JarqueBeraTest(randn(10)) and I get someth…

---

## [CairoMakie AssertionError: length(positions) == length(colors) when trying to record](https://discourse.julialang.org/t/cairomakie-assertionerror-length-positions-length-colors-when-trying-to-record/61001)

<div class="topic-metadata">

**Author:** [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Replies:** 2\
**Last updated:** [May 13, 2021, 3:56am UTC](https://discourse.julialang.org/t/cairomakie-assertionerror-length-positions-length-colors-when-trying-to-record/61001 "2021-05-13T03:56:41Z")

</div>

Hi, I’ve been trying to make this code run but I don’t know how to fix a problem. I think the problem happens too deep in the stack call that I just cannot find where in particular is it occurring: My goal is to have an…

---

## [Counting non negative instances of a variable for use in constraint - efficient formulation?](https://discourse.julialang.org/t/counting-non-negative-instances-of-a-variable-for-use-in-constraint-efficient-formulation/60507)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 6\
**Last updated:** [May 13, 2021, 5:58am UTC](https://discourse.julialang.org/t/counting-non-negative-instances-of-a-variable-for-use-in-constraint-efficient-formulation/60507 "2021-05-13T05:58:21Z")

</div>

This is an optimisation and not JuMP related question, but I thought it worth asking here. I have a constraint in my model which limits the number of non-negative instances of a variable. Specifically, I have a power bal…

---

## [Fill gaps in DataFrame](https://discourse.julialang.org/t/fill-gaps-in-dataframe/60912)

<div class="topic-metadata">

**Author:** [@stej](https://discourse.julialang.org/u/stej)\
**Replies:** 10\
**Last updated:** [May 13, 2021, 5:32am UTC](https://discourse.julialang.org/t/fill-gaps-in-dataframe/60912 "2021-05-13T05:32:12Z")

</div>

What is an idiomatic way how to fill gaps in DataFrame? “Gaps” for me are some unknown data. One example is - I need to draw a line, but I have values only for some points. I need to supply some values (e.g. zero) for th…

---

## [Creating a sparse matrix from find operation on dense matrix](https://discourse.julialang.org/t/creating-a-sparse-matrix-from-find-operation-on-dense-matrix/61056)

<div class="topic-metadata">

**Author:** [@bmit](https://discourse.julialang.org/u/bmit)\
**Replies:** 4\
**Last updated:** [May 13, 2021, 2:20am UTC](https://discourse.julialang.org/t/creating-a-sparse-matrix-from-find-operation-on-dense-matrix/61056 "2021-05-13T02:20:04Z")

</div>

I have a large matrix x. I’d like to create a sparse representation of the values that meet a certain criteria, e.g. xi \< 1. I’d like to do something like the following: x = rand(1000, 1000) i = findall(xi -\> xi \< 0.01…

---

## [Doing trivial transformations and assertions inside a struct definition](https://discourse.julialang.org/t/doing-trivial-transformations-and-assertions-inside-a-struct-definition/61054)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 9\
**Last updated:** [May 13, 2021, 1:53am UTC](https://discourse.julialang.org/t/doing-trivial-transformations-and-assertions-inside-a-struct-definition/61054 "2021-05-13T01:53:28Z")

</div>

I am defining a struct, and I would like to make it perform some trivial transformations on the input data to simplify later calculations. The goal is for the struct to accept just a vector of qualities and prices, and …

---

## [Getting started with Differential Equations](https://discourse.julialang.org/t/getting-started-with-differential-equations/61055)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 7\
**Last updated:** [May 13, 2021, 1:25am UTC](https://discourse.julialang.org/t/getting-started-with-differential-equations/61055 "2021-05-13T01:25:36Z")

</div>

I am trying to port a simple example from Python to Julia, but already the first example from the Tutorial fails: using DifferentialEquations function lorenz(t, u, du) du\[1\] = 10.0(u\[2\]-u\[1\]) du\[2\] = u\[1\]\*(28.0…

---

## [Rodas5 and ModelingToolkit much slower than Sundials' IDA on large systems](https://discourse.julialang.org/t/rodas5-and-modelingtoolkit-much-slower-than-sundials-ida-on-large-systems/60712)

<div class="topic-metadata">

**Author:** [@bmetherall](https://discourse.julialang.org/u/bmetherall)\
**Replies:** 7\
**Last updated:** [May 13, 2021, 1:21am UTC](https://discourse.julialang.org/t/rodas5-and-modelingtoolkit-much-slower-than-sundials-ida-on-large-systems/60712 "2021-05-13T01:21:38Z")

</div>

I’m trying to solve a 1-D advection-diffusion-reaction equation which has been discretized into a set of ODEs. My code below is about 30x slower for n~1000 than a similar implementation as a DAEProblem solved with IDA().…

---

## [Getting second derivatives at every possible time point w.r.t. parameters](https://discourse.julialang.org/t/getting-second-derivatives-at-every-possible-time-point-w-r-t-parameters/58130)

<div class="topic-metadata">

**Author:** [@donkeysaddle](https://discourse.julialang.org/u/donkeysaddle)\
**Replies:** 3\
**Last updated:** [May 13, 2021, 1:08am UTC](https://discourse.julialang.org/t/getting-second-derivatives-at-every-possible-time-point-w-r-t-parameters/58130 "2021-05-13T01:08:25Z")

</div>

I have used ODEForwardSensitivityProblem to great effect to get derivatives of the equations in my system w.r.t the parameters at every possible time point. Is there a way to get the Hessian at every possible time point…

---

## [Using MbedTLS to create an encrypted TCP server](https://discourse.julialang.org/t/using-mbedtls-to-create-an-encrypted-tcp-server/60927)

<div class="topic-metadata">

**Author:** [@ligert123](https://discourse.julialang.org/u/ligert123)\
**Replies:** 2\
**Last updated:** [May 13, 2021, 12:42am UTC](https://discourse.julialang.org/t/using-mbedtls-to-create-an-encrypted-tcp-server/60927 "2021-05-13T00:42:51Z")

</div>

Hello, any ideas on how to use MbedTLS to encrypt new incoming connections? I have been having a lot of trouble finding anything on doing this

---

## [How to create an SVector of SVectors?](https://discourse.julialang.org/t/how-to-create-an-svector-of-svectors/61025)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [May 12, 2021, 3:46pm UTC](https://discourse.julialang.org/t/how-to-create-an-svector-of-svectors/61025 "2021-05-12T15:46:01Z")

</div>

The following does not work: using StaticArrays pos=SVector{3, SVector{3,Float64}}(zeros(3,3)) Any idea?

---

## [LoadError: UndefVarError: Grisu not defined](https://discourse.julialang.org/t/loaderror-undefvarerror-grisu-not-defined/61000)

<div class="topic-metadata">

**Author:** [@healyp](https://discourse.julialang.org/u/healyp)\
**Replies:** 7\
**Last updated:** [May 12, 2021, 10:15pm UTC](https://discourse.julialang.org/t/loaderror-undefvarerror-grisu-not-defined/61000 "2021-05-12T22:15:23Z")

</div>

I’m getting the above error with JuMP / MathOptInterface when I attempt to write a model to a file: MOI.write\_to\_file(lp\_model, gName\*".lp") I note that there has been some discussion about Grisu in a plots+1.6 context…

---

## [Approximate set intersection for floating point numbers](https://discourse.julialang.org/t/approximate-set-intersection-for-floating-point-numbers/61047)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 1\
**Last updated:** [May 12, 2021, 9:45pm UTC](https://discourse.julialang.org/t/approximate-set-intersection-for-floating-point-numbers/61047 "2021-05-12T21:45:05Z")

</div>

I have two sets of numbers, say… x = randn(1\_000\_000) |\> Set y = randn(1\_000\_000) |\> Set I’d like to find the approximate intersection of the two sets, to some tolerance. I could… for xi in x for yi in y i…

---

## [Fitting normalizing flows with Bijectors.jl](https://discourse.julialang.org/t/fitting-normalizing-flows-with-bijectors-jl/60383)

<div class="topic-metadata">

**Author:** [@mateuszbaran](https://discourse.julialang.org/u/mateuszbaran)\
**Replies:** 6\
**Last updated:** [May 12, 2021, 9:42pm UTC](https://discourse.julialang.org/t/fitting-normalizing-flows-with-bijectors-jl/60383 "2021-05-12T21:42:05Z")

</div>

Hi! I’d like to fit a normalizing flow to some data using Bijectors.jl. I’m a bit lost because I couldn’t find any complete examples. This is what I managed to do so far: using Bijectors using KernelDensity using Stats…

---

## [Stack Overflow switched to system fonts](https://discourse.julialang.org/t/stack-overflow-switched-to-system-fonts/60997)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 5\
**Last updated:** [May 12, 2021, 8:48pm UTC](https://discourse.julialang.org/t/stack-overflow-switched-to-system-fonts/60997 "2021-05-12T20:48:16Z")

</div>

I’m mainly posting this (in Offtopic) to rant and commiserate. On my machine (Chrome on a Mac laptop), Stack Overflow is mostly unreadable now. The text is too small, and if I zoom in the formatting gets all wonky. An…

---

## [Parse a large array of small JSON objects?](https://discourse.julialang.org/t/parse-a-large-array-of-small-json-objects/61040)

<div class="topic-metadata">

**Author:** [@Satvik](https://discourse.julialang.org/u/Satvik)\
**Replies:** 2\
**Last updated:** [May 12, 2021, 8:36pm UTC](https://discourse.julialang.org/t/parse-a-large-array-of-small-json-objects/61040 "2021-05-12T20:36:29Z")

</div>

Hi, I have a DataFrame that contains a column of several million JSON strings, e.g. julia\> DataFrame(j=""""{a": 1, "b": 2}""") julia\> pretty\_table(df) ┌──────────────────┐ │ j │ │ String │ ├───…

---

## [How do I map a build ID to a cache file?](https://discourse.julialang.org/t/how-do-i-map-a-build-id-to-a-cache-file/61044)

<div class="topic-metadata">

**Author:** [@bluesmoon](https://discourse.julialang.org/u/bluesmoon)\
**Replies:** 0\
**Last updated:** [May 12, 2021, 8:08pm UTC](https://discourse.julialang.org/t/how-do-i-map-a-build-id-to-a-cache-file/61044 "2021-05-12T20:08:25Z")

</div>

I’m using Julia 1.5.3 I have a module (DSWB) which depends on another module (HTTP), which in turn depends on another module (MbedTLS@1.0.3). When I call using DSWB in my notebook, Julia tries to precompile, and then g…

---

## [How to update JuMP](https://discourse.julialang.org/t/how-to-update-jump/60682)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 2\
**Last updated:** [May 12, 2021, 6:05pm UTC](https://discourse.julialang.org/t/how-to-update-jump/60682 "2021-05-12T18:05:57Z")

</div>

I’m with JuMP v0.18.6 and I want to update to v0.21, but whenever I try the following message appears: julia\> Pkg.update ("JuMP") Updating registry at \`C: \\ Users \\ raquel.santos \\ .julia \\ registries \\ General\` …

---

## [Cannon's or SUMA algorithm implementation?](https://discourse.julialang.org/t/cannons-or-suma-algorithm-implementation/61034)

<div class="topic-metadata">

**Author:** [@Chase\_Roberts](https://discourse.julialang.org/u/Chase_Roberts)\
**Replies:** 0\
**Last updated:** [May 12, 2021, 5:22pm UTC](https://discourse.julialang.org/t/cannons-or-suma-algorithm-implementation/61034 "2021-05-12T17:22:57Z")

</div>

Are there any examples of doing distributed matmuls with Cannon’s or SUMA algorithm in Julia?

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

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