# General Usage

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

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

**Page:** 773

---

## [Calling a function breaks REPL in Juno -- ERROR: unlock from wrong thread](https://discourse.julialang.org/t/calling-a-function-breaks-repl-in-juno-error-unlock-from-wrong-thread/36165)

<div class="topic-metadata">

**Author:** [@vlandau](https://discourse.julialang.org/u/vlandau)\
**Replies:** 4\
**Last updated:** [March 25, 2020, 5:29pm UTC](https://discourse.julialang.org/t/calling-a-function-breaks-repl-in-juno-error-unlock-from-wrong-thread/36165 "2020-03-25T17:29:53Z")

</div>

Running the code below in Juno renders the REPL broken, and by that I mean I can no longer run anything from the REPL. I’m trying to do more than just a simple wrapper function, but the code below was the minimum needed …

---

## [I have a list of dataframes with the same columns, how would I stack them on top of each other and make one dataframe?](https://discourse.julialang.org/t/i-have-a-list-of-dataframes-with-the-same-columns-how-would-i-stack-them-on-top-of-each-other-and-make-one-dataframe/36495)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 3\
**Last updated:** [March 25, 2020, 4:05pm UTC](https://discourse.julialang.org/t/i-have-a-list-of-dataframes-with-the-same-columns-how-would-i-stack-them-on-top-of-each-other-and-make-one-dataframe/36495 "2020-03-25T16:05:51Z")

</div>

Hi how’s it going, I tried using hcat to stack each of these dataframes on top of each other, but it’s not really working as intended. I want to combine a list of dataframes, all with the same column names, into one big…

---

## [Get source code of a loaded function?](https://discourse.julialang.org/t/get-source-code-of-a-loaded-function/36501)

<div class="topic-metadata">

**Author:** [@crbinz](https://discourse.julialang.org/u/crbinz)\
**Replies:** 0\
**Last updated:** [March 25, 2020, 3:51pm UTC](https://discourse.julialang.org/t/get-source-code-of-a-loaded-function/36501 "2020-03-25T15:51:49Z")

</div>

I had some code written in a file, which I was loading into a Jupyter notebook using include(\<filename\>), then running the functions in the file. Somehow the file got overwritten in such a way that I cannot recover the c…

---

## [Strange comportment of @distributed](https://discourse.julialang.org/t/strange-comportment-of-distributed/36409)

<div class="topic-metadata">

**Author:** [@Geoffrey](https://discourse.julialang.org/u/Geoffrey)\
**Replies:** 4\
**Last updated:** [March 25, 2020, 3:43pm UTC](https://discourse.julialang.org/t/strange-comportment-of-distributed/36409 "2020-03-25T15:43:11Z")

</div>

Hi, I’m not use to write down question but I’ve long search on google and I can’t find answer to my problem. I trying to implement the algorithm of sugimoto et al concerning Compressive Bilateral Filter (DOI: 10.1109/TI…

---

## [Vscode with ssh environment variables](https://discourse.julialang.org/t/vscode-with-ssh-environment-variables/36471)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 3\
**Last updated:** [March 25, 2020, 2:40pm UTC](https://discourse.julialang.org/t/vscode-with-ssh-environment-variables/36471 "2020-03-25T14:40:06Z")

</div>

When running vscode over ssh, loading the julia REPL loads julia-1.3, but I would like to use julia 1.4. This is presumably because ENV\["PATH"\] for the REPL only contains /julia-1.3.1/bin. But I don’t know where that PAT…

---

## [Initialising parameter values with compositional sampling in Turing.jl](https://discourse.julialang.org/t/initialising-parameter-values-with-compositional-sampling-in-turing-jl/36494)

<div class="topic-metadata">

**Author:** [@MVanta](https://discourse.julialang.org/u/MVanta)\
**Replies:** 0\
**Last updated:** [March 25, 2020, 2:02pm UTC](https://discourse.julialang.org/t/initialising-parameter-values-with-compositional-sampling-in-turing-jl/36494 "2020-03-25T14:02:29Z")

</div>

Hi all, Is there a way to set the initialisation location for samplers when using the compositional sampling method in Turing.jl? Setting the initial values when sampling from a continuous parameter space (with hamilton…

---

## [Matlab's sparse matrix function](https://discourse.julialang.org/t/matlabs-sparse-matrix-function/36473)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 1\
**Last updated:** [March 25, 2020, 4:46am UTC](https://discourse.julialang.org/t/matlabs-sparse-matrix-function/36473 "2020-03-25T04:46:01Z")

</div>

In MATLAB it’s possible to use sparse like this: \>\> full(sparse(\[2 3 4 5; 1 2 3 4; 9 8 6 7\],ones(3,1)\*(1:4),1,9,9)) ans = 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 …

---

## [Setindex for CartesianIndex](https://discourse.julialang.org/t/setindex-for-cartesianindex/36424)

<div class="topic-metadata">

**Author:** [@Snir\_Gazit](https://discourse.julialang.org/u/Snir_Gazit)\
**Replies:** 5\
**Last updated:** [March 25, 2020, 8:38am UTC](https://discourse.julialang.org/t/setindex-for-cartesianindex/36424 "2020-03-25T08:38:50Z")

</div>

The question is related to the general topic of mutating immutables. StaticArrays comes with a helpful convenience function setindex, which allows modifying an array element at a given position and returning a new Stati…

---

## [Extend for vector-valued matrix multiplication?](https://discourse.julialang.org/t/extend-for-vector-valued-matrix-multiplication/36286)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 14\
**Last updated:** [March 25, 2020, 7:37am UTC](https://discourse.julialang.org/t/extend-for-vector-valued-matrix-multiplication/36286 "2020-03-25T07:37:14Z")

</div>

Consider a UV::Vector{SVector{2}} or alternatively (U,V)::Tuple{Vector,Vector}. I would like to compute the same matrix multiplication formula for U and V but would prefer storing the information in the Vector{SVector{2…

---

## [Unreachable reached at 0x7fa478093547 in Julia 1.0.5](https://discourse.julialang.org/t/unreachable-reached-at-0x7fa478093547-in-julia-1-0-5/36404)

<div class="topic-metadata">

**Author:** [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Replies:** 4\
**Last updated:** [March 25, 2020, 4:53am UTC](https://discourse.julialang.org/t/unreachable-reached-at-0x7fa478093547-in-julia-1-0-5/36404 "2020-03-25T04:53:07Z")

</div>

I had the test code of a package I am developing for my PhD suddenly start crashing after a seemingly inoffensive commit. The complete error log is here. It happens if I execute the tests in my last commit (i.e., git c…

---

## [Ccall when argtype is a struct](https://discourse.julialang.org/t/ccall-when-argtype-is-a-struct/36328)

<div class="topic-metadata">

**Author:** [@iloaiza](https://discourse.julialang.org/u/iloaiza)\
**Replies:** 4\
**Last updated:** [March 25, 2020, 2:55am UTC](https://discourse.julialang.org/t/ccall-when-argtype-is-a-struct/36328 "2020-03-25T02:55:12Z")

</div>

Hey guys! I am trying to write my own small module to interface a C package to my existing Julia code. This C package is working, and I have compiled it with all the necessary flags so it’s a .so file. My problem is tha…

---

## [Get the enumerate type components from the string counterpart](https://discourse.julialang.org/t/get-the-enumerate-type-components-from-the-string-counterpart/23083)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 11\
**Last updated:** [March 25, 2020, 1:42am UTC](https://discourse.julialang.org/t/get-the-enumerate-type-components-from-the-string-counterpart/23083 "2020-03-25T01:42:48Z")

</div>

This is a simple task. I tried the following and it did not work. julia\> @enum Fruit apple=0 pear=1 banana=2 julia\> Fruit("apple") ERROR: MethodError: no method matching Fruit(::String) Closest candidates are: Fruit(…

---

## [StaticArrays as vector elements](https://discourse.julialang.org/t/staticarrays-as-vector-elements/36472)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 2\
**Last updated:** [March 25, 2020, 12:57am UTC](https://discourse.julialang.org/t/staticarrays-as-vector-elements/36472 "2020-03-25T00:57:13Z")

</div>

I remember having seen somewhere an argument that stated that static vectors were stored sequentially (contiguously) in an array of such vectors. No pointers were stored, the data itself. Would anyone remember where to f…

---

## [Intel MKL Error on mac](https://discourse.julialang.org/t/intel-mkl-error-on-mac/34826)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 3\
**Last updated:** [March 24, 2020, 10:47pm UTC](https://discourse.julialang.org/t/intel-mkl-error-on-mac/34826 "2020-03-24T22:47:51Z")

</div>

I downloaded Julia 1.3.1. versioninfo() Julia Version 1.3.1 Commit 2d5741174c (2019-12-30 21:36 UTC) Platform Info: OS: macOS (x86\_64-apple-darwin18.6.0) CPU: Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz WORD\_SIZE: …

---

## [How do I kill a task / coroutine in Julia?](https://discourse.julialang.org/t/how-do-i-kill-a-task-coroutine-in-julia/26683)

<div class="topic-metadata">

**Author:** [@AtsushiSakai](https://discourse.julialang.org/u/AtsushiSakai)\
**Replies:** 3\
**Last updated:** [March 24, 2020, 8:10pm UTC](https://discourse.julialang.org/t/how-do-i-kill-a-task-coroutine-in-julia/26683 "2020-03-24T20:10:45Z")

</div>

I have a totally same question as this: How do I kill a task / coroutine in Julia? - Stack Overflow How do I kill a task / coroutine in Julia? - Stack Overflow I tried the same way to kill the task of the answer like: …

---

## [Running julia over ssh](https://discourse.julialang.org/t/running-julia-over-ssh/36447)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 3\
**Last updated:** [March 24, 2020, 5:29pm UTC](https://discourse.julialang.org/t/running-julia-over-ssh/36447 "2020-03-24T17:29:28Z")

</div>

If I run julia over ssh: ssh user@host julia -i it doesn’t seem to give me prompts, though it does respond to commands, even though I passed the -i “interactive” option. Is there any way I can get it to do this? I’d …

---

## [How to define Deep Q learning loss function in Knet?](https://discourse.julialang.org/t/how-to-define-deep-q-learning-loss-function-in-knet/36439)

<div class="topic-metadata">

**Author:** [@DeepQ](https://discourse.julialang.org/u/DeepQ)\
**Replies:** 2\
**Last updated:** [March 24, 2020, 2:33pm UTC](https://discourse.julialang.org/t/how-to-define-deep-q-learning-loss-function-in-knet/36439 "2020-03-24T14:33:07Z")

</div>

I’am trying to implement a Deep Q learning loss function as part of my thesis. I’m trying to use Knet but I can’t find a simple example.

---

## [Embedding Julia and two-way communication with cpp code?](https://discourse.julialang.org/t/embedding-julia-and-two-way-communication-with-cpp-code/36445)

<div class="topic-metadata">

**Author:** [@sairus7](https://discourse.julialang.org/u/sairus7)\
**Replies:** 0\
**Last updated:** [March 24, 2020, 1:22pm UTC](https://discourse.julialang.org/t/embedding-julia-and-two-way-communication-with-cpp-code/36445 "2020-03-24T13:22:24Z")

</div>

As far as I know, it is possible to embedd Julia in Cpp code and call Cpp libraries from Julia. But if I embedd Julia and call it from Cpp, how can I callback some Cpp functions and methods on Cpp objects and pass resul…

---

## [Own Registry Problems](https://discourse.julialang.org/t/own-registry-problems/36433)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 2\
**Last updated:** [March 24, 2020, 12:53pm UTC](https://discourse.julialang.org/t/own-registry-problems/36433 "2020-03-24T12:53:32Z")

</div>

I’m managing a small registry for Julia packages related to molecular simulation. I’ve recently started to run into errors that I don’t understand and cannot fix usually I’ll find a workaround that I don’t understand eit…

---

## [Converting Tables into arrays](https://discourse.julialang.org/t/converting-tables-into-arrays/36396)

<div class="topic-metadata">

**Author:** [@bandaya](https://discourse.julialang.org/u/bandaya)\
**Replies:** 2\
**Last updated:** [March 24, 2020, 10:35am UTC](https://discourse.julialang.org/t/converting-tables-into-arrays/36396 "2020-03-24T10:35:19Z")

</div>

Hi, I am converting some columns from a table in to a 5x5 array. I have managed to do it in inefficient way as I first convert the table into a DataFrame and then convert that into an array. Is there a more efficient wa…

---

## [How to specify the SSH key for Pkg to use](https://discourse.julialang.org/t/how-to-specify-the-ssh-key-for-pkg-to-use/14784)

<div class="topic-metadata">

**Author:** [@danielmatz](https://discourse.julialang.org/u/danielmatz)\
**Replies:** 5\
**Last updated:** [March 24, 2020, 9:52am UTC](https://discourse.julialang.org/t/how-to-specify-the-ssh-key-for-pkg-to-use/14784 "2020-03-24T09:52:21Z")

</div>

I’m trying to get Pkg to use a different SSH key when it instantiates a project. I naively tried this: env GIT\_SSH\_COMMAND='ssh -i /path/to/key' julia --project -e 'using Pkg; Pkg.instantiate()' But it doesn’t seem to…

---

## [Programatically access version of third party package](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357)

<div class="topic-metadata">

**Author:** [@mfh](https://discourse.julialang.org/u/mfh)\
**Replies:** 9\
**Last updated:** [March 24, 2020, 8:41am UTC](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357 "2020-03-24T08:41:59Z")

</div>

I would like to access the version information of an installed third-party package in terms of a VersionNumber object or similar. Is this possible somehow? I did bit of digging in the documentation of Base and Pkg, but n…

---

## [How to modify HDF5 dataset](https://discourse.julialang.org/t/how-to-modify-hdf5-dataset/36413)

<div class="topic-metadata">

**Author:** [@bhawkins](https://discourse.julialang.org/u/bhawkins)\
**Replies:** 1\
**Last updated:** [March 24, 2020, 5:31am UTC](https://discourse.julialang.org/t/how-to-modify-hdf5-dataset/36413 "2020-03-24T05:31:50Z")

</div>

I’m trying to write a program to read in an HDF5 file with a lot of complicated metadata, do some processing on a large dataset, and write the metadata and modified dataset back out to a new file. I want to avoid explici…

---

## [Method works in REPL; can't use in a function body](https://discourse.julialang.org/t/method-works-in-repl-cant-use-in-a-function-body/36332)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 17\
**Last updated:** [March 24, 2020, 4:12am UTC](https://discourse.julialang.org/t/method-works-in-repl-cant-use-in-a-function-body/36332 "2020-03-24T04:12:29Z")

</div>

I’ve stared at this a long time and can’t figure out what’s wrong. Here is a method call that works in the REPL: julia\> plus!(\[1,2,3,4,5\], infectious, 1:5,1,1) 5-element view(::Array{Float64,4}, 2, 1, 1:5, 1) with elty…

---

## [Not sure how to use XLSX](https://discourse.julialang.org/t/not-sure-how-to-use-xlsx/36410)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 3\
**Last updated:** [March 24, 2020, 1:30am UTC](https://discourse.julialang.org/t/not-sure-how-to-use-xlsx/36410 "2020-03-24T01:30:14Z")

</div>

trying to put an xlsx into a dataframe for Julia using DataFrames using XLSX df = DataFrame(XLSX.readdata("C:/Users/Brett/Documents/FemaleLabourData.xlsx",Sheet1")...) I get an error that my sheet is not recognized, al…

---

## [Multi-party/agent system](https://discourse.julialang.org/t/multi-party-agent-system/36406)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 0\
**Last updated:** [March 23, 2020, 9:04pm UTC](https://discourse.julialang.org/t/multi-party-agent-system/36406 "2020-03-23T21:04:41Z")

</div>

What Julia communication framework is recommended for multi-agent system: Same program running on several (3-4) computers sharing data among them The communication between agents must be low latency and high throughput …

---

## [Strange DataFrame results](https://discourse.julialang.org/t/strange-dataframe-results/36351)

<div class="topic-metadata">

**Author:** [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Replies:** 6\
**Last updated:** [March 23, 2020, 8:01pm UTC](https://discourse.julialang.org/t/strange-dataframe-results/36351 "2020-03-23T20:01:55Z")

</div>

Hello I have a strange issue. I have many places where I’m first creating an array of Dictionaries and then converting it to a DataFrame at the end. This works fine and is fast enough for my purposes. In most cases, …

---

## [Install binary package such as OpenBLAS\_jll via very slow internet connection](https://discourse.julialang.org/t/install-binary-package-such-as-openblas-jll-via-very-slow-internet-connection/36335)

<div class="topic-metadata">

**Author:** [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Replies:** 16\
**Last updated:** [March 23, 2020, 7:43pm UTC](https://discourse.julialang.org/t/install-binary-package-such-as-openblas-jll-via-very-slow-internet-connection/36335 "2020-03-23T19:43:52Z")

</div>

I am frustrated with adding packages which requires downloading large binaries, such as OpenBLAS\_jll. I have a very slow internet connection and the downloading typically takes hours to complete (\>10MB). And the failing …

---

## [Plotly not plotting in browser](https://discourse.julialang.org/t/plotly-not-plotting-in-browser/36353)

<div class="topic-metadata">

**Author:** [@meritwagner](https://discourse.julialang.org/u/meritwagner)\
**Replies:** 3\
**Last updated:** [March 23, 2020, 7:38pm UTC](https://discourse.julialang.org/t/plotly-not-plotting-in-browser/36353 "2020-03-23T19:38:41Z")

</div>

Hey guys, I’ve been using Plotly now for a while but the Plots always open in the plots pane of Juno. From what I’ve read this code should by default open a browser window or am I wrong? using Plotly data = \[1,2,3,4\]…

---

## [FFT(W) does not infer](https://discourse.julialang.org/t/fft-w-does-not-infer/36393)

<div class="topic-metadata">

**Author:** [@raminammour](https://discourse.julialang.org/u/raminammour)\
**Replies:** 11\
**Last updated:** [March 23, 2020, 6:22pm UTC](https://discourse.julialang.org/t/fft-w-does-not-infer/36393 "2020-03-23T18:22:48Z")

</div>

Hello, Is this behavior normal/expected or is it a bug (I just noticed it doesn’t happen for 2 dimensional arrays)? fff()=(u=rand(3,3,4);FFTW.fft(u)) @code\_warntype optimize=:true fff() Variables #self#::Core.Compile…

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

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