# General Usage

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

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

**Page:** 748

---

## [Left over temporary files when adding a "jll" file](https://discourse.julialang.org/t/left-over-temporary-files-when-adding-a-jll-file/40287)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 4\
**Last updated:** [May 27, 2020, 11:52pm UTC](https://discourse.julialang.org/t/left-over-temporary-files-when-adding-a-jll-file/40287 "2020-05-27T23:52:02Z")

</div>

When adding Leptonica\_jll with the Pkg I’m left with 23 small files in /tmp'. This is from a clean system when no ~/.julia\` directory exists: As an example: jl\_1l4NBI-download.gz.sha256 jl\_5vHlCu-download.gz.sha256 jl\_…

---

## [\[SOLVED : SDL binding\] SDL or similar in Julia?](https://discourse.julialang.org/t/solved-sdl-binding-sdl-or-similar-in-julia/40300)

<div class="topic-metadata">

**Author:** [@lhp22](https://discourse.julialang.org/u/lhp22)\
**Replies:** 2\
**Last updated:** [May 27, 2020, 11:22pm UTC](https://discourse.julialang.org/t/solved-sdl-binding-sdl-or-similar-in-julia/40300 "2020-05-27T23:22:04Z")

</div>

Hi there ! Is there any package in Julia which provide low level access as SDL ? Or at least the possibility to change screen through the pixel array ? (I wanted to try to make a little 2D game with Julia, to learn more…

---

## [DifferentialEquations Pkg first use](https://discourse.julialang.org/t/differentialequations-pkg-first-use/40286)

<div class="topic-metadata">

**Author:** [@A.U.M](https://discourse.julialang.org/u/A.U.M)\
**Replies:** 2\
**Last updated:** [May 27, 2020, 9:46pm UTC](https://discourse.julialang.org/t/differentialequations-pkg-first-use/40286 "2020-05-27T21:46:09Z")

</div>

Hello, It’s my first time to use DifferentialEquations Pkg. I used this documentation ( https://docs.sciml.ai/stable/tutorials/ode\_example/) to do some tutorial and when I run the same code in the documentation using J…

---

## [How to declare parametric with return type of a function?](https://discourse.julialang.org/t/how-to-declare-parametric-with-return-type-of-a-function/40288)

<div class="topic-metadata">

**Author:** [@Ronneesley](https://discourse.julialang.org/u/Ronneesley)\
**Replies:** 3\
**Last updated:** [May 27, 2020, 8:45pm UTC](https://discourse.julialang.org/t/how-to-declare-parametric-with-return-type-of-a-function/40288 "2020-05-27T20:45:06Z")

</div>

I have a method and I want to declare it with parametric and with return type. What is the syntax? f(a::T)::Bool where {T \<: Number} = a == 1 The error message is: ERROR: UndefVarError: T not defined Stacktrace: \[1\]…

---

## [Inspecting values of default and optional arguments of a function](https://discourse.julialang.org/t/inspecting-values-of-default-and-optional-arguments-of-a-function/40277)

<div class="topic-metadata">

**Author:** [@colm-connaughton](https://discourse.julialang.org/u/colm-connaughton)\
**Replies:** 0\
**Last updated:** [May 27, 2020, 5:11pm UTC](https://discourse.julialang.org/t/inspecting-values-of-default-and-optional-arguments-of-a-function/40277 "2020-05-27T17:11:07Z")

</div>

Hi everyone. First time poster here. I’m wondering if there is a neat way to access the values of default and optional arguments of a function? Suppose I have julia\> f(x, arg1=10.0, arg2=“Hello world”) = (x, arg1, arg2…

---

## [Help on defining function for ODE solver](https://discourse.julialang.org/t/help-on-defining-function-for-ode-solver/40261)

<div class="topic-metadata">

**Author:** [@Wenzhe\_Ma](https://discourse.julialang.org/u/Wenzhe_Ma)\
**Replies:** 3\
**Last updated:** [May 27, 2020, 4:02pm UTC](https://discourse.julialang.org/t/help-on-defining-function-for-ode-solver/40261 "2020-05-27T16:02:14Z")

</div>

Newbie here. I am trying to write ODE function with vector calculation in it. And I started with very basic examples. I tried one with expression definition and another with function definition. What puzzles me is that t…

---

## [Function like VLOOKUP](https://discourse.julialang.org/t/function-like-vlookup/39814)

<div class="topic-metadata">

**Author:** [@yasser\_rajwani](https://discourse.julialang.org/u/yasser_rajwani)\
**Replies:** 19\
**Last updated:** [May 27, 2020, 3:23pm UTC](https://discourse.julialang.org/t/function-like-vlookup/39814 "2020-05-27T15:23:14Z")

</div>

I have the following data and require a function like Vlookup in excel. Table 1 Criteria 1 Criteria 2 Factor 1 A 1 75 B 2 85 A 2 50…

---

## [Help me make this O(n^2) function faster?](https://discourse.julialang.org/t/help-me-make-this-o-n-2-function-faster/24326)

<div class="topic-metadata">

**Author:** [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Replies:** 8\
**Last updated:** [May 27, 2020, 1:12pm UTC](https://discourse.julialang.org/t/help-me-make-this-o-n-2-function-faster/24326 "2020-05-27T13:12:30Z")

</div>

I have a collection of interval events. Each interval has a (physical) location, a start time, and a stop time. There’s also a non-negative kernel function, e.g. kernel(dist) = ifelse(dist \<= 100, 1, 0). For each interv…

---

## [Speeding up solution to the large system of non-linear, complex-valued ODEs](https://discourse.julialang.org/t/speeding-up-solution-to-the-large-system-of-non-linear-complex-valued-odes/39075)

<div class="topic-metadata">

**Author:** [@Bogo](https://discourse.julialang.org/u/Bogo)\
**Replies:** 6\
**Last updated:** [May 27, 2020, 11:09am UTC](https://discourse.julialang.org/t/speeding-up-solution-to-the-large-system-of-non-linear-complex-valued-odes/39075 "2020-05-27T11:09:05Z")

</div>

First of all, thank you to the people who developed Julia and DifferentialEquations.jl these both are really great tools! Now, cutting to the chase: I need to solve a large system of non-linear complex-valued ODEs (N~1…

---

## [Registering in General packages not intended for the general public](https://discourse.julialang.org/t/registering-in-general-packages-not-intended-for-the-general-public/40236)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 14\
**Last updated:** [May 27, 2020, 9:24am UTC](https://discourse.julialang.org/t/registering-in-general-packages-not-intended-for-the-general-public/40236 "2020-05-27T09:24:47Z")

</div>

(This has been spurred by a comment by Stefan on slack#pkg-registration) I’m a researcher at a lab. I write tools in Julia for the lab. I know no one outside the lab would need to use some of these tools. Should I be reg…

---

## [Why writing array to socket is slow in Julia Version 1.3.1?](https://discourse.julialang.org/t/why-writing-array-to-socket-is-slow-in-julia-version-1-3-1/40208)

<div class="topic-metadata">

**Author:** [@indiajoe](https://discourse.julialang.org/u/indiajoe)\
**Replies:** 6\
**Last updated:** [May 27, 2020, 6:40am UTC](https://discourse.julialang.org/t/why-writing-array-to-socket-is-slow-in-julia-version-1-3-1/40208 "2020-05-27T06:40:11Z")

</div>

We recently updated our Julia (finally!) to 1.3.1 from 0.6, and I have been updating my code. In my code I am writing a numpy python array to a socket as outlined below using NPZ using Sockets server = listen(8006) so…

---

## [Segfault using ccall on initialization function](https://discourse.julialang.org/t/segfault-using-ccall-on-initialization-function/40212)

<div class="topic-metadata">

**Author:** [@Matt\_Davis](https://discourse.julialang.org/u/Matt_Davis)\
**Replies:** 11\
**Last updated:** [May 27, 2020, 3:39am UTC](https://discourse.julialang.org/t/segfault-using-ccall-on-initialization-function/40212 "2020-05-27T03:39:05Z")

</div>

I am trying to wrap the TBLIS library (GitHub - devinamatthews/tblis: TBLIS is a library and framework for performing tensor operations, especially tensor contraction, using efficient native algorithms.). I have successf…

---

## [JuliaPro PyPlot Fails](https://discourse.julialang.org/t/juliapro-pyplot-fails/40225)

<div class="topic-metadata">

**Author:** [@Lucas\_Liu](https://discourse.julialang.org/u/Lucas_Liu)\
**Replies:** 0\
**Last updated:** [May 26, 2020, 11:54pm UTC](https://discourse.julialang.org/t/juliapro-pyplot-fails/40225 "2020-05-26T23:54:36Z")

</div>

I am using JuliaPro 1.4.1-1. When I do using PyPlot It gives the following warning message C:\\ProgramData\\Anaconda3\\lib\\site-packages\\numpy\\\_\_init\_\_.py:140: UserWarning: mkl-service package failed to import, therefore…

---

## [Efficiently iterate over partially permuted array](https://discourse.julialang.org/t/efficiently-iterate-over-partially-permuted-array/39982)

<div class="topic-metadata">

**Author:** [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Replies:** 4\
**Last updated:** [May 26, 2020, 8:53pm UTC](https://discourse.julialang.org/t/efficiently-iterate-over-partially-permuted-array/39982 "2020-05-26T20:53:01Z")

</div>

I need to iterate over all multi-set permutations of parts of an array, and get the value of a function which depends on the order of elements in the array. What’s the most efficient way to do this? Only a subset of the…

---

## [DDPG using Flux](https://discourse.julialang.org/t/ddpg-using-flux/40219)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 2\
**Last updated:** [May 26, 2020, 8:51pm UTC](https://discourse.julialang.org/t/ddpg-using-flux/40219 "2020-05-26T20:51:20Z")

</div>

Hi! I need to implement DDPG (and TD3) algorithm for Julia using Flux. I saw that we have an initial implementation here: However, the algorithm is very old and does not work with the newest version of Flux. I am won…

---

## [Unable to install Conda or PyCall](https://discourse.julialang.org/t/unable-to-install-conda-or-pycall/39956)

<div class="topic-metadata">

**Author:** [@Ryan\_Chan](https://discourse.julialang.org/u/Ryan_Chan)\
**Replies:** 1\
**Last updated:** [May 26, 2020, 8:02pm UTC](https://discourse.julialang.org/t/unable-to-install-conda-or-pycall/39956 "2020-05-26T20:02:45Z")

</div>

Hi everyone, I recently started to try learn Julia and cannot seem to install the Conda or PyCall packages. I have seen around that a lot of people have encountered this problem but they seem to be a bit old and the thin…

---

## [Code availability: user-input functions](https://discourse.julialang.org/t/code-availability-user-input-functions/40213)

<div class="topic-metadata">

**Author:** [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Replies:** 0\
**Last updated:** [May 26, 2020, 6:52pm UTC](https://discourse.julialang.org/t/code-availability-user-input-functions/40213 "2020-05-26T18:52:06Z")

</div>

In an effort to make my main calculation code transparent to the parallelized implement, I want to have a user-defined function, then run it in parts of the calculations, doing all the setting up of parallelized calculat…

---

## [Can't launch jupyter from Juliabox](https://discourse.julialang.org/t/cant-launch-jupyter-from-juliabox/40199)

<div class="topic-metadata">

**Author:** [@aebk2015](https://discourse.julialang.org/u/aebk2015)\
**Replies:** 2\
**Last updated:** [May 26, 2020, 6:52pm UTC](https://discourse.julialang.org/t/cant-launch-jupyter-from-juliabox/40199 "2020-05-26T18:52:52Z")

</div>

I am unable to launch jupyter from Juliabox. I just registered; can log in from Juliabox but then I am presented with the launch page which is not activated: see below, thanks

---

## [Integer parametric typed struct much slower than concrete struct](https://discourse.julialang.org/t/integer-parametric-typed-struct-much-slower-than-concrete-struct/40169)

<div class="topic-metadata">

**Author:** [@Lucas\_Liu](https://discourse.julialang.org/u/Lucas_Liu)\
**Replies:** 6\
**Last updated:** [May 26, 2020, 6:48pm UTC](https://discourse.julialang.org/t/integer-parametric-typed-struct-much-slower-than-concrete-struct/40169 "2020-05-26T18:48:33Z")

</div>

Need help on performance of struct with integer parametric-types. I have the following piece of code for an AD package I am developing. PGrad is a struct for tracking gradients w.r.t N\_v variables in N\_c cells. PVa…

---

## [Best practices for generating vectors with ones, zeros, rand, etc](https://discourse.julialang.org/t/best-practices-for-generating-vectors-with-ones-zeros-rand-etc/40197)

<div class="topic-metadata">

**Author:** [@ark](https://discourse.julialang.org/u/ark)\
**Replies:** 11\
**Last updated:** [May 26, 2020, 4:47pm UTC](https://discourse.julialang.org/t/best-practices-for-generating-vectors-with-ones-zeros-rand-etc/40197 "2020-05-26T16:47:08Z")

</div>

A common method to generate and initialize vectors using ones, zeros, or random values, is, e.g., ones(N,1). However, in Julia, such initializations result in a matrix type (!) rather than a vector: julia\> VERSION v"1…

---

## [How to safely cast C union types / use pointer\_from\_objref?](https://discourse.julialang.org/t/how-to-safely-cast-c-union-types-use-pointer-from-objref/40162)

<div class="topic-metadata">

**Author:** [@ColinCaine](https://discourse.julialang.org/u/ColinCaine)\
**Replies:** 7\
**Last updated:** [May 26, 2020, 3:42pm UTC](https://discourse.julialang.org/t/how-to-safely-cast-c-union-types-use-pointer-from-objref/40162 "2020-05-26T15:42:03Z")

</div>

I have a function, that accepts a pointer to a Julia allocated object, fills it with data, and returns it. I then want to cast that object to another type and do stuff with it. How can I best do that without risking the …

---

## [How to add description to failed unit tests?](https://discourse.julialang.org/t/how-to-add-description-to-failed-unit-tests/40107)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 6\
**Last updated:** [May 26, 2020, 3:26pm UTC](https://discourse.julialang.org/t/how-to-add-description-to-failed-unit-tests/40107 "2020-05-26T15:26:20Z")

</div>

In our numerics package we rely on Julia’s Test for unit testing. Sometimes we have multiple values returned from a function which we would like to check separately (e.g., L2 errors for different variables). Conceptually…

---

## [Nested Vectors/Arrays to multidimensional tensor](https://discourse.julialang.org/t/nested-vectors-arrays-to-multidimensional-tensor/36186)

<div class="topic-metadata">

**Author:** [@LudiWin](https://discourse.julialang.org/u/LudiWin)\
**Replies:** 5\
**Last updated:** [May 26, 2020, 3:06pm UTC](https://discourse.julialang.org/t/nested-vectors-arrays-to-multidimensional-tensor/36186 "2020-05-26T15:06:19Z")

</div>

I searched far and wide in the Julia forum and stackoverflow but haven’t found a general answer to my question (or I missed the point of the answers): How can I collect an arbitrary number of nested vectors/arrays into …

---

## [Passing sub-arrays by reference](https://discourse.julialang.org/t/passing-sub-arrays-by-reference/40191)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 3\
**Last updated:** [May 26, 2020, 2:08pm UTC](https://discourse.julialang.org/t/passing-sub-arrays-by-reference/40191 "2020-05-26T14:08:42Z")

</div>

I am puzzled by how to pass sub-arrays of two or higher dimensional arrays by reference. I have defined the following function julia\> function ff(a::Vector) a\[1\]=777; end which sets the first element to 777. However, …

---

## [Weave YAML header doesn't get rendered](https://discourse.julialang.org/t/weave-yaml-header-doesnt-get-rendered/40189)

<div class="topic-metadata">

**Author:** [@eaubanel](https://discourse.julialang.org/u/eaubanel)\
**Replies:** 0\
**Last updated:** [May 26, 2020, 1:42pm UTC](https://discourse.julialang.org/t/weave-yaml-header-doesnt-get-rendered/40189 "2020-05-26T13:42:58Z")

</div>

I started using Weave recently, and just upgraded to version 0.10.2 from 0.9.4. With this upgrade the YAML header isn’t properly rendered into title-author-date (i.e centred with large fonts). One can see this from the e…

---

## [GR.jl Open two figures](https://discourse.julialang.org/t/gr-jl-open-two-figures/7326)

<div class="topic-metadata">

**Author:** [@tobias.knopp](https://discourse.julialang.org/u/tobias.knopp)\
**Replies:** 9\
**Last updated:** [May 26, 2020, 1:07pm UTC](https://discourse.julialang.org/t/gr-jl-open-two-figures/7326 "2020-05-26T13:07:03Z")

</div>

Hi, I am using GR.jl and would like to open two figures. I also need to toggle between them in order to show changes of real-time data. In PyPlot.jl I would use figure(1) and figure(2) to switch between the figures. Th…

---

## [Inverse of symmetric Matrix does not give proper output](https://discourse.julialang.org/t/inverse-of-symmetric-matrix-does-not-give-proper-output/40173)

<div class="topic-metadata">

**Author:** [@morkip](https://discourse.julialang.org/u/morkip)\
**Replies:** 3\
**Last updated:** [May 26, 2020, 10:47am UTC](https://discourse.julialang.org/t/inverse-of-symmetric-matrix-does-not-give-proper-output/40173 "2020-05-26T10:47:00Z")

</div>

I am trying to achieve better performance in my Matrix Inversion by tagging the Matrix as ‘symmetric’. The Matrix is medium sized (200x200) Parameters and complex valued (it is indeed symmetric and not hermitian). The n…

---

## [@memoize macro](https://discourse.julialang.org/t/memoize-macro/39968)

<div class="topic-metadata">

**Author:** [@A.U.M](https://discourse.julialang.org/u/A.U.M)\
**Replies:** 3\
**Last updated:** [May 26, 2020, 8:01am UTC](https://discourse.julialang.org/t/memoize-macro/39968 "2020-05-26T08:01:35Z")

</div>

Hello. I am working on implement macro @memoize. it works well but i want to generalize it and make it more robust (still for functions with a single argument) by checking whether the argument and return types are specif…

---

## [Out of order branch execution prediction slower?](https://discourse.julialang.org/t/out-of-order-branch-execution-prediction-slower/40092)

<div class="topic-metadata">

**Author:** [@angelv](https://discourse.julialang.org/u/angelv)\
**Replies:** 17\
**Last updated:** [May 26, 2020, 7:37am UTC](https://discourse.julialang.org/t/out-of-order-branch-execution-prediction-slower/40092 "2020-05-26T07:37:23Z")

</div>

Hi, following the Parallel Computing course in JuliaAcademy I wanted to try the hardware effects of branch prediction (Serial Performance | JuliaAcademy, time about 33:00). The idea is that in the second case the data …

---

## [Invoking "remote" variables in remote computations](https://discourse.julialang.org/t/invoking-remote-variables-in-remote-computations/40134)

<div class="topic-metadata">

**Author:** [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Replies:** 1\
**Last updated:** [May 26, 2020, 5:58am UTC](https://discourse.julialang.org/t/invoking-remote-variables-in-remote-computations/40134 "2020-05-26T05:58:43Z")

</div>

Let’s suppose in a distributed computing task, for each worker or process we’d like to compute some data (for example in the form of a matrix A) which might or might not be unique for that worker and will be useful later…

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

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