# Latest

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

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

**Page:** 1449

---

## [Why does this ccall segfault?](https://discourse.julialang.org/t/why-does-this-ccall-segfault/57690)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 7\
**Last updated:** [March 24, 2021, 8:20am UTC](https://discourse.julialang.org/t/why-does-this-ccall-segfault/57690 "2021-03-24T08:20:31Z")

</div>

The following code segfaults for me: C = """ typedef struct CParticle { double charge; double E; double weight; } CParticle; void simulate(void (\*f)(CParticle x)) { CParticle cp; cp.charge = 0; …

---

## [Using Transformers.jl for "is next sentence"](https://discourse.julialang.org/t/using-transformers-jl-for-is-next-sentence/57829)

<div class="topic-metadata">

**Author:** [@Anna\_Zavyalova](https://discourse.julialang.org/u/Anna_Zavyalova)\
**Replies:** 2\
**Last updated:** [March 24, 2021, 8:13am UTC](https://discourse.julialang.org/t/using-transformers-jl-for-is-next-sentence/57829 "2021-03-24T08:13:16Z")

</div>

Hello, how can i get the probability for next sentence prediction using Bert? Example gives arrays of different lengths for each 2 sentences, according to the number of tokens in this 2 sentences. What should i do next…

---

## [Tutorial: How to benchmark and profile your code?](https://discourse.julialang.org/t/tutorial-how-to-benchmark-and-profile-your-code/57790)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 11\
**Last updated:** [March 24, 2021, 7:20am UTC](https://discourse.julialang.org/t/tutorial-how-to-benchmark-and-profile-your-code/57790 "2021-03-24T07:20:46Z")

</div>

Interested in benchmarking and profiling your code? My new blog post walks you through it from highlevel benchmarking to getting deeper with profiling tools. It’s quite high level so I avoided explaining the different …

---

## [Integration over regions with varying boundaries, triangular domains and more](https://discourse.julialang.org/t/integration-over-regions-with-varying-boundaries-triangular-domains-and-more/57157)

<div class="topic-metadata">

**Author:** [@Aleksandr\_Mikheev](https://discourse.julialang.org/u/Aleksandr_Mikheev)\
**Replies:** 10\
**Last updated:** [March 24, 2021, 5:08am UTC](https://discourse.julialang.org/t/integration-over-regions-with-varying-boundaries-triangular-domains-and-more/57157 "2021-03-24T05:08:06Z")

</div>

This topic may be considered, in some sense, as a follow-up of my previous thread. Thanks to stevengj and ChrisRackauckas I believe I more or less solved the “symbolic part” of my problem and could start working on the a…

---

## [How to use \`ordered\` keyword equals to \`true\` with \`StatsBase.sample()\` function when sampling 2 or more dimensional array from a population?](https://discourse.julialang.org/t/how-to-use-ordered-keyword-equals-to-true-with-statsbase-sample-function-when-sampling-2-or-more-dimensional-array-from-a-population/57796)

<div class="topic-metadata">

**Author:** [@shubh\_b](https://discourse.julialang.org/u/shubh_b)\
**Replies:** 8\
**Last updated:** [March 24, 2021, 4:05am UTC](https://discourse.julialang.org/t/how-to-use-ordered-keyword-equals-to-true-with-statsbase-sample-function-when-sampling-2-or-more-dimensional-array-from-a-population/57796 "2021-03-24T04:05:01Z")

</div>

I was using sample() function from StatsBase module for sampling with replacement from a population a and sampling probabilities weight vector wv as below: a = \[31, 12, 29, 9, 15\] wv = weights(\[0.1, 0.4, 0.2, 0.1, 0.2\])…

---

## [Using EnsembleThreads in DifferentialEquations.jl fails for SDEs with trajectories \> nthreads](https://discourse.julialang.org/t/using-ensemblethreads-in-differentialequations-jl-fails-for-sdes-with-trajectories-nthreads/57831)

<div class="topic-metadata">

**Author:** [@Junkiejim](https://discourse.julialang.org/u/Junkiejim)\
**Replies:** 3\
**Last updated:** [March 24, 2021, 3:19am UTC](https://discourse.julialang.org/t/using-ensemblethreads-in-differentialequations-jl-fails-for-sdes-with-trajectories-nthreads/57831 "2021-03-24T03:19:33Z")

</div>

I’m trying to run some stochastic simulations for a research problem using DifferentialEquations.jl. I’ve had no problem setting up my differential equation, and solving it is fine until I try to setup an ensembleproblem…

---

## [Error when assigning a difference to a vector](https://discourse.julialang.org/t/error-when-assigning-a-difference-to-a-vector/57748)

<div class="topic-metadata">

**Author:** [@umair\_durrani](https://discourse.julialang.org/u/umair_durrani)\
**Replies:** 5\
**Last updated:** [March 24, 2021, 1:57am UTC](https://discourse.julialang.org/t/error-when-assigning-a-difference-to-a-vector/57748 "2021-03-24T01:57:45Z")

</div>

I have posted this question on stackoverflow as well. I am using the following code to apply a function to my data. The function definition is also provided below. However, I am getting a type error. Could you please he…

---

## [PackageCompiler can't load library - wrong ELFCLASS32](https://discourse.julialang.org/t/packagecompiler-cant-load-library-wrong-elfclass32/57825)

<div class="topic-metadata">

**Author:** [@sschmidhuber](https://discourse.julialang.org/u/sschmidhuber)\
**Replies:** 3\
**Last updated:** [March 23, 2021, 11:44pm UTC](https://discourse.julialang.org/t/packagecompiler-cant-load-library-wrong-elfclass32/57825 "2021-03-23T23:44:57Z")

</div>

Hello, I would like to compile a little test application, which is just using Gkt package. It runs in general, but if I try to compile it with PackageCompiler I get the following error message: julia\> create\_app("Compi…

---

## [Running "make test" fails in master](https://discourse.julialang.org/t/running-make-test-fails-in-master/57695)

<div class="topic-metadata">

**Author:** [@oneironaut](https://discourse.julialang.org/u/oneironaut)\
**Replies:** 8\
**Last updated:** [March 23, 2021, 11:20pm UTC](https://discourse.julialang.org/t/running-make-test-fails-in-master/57695 "2021-03-23T23:20:58Z")

</div>

Hello everyone, I am new to Julia and have been trying to build it from source. I ran the make command and built it. After that I ran julia and the shell was launched. But when I ran make test it fails. Am I doing somet…

---

## [\[PyCall\] Pre-installing a python package required by a Julia package](https://discourse.julialang.org/t/pycall-pre-installing-a-python-package-required-by-a-julia-package/3316)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 17\
**Last updated:** [March 23, 2021, 10:32pm UTC](https://discourse.julialang.org/t/pycall-pre-installing-a-python-package-required-by-a-julia-package/3316 "2021-03-23T22:32:10Z")

</div>

Hello, I’m developing OdsIO, a module that uses the Python ezodf (and, in turn, lxml) modules to import/export data from/to OpenDocument spreadsheets. How do I guarantee that ezodf and lxml are available to the user? O…

---

## [New BridgeBot, are answers bridged back?](https://discourse.julialang.org/t/new-bridgebot-are-answers-bridged-back/54201)

<div class="topic-metadata">

**Author:** [@oheil](https://discourse.julialang.org/u/oheil)\
**Replies:** 19\
**Last updated:** [March 23, 2021, 10:27pm UTC](https://discourse.julialang.org/t/new-bridgebot-are-answers-bridged-back/54201 "2021-03-23T22:27:21Z")

</div>

When a question is bridged from slack to discourd like e.g. this one: What happens to the answer? Does it also appear on slack?

---

## [Why would these errors pop up?](https://discourse.julialang.org/t/why-would-these-errors-pop-up/57330)

<div class="topic-metadata">

**Author:** [@redlush](https://discourse.julialang.org/u/redlush)\
**Replies:** 2\
**Last updated:** [March 23, 2021, 7:37pm UTC](https://discourse.julialang.org/t/why-would-these-errors-pop-up/57330 "2021-03-23T19:37:52Z")

</div>

Hi all. I am new to Julia and not familiar on troubleshooting my code in this language. I have constructed a block matrix constructed of smaller block matrices - a diagonal one and then an off diagonal one. The construct…

---

## [Completely frustrated with compilation times](https://discourse.julialang.org/t/completely-frustrated-with-compilation-times/57733)

<div class="topic-metadata">

**Author:** [@andreasvarga](https://discourse.julialang.org/u/andreasvarga)\
**Replies:** 16\
**Last updated:** [March 23, 2021, 7:03pm UTC](https://discourse.julialang.org/t/completely-frustrated-with-compilation-times/57733 "2021-03-23T19:03:25Z")

</div>

I am working with Julia 1.5.3 on the development of a new package DescriptorSystems, which basically manipulates 5-tuples of matrices (which describe so called descriptor systems). Recently, I added a new object, which i…

---

## [Copy of postmortem for JuliaOptical](https://discourse.julialang.org/t/copy-of-postmortem-for-juliaoptical/57752)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 2\
**Last updated:** [March 23, 2021, 6:25pm UTC](https://discourse.julialang.org/t/copy-of-postmortem-for-juliaoptical/57752 "2021-03-23T18:25:12Z")

</div>

I ran across a JPL optics engineer’s explanation of why he’s giving up on his JuliaOptical project. I know there was a discussion about posting lists of gripes, but I don’t remember where that ended up and Jeff said in h…

---

## [How to use gradient of neural network as the loss function?](https://discourse.julialang.org/t/how-to-use-gradient-of-neural-network-as-the-loss-function/50569)

<div class="topic-metadata">

**Author:** [@XiaodongMa-MRI](https://discourse.julialang.org/u/XiaodongMa-MRI)\
**Replies:** 13\
**Last updated:** [March 23, 2021, 6:30pm UTC](https://discourse.julialang.org/t/how-to-use-gradient-of-neural-network-as-the-loss-function/50569 "2021-03-23T18:30:15Z")

</div>

Dear all, I want to put the gradient of neural network (i.e., the gradient of NN output w.r.t input) in the loss function. However, it seems that Zygote cannot differentiate that. Here is my code: using Flux using Zygo…

---

## [JuMP/CPLEX: problems with submitting heuristic solution](https://discourse.julialang.org/t/jump-cplex-problems-with-submitting-heuristic-solution/57807)

<div class="topic-metadata">

**Author:** [@Ryao](https://discourse.julialang.org/u/Ryao)\
**Replies:** 1\
**Last updated:** [March 23, 2021, 6:27pm UTC](https://discourse.julialang.org/t/jump-cplex-problems-with-submitting-heuristic-solution/57807 "2021-03-23T18:27:45Z")

</div>

Hi everyone, I try to submit a solution extracted from a second model to the main model while encountering such error, any idea? Is there a way to get the CPLEX.Optimizer object from a Model object? Regards, Ryao ER…

---

## [Rotate text such that it aligns with the gradient of a line](https://discourse.julialang.org/t/rotate-text-such-that-it-aligns-with-the-gradient-of-a-line/57799)

<div class="topic-metadata">

**Author:** [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Replies:** 4\
**Last updated:** [March 23, 2021, 6:12pm UTC](https://discourse.julialang.org/t/rotate-text-such-that-it-aligns-with-the-gradient-of-a-line/57799 "2021-03-23T18:12:54Z")

</div>

Hello, I’m trying to make some text line up with a line from A to B, the problem is that the angle is fixed and not relative to the aspect ratio of the figure. I suppose a way to do it is to get the size of the figure a…

---

## [MakieLayout - Alignment of horizontal colorbar and legend](https://discourse.julialang.org/t/makielayout-alignment-of-horizontal-colorbar-and-legend/57804)

<div class="topic-metadata">

**Author:** [@fabgrei](https://discourse.julialang.org/u/fabgrei)\
**Replies:** 2\
**Last updated:** [March 23, 2021, 5:54pm UTC](https://discourse.julialang.org/t/makielayout-alignment-of-horizontal-colorbar-and-legend/57804 "2021-03-23T17:54:56Z")

</div>

I would like to have the colorbar and the legend nicely aligned. Is there a way to perfectly align the top row of the legend with tick labels of the colorbar, and also the titles of legend and colorbar? This is how it l…

---

## [Shuffle values and sample indices of a sparse matrix](https://discourse.julialang.org/t/shuffle-values-and-sample-indices-of-a-sparse-matrix/57677)

<div class="topic-metadata">

**Author:** [@eliassno](https://discourse.julialang.org/u/eliassno)\
**Replies:** 15\
**Last updated:** [March 23, 2021, 5:50pm UTC](https://discourse.julialang.org/t/shuffle-values-and-sample-indices-of-a-sparse-matrix/57677 "2021-03-23T17:50:24Z")

</div>

I need to shuffle entries in selected columns of a large, sparse matrix X with dimensions M x N . I have written a function that does this in-place, as I need to perform the shuffling repeatedly on the same data. functi…

---

## [Julia v1.5.4 and v1.6.0-rc2 have been released](https://discourse.julialang.org/t/julia-v1-5-4-and-v1-6-0-rc2-have-been-released/57040)

<div class="topic-metadata">

**Author:** [@ararslan](https://discourse.julialang.org/u/ararslan)\
**Replies:** 29\
**Last updated:** [March 23, 2021, 5:46pm UTC](https://discourse.julialang.org/t/julia-v1-5-4-and-v1-6-0-rc2-have-been-released/57040 "2021-03-23T17:46:48Z")

</div>

The Julia developers are pleased to announce two new releases: v1.5.4, the fourth patch release for Julia 1.5, and v1.6.0-rc2, the second release candidate for Julia 1.6. You can download binaries at https://julialang.or…

---

## [Plots with plotly() backend does not show in VS code](https://discourse.julialang.org/t/plots-with-plotly-backend-does-not-show-in-vs-code/41579)

<div class="topic-metadata">

**Author:** [@sunjin](https://discourse.julialang.org/u/sunjin)\
**Replies:** 5\
**Last updated:** [March 23, 2021, 5:09pm UTC](https://discourse.julialang.org/t/plots-with-plotly-backend-does-not-show-in-vs-code/41579 "2021-03-23T17:09:00Z")

</div>

Hi, I am trying to make a simple plot using Plots from VS code REPL. While the default gr() backend plots fine, the plot in the figure pane does not automatically resize when resizing the plot pane under VS code. On the…

---

## [Convert string encoding to UTF-8](https://discourse.julialang.org/t/convert-string-encoding-to-utf-8/57782)

<div class="topic-metadata">

**Author:** [@Thomas\_Lei](https://discourse.julialang.org/u/Thomas_Lei)\
**Replies:** 2\
**Last updated:** [March 23, 2021, 4:54pm UTC](https://discourse.julialang.org/t/convert-string-encoding-to-utf-8/57782 "2021-03-23T16:54:12Z")

</div>

Hi all, Somewhere in my code I read strings which contains unicode characters. For example, the reading output is: myString = "caf\\xe9" I’d like this string to be parsed as myString = "café" I played along with St…

---

## [Agents.jl 4.0 + Comparison with competitors](https://discourse.julialang.org/t/agents-jl-4-0-comparison-with-competitors/53927)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 16\
**Last updated:** [March 23, 2021, 4:46pm UTC](https://discourse.julialang.org/t/agents-jl-4-0-comparison-with-competitors/53927 "2021-03-23T16:46:21Z")

</div>

Hello everyone, with pleasure I announce here the release 4.0 of Agents.jl: Github repo, Documentation, CHANGELOG. This new release is a really big one. I’d say about 50% of the library has been either entirely re-writ…

---

## [Domain error when running user-defined function, but not when code is run outside function](https://discourse.julialang.org/t/domain-error-when-running-user-defined-function-but-not-when-code-is-run-outside-function/57771)

<div class="topic-metadata">

**Author:** [@guysutton](https://discourse.julialang.org/u/guysutton)\
**Replies:** 5\
**Last updated:** [March 23, 2021, 3:47pm UTC](https://discourse.julialang.org/t/domain-error-when-running-user-defined-function-but-not-when-code-is-run-outside-function/57771 "2021-03-23T15:47:05Z")

</div>

I am trying to write a function that will calculate deviance residuals for a general linear model (specified using GLM.jl). The function extracts predictions from the fitted model (pred), a vector containing the response…

---

## [Plots stroke and fill different alpha](https://discourse.julialang.org/t/plots-stroke-and-fill-different-alpha/57794)

<div class="topic-metadata">

**Author:** [@luboshanus](https://discourse.julialang.org/u/luboshanus)\
**Replies:** 0\
**Last updated:** [March 23, 2021, 3:34pm UTC](https://discourse.julialang.org/t/plots-stroke-and-fill-different-alpha/57794 "2021-03-23T15:34:35Z")

</div>

Hi, I would like to have different alphas for fill and stroke of markers. Using Plots.jl and gr(). Wishing this would work scatter(rand(10), marker=(20, 0.3, :green, Plots.stroke(5, :blue, :solid; alpha=0.9))) but th…

---

## [Differentialequations.jl: SDE ensemble solve fails for vector SDEs?](https://discourse.julialang.org/t/differentialequations-jl-sde-ensemble-solve-fails-for-vector-sdes/57631)

<div class="topic-metadata">

**Author:** [@colm-connaughton](https://discourse.julialang.org/u/colm-connaughton)\
**Replies:** 2\
**Last updated:** [March 23, 2021, 2:52pm UTC](https://discourse.julialang.org/t/differentialequations-jl-sde-ensemble-solve-fails-for-vector-sdes/57631 "2021-03-23T14:52:35Z")

</div>

I’ve been using the examples in the documentation to play around with the SDE solvers in DifferentialEquations.jl and have run into trouble trying to run ensemble simulations with vector-valued SDEs (the scalar case work…

---

## [Can't make a new branch of Julia for a PR](https://discourse.julialang.org/t/cant-make-a-new-branch-of-julia-for-a-pr/57786)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 3\
**Last updated:** [March 23, 2021, 2:28pm UTC](https://discourse.julialang.org/t/cant-make-a-new-branch-of-julia-for-a-pr/57786 "2021-03-23T14:28:34Z")

</div>

Hello, I’d like to suggest a simple change to a Julia.Base file but I can’t manage to create a branch on github for a quick file edit then a PR. You know, by using the edit button at the top of the file. Is it restrict…

---

## [Count words challenge](https://discourse.julialang.org/t/count-words-challenge/57221)

<div class="topic-metadata">

**Author:** [@alemelis](https://discourse.julialang.org/u/alemelis)\
**Replies:** 24\
**Last updated:** [March 23, 2021, 2:10pm UTC](https://discourse.julialang.org/t/count-words-challenge/57221 "2021-03-23T14:10:06Z")

</div>

Hello! I’ve been reading this blog post today and decided to give it a try in Julia. In short, the idea is to benchmark different languages in counting words frequency for long text files. I’ve added what I believe is…

---

## [Which characters to avoid in file and path names](https://discourse.julialang.org/t/which-characters-to-avoid-in-file-and-path-names/57772)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 5\
**Last updated:** [March 23, 2021, 1:29pm UTC](https://discourse.julialang.org/t/which-characters-to-avoid-in-file-and-path-names/57772 "2021-03-23T13:29:25Z")

</div>

The allowed set of characters within files and folders depends on the operating system. What would be “best practice” for the naming of files and folders in public Julia projects and packages?

---

## [Dealing with flamebait](https://discourse.julialang.org/t/dealing-with-flamebait/56893)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 50\
**Last updated:** [March 23, 2021, 1:14pm UTC](https://discourse.julialang.org/t/dealing-with-flamebait/56893 "2021-03-23T13:14:42Z")

</div>

Occasionally this forum experiences discussions which contribute little to the development or understanding of Julia (or any other programming language or meaningful human endavor for that matter), yet at the same time…

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

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