# Latest

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

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

**Page:** 1468

---

## [Worker thread setup in Julia compared to C++/pthreads](https://discourse.julialang.org/t/worker-thread-setup-in-julia-compared-to-c-pthreads/56630)

<div class="topic-metadata">

**Author:** [@paulmelis](https://discourse.julialang.org/u/paulmelis)\
**Replies:** 6\
**Last updated:** [March 8, 2021, 8:16am UTC](https://discourse.julialang.org/t/worker-thread-setup-in-julia-compared-to-c-pthreads/56630 "2021-03-08T08:16:03Z")

</div>

I’m trying to port some code (a 3D renderer) that in C++ uses a simple tasking system to process items of work using multiple OS-level threads. Each item can (and will) take a varying amount of time to process making it …

---

## [Running counterfactuals on a regression with interactions](https://discourse.julialang.org/t/running-counterfactuals-on-a-regression-with-interactions/56711)

<div class="topic-metadata">

**Author:** [@samerb](https://discourse.julialang.org/u/samerb)\
**Replies:** 4\
**Last updated:** [March 8, 2021, 7:38am UTC](https://discourse.julialang.org/t/running-counterfactuals-on-a-regression-with-interactions/56711 "2021-03-08T07:38:21Z")

</div>

Let’s say I have a data frame with columns c1,c2,…,cn and I run a regression of c1 on c2, c3, c4 and c2.\*c4: sm = GLM.lm( @formula(c1 ~ c2 + c3 +c4 +c2&c4), df) If I were in Python, I could then do formula = 'c1 ~ c2 …

---

## [Pre-allocated, thread-save buffer arrays](https://discourse.julialang.org/t/pre-allocated-thread-save-buffer-arrays/56715)

<div class="topic-metadata">

**Author:** [@Jae-Mo\_Lihm](https://discourse.julialang.org/u/Jae-Mo_Lihm)\
**Replies:** 0\
**Last updated:** [March 8, 2021, 6:52am UTC](https://discourse.julialang.org/t/pre-allocated-thread-save-buffer-arrays/56715 "2021-03-08T06:52:48Z")

</div>

In my program, I have a loop where I need a buffer array. The required size of the buffer changes only a few times during the run. Also, I am using multithreading. So, the buffer should be thread-safe. The following scr…

---

## [Any GAM or Spline packages like mgcv and splines in R?](https://discourse.julialang.org/t/any-gam-or-spline-packages-like-mgcv-and-splines-in-r/56714)

<div class="topic-metadata">

**Author:** [@NightRider](https://discourse.julialang.org/u/NightRider)\
**Replies:** 0\
**Last updated:** [March 8, 2021, 5:11am UTC](https://discourse.julialang.org/t/any-gam-or-spline-packages-like-mgcv-and-splines-in-r/56714 "2021-03-08T05:11:15Z")

</div>

So I come from a stat background and primarily use R. Julia has been amazing but I’m wondering is there a GAM package at all in the ecosystem? I have used GLM.jl so I’m wondering if there is something that is kind of lik…

---

## [Why const changes the behavior of Ptr?](https://discourse.julialang.org/t/why-const-changes-the-behavior-of-ptr/56645)

<div class="topic-metadata">

**Author:** [@SnowShut](https://discourse.julialang.org/u/SnowShut)\
**Replies:** 2\
**Last updated:** [March 8, 2021, 2:41am UTC](https://discourse.julialang.org/t/why-const-changes-the-behavior-of-ptr/56645 "2021-03-08T02:41:53Z")

</div>

In the docs: julia\> const s1 = "1" "1" julia\> s2 = "1" "1" julia\> pointer.(\[s1, s2\], 1) 2-element Array{Ptr{UInt8},1}: Ptr{UInt8} @0x00000000132c9638 Ptr{UInt8} @0x0000000013dd3d18 julia\> s1 = s2 "1" julia\> pointe…

---

## [Request for example: "Hello world \[name\]" as a web app, aka how to pass to Julia the inputs of a web form and retrieve the output as a html response](https://discourse.julialang.org/t/request-for-example-hello-world-name-as-a-web-app-aka-how-to-pass-to-julia-the-inputs-of-a-web-form-and-retrieve-the-output-as-a-html-response/48803)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 3\
**Last updated:** [March 8, 2021, 1:51am UTC](https://discourse.julialang.org/t/request-for-example-hello-world-name-as-a-web-app-aka-how-to-pass-to-julia-the-inputs-of-a-web-form-and-retrieve-the-output-as-a-html-response/48803 "2021-03-08T01:51:39Z")

</div>

I need to expose a Julia function as a web app, where users fill a simple (static?) html form with a couple of input fields and a file input (for a csv file) and the “web app” responds with a string to be formatted as a …

---

## [\<C-W\> deletes all texts up to the beginning, not a word, in REPL](https://discourse.julialang.org/t/c-w-deletes-all-texts-up-to-the-beginning-not-a-word-in-repl/56662)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 13\
**Last updated:** [March 8, 2021, 1:14am UTC](https://discourse.julialang.org/t/c-w-deletes-all-texts-up-to-the-beginning-not-a-word-in-repl/56662 "2021-03-08T01:14:17Z")

</div>

I think that \<C-W\> in JuliaREPL should remove text a word at once, not all texts up to the beginning. Is there any way to configure it as I want? Note: I’m using OhMyREPL. Julia Version 1.5.3 Commit 788b2c77c1 (2020-1…

---

## [In place GEMM](https://discourse.julialang.org/t/in-place-gemm/56260)

<div class="topic-metadata">

**Author:** [@Xijiang\_Yu](https://discourse.julialang.org/u/Xijiang_Yu)\
**Replies:** 6\
**Last updated:** [March 7, 2021, 11:26pm UTC](https://discourse.julialang.org/t/in-place-gemm/56260 "2021-03-07T23:26:04Z")

</div>

My LHS is huge and needs to be constructed by parts/sub-matrix. e.g., lhs = \[ b11 b12 b21 b22\] Is there a way to specify the results into a sub-matrix, e.g., b22, to save memory? I believe gemm in Julia is also b…

---

## [Lingering Julia processes?](https://discourse.julialang.org/t/lingering-julia-processes/56699)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 1\
**Last updated:** [March 7, 2021, 11:00pm UTC](https://discourse.julialang.org/t/lingering-julia-processes/56699 "2021-03-07T23:00:10Z")

</div>

I have noticed that after closing VSCode, there remain about 3 or 4 Julia processes in the background. That is not because of indexing packages, because VSCode has already finished indexing, and there is no CPU usage by …

---

## [Trivial question about avoiding concurrency in a shared matrix between processes](https://discourse.julialang.org/t/trivial-question-about-avoiding-concurrency-in-a-shared-matrix-between-processes/56522)

<div class="topic-metadata">

**Author:** [@Frisus95](https://discourse.julialang.org/u/Frisus95)\
**Replies:** 2\
**Last updated:** [March 7, 2021, 10:56pm UTC](https://discourse.julialang.org/t/trivial-question-about-avoiding-concurrency-in-a-shared-matrix-between-processes/56522 "2021-03-07T22:56:41Z")

</div>

Good evening everyone. As the title suggests, I have a very trivial question to ask (I’m a beginner with julia). In my code, I would like to have several (parallel) processes do calculations (quite long and complex) an…

---

## [Citations in Weave](https://discourse.julialang.org/t/citations-in-weave/36918)

<div class="topic-metadata">

**Author:** [@andrewellis](https://discourse.julialang.org/u/andrewellis)\
**Replies:** 1\
**Last updated:** [March 7, 2021, 10:37pm UTC](https://discourse.julialang.org/t/citations-in-weave/36918 "2021-03-07T22:37:57Z")

</div>

Has anyone figured out how to include citations in Julia markdown with Weave.jl, either using pandoc’s markdown citation syntax, or LaTeX? I have tried to generate a markdown file using the pandoc doctype, and then run …

---

## [Rsvg question](https://discourse.julialang.org/t/rsvg-question/56679)

<div class="topic-metadata">

**Author:** [@hpw](https://discourse.julialang.org/u/hpw)\
**Replies:** 5\
**Last updated:** [March 7, 2021, 9:36pm UTC](https://discourse.julialang.org/t/rsvg-question/56679 "2021-03-07T21:36:45Z")

</div>

I cut and paste below code from the web. I am trying to convert a svg file to png. The problem is the output file has only a size of 137 bytes. The Mac finder displays an empty content. I expect the file size to be …

---

## [Hi all. I have a function in which I create an array but the type of the array is](https://discourse.julialang.org/t/hi-all-i-have-a-function-in-which-i-create-an-array-but-the-type-of-the-array-is/56665)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [March 7, 2021, 8:44pm UTC](https://discourse.julialang.org/t/hi-all-i-have-a-function-in-which-i-create-an-array-but-the-type-of-the-array-is/56665 "2021-03-07T20:44:10Z")

</div>

Hi all. I have a function in which I create an array but the type of the array is selected by the user meaning that it is passed as an argument something like: function f(T) arr = Matrix{T}(undef,3,3) return arr…

---

## [I have a function where I would like to move something from runtime to compile-tim](https://discourse.julialang.org/t/i-have-a-function-where-i-would-like-to-move-something-from-runtime-to-compile-tim/56681)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [March 7, 2021, 7:13pm UTC](https://discourse.julialang.org/t/i-have-a-function-where-i-would-like-to-move-something-from-runtime-to-compile-tim/56681 "2021-03-07T19:13:48Z")

</div>

I have a function where I would like to move something from runtime to compile-time. It looks similar to this function foo(x::Int, y::Val{Z}) where Z table = calc\_table(Z) bar(table, x) end I would like to move…

---

## [Add spacing under title in PlotlyJS](https://discourse.julialang.org/t/add-spacing-under-title-in-plotlyjs/56670)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 3\
**Last updated:** [March 7, 2021, 6:29pm UTC](https://discourse.julialang.org/t/add-spacing-under-title-in-plotlyjs/56670 "2021-03-07T18:29:00Z")

</div>

I have the following plot: I don’t want the lines to extend all the way to the title - it looks pretty bad. The lines are created from \`vline()´, and I have not figured out how I can ajust their height - that would a…

---

## [DataLoader-like interface for Turing?](https://discourse.julialang.org/t/dataloader-like-interface-for-turing/56678)

<div class="topic-metadata">

**Author:** [@qft](https://discourse.julialang.org/u/qft)\
**Replies:** 6\
**Last updated:** [March 7, 2021, 5:53pm UTC](https://discourse.julialang.org/t/dataloader-like-interface-for-turing/56678 "2021-03-07T17:53:55Z")

</div>

I am very recently introduced to Turing. In all the example code I see, the model is given a fixed set of observation, and sample a for specific number of iterations. I am wondering, is it possible to use a different sub…

---

## [Need help with very basic plotting](https://discourse.julialang.org/t/need-help-with-very-basic-plotting/56657)

<div class="topic-metadata">

**Author:** [@Jcort](https://discourse.julialang.org/u/Jcort)\
**Replies:** 3\
**Last updated:** [March 7, 2021, 5:20pm UTC](https://discourse.julialang.org/t/need-help-with-very-basic-plotting/56657 "2021-03-07T17:20:49Z")

</div>

Hello, I am trying to learn Julia. When I type in the basic plotting example given at Tutorial · Plots, namely the code below copied directly from the link given above. import Pkg; Pkg.add(“Plots”) using Plots x = …

---

## [Text substitution (like sed) with Julia](https://discourse.julialang.org/t/text-substitution-like-sed-with-julia/56684)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [March 7, 2021, 5:15pm UTC](https://discourse.julialang.org/t/text-substitution-like-sed-with-julia/56684 "2021-03-07T17:15:46Z")

</div>

If I want to replace all occurrences of “apple” by “orange” in a file, I can use the Unix shell command sed -i 's/apple/orange/g' filename.txt What would be an equivalent Julia code?

---

## [DataFrame creating a rowmean for 95 columns](https://discourse.julialang.org/t/dataframe-creating-a-rowmean-for-95-columns/56671)

<div class="topic-metadata">

**Author:** [@korilium](https://discourse.julialang.org/u/korilium)\
**Replies:** 6\
**Last updated:** [March 7, 2021, 4:57pm UTC](https://discourse.julialang.org/t/dataframe-creating-a-rowmean-for-95-columns/56671 "2021-03-07T16:57:45Z")

</div>

Hello, I am quite new to Julia and I was wondering how to implement a rowmean using a dataframe type. For Arrays, this is quite easy but I can not seem to figure out how to do it with a dataframe because most transforma…

---

## [Error in Regression but I don't think there is collinearity: "PosDefException: matrix is not positive definite; Cholesky factorization failed."](https://discourse.julialang.org/t/error-in-regression-but-i-dont-think-there-is-collinearity-posdefexception-matrix-is-not-positive-definite-cholesky-factorization-failed/56689)

<div class="topic-metadata">

**Author:** [@samerb](https://discourse.julialang.org/u/samerb)\
**Replies:** 0\
**Last updated:** [March 7, 2021, 4:51pm UTC](https://discourse.julialang.org/t/error-in-regression-but-i-dont-think-there-is-collinearity-posdefexception-matrix-is-not-positive-definite-cholesky-factorization-failed/56689 "2021-03-07T16:51:55Z")

</div>

“PosDefException: matrix is not positive definite; Cholesky factorization failed.” I am getting the above error when I try to do certain regressions such as the one below involving interaction terms involving some binar…

---

## [Interpolation for 3D data points does not honors the actual data using custom surrogates \`Stheno\`](https://discourse.julialang.org/t/interpolation-for-3d-data-points-does-not-honors-the-actual-data-using-custom-surrogates-stheno/56687)

<div class="topic-metadata">

**Author:** [@mdsa3d](https://discourse.julialang.org/u/mdsa3d)\
**Replies:** 0\
**Last updated:** [March 7, 2021, 4:48pm UTC](https://discourse.julialang.org/t/interpolation-for-3d-data-points-does-not-honors-the-actual-data-using-custom-surrogates-stheno/56687 "2021-03-07T16:48:06Z")

</div>

I tried testing the kriging interpolation using custom surrogate function = Stheno for a set of points scattered in 3D space. The interpolated results from the testing doesn’t honors the actual data points. May I know…

---

## [Seek help on displaying svg file content onto screen using Rsvg and Cairo/Gtk](https://discourse.julialang.org/t/seek-help-on-displaying-svg-file-content-onto-screen-using-rsvg-and-cairo-gtk/56680)

<div class="topic-metadata">

**Author:** [@hpw](https://discourse.julialang.org/u/hpw)\
**Replies:** 0\
**Last updated:** [March 7, 2021, 3:58pm UTC](https://discourse.julialang.org/t/seek-help-on-displaying-svg-file-content-onto-screen-using-rsvg-and-cairo-gtk/56680 "2021-03-07T15:58:48Z")

</div>

In a custom draw function, I have this snippet: when the draw function is called, I can see the println messages printed on the REPL. But the Gtk window did not show the image from the svg file. { I also tried to com…

---

## [Would an AbstractTuple type be helpful?](https://discourse.julialang.org/t/would-an-abstracttuple-type-be-helpful/56673)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 3\
**Last updated:** [March 7, 2021, 3:29pm UTC](https://discourse.julialang.org/t/would-an-abstracttuple-type-be-helpful/56673 "2021-03-07T15:29:33Z")

</div>

Where both Tuple and NamedTuple are subtypes of AbstractTuple. Now (v"1.7") that indexing over NamedTuples exists and indexes over its values, there are more methods that share functionality (first and last have worked …

---

## [Unrolled loop results in Improbable @benchmark timing](https://discourse.julialang.org/t/unrolled-loop-results-in-improbable-benchmark-timing/56637)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 6\
**Last updated:** [March 7, 2021, 2:18pm UTC](https://discourse.julialang.org/t/unrolled-loop-results-in-improbable-benchmark-timing/56637 "2021-03-07T14:18:30Z")

</div>

The TLDR is why would I get improbably timings when benchmarking passing in by reference i.e. $c but get maybe reasonable timings when passing in the value i.e. ‘c’. And how much can I trust the timing passing in the va…

---

## [For a tree, how to obtain two induced subgraph by breaking an edge in LightGraphs?](https://discourse.julialang.org/t/for-a-tree-how-to-obtain-two-induced-subgraph-by-breaking-an-edge-in-lightgraphs/56676)

<div class="topic-metadata">

**Author:** [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Replies:** 0\
**Last updated:** [March 7, 2021, 2:12pm UTC](https://discourse.julialang.org/t/for-a-tree-how-to-obtain-two-induced-subgraph-by-breaking-an-edge-in-lightgraphs/56676 "2021-03-07T14:12:24Z")

</div>

For example, if I have a tree 1 - 2 - 3 - 4 | | 5 6 - 7 - 8 If breaking the ege (3,6), I want to obtain two induced subgraphs 1 -…

---

## [Creating NamedTuple from exisiting NamedTuples using their keys and values?](https://discourse.julialang.org/t/creating-namedtuple-from-exisiting-namedtuples-using-their-keys-and-values/56669)

<div class="topic-metadata">

**Author:** [@Sanjan\_Das](https://discourse.julialang.org/u/Sanjan_Das)\
**Replies:** 2\
**Last updated:** [March 7, 2021, 12:28pm UTC](https://discourse.julialang.org/t/creating-namedtuple-from-exisiting-namedtuples-using-their-keys-and-values/56669 "2021-03-07T12:28:47Z")

</div>

I’m looking to combine two NamedTuples in Julia in the following way - I start with p = (a = 1, b = 2) and q = (c = 3, d = 4). What I want is to create a new NamedTuple with the keys of p and the values of q (or vice ve…

---

## [Error message: ENOTSUP](https://discourse.julialang.org/t/error-message-enotsup/56649)

<div class="topic-metadata">

**Author:** [@PrenzlHain](https://discourse.julialang.org/u/PrenzlHain)\
**Replies:** 2\
**Last updated:** [March 7, 2021, 11:13am UTC](https://discourse.julialang.org/t/error-message-enotsup/56649 "2021-03-07T11:13:49Z")

</div>

I am new to Julia. I am trying to add packages in JuliaPro. For example I do this: using Pkg Pkg.add(“DataFrames”) and the following error message pops up: ERROR: IOError: mkdir: operation not supported on socket (EN…

---

## [How to install the latest package given dependency conflicts](https://discourse.julialang.org/t/how-to-install-the-latest-package-given-dependency-conflicts/56623)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 6\
**Last updated:** [March 7, 2021, 10:38am UTC](https://discourse.julialang.org/t/how-to-install-the-latest-package-given-dependency-conflicts/56623 "2021-03-07T10:38:52Z")

</div>

In a fresh environment I am trying to install DifferentialEquations and Gnuplot 1.30. If I install DifferentialEquations first, I get the latest copy of the package + all the correct dependencies (particular the dependen…

---

## [Converting region of interest (ROI) polygon to a mask](https://discourse.julialang.org/t/converting-region-of-interest-roi-polygon-to-a-mask/56545)

<div class="topic-metadata">

**Author:** [@mateuszbaran](https://discourse.julialang.org/u/mateuszbaran)\
**Replies:** 1\
**Last updated:** [March 7, 2021, 10:30am UTC](https://discourse.julialang.org/t/converting-region-of-interest-roi-polygon-to-a-mask/56545 "2021-03-07T10:30:33Z")

</div>

I’d like to share a simple piece of code for converting a region of interest given by vertices of a polygon to a binary mask in Julia. This turned out to be more difficult than I expected so someone else may find this us…

---

## [Equivalent of Rs \`aov(Y ~ B + Error(A/B), data=d)\`](https://discourse.julialang.org/t/equivalent-of-rs-aov-y-b-error-a-b-data-d/56629)

<div class="topic-metadata">

**Author:** [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Replies:** 1\
**Last updated:** [March 7, 2021, 10:22am UTC](https://discourse.julialang.org/t/equivalent-of-rs-aov-y-b-error-a-b-data-d/56629 "2021-03-07T10:22:19Z")

</div>

Is there a julia equivalent of R’s way to compute classical anovas with random effects? For example, is there an easy way to obtain the following result without calling R? julia\> using DataFrames, RCall julia\> df = Da…

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

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