# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=598

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

**Page:** 599

---

## [CUDA.jl and svd getting automatic casting to Array{Float32,2}](https://discourse.julialang.org/t/cuda-jl-and-svd-getting-automatic-casting-to-array-float32-2/56190)

<div class="topic-metadata">

**Author:** [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Replies:** 1\
**Last updated:** [May 18, 2021, 3:35am UTC](https://discourse.julialang.org/t/cuda-jl-and-svd-getting-automatic-casting-to-array-float32-2/56190 "2021-05-18T03:35:36Z")

</div>

Hello, I am using CUDA.jl package for svd calculation. But I get automatic casting to Array{Float32,2}. Could anyone help please ? Below, I share m.w.e. using CUDA A = CUDA.rand(10, 20) ; # getting float32 on GPU # th…

---

## [How to decode an HTTP payload to a string?](https://discourse.julialang.org/t/how-to-decode-an-http-payload-to-a-string/60999)

<div class="topic-metadata">

**Author:** [@ben-schulz](https://discourse.julialang.org/u/ben-schulz)\
**Replies:** 7\
**Last updated:** [May 18, 2021, 3:25am UTC](https://discourse.julialang.org/t/how-to-decode-an-http-payload-to-a-string/60999 "2021-05-18T03:25:36Z")

</div>

suppose i have the following call to HTTP.jl: using HTTP rsp = HTTP.request("GET", "https://www.google.com") rsp appears to contain the target HTML document, since a call to print displays what look like the first few …

---

## [Memory reuse problem in for loop](https://discourse.julialang.org/t/memory-reuse-problem-in-for-loop/61290)

<div class="topic-metadata">

**Author:** [@deil](https://discourse.julialang.org/u/deil)\
**Replies:** 10\
**Last updated:** [May 18, 2021, 2:24am UTC](https://discourse.julialang.org/t/memory-reuse-problem-in-for-loop/61290 "2021-05-18T02:24:31Z")

</div>

I was implementing an algorithm to detect edges in RGB images, when I noticed very high memory usage: function coloredge(img::Matrix{RGB{T}})::Matrix{T} where T \<: AbstractFloat Sy, Sx = size(img) z = zeros…

---

## [Double function definition](https://discourse.julialang.org/t/double-function-definition/61330)

<div class="topic-metadata">

**Author:** [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Replies:** 5\
**Last updated:** [May 17, 2021, 11:21pm UTC](https://discourse.julialang.org/t/double-function-definition/61330 "2021-05-17T23:21:46Z")

</div>

Wondering if it is possible to define two functions with the same sugar as for variable definition (ex: x, y = 1.0, -pi): h(x,y), g(x,y) = y-x, y-2x # Error (h,g)(x,y) = y-x, y-2x # OK but what is it? h(1,1), g(1…

---

## [Using macros to modify function bodies](https://discourse.julialang.org/t/using-macros-to-modify-function-bodies/61319)

<div class="topic-metadata">

**Author:** [@jmuchovej](https://discourse.julialang.org/u/jmuchovej)\
**Replies:** 1\
**Last updated:** [May 17, 2021, 9:16pm UTC](https://discourse.julialang.org/t/using-macros-to-modify-function-bodies/61319 "2021-05-17T21:16:52Z")

</div>

I’m coming from Python, attempting to build a Julia equivalent of huggingface/knockknock. Briefly: KnockKnock decorates Python functions notifying you when said functions begin execution and fail/complete execution. My g…

---

## [Comparing symbols with == vs ===](https://discourse.julialang.org/t/comparing-symbols-with-vs/56569)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 7\
**Last updated:** [May 17, 2021, 8:59pm UTC](https://discourse.julialang.org/t/comparing-symbols-with-vs/56569 "2021-05-17T20:59:23Z")

</div>

The documentation of Symbol says Symbols are immutable and should be compared using ===. Is that for the same reason that it was recommended to use === when checking for missing or nothing? And following the merge o…

---

## [Code templates, quoting, and variable substitution](https://discourse.julialang.org/t/code-templates-quoting-and-variable-substitution/61306)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 3\
**Last updated:** [May 17, 2021, 8:21pm UTC](https://discourse.julialang.org/t/code-templates-quoting-and-variable-substitution/61306 "2021-05-17T20:21:12Z")

</div>

I’m having trouble with code templates, quoting, and variables. I’m using the NativeSVG package. Some of its SVG element definitions don’t allow content even though they should. In particular, I’d like to add a title …

---

## [Compatibility entry for julia itself is ignored](https://discourse.julialang.org/t/compatibility-entry-for-julia-itself-is-ignored/61309)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 2\
**Last updated:** [May 17, 2021, 7:28pm UTC](https://discourse.julialang.org/t/compatibility-entry-for-julia-itself-is-ignored/61309 "2021-05-17T19:28:47Z")

</div>

I ran package activation and instantiation for a package that specified julia 1.5.4 in julia 1.6.0. I used the specifier julia = "~1.5.4", which I believe allows only the patch number to vary. However, there was no error…

---

## [Not sure how to tie all the functionality together](https://discourse.julialang.org/t/not-sure-how-to-tie-all-the-functionality-together/61316)

<div class="topic-metadata">

**Author:** [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Replies:** 0\
**Last updated:** [May 17, 2021, 7:06pm UTC](https://discourse.julialang.org/t/not-sure-how-to-tie-all-the-functionality-together/61316 "2021-05-17T19:06:04Z")

</div>

Hi there I am confident I can write functions in Julia ( thanks to the wonderful book ( the julia language handbook by George Root) but I am NOT confident I know how to tie all the functions together in the same manner …

---

## [DiffEqParamEstim.jl and multiple\_shooting\_objective](https://discourse.julialang.org/t/diffeqparamestim-jl-and-multiple-shooting-objective/61140)

<div class="topic-metadata">

**Author:** [@cricci](https://discourse.julialang.org/u/cricci)\
**Replies:** 6\
**Last updated:** [May 17, 2021, 6:05pm UTC](https://discourse.julialang.org/t/diffeqparamestim-jl-and-multiple-shooting-objective/61140 "2021-05-17T18:05:08Z")

</div>

I am reading through the tutorial of DiffEqParamEstim.jl (Optimization-Based ODE Parameter Estimation · DiffEqParamEstim.jl) in the section of multiple shooting method. The code put together reads the following using D…

---

## [Problem of convergence for the SH model](https://discourse.julialang.org/t/problem-of-convergence-for-the-sh-model/61307)

<div class="topic-metadata">

**Author:** [@Frazze](https://discourse.julialang.org/u/Frazze)\
**Replies:** 11\
**Last updated:** [May 17, 2021, 5:05pm UTC](https://discourse.julialang.org/t/problem-of-convergence-for-the-sh-model/61307 "2021-05-17T17:05:58Z")

</div>

Hi everyone, I’m trying to solving the Swift Hohenberg 2D model as a ODE problem, but it works only on a short time range and reducing the resolution of my grid. I believe that the problem is not only an optimization p…

---

## [Manifest.toml for reproducible code: is it even useful cross-platform?](https://discourse.julialang.org/t/manifest-toml-for-reproducible-code-is-it-even-useful-cross-platform/61293)

<div class="topic-metadata">

**Author:** [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Replies:** 11\
**Last updated:** [May 17, 2021, 4:31pm UTC](https://discourse.julialang.org/t/manifest-toml-for-reproducible-code-is-it-even-useful-cross-platform/61293 "2021-05-17T16:31:41Z")

</div>

The Manifest.toml records the state of all installed packages of a “project” (I’m interested in “projects” here not “packages”). I’m collaborating on a project with someone on Windows, I’m on Linux. In general, instant…

---

## [Weird allocation issue for fill! with ArrayPartition in Julia \< 1.6](https://discourse.julialang.org/t/weird-allocation-issue-for-fill-with-arraypartition-in-julia-1-6/61296)

<div class="topic-metadata">

**Author:** [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Replies:** 1\
**Last updated:** [May 17, 2021, 3:31pm UTC](https://discourse.julialang.org/t/weird-allocation-issue-for-fill-with-arraypartition-in-julia-1-6/61296 "2021-05-17T15:31:10Z")

</div>

Hello Julians, I have an issue with allocations that I encountered while running my code on a cluster which uses Julia 1.5.4. Basically, once my partition array gets reasonably large, I encounter many allocations when c…

---

## [How to use Makie to visualize network data in 3D?](https://discourse.julialang.org/t/how-to-use-makie-to-visualize-network-data-in-3d/61197)

<div class="topic-metadata">

**Author:** [@Junars](https://discourse.julialang.org/u/Junars)\
**Replies:** 7\
**Last updated:** [May 16, 2021, 2:07pm UTC](https://discourse.julialang.org/t/how-to-use-makie-to-visualize-network-data-in-3d/61197 "2021-05-16T14:07:14Z")

</div>

I have a custom node type and I want to be able to present data dynamically in real time. Maybe I should do it in another language？ Hope a simple example. Thx!!!

---

## [Strange Pluto performance on Binder](https://discourse.julialang.org/t/strange-pluto-performance-on-binder/61305)

<div class="topic-metadata">

**Author:** [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Replies:** 0\
**Last updated:** [May 17, 2021, 2:06pm UTC](https://discourse.julialang.org/t/strange-pluto-performance-on-binder/61305 "2021-05-17T14:06:13Z")

</div>

I created a Pluto notebook to capture some the performance tips in the manual, and everything seems to run fine on my home computer. But I am getting an odd result when trying to run the notebook on Binder using this Plu…

---

## [Pattern for managing thread local storage?](https://discourse.julialang.org/t/pattern-for-managing-thread-local-storage/54023)

<div class="topic-metadata">

**Author:** [@dmitrip](https://discourse.julialang.org/u/dmitrip)\
**Replies:** 5\
**Last updated:** [May 17, 2021, 1:19pm UTC](https://discourse.julialang.org/t/pattern-for-managing-thread-local-storage/54023 "2021-05-17T13:19:18Z")

</div>

What’s a good pattern for preallocating buffers in a multithreaded setting? I want to avoid allocating new memory whenever I launch a task on a thread. So far I’ve been using the following pattern, which maintains a po…

---

## [FFTW.jl : could not load library "libfftw3"](https://discourse.julialang.org/t/fftw-jl-could-not-load-library-libfftw3/60995)

<div class="topic-metadata">

**Author:** [@Ashwani\_Rathee](https://discourse.julialang.org/u/Ashwani_Rathee)\
**Replies:** 6\
**Last updated:** [May 17, 2021, 12:28pm UTC](https://discourse.julialang.org/t/fftw-jl-could-not-load-library-libfftw3/60995 "2021-05-17T12:28:25Z")

</div>

I am facing this issue, I have provided the information that has been used to solve this issue. https://github.com/JuliaMath/FFTW.jl/issues/110 It’s local issue to my system and works fine for another contributor there. …

---

## [Instantaneous bandwidth](https://discourse.julialang.org/t/instantaneous-bandwidth/61260)

<div class="topic-metadata">

**Author:** [@davidwallis](https://discourse.julialang.org/u/davidwallis)\
**Replies:** 4\
**Last updated:** [May 17, 2021, 12:05pm UTC](https://discourse.julialang.org/t/instantaneous-bandwidth/61260 "2021-05-17T12:05:14Z")

</div>

Does anyone have a function to calculate instantaneous bandwidth? Like instbw in Matlab.

---

## [Find Reimann zeta's zeros with SpecialFunctions and Roots](https://discourse.julialang.org/t/find-reimann-zetas-zeros-with-specialfunctions-and-roots/61275)

<div class="topic-metadata">

**Author:** [@Wei\_Yang](https://discourse.julialang.org/u/Wei_Yang)\
**Replies:** 2\
**Last updated:** [May 17, 2021, 2:11am UTC](https://discourse.julialang.org/t/find-reimann-zetas-zeros-with-specialfunctions-and-roots/61275 "2021-05-17T02:11:13Z")

</div>

To find the zeros of the Reimann \\zeta with real part 1/2, and imaginary part less than 1000 in norm, the following is what I’m using at the moment, using SpecialFunctions using Roots g(x) = abs(zeta(.5 + x\*im)) Z =\[\] …

---

## [Recommended Graphical User Interface with Tabs?](https://discourse.julialang.org/t/recommended-graphical-user-interface-with-tabs/61268)

<div class="topic-metadata">

**Author:** [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)\
**Replies:** 0\
**Last updated:** [May 16, 2021, 11:22pm UTC](https://discourse.julialang.org/t/recommended-graphical-user-interface-with-tabs/61268 "2021-05-16T23:22:44Z")

</div>

For my SoiLWater-ToolBox I am looking for a Graphical User Interface package to input the list of Parameters and Options written in TOML. Since the hydrological models is complex I will need to subdivide the parameters …

---

## [Same code much faster on a Ryzen than on a Xeon?](https://discourse.julialang.org/t/same-code-much-faster-on-a-ryzen-than-on-a-xeon/60534)

<div class="topic-metadata">

**Author:** [@ederag](https://discourse.julialang.org/u/ederag)\
**Replies:** 10\
**Last updated:** [May 16, 2021, 10:41pm UTC](https://discourse.julialang.org/t/same-code-much-faster-on-a-ryzen-than-on-a-xeon/60534 "2021-05-16T22:41:04Z")

</div>

The time\_evolution ODE kernel below is blazing fast on a Ryzen, and more than 4 times slower on a Xeon. This difference is striking, as usually both machines have similar single thread performances. (more on that below…

---

## [Does Mac M1 in multithreads is slower that in single thread?](https://discourse.julialang.org/t/does-mac-m1-in-multithreads-is-slower-that-in-single-thread/61114)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 10\
**Last updated:** [May 16, 2021, 6:48pm UTC](https://discourse.julialang.org/t/does-mac-m1-in-multithreads-is-slower-that-in-single-thread/61114 "2021-05-16T18:48:31Z")

</div>

I’ve run a simple code on mac M1 (pro, 8gb ram), Julia is the last version. @Threads for i in 1:1000 rand(1000,1000)/rand(1000,1000) end 1 core = 50 sec 2 core = 62 sec 4 core = 71 sec 8 core = doesn’t work at all. …

---

## [Julia -J load multiple system images](https://discourse.julialang.org/t/julia-j-load-multiple-system-images/44725)

<div class="topic-metadata">

**Author:** [@wormholestds9](https://discourse.julialang.org/u/wormholestds9)\
**Replies:** 2\
**Last updated:** [May 16, 2021, 12:21pm UTC](https://discourse.julialang.org/t/julia-j-load-multiple-system-images/44725 "2021-05-16T12:21:16Z")

</div>

I created user-defined system images of some packages. I want to preload packages using -J switch. However, I have a problem. For example, I did the following using three system images. julia -J sysimage1.so -J sysima…

---

## [Converting filter using "||" condition to subset](https://discourse.julialang.org/t/converting-filter-using-condition-to-subset/61203)

<div class="topic-metadata">

**Author:** [@kobusherbst](https://discourse.julialang.org/u/kobusherbst)\
**Replies:** 4\
**Last updated:** [May 16, 2021, 4:53am UTC](https://discourse.julialang.org/t/converting-filter-using-condition-to-subset/61203 "2021-05-16T04:53:49Z")

</div>

How do I convert the following code fragment to use subset rather than filter and is there a benefit in doing so for large dataframes? df = DataFrame(a = \[1,2,3,4,6,6\], b=\[1,missing,3,missing,5,missing\], c=\[missing,2,mi…

---

## [Meaning of ";" in PlotlyJS](https://discourse.julialang.org/t/meaning-of-in-plotlyjs/61205)

<div class="topic-metadata">

**Author:** [@Oto\_Brzobohaty](https://discourse.julialang.org/u/Oto_Brzobohaty)\
**Replies:** 7\
**Last updated:** [May 16, 2021, 1:47am UTC](https://discourse.julialang.org/t/meaning-of-in-plotlyjs/61205 "2021-05-16T01:47:11Z")

</div>

I was always wondered what does “;” means in all examples. The following functions give me the same output. using PlotlyBase function linescatter1() trace1 = scatter(;x=1:4, y=\[10, 15, 13, 17\], mode="markers") …

---

## [Need help speeding up ode ensemble problem; preallocation and type instability?](https://discourse.julialang.org/t/need-help-speeding-up-ode-ensemble-problem-preallocation-and-type-instability/61216)

<div class="topic-metadata">

**Author:** [@ethansigh](https://discourse.julialang.org/u/ethansigh)\
**Replies:** 5\
**Last updated:** [May 16, 2021, 12:37am UTC](https://discourse.julialang.org/t/need-help-speeding-up-ode-ensemble-problem-preallocation-and-type-instability/61216 "2021-05-16T00:37:55Z")

</div>

Hi! I’m writing some particle tracing code with large ensemble sizes and it’s super slow. Because for my simulations I need really small timesteps, the solution is huge, and this takes a very very long time (like couple …

---

## [Anyone looking into augmented reality approaches](https://discourse.julialang.org/t/anyone-looking-into-augmented-reality-approaches/61206)

<div class="topic-metadata">

**Author:** [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Replies:** 0\
**Last updated:** [May 15, 2021, 4:42pm UTC](https://discourse.julialang.org/t/anyone-looking-into-augmented-reality-approaches/61206 "2021-05-15T16:42:40Z")

</div>

Hi All I’m interested in OPEN SOURCE augmented reality approaches and wonder if anyone has any experience with them and which one? thanks theakson

---

## [Using LinuxPerf for small functions](https://discourse.julialang.org/t/using-linuxperf-for-small-functions/60410)

<div class="topic-metadata">

**Author:** [@shmiggles](https://discourse.julialang.org/u/shmiggles)\
**Replies:** 7\
**Last updated:** [May 15, 2021, 2:39pm UTC](https://discourse.julialang.org/t/using-linuxperf-for-small-functions/60410 "2021-05-15T14:39:09Z")

</div>

LinuxPerf.jl wraps the perf\_event\_open Linux syscall. But using it for small functions gives ridiculous results. The following example reports over 12000 clock cycles and 2000 memory fetches to compute 1+1: using LinuxP…

---

## [Why do I get a sparse matrix?](https://discourse.julialang.org/t/why-do-i-get-a-sparse-matrix/61196)

<div class="topic-metadata">

**Author:** [@stla](https://discourse.julialang.org/u/stla)\
**Replies:** 1\
**Last updated:** [May 15, 2021, 11:42am UTC](https://discourse.julialang.org/t/why-do-i-get-a-sparse-matrix/61196 "2021-05-15T11:42:48Z")

</div>

Hello, I have these two matrices: julia\> L 1×1 Array{Float64,2}: 3.0 julia\> M 2×1 Array{Float64,2}: 2.0 1.0 I do: import LinearAlgebra d = 3 Ctilde = hcat(vcat(L,M), vcat(zeros(size(L,1),d-size(L,1)), LinearAlgeb…

---

## [Possible enum slowness?](https://discourse.julialang.org/t/possible-enum-slowness/59896)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 3\
**Last updated:** [May 14, 2021, 11:12pm UTC](https://discourse.julialang.org/t/possible-enum-slowness/59896 "2021-05-14T23:12:10Z")

</div>

I may have encountered enum slowness–looking for insight. The background is a bit long: just skip to my question below. The application is a Covid simulation using a physical event approach at the level of individuals. …

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=597)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=599)
