# General Usage

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

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

**Page:** 663

---

## [Ccall printf works with ints but not with floats. Why?](https://discourse.julialang.org/t/ccall-printf-works-with-ints-but-not-with-floats-why/52487)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 7\
**Last updated:** [December 29, 2020, 12:37am UTC](https://discourse.julialang.org/t/ccall-printf-works-with-ints-but-not-with-floats-why/52487 "2020-12-29T00:37:05Z")

</div>

julia\> ccall(:printf, Cint, (Ptr{Cchar}, Cint), "aiai %d", 10); aiai 10 julia\> ccall(:printf, Cint, (Ptr{Cchar}, Cdouble), "aiai %f", 10.99); aiai 0.000000 The context for this is to reduce invalidations that cause late…

---

## [Elementwise operation with different dimensions of vectors](https://discourse.julialang.org/t/elementwise-operation-with-different-dimensions-of-vectors/52543)

<div class="topic-metadata">

**Author:** [@rcesarpacheco](https://discourse.julialang.org/u/rcesarpacheco)\
**Replies:** 1\
**Last updated:** [December 28, 2020, 11:29pm UTC](https://discourse.julialang.org/t/elementwise-operation-with-different-dimensions-of-vectors/52543 "2020-12-28T23:29:21Z")

</div>

I am starting to write some codes in Julia and I have some doubts about elementwise operations. Imagine that I have two matrices, A and B: A= randn(3,3,3); B = rand(3,3); When I do something like A .==B what the compi…

---

## [Question about the Template type in the PkgTemplates.jl package](https://discourse.julialang.org/t/question-about-the-template-type-in-the-pkgtemplates-jl-package/52545)

<div class="topic-metadata">

**Author:** [@florian](https://discourse.julialang.org/u/florian)\
**Replies:** 2\
**Last updated:** [December 28, 2020, 10:39pm UTC](https://discourse.julialang.org/t/question-about-the-template-type-in-the-pkgtemplates-jl-package/52545 "2020-12-28T22:39:03Z")

</div>

Hi everyone, I have a question regarding Types/Functions that came up after I discovered the PkgTemplates.jl package. In this package I can define an object of type Template like so: t = Template(); Then, to actuall…

---

## [CI/CD without travis-ci.org](https://discourse.julialang.org/t/ci-cd-without-travis-ci-org/52501)

<div class="topic-metadata">

**Author:** [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Replies:** 8\
**Last updated:** [December 28, 2020, 6:54pm UTC](https://discourse.julialang.org/t/ci-cd-without-travis-ci-org/52501 "2020-12-28T18:54:49Z")

</div>

I followed a little bit the topic of moving CI to github actions, but couldn’t really get the conclusion how to do this for packages in general. Afaics github is providing resources for runners and some infrastructure f…

---

## [Fastest way to filter when right hand sinde of \`in\` is large](https://discourse.julialang.org/t/fastest-way-to-filter-when-right-hand-sinde-of-in-is-large/52526)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 3\
**Last updated:** [December 28, 2020, 6:48pm UTC](https://discourse.julialang.org/t/fastest-way-to-filter-when-right-hand-sinde-of-in-is-large/52526 "2020-12-28T18:48:41Z")

</div>

I’m facing a problem where I would like to filter a dataset by using only those IDs that occur in another vector (that is around 100,000 elements long). If I just use in that takes forever as, I assume it checks every el…

---

## [Problem adding a local registry from remote](https://discourse.julialang.org/t/problem-adding-a-local-registry-from-remote/52500)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 1\
**Last updated:** [December 28, 2020, 6:03pm UTC](https://discourse.julialang.org/t/problem-adding-a-local-registry-from-remote/52500 "2020-12-28T18:03:28Z")

</div>

I made a local registry with LocalRegistry.jl, and set its remote in a private network to share it with colleagues. I can work with that local registry without problems, but other people have problems when they try to ad…

---

## [Configuring the view of the REPL and plots in VSCode](https://discourse.julialang.org/t/configuring-the-view-of-the-repl-and-plots-in-vscode/52381)

<div class="topic-metadata">

**Author:** [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Replies:** 2\
**Last updated:** [December 28, 2020, 5:12pm UTC](https://discourse.julialang.org/t/configuring-the-view-of-the-repl-and-plots-in-vscode/52381 "2020-12-28T17:12:49Z")

</div>

I just created my first plot in Julia using the VSCode editor, and I’m trying to figure out how to change the appearance of the plot display and the REPL so that they are stacked on top of each other on the right hand si…

---

## [Call C++ library](https://discourse.julialang.org/t/call-c-library/51856)

<div class="topic-metadata">

**Author:** [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Replies:** 4\
**Last updated:** [December 28, 2020, 4:36pm UTC](https://discourse.julialang.org/t/call-c-library/51856 "2020-12-28T16:36:51Z")

</div>

I want to control this equipment using the libraries provided by the manufacturer: libm2k: libm2k::analog::DMM Class Reference I tried to install Cxx on Julia 1.5 but I got and error: julia\> using Cxx \[ Info: Precompil…

---

## [Ssl\_handshake errors with download](https://discourse.julialang.org/t/ssl-handshake-errors-with-download/52507)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 0\
**Last updated:** [December 28, 2020, 12:37pm UTC](https://discourse.julialang.org/t/ssl-handshake-errors-with-download/52507 "2020-12-28T12:37:23Z")

</div>

I’m using download to get a copy of a Google sheet “published” to a url as csv (this is a convinient way of letting users edit their data online via Google sheets, and then I can download their finished data). Sometimes,…

---

## [Unexpected infinite loop when calling a simple function](https://discourse.julialang.org/t/unexpected-infinite-loop-when-calling-a-simple-function/52482)

<div class="topic-metadata">

**Author:** [@Chen](https://discourse.julialang.org/u/Chen)\
**Replies:** 2\
**Last updated:** [December 28, 2020, 9:37am UTC](https://discourse.julialang.org/t/unexpected-infinite-loop-when-calling-a-simple-function/52482 "2020-12-28T09:37:27Z")

</div>

I’m trying to create a function that calls another function. using Weave function knytte( file\_name, doc\_type ) weave( file\_name, doctype = doc\_type ) end knytte( "test.jmd", "md2html" ) The content of “test.jmd”…

---

## [Win 10 Issue with Pkg/PlatformEngines](https://discourse.julialang.org/t/win-10-issue-with-pkg-platformengines/43272)

<div class="topic-metadata">

**Author:** [@Omega-xyZac](https://discourse.julialang.org/u/Omega-xyZac)\
**Replies:** 21\
**Last updated:** [December 28, 2020, 5:17am UTC](https://discourse.julialang.org/t/win-10-issue-with-pkg-platformengines/43272 "2020-12-28T05:17:46Z")

</div>

I have been trying to find a fix for this issue for awhile. Perhaps this is a bug or my Windows has an issue. I have Powershell/curl on path along with 7z and tar. Am on Win 10 machine. I am able to run powershell and 7z…

---

## [Julia US-East servers down? Here is how to update your packages](https://discourse.julialang.org/t/julia-us-east-servers-down-here-is-how-to-update-your-packages/52496)

<div class="topic-metadata">

**Author:** [@dannofthursday](https://discourse.julialang.org/u/dannofthursday)\
**Replies:** 0\
**Last updated:** [December 28, 2020, 7:13am UTC](https://discourse.julialang.org/t/julia-us-east-servers-down-here-is-how-to-update-your-packages/52496 "2020-12-28T07:13:52Z")

</div>

Newish Julia user. Experiencing the following issue when trying to update packages: Per this thread, the environment variable, JULIA\_PKG\_SERVER, needs to be changed. Here is what I did: Run julia\> ENV\["JULIA\_PKG\_SE…

---

## [How to check what holds package update?](https://discourse.julialang.org/t/how-to-check-what-holds-package-update/52442)

<div class="topic-metadata">

**Author:** [@asyrov](https://discourse.julialang.org/u/asyrov)\
**Replies:** 5\
**Last updated:** [December 28, 2020, 2:10am UTC](https://discourse.julialang.org/t/how-to-check-what-holds-package-update/52442 "2020-12-28T02:10:40Z")

</div>

I found that DataStructures.jl package is on version 0.17 while up-to-date version is 0.18. How do I find what other package holds the update? Thank you very much,

---

## [My script performance lags Python](https://discourse.julialang.org/t/my-script-performance-lags-python/52249)

<div class="topic-metadata">

**Author:** [@jsundram](https://discourse.julialang.org/u/jsundram)\
**Replies:** 13\
**Last updated:** [December 28, 2020, 12:31am UTC](https://discourse.julialang.org/t/my-script-performance-lags-python/52249 "2020-12-28T00:31:51Z")

</div>

Context: @dpsanders encouraged me to try rewriting a slow Python script of mine in Julia. The code is intended largely as an art project – to do something similar to images that the Percolator app does. I implemented a…

---

## [Properties on expressions including call arguments, constructors or array indices](https://discourse.julialang.org/t/properties-on-expressions-including-call-arguments-constructors-or-array-indices/52450)

<div class="topic-metadata">

**Author:** [@Floris](https://discourse.julialang.org/u/Floris)\
**Replies:** 2\
**Last updated:** [December 27, 2020, 11:04pm UTC](https://discourse.julialang.org/t/properties-on-expressions-including-call-arguments-constructors-or-array-indices/52450 "2020-12-27T23:04:07Z")

</div>

Hi there, I am new to the Julia community, but since a while I’ve been working on a package to enable painless interaction with COMSOL (commercial finite element software). It relies heavily on java’s reflection API to m…

---

## [Fastest way to run a for loop in parallel](https://discourse.julialang.org/t/fastest-way-to-run-a-for-loop-in-parallel/52477)

<div class="topic-metadata">

**Author:** [@rcesarpacheco](https://discourse.julialang.org/u/rcesarpacheco)\
**Replies:** 4\
**Last updated:** [December 27, 2020, 10:58pm UTC](https://discourse.julialang.org/t/fastest-way-to-run-a-for-loop-in-parallel/52477 "2020-12-27T22:58:02Z")

</div>

I am a new user of Julia and I am trying to run a for loop in parallel using .Threads but I don’t know if this is the fastest way that I can do this. The for loop is: res = zeros(length(posicao),2) Threads.@thr…

---

## [Letting a package use external user-created functions](https://discourse.julialang.org/t/letting-a-package-use-external-user-created-functions/52345)

<div class="topic-metadata">

**Author:** [@Michael\_Wang](https://discourse.julialang.org/u/Michael_Wang)\
**Replies:** 26\
**Last updated:** [December 27, 2020, 9:40pm UTC](https://discourse.julialang.org/t/letting-a-package-use-external-user-created-functions/52345 "2020-12-27T21:40:45Z")

</div>

Suppose I have a simulation package module MySimPackage struct Interaction1 \<: AbstractInteraction stuff end function compute\_interaction(i::Interaction1) compute something end func…

---

## [Replace for loop with vectorized call of a function that returns multiple values](https://discourse.julialang.org/t/replace-for-loop-with-vectorized-call-of-a-function-that-returns-multiple-values/52476)

<div class="topic-metadata">

**Author:** [@rcesarpacheco](https://discourse.julialang.org/u/rcesarpacheco)\
**Replies:** 1\
**Last updated:** [December 27, 2020, 8:51pm UTC](https://discourse.julialang.org/t/replace-for-loop-with-vectorized-call-of-a-function-that-returns-multiple-values/52476 "2020-12-27T20:51:35Z")

</div>

I have the following function: problema\_firma\_emprestimo(r,w,r\_emprestimo,posicao,posicao\_banco) , where all inputs are scalars. This function return three different matrix, using return demanda\_k\_emprestimo,demanda\_l\_e…

---

## [Problem using Pardiso in Julia](https://discourse.julialang.org/t/problem-using-pardiso-in-julia/52469)

<div class="topic-metadata">

**Author:** [@rcesarpacheco](https://discourse.julialang.org/u/rcesarpacheco)\
**Replies:** 0\
**Last updated:** [December 27, 2020, 6:06pm UTC](https://discourse.julialang.org/t/problem-using-pardiso-in-julia/52469 "2020-12-27T18:06:46Z")

</div>

Hello, I am trying to use the Pardiso package in Julia together with the Pardiso library. However, I can’t build the package. When I look into the build log, I see this message: Looking in “C:\\Users\\Rodrigo.julia\\packa…

---

## [Plot graph is zoomed to much](https://discourse.julialang.org/t/plot-graph-is-zoomed-to-much/52431)

<div class="topic-metadata">

**Author:** [@acastrauss](https://discourse.julialang.org/u/acastrauss)\
**Replies:** 0\
**Last updated:** [December 26, 2020, 11:35pm UTC](https://discourse.julialang.org/t/plot-graph-is-zoomed-to-much/52431 "2020-12-26T23:35:50Z")

</div>

I recently installed newest version of Julia, and ever since, when I plot any function my view is zoomed too much (like on the picture). Of course, I can zoom out, but then I would have to zoom in when I write code. Can …

---

## [Trouble installing an Excel reader](https://discourse.julialang.org/t/trouble-installing-an-excel-reader/52419)

<div class="topic-metadata">

**Author:** [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Replies:** 12\
**Last updated:** [December 27, 2020, 2:12am UTC](https://discourse.julialang.org/t/trouble-installing-an-excel-reader/52419 "2020-12-27T02:12:22Z")

</div>

I’d like to read in some data from an Excel file, but I am having trouble installing an Excel reader. After issuing the using Pkg command, the following attempts all gave me the same error: Pkg.add("XLSX") Pkg.add("Exc…

---

## [Should abstract types be exported?](https://discourse.julialang.org/t/should-abstract-types-be-exported/52359)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 3\
**Last updated:** [December 26, 2020, 8:58pm UTC](https://discourse.julialang.org/t/should-abstract-types-be-exported/52359 "2020-12-26T20:58:03Z")

</div>

My module has a few composite types like: struct myType1 \<: ModFooAbstractType. It seems the intent of abstract types is that they are an interface for functions, not necessarily defined in the same module, like: using…

---

## [Rotating the axes labels in GR](https://discourse.julialang.org/t/rotating-the-axes-labels-in-gr/52379)

<div class="topic-metadata">

**Author:** [@bhaveshshrimali](https://discourse.julialang.org/u/bhaveshshrimali)\
**Replies:** 1\
**Last updated:** [December 26, 2020, 9:19pm UTC](https://discourse.julialang.org/t/rotating-the-axes-labels-in-gr/52379 "2020-12-26T21:19:24Z")

</div>

Hi everyone, I was trying to use the GR (version: \[28b8d3ca\] GR v0.53.0) backend with the axes label on the y axis rotated clockwise by 90 degrees. Consider the following snippet using Plots, LaTeXStrings gr() λ\_linear…

---

## [Does anyone find it is a bit annoying that Pluto.jl does not let you reuse variable in different cells?](https://discourse.julialang.org/t/does-anyone-find-it-is-a-bit-annoying-that-pluto-jl-does-not-let-you-reuse-variable-in-different-cells/46901)

<div class="topic-metadata">

**Author:** [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Replies:** 8\
**Last updated:** [December 26, 2020, 8:28pm UTC](https://discourse.julialang.org/t/does-anyone-find-it-is-a-bit-annoying-that-pluto-jl-does-not-let-you-reuse-variable-in-different-cells/46901 "2020-12-26T20:28:56Z")

</div>

Sometimes it is handy to use a same variable name in different cells. For example, I want to test several differenty ways to interpolation a function. I will define a interpolation instance in one cell, say begin spl …

---

## [Why won't \`pkg\> generate\` allow a ".jl" suffix in the name?](https://discourse.julialang.org/t/why-wont-pkg-generate-allow-a-jl-suffix-in-the-name/52412)

<div class="topic-metadata">

**Author:** [@ben-schulz](https://discourse.julialang.org/u/ben-schulz)\
**Replies:** 3\
**Last updated:** [December 26, 2020, 6:01pm UTC](https://discourse.julialang.org/t/why-wont-pkg-generate-allow-a-jl-suffix-in-the-name/52412 "2020-12-26T18:01:17Z")

</div>

hi there, after some time away from Julia, i’m trying to create a new package, and seem to recall that standard convention is to put a “.jl” suffix on the repo name, i.e. on the root project directory. i thought i woul…

---

## [Defining function that accepts both FP32 and FP64](https://discourse.julialang.org/t/defining-function-that-accepts-both-fp32-and-fp64/52394)

<div class="topic-metadata">

**Author:** [@tgautam03](https://discourse.julialang.org/u/tgautam03)\
**Replies:** 6\
**Last updated:** [December 26, 2020, 5:10pm UTC](https://discourse.julialang.org/t/defining-function-that-accepts-both-fp32-and-fp64/52394 "2020-12-26T17:10:37Z")

</div>

Hi, I’m just starting out with Julia and ran into a weird issue. I defined a function that can take float values (fp32 or fp64, but strictly no int) as follows function elim(A::Array{float},b::Array{float}) #= F…

---

## [Compat entry for a package that may or may not be a standard library](https://discourse.julialang.org/t/compat-entry-for-a-package-that-may-or-may-not-be-a-standard-library/52397)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 0\
**Last updated:** [December 26, 2020, 8:31am UTC](https://discourse.julialang.org/t/compat-entry-for-a-package-that-may-or-may-not-be-a-standard-library/52397 "2020-12-26T08:31:31Z")

</div>

TOML.jl currently (Julia \<=1.5) requires a \[compat\] entry for the General registry, but it will be a standard library for 1.6. Will that compat entry just be ignored then, or is it going to cause problems?

---

## [Assignment not effective in \`@spawn\` in function](https://discourse.julialang.org/t/assignment-not-effective-in-spawn-in-function/52382)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 4\
**Last updated:** [December 26, 2020, 1:25am UTC](https://discourse.julialang.org/t/assignment-not-effective-in-spawn-in-function/52382 "2020-12-26T01:25:11Z")

</div>

Define a simple function copying the contents of one array to another: function copy\_array!(array\_t::AbstractArray, array\_s::AbstractArray) array\_t .= array\_s return nothing end The following function performs…

---

## ["import MyPkg" uses old version of MyPkg](https://discourse.julialang.org/t/import-mypkg-uses-old-version-of-mypkg/52385)

<div class="topic-metadata">

**Author:** [@Volker\_Weissmann](https://discourse.julialang.org/u/Volker_Weissmann)\
**Replies:** 1\
**Last updated:** [December 25, 2020, 11:24pm UTC](https://discourse.julialang.org/t/import-mypkg-uses-old-version-of-mypkg/52385 "2020-12-25T23:24:59Z")

</div>

Hello, let’s say you are doing this: pkg\> dev path/to/MyPkg julia\> import MyPkg modify the contents of MyPkg/src/MyPkg.jl on disk julia\> import MyPkg julia\> MyPkg.func() In Julia 1.5 this executes the new versio…

---

## [Look up UUID of package by name in the General registry](https://discourse.julialang.org/t/look-up-uuid-of-package-by-name-in-the-general-registry/52369)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 5\
**Last updated:** [December 25, 2020, 10:08pm UTC](https://discourse.julialang.org/t/look-up-uuid-of-package-by-name-in-the-general-registry/52369 "2020-12-25T22:08:42Z")

</div>

How can I look up UUID of a package by name in the General registry (or return nothing if there is no such package?)

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

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