# General Usage

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

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

**Page:** 620

---

## [Restructuring Performant Code (C, Pascal) with Type Unions and Pointers](https://discourse.julialang.org/t/restructuring-performant-code-c-pascal-with-type-unions-and-pointers/58374)

<div class="topic-metadata">

**Author:** [@tawheeler](https://discourse.julialang.org/u/tawheeler)\
**Replies:** 11\
**Last updated:** [April 2, 2021, 5:39pm UTC](https://discourse.julialang.org/t/restructuring-performant-code-c-pascal-with-type-unions-and-pointers/58374 "2021-04-02T17:39:13Z")

</div>

Hello! I’ve been taking a stab at porting the YASS sokoban solver into Julia as a programming exercise. It is a 20k line Pascal program that can solve some pretty hard sokoban problems (block pushing) in under a second. …

---

## [LoopVectorization.jl's @avx does not store results](https://discourse.julialang.org/t/loopvectorization-jls-avx-does-not-store-results/58373)

<div class="topic-metadata">

**Author:** [@ambiso](https://discourse.julialang.org/u/ambiso)\
**Replies:** 9\
**Last updated:** [April 2, 2021, 4:14pm UTC](https://discourse.julialang.org/t/loopvectorization-jls-avx-does-not-store-results/58373 "2021-04-02T16:14:02Z")

</div>

Hi, I was trying to write a SIMD version of a to\_upper function using LoopVectorization.jl package. Here’s the branchless version: function to\_upper\_branchless(s) b = Vector{UInt8}(s) for i ∈ eachindex(b) …

---

## [ERROR: LoadError: ArgumentError: invalid index: :Position of type Symbol](https://discourse.julialang.org/t/error-loaderror-argumenterror-invalid-index-position-of-type-symbol/58453)

<div class="topic-metadata">

**Author:** [@asu10](https://discourse.julialang.org/u/asu10)\
**Replies:** 0\
**Last updated:** [April 2, 2021, 4:16pm UTC](https://discourse.julialang.org/t/error-loaderror-argumenterror-invalid-index-position-of-type-symbol/58453 "2021-04-02T16:16:12Z")

</div>

I’m trying to import a csv file using CSV.File, but I keep getting this error here are my paths # path\_skaters is a string that gives the path to the csv file with the skaters information (see example file for sugge…

---

## [Using CartesianIndices with view()](https://discourse.julialang.org/t/using-cartesianindices-with-view/58411)

<div class="topic-metadata">

**Author:** [@Phil\_Tomson](https://discourse.julialang.org/u/Phil_Tomson)\
**Replies:** 2\
**Last updated:** [April 2, 2021, 3:18pm UTC](https://discourse.julialang.org/t/using-cartesianindices-with-view/58411 "2021-04-02T15:18:11Z")

</div>

I’ve got this function for computing the next state of a CA: function convGOL\_dot(A::AbstractMatrix, kern::AbstractMatrix) b = CartesianIndex(1,1) out = zeros(eltype(A), size(A)) @inbounds for i in CartesianIndic…

---

## [Determine version lanuched from terminal](https://discourse.julialang.org/t/determine-version-lanuched-from-terminal/58441)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 1\
**Last updated:** [April 2, 2021, 12:55pm UTC](https://discourse.julialang.org/t/determine-version-lanuched-from-terminal/58441 "2021-04-02T12:55:48Z")

</div>

I have added C:\\Users\\username\\AppData\\Local\\Programs\\Julia 1.5.3\\bin to my path, so that I can launch Julia by typing julia in the terminal. I have since installed 1.6.0 via chocolatey. As far as I can tell, chocolatey …

---

## [Unitful + ForwardDiff](https://discourse.julialang.org/t/unitful-forwarddiff/41422)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 2\
**Last updated:** [April 2, 2021, 12:18pm UTC](https://discourse.julialang.org/t/unitful-forwarddiff/41422 "2021-04-02T12:18:48Z")

</div>

ForwardDiff.jl and Unitful.jl do not work together out of the box. Did anybody try to make them work together?

---

## [Help understanding dot assignment to Vector of mutable static arrays](https://discourse.julialang.org/t/help-understanding-dot-assignment-to-vector-of-mutable-static-arrays/58108)

<div class="topic-metadata">

**Author:** [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Replies:** 6\
**Last updated:** [April 2, 2021, 12:10pm UTC](https://discourse.julialang.org/t/help-understanding-dot-assignment-to-vector-of-mutable-static-arrays/58108 "2021-04-02T12:10:36Z")

</div>

I am puzzled by the following behavior, which produced a difficult to find bug… julia\> using StaticArrays julia\> t = @MVector(\[1.0,2.0\]) 2-element MVector{2, Float64} with indices SOneTo(2): 1.0 2.0 julia\> x = zeros…

---

## [Pkg trying to add private repository gives GitError(Code:ERROR, Class:Net, unrecognized URL prefix)](https://discourse.julialang.org/t/pkg-trying-to-add-private-repository-gives-giterror-code-error-class-net-unrecognized-url-prefix/58432)

<div class="topic-metadata">

**Author:** [@Shane\_Kelly](https://discourse.julialang.org/u/Shane_Kelly)\
**Replies:** 0\
**Last updated:** [April 2, 2021, 9:32am UTC](https://discourse.julialang.org/t/pkg-trying-to-add-private-repository-gives-giterror-code-error-class-net-unrecognized-url-prefix/58432 "2021-04-02T09:32:30Z")

</div>

I am trying to add a private gitlab repository and I am encountering the following issue: (myEnv) pkg\> add https://gitlab.com/me/private.git Cloning git-repo \`https://gitlab.com/me/private.git\` ERROR: failed to clon…

---

## [Ccall problem while calling fortran](https://discourse.julialang.org/t/ccall-problem-while-calling-fortran/58413)

<div class="topic-metadata">

**Author:** [@Adam\_D](https://discourse.julialang.org/u/Adam_D)\
**Replies:** 3\
**Last updated:** [April 2, 2021, 6:59am UTC](https://discourse.julialang.org/t/ccall-problem-while-calling-fortran/58413 "2021-04-02T06:59:55Z")

</div>

Hi all, I was playing with calling a stupid fortran code in julia. I encountered some weird results. 1)Here is my fortran code to calculate “volume”. module volmod implicit none contains function volume(…

---

## [Unexpected behavior possibly due to how scope and multithreading works on 1.4.2](https://discourse.julialang.org/t/unexpected-behavior-possibly-due-to-how-scope-and-multithreading-works-on-1-4-2/58412)

<div class="topic-metadata">

**Author:** [@dmitrip](https://discourse.julialang.org/u/dmitrip)\
**Replies:** 2\
**Last updated:** [April 2, 2021, 5:30am UTC](https://discourse.julialang.org/t/unexpected-behavior-possibly-due-to-how-scope-and-multithreading-works-on-1-4-2/58412 "2021-04-02T05:30:49Z")

</div>

This multithreading behavior with a weird “fix” happens on 1.4.2 for me, but not 1.5 or 1.6. I don’t understand what I’m doing wrong, so I’m wary of just upgrading and forgetting about it: module M function f() x =…

---

## [How to extract input data just knowing the output values?](https://discourse.julialang.org/t/how-to-extract-input-data-just-knowing-the-output-values/58380)

<div class="topic-metadata">

**Author:** [@mdsa3d](https://discourse.julialang.org/u/mdsa3d)\
**Replies:** 4\
**Last updated:** [April 2, 2021, 3:27am UTC](https://discourse.julialang.org/t/how-to-extract-input-data-just-knowing-the-output-values/58380 "2021-04-02T03:27:04Z")

</div>

I would like to inquire, how may i extract input data from a given dataset (I guess it is similar to data decomposition). The goal is to decompose a dataset to extract the features? For example: Extract individual com…

---

## [JuMP: how NOT to display the results of an optimization problem in the REPL?](https://discourse.julialang.org/t/jump-how-not-to-display-the-results-of-an-optimization-problem-in-the-repl/20429)

<div class="topic-metadata">

**Author:** [@ale](https://discourse.julialang.org/u/ale)\
**Replies:** 5\
**Last updated:** [April 2, 2021, 3:13am UTC](https://discourse.julialang.org/t/jump-how-not-to-display-the-results-of-an-optimization-problem-in-the-repl/20429 "2021-04-02T03:13:52Z")

</div>

Hello! I am using JuMP (0.18.4) (with Gurobi as solver) in a script to solve the same optimization problem for different input. This results in the same optimization problem being solved for many times. Now, everything…

---

## [Ref() which doesn't escape inside a function allocates on the heap](https://discourse.julialang.org/t/ref-which-doesnt-escape-inside-a-function-allocates-on-the-heap/58406)

<div class="topic-metadata">

**Author:** [@balenamiaa](https://discourse.julialang.org/u/balenamiaa)\
**Replies:** 1\
**Last updated:** [April 2, 2021, 1:55am UTC](https://discourse.julialang.org/t/ref-which-doesnt-escape-inside-a-function-allocates-on-the-heap/58406 "2021-04-02T01:55:45Z")

</div>

I recently learnt that creating a Ref inside a function in which it doesn’t escape will lead to a stack allocation instead of heap-allocation. But then when writing a cuda kernel like so - function \_kernel\_0(trail, part…

---

## [Does this lose the benefit of QR decomposition?](https://discourse.julialang.org/t/does-this-lose-the-benefit-of-qr-decomposition/58324)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 2\
**Last updated:** [April 1, 2021, 11:49pm UTC](https://discourse.julialang.org/t/does-this-lose-the-benefit-of-qr-decomposition/58324 "2021-04-01T23:49:29Z")

</div>

My understanding is that one can do fast multiplies by the Q matrix of the QR decomposition because it is represented as a sequence of Householder reflections. I want to compute deltai = 3:size(T, 1) δ = Q\[:, d…

---

## [Simple wildcard search in dataframes](https://discourse.julialang.org/t/simple-wildcard-search-in-dataframes/58401)

<div class="topic-metadata">

**Author:** [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Replies:** 2\
**Last updated:** [April 1, 2021, 10:40pm UTC](https://discourse.julialang.org/t/simple-wildcard-search-in-dataframes/58401 "2021-04-01T22:40:31Z")

</div>

Hello All, This seems like such a trivial thing, but I couldn’t get it to work. I’m simply trying to filter a dataframe column by a wildcard search. What is the right syntax? df = DataFrame(:a =\> \["abcdef","abcdeg","…

---

## [Concurrency violation during garbage collections?](https://discourse.julialang.org/t/concurrency-violation-during-garbage-collections/58391)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 1\
**Last updated:** [April 1, 2021, 9:13pm UTC](https://discourse.julialang.org/t/concurrency-violation-during-garbage-collections/58391 "2021-04-01T21:13:14Z")

</div>

Really, I guess my question is should I open a bug against Julia for this? It doesn’t appear to be causing issues, and I expect that this will only happen during development. First the stack trace: error in running fi…

---

## [No-op function?](https://discourse.julialang.org/t/no-op-function/58392)

<div class="topic-metadata">

**Author:** [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Replies:** 2\
**Last updated:** [April 1, 2021, 8:56pm UTC](https://discourse.julialang.org/t/no-op-function/58392 "2021-04-01T20:56:00Z")

</div>

Is there such a thing as a function that is a no-op (and returns nothing which I guess is always mandatory) for any arguments? Basically noop(args...; kwargs...) = nothing I’m wondering if either something like this…

---

## [Drop of performances with Julia 1.6.0 for InterpolationKernels](https://discourse.julialang.org/t/drop-of-performances-with-julia-1-6-0-for-interpolationkernels/58085)

<div class="topic-metadata">

**Author:** [@emmt](https://discourse.julialang.org/u/emmt)\
**Replies:** 40\
**Last updated:** [April 1, 2021, 8:21pm UTC](https://discourse.julialang.org/t/drop-of-performances-with-julia-1-6-0-for-interpolationkernels/58085 "2021-04-01T20:21:32Z")

</div>

I was happy to switch from Julia 1.5.4 to Julia 1.6.0 but I experienced significant drops of performances for InterpolationKernels by up to a factor 3.6… Below are tables summarizing my tests with BenchmarkTools. The c…

---

## [GR can't connect on Windows](https://discourse.julialang.org/t/gr-cant-connect-on-windows/58371)

<div class="topic-metadata">

**Author:** [@jbreeden](https://discourse.julialang.org/u/jbreeden)\
**Replies:** 4\
**Last updated:** [April 1, 2021, 6:33pm UTC](https://discourse.julialang.org/t/gr-cant-connect-on-windows/58371 "2021-04-01T18:33:34Z")

</div>

I installed Julia 1.6 on Windows a few days ago, and had been using the Plots package with no problems (GR backend only). Now, every time I plot, I get GKS: can't connect to GKS socket application GKS: Open failed in r…

---

## [Recompiling functions with infrequently mutating constant](https://discourse.julialang.org/t/recompiling-functions-with-infrequently-mutating-constant/58368)

<div class="topic-metadata">

**Author:** [@Deduction42](https://discourse.julialang.org/u/Deduction42)\
**Replies:** 7\
**Last updated:** [April 1, 2021, 4:54pm UTC](https://discourse.julialang.org/t/recompiling-functions-with-infrequently-mutating-constant/58368 "2021-04-01T16:54:39Z")

</div>

I’m writing an application with a whole bunch of vectors of length N that syntactically have elements having a consistent meaning (chemical components in a mixture). Most of the time, I don’t need the names, but on some …

---

## [How to migrate version of PooledArrays inside JLD2 file](https://discourse.julialang.org/t/how-to-migrate-version-of-pooledarrays-inside-jld2-file/58369)

<div class="topic-metadata">

**Author:** [@bluesmoon](https://discourse.julialang.org/u/bluesmoon)\
**Replies:** 3\
**Last updated:** [April 1, 2021, 4:01pm UTC](https://discourse.julialang.org/t/how-to-migrate-version-of-pooledarrays-inside-jld2-file/58369 "2021-04-01T16:01:07Z")

</div>

A while ago I created a JLD2 file with a DataFrame in it. (This is used for unit testing) One of the columns in the DataFrame has a type of PooledArrays.PooledArray{String,UInt32,1,Array{UInt32,1}} When I created the J…

---

## [Best Practices for Harmonizing Datasets](https://discourse.julialang.org/t/best-practices-for-harmonizing-datasets/58364)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 5\
**Last updated:** [April 1, 2021, 4:26pm UTC](https://discourse.julialang.org/t/best-practices-for-harmonizing-datasets/58364 "2021-04-01T16:26:44Z")

</div>

Hi everyone! I have a question about data manipulation that is more on the conceptual side: Say you have multiple datasets that you are trying to harmonize. Each dataset requires their own amount of processing to get i…

---

## [Private Package dll gives "Access is denied"](https://discourse.julialang.org/t/private-package-dll-gives-access-is-denied/58295)

<div class="topic-metadata">

**Author:** [@Brad\_Carman](https://discourse.julialang.org/u/Brad_Carman)\
**Replies:** 4\
**Last updated:** [April 1, 2021, 2:58pm UTC](https://discourse.julialang.org/t/private-package-dll-gives-access-is-denied/58295 "2021-04-01T14:58:07Z")

</div>

I am developing a private package which uses a dll I store in a “lib” folder in my package repository. This dll is from compiled c code and does not require registering and works fine from the development directory. The…

---

## [Tuple indexing taking time?](https://discourse.julialang.org/t/tuple-indexing-taking-time/58309)

<div class="topic-metadata">

**Author:** [@markmbaum](https://discourse.julialang.org/u/markmbaum)\
**Replies:** 25\
**Last updated:** [April 1, 2021, 2:51pm UTC](https://discourse.julialang.org/t/tuple-indexing-taking-time/58309 "2021-04-01T14:51:00Z")

</div>

A fairly general question about a function that I’m working on before I try to summarize what it’s doing. The profile view is below. There are three main red blocks that take up most of the time, each for the same line o…

---

## [Multiple-choice (dropdown) arguments](https://discourse.julialang.org/t/multiple-choice-dropdown-arguments/58353)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 10\
**Last updated:** [April 1, 2021, 2:46pm UTC](https://discourse.julialang.org/t/multiple-choice-dropdown-arguments/58353 "2021-04-01T14:46:56Z")

</div>

Writing code in julia, I often encounter the need for an argument which can assume a number of different choices. E.g. in IndexFunArrays many functions (e.g. rr(mysize; offset=CtrFT)) have the offset parameter which can …

---

## [Radial Basis Surrogate](https://discourse.julialang.org/t/radial-basis-surrogate/58192)

<div class="topic-metadata">

**Author:** [@Manisha\_07](https://discourse.julialang.org/u/Manisha_07)\
**Replies:** 6\
**Last updated:** [April 1, 2021, 1:43pm UTC](https://discourse.julialang.org/t/radial-basis-surrogate/58192 "2021-04-01T13:43:16Z")

</div>

I am trying to execute the following program but facing the issue. Please help me to resolve this

---

## [Determine sysimage used at runtime](https://discourse.julialang.org/t/determine-sysimage-used-at-runtime/58329)

<div class="topic-metadata">

**Author:** [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Replies:** 1\
**Last updated:** [March 31, 2021, 8:42pm UTC](https://discourse.julialang.org/t/determine-sysimage-used-at-runtime/58329 "2021-03-31T20:42:42Z")

</div>

How does one determine what sysimage was used to start Julia? I know I’ve seen how to do this somewhere but can’t for the life of me find it in the docs or searching online.

---

## [Plots histogram2d not displaying correct number of bins](https://discourse.julialang.org/t/plots-histogram2d-not-displaying-correct-number-of-bins/58328)

<div class="topic-metadata">

**Author:** [@MattWillFlood](https://discourse.julialang.org/u/MattWillFlood)\
**Replies:** 4\
**Last updated:** [March 31, 2021, 8:28pm UTC](https://discourse.julialang.org/t/plots-histogram2d-not-displaying-correct-number-of-bins/58328 "2021-03-31T20:28:36Z")

</div>

Hi Guys :slightly\_smiling\_face: I’m trying to plot a 2D histogram using the plots function histogram2D. \[backend: plotlyjs, environment: VSCode\] My aim is to plot the 2D histogram for different numbers of bins (\*same …

---

## [Index rows of arbitrary dimensional array?](https://discourse.julialang.org/t/index-rows-of-arbitrary-dimensional-array/58312)

<div class="topic-metadata">

**Author:** [@Satvik](https://discourse.julialang.org/u/Satvik)\
**Replies:** 1\
**Last updated:** [March 31, 2021, 4:39pm UTC](https://discourse.julialang.org/t/index-rows-of-arbitrary-dimensional-array/58312 "2021-03-31T16:39:14Z")

</div>

I have some code that receives vectors or matrices, and I would like to get certain rows while preserving the dimensionality of the input. E.g. arr = \[1, 2, 3\] mat = \[1 2; 3 4; 5 6\] get\_rows(arr, 2, 3) == \[2, 3\] get\_ro…

---

## [New scientific computing benchmark - Network of differential equations](https://discourse.julialang.org/t/new-scientific-computing-benchmark-network-of-differential-equations/58221)

<div class="topic-metadata">

**Author:** [@lindnemi](https://discourse.julialang.org/u/lindnemi)\
**Replies:** 8\
**Last updated:** [March 31, 2021, 3:39pm UTC](https://discourse.julialang.org/t/new-scientific-computing-benchmark-network-of-differential-equations/58221 "2021-03-31T15:39:21Z")

</div>

For our recent paper on NetworkDynamics.jl, we developed a benchmark problem. The goal is to solve a Kuramoto system on a sparse random graph, i.e. \\dot \\theta\_i = \\omega\_i + \\sigma \\sum\_{j=1}^N sin(\\theta\_j - \\theta\_i…

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

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