# Latest

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

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

**Page:** 1635

---

## ["and", "or", bitwise or shortcircuit, what we get searching docs](https://discourse.julialang.org/t/and-or-bitwise-or-shortcircuit-what-we-get-searching-docs/46263)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 60\
**Last updated:** [September 11, 2020, 1:05pm UTC](https://discourse.julialang.org/t/and-or-bitwise-or-shortcircuit-what-we-get-searching-docs/46263 "2020-09-11T13:05:04Z")

</div>

I am teaching some programming using Julia, and I faced a common student mistake which I think is justified from what we get when searching the docs. If we search “and or Julia” on google, we get, first, this page: “Mat…

---

## [Second plot series send to background](https://discourse.julialang.org/t/second-plot-series-send-to-background/45889)

<div class="topic-metadata">

**Author:** [@moesphere](https://discourse.julialang.org/u/moesphere)\
**Replies:** 4\
**Last updated:** [September 11, 2020, 12:45pm UTC](https://discourse.julialang.org/t/second-plot-series-send-to-background/45889 "2020-09-11T12:45:00Z")

</div>

Is it possible to send a second plot (e.g. a vertical line) to the background? I know, if I drew the vertical line first, I would get what I want. However, then I have to provide axis scales in order to get a nice plot. …

---

## [Callback problem with DifferentialEquations](https://discourse.julialang.org/t/callback-problem-with-differentialequations/46057)

<div class="topic-metadata">

**Author:** [@moesphere](https://discourse.julialang.org/u/moesphere)\
**Replies:** 10\
**Last updated:** [September 11, 2020, 12:40pm UTC](https://discourse.julialang.org/t/callback-problem-with-differentialequations/46057 "2020-09-11T12:40:24Z")

</div>

I am stuck with a problem considering a SavingCallback from the DifferentialEquations suite. I could not create a MWE, thus I will explain the problem. I have an ODEProblem where I use a SavingCallback for the calculat…

---

## [Help converting a transformation matrix](https://discourse.julialang.org/t/help-converting-a-transformation-matrix/46095)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 5\
**Last updated:** [September 11, 2020, 11:48am UTC](https://discourse.julialang.org/t/help-converting-a-transformation-matrix/46095 "2020-09-11T11:48:31Z")

</div>

For lack of a better alternative, I’m using Matlab’s image calibration toolbox. One of the things I’m after is the transformation matrix Matlab’s fitgeotrans outputs: tform = fitgeotrans(imagePoints, worldPoints, 'proje…

---

## [How to find the number of non-zeros weights needed to minimise the distance between a weighted sum and a population](https://discourse.julialang.org/t/how-to-find-the-number-of-non-zeros-weights-needed-to-minimise-the-distance-between-a-weighted-sum-and-a-population/46442)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [September 11, 2020, 11:36am UTC](https://discourse.julialang.org/t/how-to-find-the-number-of-non-zeros-weights-needed-to-minimise-the-distance-between-a-weighted-sum-and-a-population/46442 "2020-09-11T11:36:35Z")

</div>

Hello, I need to use some individual elements (x\_n, in my application agricultural farms of which I know every details) as building blocks to reconstruct an observed aggregate V\_d \>=0 for the d dimensions (in my applica…

---

## [How to keep result one-dimensional even after multiplication?](https://discourse.julialang.org/t/how-to-keep-result-one-dimensional-even-after-multiplication/46439)

<div class="topic-metadata">

**Author:** [@ishihama](https://discourse.julialang.org/u/ishihama)\
**Replies:** 3\
**Last updated:** [September 11, 2020, 9:32am UTC](https://discourse.julialang.org/t/how-to-keep-result-one-dimensional-even-after-multiplication/46439 "2020-09-11T09:32:41Z")

</div>

I am trying several functions who include vectors as variable. The variable (x) is x= \[2.0:0.5:5.0;\] I like to define the following kinds of functions: f(x) = (x .+ 0.07im)/2.3; g(x) = (1/f(x)).^2 h(x) = g(x) .\* (2 .…

---

## [StackOverflowError when fitting data to a von Mises distribution](https://discourse.julialang.org/t/stackoverflowerror-when-fitting-data-to-a-von-mises-distribution/45406)

<div class="topic-metadata">

**Author:** [@oscarbelmon](https://discourse.julialang.org/u/oscarbelmon)\
**Replies:** 4\
**Last updated:** [September 11, 2020, 8:05am UTC](https://discourse.julialang.org/t/stackoverflowerror-when-fitting-data-to-a-von-mises-distribution/45406 "2020-09-11T08:05:26Z")

</div>

Hi everyone. I’m trying to use Turing.jl to fit data to a von Mises circular distribution, and I am having some “stack overflow” issues during the fitting. This is my (very simple) code (coin flip adaptation): using T…

---

## [Gradients from an SDE solver with callbacks](https://discourse.julialang.org/t/gradients-from-an-sde-solver-with-callbacks/46317)

<div class="topic-metadata">

**Author:** [@MikeKlocCZ](https://discourse.julialang.org/u/MikeKlocCZ)\
**Replies:** 2\
**Last updated:** [September 11, 2020, 7:49am UTC](https://discourse.julialang.org/t/gradients-from-an-sde-solver-with-callbacks/46317 "2020-09-11T07:49:03Z")

</div>

I am trying to get gradients of the solution of an SDE where a callback function is used in the solve command. It seems that the forward adjoint method is not compatible with the usage of callbacks as I get "ERROR: type…

---

## [Status of Pkg speed improvements outside US in v1.5](https://discourse.julialang.org/t/status-of-pkg-speed-improvements-outside-us-in-v1-5/46395)

<div class="topic-metadata">

**Author:** [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Replies:** 19\
**Last updated:** [September 11, 2020, 7:40am UTC](https://discourse.julialang.org/t/status-of-pkg-speed-improvements-outside-us-in-v1-5/46395 "2020-09-11T07:40:41Z")

</div>

One of the improvements I was most looking forward to in v1.5 is the new Pkg infrastructure with expected speed improvements for non-US users. But so far my end-user experience is largely unchanged. Is this expected, or …

---

## [Julia Seasons of Contributions to supplement GSoC 2020](https://discourse.julialang.org/t/julia-seasons-of-contributions-to-supplement-gsoc-2020/38754)

<div class="topic-metadata">

**Author:** [@logankilpatrick](https://discourse.julialang.org/u/logankilpatrick)\
**Replies:** 7\
**Last updated:** [September 11, 2020, 6:27am UTC](https://discourse.julialang.org/t/julia-seasons-of-contributions-to-supplement-gsoc-2020/38754 "2020-09-11T06:27:48Z")

</div>

Hey all, As many of you know, last year was our inaugural year of JSoC to supplement GSoC. While we very much hope to get our minimum slots requested through GSoC each year, this year, again our allocated slots were few…

---

## [Get type containing the types of a set?](https://discourse.julialang.org/t/get-type-containing-the-types-of-a-set/46304)

<div class="topic-metadata">

**Author:** [@pjentsch0](https://discourse.julialang.org/u/pjentsch0)\
**Replies:** 8\
**Last updated:** [September 11, 2020, 6:24am UTC](https://discourse.julialang.org/t/get-type-containing-the-types-of-a-set/46304 "2020-09-11T06:24:39Z")

</div>

Given a set of variables \[a,b,c...\], I want to find the type T such that typeof(a)\<:T, typeof(b)\<:T, .... The reason I want to do this is that I have cache variables in my ODE system, which need to be able to adapt if o…

---

## [Understanding memory allocations](https://discourse.julialang.org/t/understanding-memory-allocations/46379)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 6\
**Last updated:** [September 11, 2020, 5:47am UTC](https://discourse.julialang.org/t/understanding-memory-allocations/46379 "2020-09-11T05:47:08Z")

</div>

I want fast code. :sunglasses: I will get a core meltdown. I try to understand why some code allocates while other doesn’t. Here is my little benchmark, and I cannot make head or tail of the results. b = Complex(1.,2…

---

## [BLAS vs CUBLAS benchmark](https://discourse.julialang.org/t/blas-vs-cublas-benchmark/46205)

<div class="topic-metadata">

**Author:** [@Szymon\_Zak](https://discourse.julialang.org/u/Szymon_Zak)\
**Replies:** 13\
**Last updated:** [September 11, 2020, 4:17am UTC](https://discourse.julialang.org/t/blas-vs-cublas-benchmark/46205 "2020-09-11T04:17:43Z")

</div>

Hello. I’m trying to compare BLAS and CUBLAS performance with Julia. For example, I want to compare matrix multiplication time. Let A, B, C will be \[NxN\] matrices. Which function, should I use to get something like C…

---

## [Don't understand behaviour of NamedTuple{...,Tuple{...,T}} where T](https://discourse.julialang.org/t/dont-understand-behaviour-of-namedtuple-tuple-t-where-t/46382)

<div class="topic-metadata">

**Author:** [@Graham\_Gill](https://discourse.julialang.org/u/Graham_Gill)\
**Replies:** 6\
**Last updated:** [September 11, 2020, 3:44am UTC](https://discourse.julialang.org/t/dont-understand-behaviour-of-namedtuple-tuple-t-where-t/46382 "2020-09-11T03:44:50Z")

</div>

Here’s an example to enter in the REPL. I don’t understand the behaviour of Z(x) below. I’m using Julia 1.4.2. julia\> Y = NamedTuple{(:a,:b), Tuple{String,Real}} julia\> Z = NamedTuple{(:a,:b), Tuple{String,T}} where T \<…

---

## [Package incompatibility](https://discourse.julialang.org/t/package-incompatibility/46420)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 8\
**Last updated:** [September 11, 2020, 2:13am UTC](https://discourse.julialang.org/t/package-incompatibility/46420 "2020-09-11T02:13:36Z")

</div>

I’m trying to find out what is holding back DataStructures package. Installed version is v0.17.20, latest version is 0.18.4. Attempting to explicitly add the latest version of DataStructures reveals a seemingly weird …

---

## [How to create tab space using @sprintf?](https://discourse.julialang.org/t/how-to-create-tab-space-using-sprintf/46421)

<div class="topic-metadata">

**Author:** [@Nova](https://discourse.julialang.org/u/Nova)\
**Replies:** 6\
**Last updated:** [September 11, 2020, 12:13am UTC](https://discourse.julialang.org/t/how-to-create-tab-space-using-sprintf/46421 "2020-09-11T00:13:30Z")

</div>

For some reasons, I would like to stick to using sprintf and I need to write into a file when each line has a tab space in the beginning. Here is what I wrote but it doesn’t work: ff = open("test.txt", "w") ss = Array{…

---

## [How to capture a for loop index after break?](https://discourse.julialang.org/t/how-to-capture-a-for-loop-index-after-break/46342)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 22\
**Last updated:** [September 10, 2020, 11:02pm UTC](https://discourse.julialang.org/t/how-to-capture-a-for-loop-index-after-break/46342 "2020-09-10T23:02:38Z")

</div>

Is there a way to have a non-local scope loop index, so code similar to this: for i = 1:9 if i \> 3 break end end println(i) works and I don’t have to write: j = 0 for i = 1:9 if i \> 3 j = i break …

---

## [Changing the default solving loop condition in DifferentialEquations.jl](https://discourse.julialang.org/t/changing-the-default-solving-loop-condition-in-differentialequations-jl/46419)

<div class="topic-metadata">

**Author:** [@kapple](https://discourse.julialang.org/u/kapple)\
**Replies:** 1\
**Last updated:** [September 10, 2020, 10:20pm UTC](https://discourse.julialang.org/t/changing-the-default-solving-loop-condition-in-differentialequations-jl/46419 "2020-09-10T22:20:23Z")

</div>

Hi all! I’m trying to implement a solver that will stop if one of the variables passes a certain value instead of time-stepping (I may thus change the title of this topic). Say e.g. u\[1\] \< 0 || u\[1\] \> R for maximum rang…

---

## [Variables not recalculating while reloading modules](https://discourse.julialang.org/t/variables-not-recalculating-while-reloading-modules/46396)

<div class="topic-metadata">

**Author:** [@sandeep\_prakash](https://discourse.julialang.org/u/sandeep_prakash)\
**Replies:** 8\
**Last updated:** [September 10, 2020, 6:11pm UTC](https://discourse.julialang.org/t/variables-not-recalculating-while-reloading-modules/46396 "2020-09-10T18:11:17Z")

</div>

I have a module that i use to input some parameters (used in multiple functions etc, and I did not want to rewrite everywhere). They are lightly manipulated (basic scaling etc) and exported to various parts of a larger c…

---

## [PermutedDimsArray slower than permutedims?](https://discourse.julialang.org/t/permuteddimsarray-slower-than-permutedims/46401)

<div class="topic-metadata">

**Author:** [@kc104](https://discourse.julialang.org/u/kc104)\
**Replies:** 3\
**Last updated:** [September 10, 2020, 7:20pm UTC](https://discourse.julialang.org/t/permuteddimsarray-slower-than-permutedims/46401 "2020-09-10T19:20:00Z")

</div>

I’m struggling to understand why one function for multiplying a batch of matrices with a single matrix is significantly slower than another. The only difference between the functions is that PermutedDimsArray is used in …

---

## [Package Manager: Erratic behavior?](https://discourse.julialang.org/t/package-manager-erratic-behavior/46340)

<div class="topic-metadata">

**Author:** [@gaspardelanuit](https://discourse.julialang.org/u/gaspardelanuit)\
**Replies:** 4\
**Last updated:** [September 10, 2020, 7:26pm UTC](https://discourse.julialang.org/t/package-manager-erratic-behavior/46340 "2020-09-10T19:26:10Z")

</div>

After installing the ShiftedArrays package I have observed that a bunch of the packages I have installed were downgraded (while some were upgraded). Most egregiously was plots which reverted to 0.28.4 from 1.6.3 I am a…

---

## [~/.julia/bin as a standard location for scripts?](https://discourse.julialang.org/t/julia-bin-as-a-standard-location-for-scripts/45993)

<div class="topic-metadata">

**Author:** [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Replies:** 14\
**Last updated:** [September 10, 2020, 6:36pm UTC](https://discourse.julialang.org/t/julia-bin-as-a-standard-location-for-scripts/45993 "2020-09-10T18:36:55Z")

</div>

I think I have seen two different, unrelated projects that use ~/.julia/bin as a default directory for putting scripts and CLIs (and there might be others that I don’t know about): jlpkg comonicon and tools built upo…

---

## [Spilt column and save into different column](https://discourse.julialang.org/t/spilt-column-and-save-into-different-column/46368)

<div class="topic-metadata">

**Author:** [@Arpan\_Jain](https://discourse.julialang.org/u/Arpan_Jain)\
**Replies:** 7\
**Last updated:** [September 10, 2020, 5:44pm UTC](https://discourse.julialang.org/t/spilt-column-and-save-into-different-column/46368 "2020-09-10T17:44:50Z")

</div>

ho SOLVE E PART

---

## [Restart iteration in a for loop when an error is thrown](https://discourse.julialang.org/t/restart-iteration-in-a-for-loop-when-an-error-is-thrown/43850)

<div class="topic-metadata">

**Author:** [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Replies:** 14\
**Last updated:** [September 10, 2020, 4:36pm UTC](https://discourse.julialang.org/t/restart-iteration-in-a-for-loop-when-an-error-is-thrown/43850 "2020-09-10T16:36:17Z")

</div>

I have to run a for loop based on random numbers generation and inversion of a matrix. When the matrix is singular, my code stops, throwing a SingularException() error. If this occurs at a certain iteration of the loop, …

---

## [Why Base.@kwdef is not exported?](https://discourse.julialang.org/t/why-base-kwdef-is-not-exported/46328)

<div class="topic-metadata">

**Author:** [@AtsushiSakai](https://discourse.julialang.org/u/AtsushiSakai)\
**Replies:** 5\
**Last updated:** [September 10, 2020, 3:42pm UTC](https://discourse.julialang.org/t/why-base-kwdef-is-not-exported/46328 "2020-09-10T15:42:50Z")

</div>

Hi. I have a small question about Base.@kwdef. I think this macro is very useful, already many packages are using Base.@kwdef. https://github.com/search?q="Base.%40kwdef"&type=Code I don’t know why @kwdef is not expor…

---

## [Tool to tell if a package has unused dependencies or using unused packages](https://discourse.julialang.org/t/tool-to-tell-if-a-package-has-unused-dependencies-or-using-unused-packages/36254)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 11\
**Last updated:** [September 10, 2020, 2:21pm UTC](https://discourse.julialang.org/t/tool-to-tell-if-a-package-has-unused-dependencies-or-using-unused-packages/36254 "2020-09-10T14:21:19Z")

</div>

When developing large projects, I sometimes 1) lose track of what packages I \]added but am not using any longer, and 2) what packages I’m using but not actually making use of. Is there a tool to detect these kind of sit…

---

## [Macro for decorator (wrapper) in Python](https://discourse.julialang.org/t/macro-for-decorator-wrapper-in-python/46362)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 9\
**Last updated:** [September 10, 2020, 1:30pm UTC](https://discourse.julialang.org/t/macro-for-decorator-wrapper-in-python/46362 "2020-09-10T13:30:39Z")

</div>

Greetings, What I’m trying to do can be expressed as a Python code like this: def is\_convex\_repr(is\_convex): def wrapper(func): func.is\_convex = is\_convex return func return wrapper @is\_con…

---

## [Optimizing a package: how to get started](https://discourse.julialang.org/t/optimizing-a-package-how-to-get-started/46341)

<div class="topic-metadata">

**Author:** [@mbaz](https://discourse.julialang.org/u/mbaz)\
**Replies:** 7\
**Last updated:** [September 10, 2020, 1:32pm UTC](https://discourse.julialang.org/t/optimizing-a-package-how-to-get-started/46341 "2020-09-10T13:32:37Z")

</div>

The improvements in Julia v1.5.1, tools like SnoopCompile.jl, and the recent posts by Tim Holy have motivated me to see if I can extract further performance from my plotting package Gaston. Being fairly new to this kind …

---

## [How do I implement the Parametric ReLU (PReLU) function in Flux v0.11.1?](https://discourse.julialang.org/t/how-do-i-implement-the-parametric-relu-prelu-function-in-flux-v0-11-1/46310)

<div class="topic-metadata">

**Author:** [@RiN](https://discourse.julialang.org/u/RiN)\
**Replies:** 5\
**Last updated:** [September 10, 2020, 1:05pm UTC](https://discourse.julialang.org/t/how-do-i-implement-the-parametric-relu-prelu-function-in-flux-v0-11-1/46310 "2020-09-10T13:05:59Z")

</div>

I want to handle the Parametric ReLU (PReLU) function in Flux v0.11.1. https://arxiv.org/abs/1502.01852 I’m trying to implement it in Flux based on the following post, but the version of Flux in this post is old and ma…

---

## [What is regex?](https://discourse.julialang.org/t/what-is-regex/46215)

<div class="topic-metadata">

**Author:** [@string-dot-byte](https://discourse.julialang.org/u/string-dot-byte)\
**Replies:** 10\
**Last updated:** [September 10, 2020, 1:02pm UTC](https://discourse.julialang.org/t/what-is-regex/46215 "2020-09-10T13:02:55Z")

</div>

Hello, I have come across many programming terms inidcating regex which I am unsure of what it is. I have made research on this forum and on google but have not found any good explanation about the subject. What I und…

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

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