# General Usage

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

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

**Page:** 764

---

## [Is there a \`recur\` syntax to call the current function?](https://discourse.julialang.org/t/is-there-a-recur-syntax-to-call-the-current-function/37816)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 3\
**Last updated:** [April 19, 2020, 10:03am UTC](https://discourse.julialang.org/t/is-there-a-recur-syntax-to-call-the-current-function/37816 "2020-04-19T10:03:11Z")

</div>

Some functional languages have this convenience. They also usually implement tail call optimizations (convert functions to while loops). This is a helpful feature to have, since it allows easier renaming of functions and…

---

## [Adding columns based on unique values](https://discourse.julialang.org/t/adding-columns-based-on-unique-values/37835)

<div class="topic-metadata">

**Author:** [@hmemy](https://discourse.julialang.org/u/hmemy)\
**Replies:** 2\
**Last updated:** [April 19, 2020, 10:00am UTC](https://discourse.julialang.org/t/adding-columns-based-on-unique-values/37835 "2020-04-19T10:00:11Z")

</div>

Hi, I have a table A and would like to obtain the unique values in the first column and add the corresponding values in the 2nd and 3rd columns. I have already implemented it in matlab using this line: res = \[unique(A(…

---

## [BlackBoxOptim -- SearchRange problem?](https://discourse.julialang.org/t/blackboxoptim-searchrange-problem/29860)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 8\
**Last updated:** [April 19, 2020, 7:24am UTC](https://discourse.julialang.org/t/blackboxoptim-searchrange-problem/29860 "2020-04-19T07:24:25Z")

</div>

I have used BlackBoxOptim with success in the past. Now, I try to solve an optimization problem L(p) with length(p) = 9 parameters. I then create a search range: p\_range = \[(-1.e4,1e4),(-1.e4,1e4),(-1.e4,1e4),(1.5,5),(1…

---

## [Constant-time arithmetic operations](https://discourse.julialang.org/t/constant-time-arithmetic-operations/37738)

<div class="topic-metadata">

**Author:** [@fjarri](https://discourse.julialang.org/u/fjarri)\
**Replies:** 15\
**Last updated:** [April 19, 2020, 5:48am UTC](https://discourse.julialang.org/t/constant-time-arithmetic-operations/37738 "2020-04-19T05:48:26Z")

</div>

Julia has a great potential as a language for cryptographic implementations, the niche Rust is now beginning to occupy. There is one big obstacle for that: uncertainty about constant-time guarantees of operations. Rust i…

---

## [Problem about \`quote\` in macro definition](https://discourse.julialang.org/t/problem-about-quote-in-macro-definition/37806)

<div class="topic-metadata">

**Author:** [@KDr2](https://discourse.julialang.org/u/KDr2)\
**Replies:** 4\
**Last updated:** [April 19, 2020, 1:31am UTC](https://discourse.julialang.org/t/problem-about-quote-in-macro-definition/37806 "2020-04-19T01:31:17Z")

</div>

I wrote the code below: module T function f1 end macro m1(sym) :(f1(::typeof($(esc(sym)))) = 1) end macro m2(sym) quote f1(::typeof($(esc(sym)))) = 1 end end macro m3(sym) quote $(es…

---

## [How to export a column vector to text file with writedlm function](https://discourse.julialang.org/t/how-to-export-a-column-vector-to-text-file-with-writedlm-function/37818)

<div class="topic-metadata">

**Author:** [@fhkm](https://discourse.julialang.org/u/fhkm)\
**Replies:** 8\
**Last updated:** [April 19, 2020, 1:21am UTC](https://discourse.julialang.org/t/how-to-export-a-column-vector-to-text-file-with-writedlm-function/37818 "2020-04-19T01:21:42Z")

</div>

I want to export a column vector to text file. using DelimitedFiles y=\[1;2;3.4;5.5;7;8;45.78;0.445;76\]; io=open(“x1.txt”,“w”) do io writedlm(io,y) end After the codes is run, I did not get the result I expect. Se…

---

## [Plot contours of a heatmap](https://discourse.julialang.org/t/plot-contours-of-a-heatmap/37804)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 3\
**Last updated:** [April 18, 2020, 11:30pm UTC](https://discourse.julialang.org/t/plot-contours-of-a-heatmap/37804 "2020-04-18T23:30:24Z")

</div>

I have this heatmap of a matrix with Integer values. But it is best suited for continuous values, so I tried contour instead but the contour links the center of the squares like this: Is there an easy way to trac…

---

## [What is the right usage of where clauses to avoid these function calls?](https://discourse.julialang.org/t/what-is-the-right-usage-of-where-clauses-to-avoid-these-function-calls/37812)

<div class="topic-metadata">

**Author:** [@pdubya](https://discourse.julialang.org/u/pdubya)\
**Replies:** 2\
**Last updated:** [April 18, 2020, 8:39pm UTC](https://discourse.julialang.org/t/what-is-the-right-usage-of-where-clauses-to-avoid-these-function-calls/37812 "2020-04-18T20:39:36Z")

</div>

Hi all, Trying to write a function to extract one of the type parameters from the instance of a struct. Have it working but wondering what the syntax would be to this in one line as opposed to using the Type{…} functio…

---

## [Building Julia with Intel MKL and Intel LIBM on macOS](https://discourse.julialang.org/t/building-julia-with-intel-mkl-and-intel-libm-on-macos/37796)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 6\
**Last updated:** [April 18, 2020, 5:12pm UTC](https://discourse.julialang.org/t/building-julia-with-intel-mkl-and-intel-libm-on-macos/37796 "2020-04-18T17:12:01Z")

</div>

Hi all, Where do I find good instructions on how to compile Julia (1.4.0) with Intel MKL and Intel LIBM on macOS (Catalina 10.15.4)? Unfortunately, the “guide” here doesn’t work for me. After installing the Intel Paral…

---

## [MySQL.jl Not Installing](https://discourse.julialang.org/t/mysql-jl-not-installing/37622)

<div class="topic-metadata">

**Author:** [@dburch](https://discourse.julialang.org/u/dburch)\
**Replies:** 3\
**Last updated:** [April 18, 2020, 4:42pm UTC](https://discourse.julialang.org/t/mysql-jl-not-installing/37622 "2020-04-18T16:42:11Z")

</div>

I am not able to install the MySQL.jl package. I am using Julia version 1.0.5. Here is the error: (v1.0) pkg\> add MySQL Resolving package versions... ERROR: Error when installing package LibSSH2\_jll: HTTP.ExceptionRequ…

---

## [JDBC 2 Concurrent Connections](https://discourse.julialang.org/t/jdbc-2-concurrent-connections/37608)

<div class="topic-metadata">

**Author:** [@dburch](https://discourse.julialang.org/u/dburch)\
**Replies:** 1\
**Last updated:** [April 18, 2020, 1:04pm UTC](https://discourse.julialang.org/t/jdbc-2-concurrent-connections/37608 "2020-04-18T13:04:22Z")

</div>

I am able to use JDBC to connect to an Oracle DB or a MySQL DB. It works great. Now I am trying to connect to both databases at the same time. How do I do that? Can I use two different drivers at the same time? Here’s a…

---

## [BoundsError: attempt to access n-element UnitRange{Int32} at index \[n+1\]](https://discourse.julialang.org/t/boundserror-attempt-to-access-n-element-unitrange-int32-at-index-n-1/37508)

<div class="topic-metadata">

**Author:** [@jackjacker](https://discourse.julialang.org/u/jackjacker)\
**Replies:** 1\
**Last updated:** [April 18, 2020, 10:32am UTC](https://discourse.julialang.org/t/boundserror-attempt-to-access-n-element-unitrange-int32-at-index-n-1/37508 "2020-04-18T10:32:27Z")

</div>

Hello, I’m recently using Knet and working on a CNN. I have a dataset-input of 20000x1x1x200000 which I use for training As soon as i start training with progress!(sgd(dtrn,ncycle(n))), I get following the error: Bou…

---

## [Implementing sum](https://discourse.julialang.org/t/implementing-sum/37789)

<div class="topic-metadata">

**Author:** [@Nimpa](https://discourse.julialang.org/u/Nimpa)\
**Replies:** 11\
**Last updated:** [April 18, 2020, 8:14am UTC](https://discourse.julialang.org/t/implementing-sum/37789 "2020-04-18T08:14:57Z")

</div>

how can i implement this summation using reduce,sum,mapreduce, array comprehension and generators

---

## [MKL and libm compile notes: macOS](https://discourse.julialang.org/t/mkl-and-libm-compile-notes-macos/21024)

<div class="topic-metadata">

**Author:** [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Replies:** 6\
**Last updated:** [April 18, 2020, 12:24am UTC](https://discourse.julialang.org/t/mkl-and-libm-compile-notes-macos/21024 "2020-04-18T00:24:58Z")

</div>

Just compiled julia with mkl and libm on macOS, ran some tests and it looks to be working fine. It took a while and the info I found online are in various places (mainly from this github issue and the the intel documenta…

---

## [Memory allocation for sparse matrix multiplication](https://discourse.julialang.org/t/memory-allocation-for-sparse-matrix-multiplication/37787)

<div class="topic-metadata">

**Author:** [@volkerkarle](https://discourse.julialang.org/u/volkerkarle)\
**Replies:** 1\
**Last updated:** [April 17, 2020, 11:00pm UTC](https://discourse.julialang.org/t/memory-allocation-for-sparse-matrix-multiplication/37787 "2020-04-17T23:00:33Z")

</div>

Dear folks, This is my first post, so feel free to relocate me to an appropriate tag/ group/ domain, etc. etc. So I have the following questions: 1) How can I estimate the amount of memory needed for the multiplication…

---

## [Libmbedtls not defined in julia 1.4.1 on ARM (Raspberry Pi)](https://discourse.julialang.org/t/libmbedtls-not-defined-in-julia-1-4-1-on-arm-raspberry-pi/37778)

<div class="topic-metadata">

**Author:** [@Alexander-Barth](https://discourse.julialang.org/u/Alexander-Barth)\
**Replies:** 4\
**Last updated:** [April 17, 2020, 10:58pm UTC](https://discourse.julialang.org/t/libmbedtls-not-defined-in-julia-1-4-1-on-arm-raspberry-pi/37778 "2020-04-17T22:58:01Z")

</div>

I try to install HTTP (requiring MbedTLS) on a Raspberry Pi 3 in julia 1.4.1 (official binaries). The armv7l platform should be supported as far as I can see (Releases · JuliaBinaryWrappers/MbedTLS\_jll.jl · GitHub ), bu…

---

## [Strange inference problems here](https://discourse.julialang.org/t/strange-inference-problems-here/37734)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 7\
**Last updated:** [April 17, 2020, 10:20pm UTC](https://discourse.julialang.org/t/strange-inference-problems-here/37734 "2020-04-17T22:20:19Z")

</div>

I’m seeing some weird behavior with respect to type inference. Here’s the code: function SimpleGraph{T}(nv::Integer, ne::Integer; rng::AbstractRNG=GLOBAL\_RNG) where {T\<:Integer} tnv = T(nv) maxe = div(Int(nv) \* …

---

## [Nested dictionary usage](https://discourse.julialang.org/t/nested-dictionary-usage/37589)

<div class="topic-metadata">

**Author:** [@CH-8](https://discourse.julialang.org/u/CH-8)\
**Replies:** 4\
**Last updated:** [April 17, 2020, 9:55pm UTC](https://discourse.julialang.org/t/nested-dictionary-usage/37589 "2020-04-17T21:55:11Z")

</div>

Hi, I am trying to create a nested dictionary where integer tuple keys map to another dictionary with an integer key and a float value. When I try to add values to this data structure, I get a key error Test = Dict{Tu…

---

## [Badge url gives 404 for new package](https://discourse.julialang.org/t/badge-url-gives-404-for-new-package/37763)

<div class="topic-metadata">

**Author:** [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Replies:** 6\
**Last updated:** [April 17, 2020, 5:23pm UTC](https://discourse.julialang.org/t/badge-url-gives-404-for-new-package/37763 "2020-04-17T17:23:07Z")

</div>

I am using Documenter for the second time. On the first package everything went fine. This time I got as far as populating the gh-pages branch correctly, but when I install the badge in README.md the link returns a 404. …

---

## [How can i pipe arbitrary strings into a temporary file pipe for programs that read from a file?](https://discourse.julialang.org/t/how-can-i-pipe-arbitrary-strings-into-a-temporary-file-pipe-for-programs-that-read-from-a-file/37695)

<div class="topic-metadata">

**Author:** [@NHDaly](https://discourse.julialang.org/u/NHDaly)\
**Replies:** 3\
**Last updated:** [April 17, 2020, 4:55pm UTC](https://discourse.julialang.org/t/how-can-i-pipe-arbitrary-strings-into-a-temporary-file-pipe-for-programs-that-read-from-a-file/37695 "2020-04-17T16:55:20Z")

</div>

What is the julia pipeline equivalent to bash’s process substitution? https://unix.stackexchange.com/a/64011/43398 And/or can we use Pipe() to make a Named Pipe? https://unix.stackexchange.com/questions/63923/pseudo-f…

---

## [Cool chart grids](https://discourse.julialang.org/t/cool-chart-grids/37712)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 2\
**Last updated:** [April 17, 2020, 3:35pm UTC](https://discourse.julialang.org/t/cool-chart-grids/37712 "2020-04-17T15:35:44Z")

</div>

I wanted to better understand the effects of the parameters for the gamma and Erlang distributions. I didn’t quite intuit the effects based on the formulas for the probability density function. Carefully studying code e…

---

## [Plotting Unit Vectors](https://discourse.julialang.org/t/plotting-unit-vectors/37740)

<div class="topic-metadata">

**Author:** [@ennvvy](https://discourse.julialang.org/u/ennvvy)\
**Replies:** 1\
**Last updated:** [April 17, 2020, 12:26pm UTC](https://discourse.julialang.org/t/plotting-unit-vectors/37740 "2020-04-17T12:26:34Z")

</div>

I want to plot unit vectors whose orientation varies from \[-pi, pi\]. A reference figure is below. Any suggestions on how I can get the desired plot?

---

## [Parallel computing: running from terminal vs. editor. Same code, missing parallelisation](https://discourse.julialang.org/t/parallel-computing-running-from-terminal-vs-editor-same-code-missing-parallelisation/37708)

<div class="topic-metadata">

**Author:** [@galaverna](https://discourse.julialang.org/u/galaverna)\
**Replies:** 0\
**Last updated:** [April 16, 2020, 5:23pm UTC](https://discourse.julialang.org/t/parallel-computing-running-from-terminal-vs-editor-same-code-missing-parallelisation/37708 "2020-04-16T17:23:44Z")

</div>

Hello! I am getting started with Julia parallel computing and I successfully created a code that runs on different workers when launched from the Atom editor. However, I am facing some problems when running the same cod…

---

## [Can't get Juno to launch anymore](https://discourse.julialang.org/t/cant-get-juno-to-launch-anymore/37747)

<div class="topic-metadata">

**Author:** [@samantp](https://discourse.julialang.org/u/samantp)\
**Replies:** 6\
**Last updated:** [April 17, 2020, 10:07am UTC](https://discourse.julialang.org/t/cant-get-juno-to-launch-anymore/37747 "2020-04-17T10:07:45Z")

</div>

I am trying get Juno to launch but for the life of me can’t figure out how to do so. I have uninstalled and re-installed it but atom does not open the pane on the left featuring the Julia run, stop, etc. buttons. I also …

---

## [Declaring types from packages](https://discourse.julialang.org/t/declaring-types-from-packages/37737)

<div class="topic-metadata">

**Author:** [@amejia83](https://discourse.julialang.org/u/amejia83)\
**Replies:** 6\
**Last updated:** [April 17, 2020, 8:31am UTC](https://discourse.julialang.org/t/declaring-types-from-packages/37737 "2020-04-17T08:31:51Z")

</div>

Hello, I am facing an issue that I’m sure is very minor, but I cannot find anything in the documentation for either the package or Julia documentation. I’m hoping that someone here can help me out (without knowing too mu…

---

## [Cd() directory out of C:\\\\ or D:\\\\](https://discourse.julialang.org/t/cd-directory-out-of-c-or-d/37634)

<div class="topic-metadata">

**Author:** [@1634](https://discourse.julialang.org/u/1634)\
**Replies:** 13\
**Last updated:** [April 17, 2020, 6:19am UTC](https://discourse.julialang.org/t/cd-directory-out-of-c-or-d/37634 "2020-04-17T06:19:55Z")

</div>

According to Filesystem · The Julia Language I’d like to julia\> cd("/home/amend") ERROR: IOError: chdir /home/amend: no such file or directory (ENOENT) while julia\> cd("D:\\\\Julia") #working \*\*Is it a must to start f…

---

## [Type inference fails for broadcasted addition of tuples containing multiple types](https://discourse.julialang.org/t/type-inference-fails-for-broadcasted-addition-of-tuples-containing-multiple-types/37725)

<div class="topic-metadata">

**Author:** [@tomohiro\_soejima](https://discourse.julialang.org/u/tomohiro_soejima)\
**Replies:** 3\
**Last updated:** [April 17, 2020, 6:19am UTC](https://discourse.julialang.org/t/type-inference-fails-for-broadcasted-addition-of-tuples-containing-multiple-types/37725 "2020-04-17T06:19:34Z")

</div>

Hi, I want to write addition function for tuples with unknown length and unknown type e.g. something like Tuple{a, b, c, d...} where the length and type is determined at runtime, and a, b, c, and d are custom types with…

---

## [Do I have to re-add the package after upgrading Julia to a newer versions?](https://discourse.julialang.org/t/do-i-have-to-re-add-the-package-after-upgrading-julia-to-a-newer-versions/37729)

<div class="topic-metadata">

**Author:** [@Haolun\_Li](https://discourse.julialang.org/u/Haolun_Li)\
**Replies:** 3\
**Last updated:** [April 17, 2020, 5:18am UTC](https://discourse.julialang.org/t/do-i-have-to-re-add-the-package-after-upgrading-julia-to-a-newer-versions/37729 "2020-04-17T05:18:36Z")

</div>

I upgraded my Julia from 1.3 to 1.4 today. But using some\_pkg where some\_pkg is a package I added when using v1.3 no longer works. Do I have to re-add all the packages again in 1.4 or is there an easy way for me to reloc…

---

## [Extract elements of NamedTuple](https://discourse.julialang.org/t/extract-elements-of-namedtuple/37731)

<div class="topic-metadata">

**Author:** [@Jing\_Zhang](https://discourse.julialang.org/u/Jing_Zhang)\
**Replies:** 2\
**Last updated:** [April 17, 2020, 5:10am UTC](https://discourse.julialang.org/t/extract-elements-of-namedtuple/37731 "2020-04-17T05:10:18Z")

</div>

Hi Julia users, I was trying to extract multiple elements from a NamedTuple and Failed. It works for extracting one element (pt here is a NamedTuple) through the following code line pt\[:cancer\_type\] But doesn’t work …

---

## [V1.4 failed to precompile PyCall and PyPlot on windows 7 x64](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718)

<div class="topic-metadata">

**Author:** [@fhkm](https://discourse.julialang.org/u/fhkm)\
**Replies:** 8\
**Last updated:** [April 17, 2020, 4:38am UTC](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718 "2020-04-17T04:38:07Z")

</div>

I initially would like to use PyPlot. The error message prompted me to rebuild PyCall. V1.4, Windows 7 x64. I then use this command using Pkg Pkg.build(“PyCall”) But it did not solve the problem. I was unable to b…

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

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