# General Usage

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

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

**Page:** 843

---

## [(Gtk.jl) Why does this MWE not produce an animation and only show the last updated draw call?](https://discourse.julialang.org/t/gtk-jl-why-does-this-mwe-not-produce-an-animation-and-only-show-the-last-updated-draw-call/27250)

<div class="topic-metadata">

**Author:** [@mantzaris](https://discourse.julialang.org/u/mantzaris)\
**Replies:** 5\
**Last updated:** [August 9, 2019, 7:16am UTC](https://discourse.julialang.org/t/gtk-jl-why-does-this-mwe-not-produce-an-animation-and-only-show-the-last-updated-draw-call/27250 "2019-08-09T07:16:25Z")

</div>

Using Gtk.jl I would like to be able to produce an animation within a canvas widget. I have this MWE, which when run, produces a window with 2 buttons and a canvas. The first button each time pressed changes the canvas t…

---

## [A question about variable scope](https://discourse.julialang.org/t/a-question-about-variable-scope/27335)

<div class="topic-metadata">

**Author:** [@wenqi\_kou](https://discourse.julialang.org/u/wenqi_kou)\
**Replies:** 7\
**Last updated:** [August 9, 2019, 1:02am UTC](https://discourse.julialang.org/t/a-question-about-variable-scope/27335 "2019-08-09T01:02:03Z")

</div>

I met a problem that make me confused. It is about the scope of variable in Julia. x = 1 while x \<= 10 x=x+1 println(x) end In this case, julia shows “UndefVarError: x not defined”. Can anyone explain to me…

---

## [ERROR: syntax: extra token "for" after end of expression](https://discourse.julialang.org/t/error-syntax-extra-token-for-after-end-of-expression/27317)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [August 8, 2019, 8:32pm UTC](https://discourse.julialang.org/t/error-syntax-extra-token-for-after-end-of-expression/27317 "2019-08-08T20:32:41Z")

</div>

Hi, the following is the code. function f(a,b) return a+b end then, julia\> f(i,i) for i=1:3 I got an error message, saying that extra token “for” after end of expression. On the other hand, sum( f(i,i) for i …

---

## [Git sha of a project using Pkg](https://discourse.julialang.org/t/git-sha-of-a-project-using-pkg/27211)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 8\
**Last updated:** [August 8, 2019, 8:22pm UTC](https://discourse.julialang.org/t/git-sha-of-a-project-using-pkg/27211 "2019-08-08T20:22:29Z")

</div>

I am running an estimation as a batch job on a server, saving the results in a JSON file. I would like to add the git sha of the project as extra infromation (so that we can backtrack if necessary), how can I obtain it …

---

## [Windows C++ binary compatibility: MinGW vs MSVC](https://discourse.julialang.org/t/windows-c-binary-compatibility-mingw-vs-msvc/1250)

<div class="topic-metadata">

**Author:** [@barche](https://discourse.julialang.org/u/barche)\
**Replies:** 22\
**Last updated:** [August 8, 2019, 12:06pm UTC](https://discourse.julialang.org/t/windows-c-binary-compatibility-mingw-vs-msvc/1250 "2019-08-08T12:06:51Z")

</div>

Creating a new topic to continue the discussion about binary and compiler compatibility started here in the context of QML.jl. All of this is in the context of CxxWrap.jl, where C++ code is made available in Julia by bu…

---

## [Tracking changes for unregistered packages](https://discourse.julialang.org/t/tracking-changes-for-unregistered-packages/27289)

<div class="topic-metadata">

**Author:** [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Replies:** 4\
**Last updated:** [August 8, 2019, 11:46am UTC](https://discourse.julialang.org/t/tracking-changes-for-unregistered-packages/27289 "2019-08-08T11:46:10Z")

</div>

I am developing package P with dependency D on a local computer. Both packages are unregistered. Locally, changes are tracked by using Pkg.develop(D) and Revise. The actual computations are run on a remote machine. Th…

---

## [NamedTupleTools.jl](https://discourse.julialang.org/t/namedtupletools-jl/27308)

<div class="topic-metadata">

**Author:** [@lamviec4](https://discourse.julialang.org/u/lamviec4)\
**Replies:** 1\
**Last updated:** [August 8, 2019, 10:21am UTC](https://discourse.julialang.org/t/namedtupletools-jl/27308 "2019-08-08T10:21:46Z")

</div>

NamedTupleTools is a small package that makes doing a few things with NamedTuples a bit easier. (Julia v1.0) using NamedTupleTools julia\> namedtuple(:a, :b, :c)(1, 2.0, “three”) (a = 1, b = 2.0, c = “three”) #= n…

---

## [How to shorten type definition with many AbstractArray fields?](https://discourse.julialang.org/t/how-to-shorten-type-definition-with-many-abstractarray-fields/27301)

<div class="topic-metadata">

**Author:** [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Replies:** 3\
**Last updated:** [August 8, 2019, 8:37am UTC](https://discourse.julialang.org/t/how-to-shorten-type-definition-with-many-abstractarray-fields/27301 "2019-08-08T08:37:14Z")

</div>

I have a struct like: mutable struct MyType{A\<:AbstractArray, B\<:AbstractArray, C\<:AbstractArray, D\<:AbstractArray} vertices::A normals::B subsets::C isenabled::BitArray{1} size::Int levelweight:…

---

## [How to get the code behind an anonymous function represented as Symbol("##...")](https://discourse.julialang.org/t/how-to-get-the-code-behind-an-anonymous-function-represented-as-symbol/27279)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 2\
**Last updated:** [August 8, 2019, 8:03am UTC](https://discourse.julialang.org/t/how-to-get-the-code-behind-an-anonymous-function-represented-as-symbol/27279 "2019-08-08T08:03:54Z")

</div>

I’m extensively using code like this: route("/") do "Hello World" end which gets custom printed as: \[GET\] / =\> getfield(Main, Symbol("##3#4"))() It would be a lot more usable and informative if I could actually ret…

---

## [Error with \`using\` on remote worker](https://discourse.julialang.org/t/error-with-using-on-remote-worker/17900)

<div class="topic-metadata">

**Author:** [@ivborissov](https://discourse.julialang.org/u/ivborissov)\
**Replies:** 1\
**Last updated:** [November 23, 2018, 3:48pm UTC](https://discourse.julialang.org/t/error-with-using-on-remote-worker/17900 "2018-11-23T15:48:06Z")

</div>

I am on Julia 0.7 and I add remote workers with ClusterManagers and addprocs\_htc (HTCondor). Workers connect to my master worker and I can run code on them but I encounter an error with @everywhere using. For example: @…

---

## [Plot is not displaying while using Makie package for interactive visualization](https://discourse.julialang.org/t/plot-is-not-displaying-while-using-makie-package-for-interactive-visualization/27203)

<div class="topic-metadata">

**Author:** [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Replies:** 10\
**Last updated:** [August 8, 2019, 4:55am UTC](https://discourse.julialang.org/t/plot-is-not-displaying-while-using-makie-package-for-interactive-visualization/27203 "2019-08-08T04:55:56Z")

</div>

Hi, I am trying to use Mackie for interactive 3D visualization. But after running program from Makie documentation example, I am not getting any plots. using Makie using LinearAlgebra res = 500 game = Scene(resolution…

---

## [Prevent Task from yielding](https://discourse.julialang.org/t/prevent-task-from-yielding/27263)

<div class="topic-metadata">

**Author:** [@jackf](https://discourse.julialang.org/u/jackf)\
**Replies:** 1\
**Last updated:** [August 8, 2019, 12:01am UTC](https://discourse.julialang.org/t/prevent-task-from-yielding/27263 "2019-08-08T00:01:04Z")

</div>

I was thinking this morning about the new 1.3 Task system. Is there any way to prevent a particular task from yielding, even if it is doing operations that would usually yield e.g. i/o, sleeping etc?

---

## [Increase a range object by some amount](https://discourse.julialang.org/t/increase-a-range-object-by-some-amount/27286)

<div class="topic-metadata">

**Author:** [@mgalenb](https://discourse.julialang.org/u/mgalenb)\
**Replies:** 8\
**Last updated:** [August 7, 2019, 11:24pm UTC](https://discourse.julialang.org/t/increase-a-range-object-by-some-amount/27286 "2019-08-07T23:24:29Z")

</div>

Hello, I am trying to increase a range object that has already been created. Basically, I have a range 1,2,3,..,8,9,10 and then i want to add 11,12,13 to the same range object so that i will get a final range of 1,2,3,.…

---

## [Can I write a DelimitedFile with a header?](https://discourse.julialang.org/t/can-i-write-a-delimitedfile-with-a-header/27270)

<div class="topic-metadata">

**Author:** [@alvrg](https://discourse.julialang.org/u/alvrg)\
**Replies:** 2\
**Last updated:** [August 7, 2019, 3:04pm UTC](https://discourse.julialang.org/t/can-i-write-a-delimitedfile-with-a-header/27270 "2019-08-07T15:04:41Z")

</div>

Hi, I would like to save a matrix in txt format (I know there are better alternatives, but this is a two-liner). I can do that with using DelimitedFiles A = \[\[1 2\]; \[3 4\]\] writedlm("./data.txt", A) Can I also write a …

---

## [CxxWrap and visual C++ linkage error](https://discourse.julialang.org/t/cxxwrap-and-visual-c-linkage-error/27217)

<div class="topic-metadata">

**Author:** [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Replies:** 3\
**Last updated:** [August 7, 2019, 9:47am UTC](https://discourse.julialang.org/t/cxxwrap-and-visual-c-linkage-error/27217 "2019-08-07T09:47:33Z")

</div>

I’ve been trying to use CxxWrap with the minimal example from the readme, using MS visual C 2017 (and 2015), CxxWrap 0.8.2 on Win10 64 bit and in both cases I’ve ended with Creating library C:/Users/petr.hlavenka/.julia…

---

## [Problem with NaN's when plugging minimizing vectors (NLopt) back into function](https://discourse.julialang.org/t/problem-with-nans-when-plugging-minimizing-vectors-nlopt-back-into-function/27154)

<div class="topic-metadata">

**Author:** [@CPPhysics](https://discourse.julialang.org/u/CPPhysics)\
**Replies:** 8\
**Last updated:** [August 7, 2019, 5:15am UTC](https://discourse.julialang.org/t/problem-with-nans-when-plugging-minimizing-vectors-nlopt-back-into-function/27154 "2019-08-07T05:15:54Z")

</div>

Hello, first off I don’t have a working example due to research privacy and I know that will make things much harder to debug. But I would like to see if anyone recognizes this problem by chance. I have a function, whic…

---

## [Efficiently traverse binary tree represented as tuple of tuples](https://discourse.julialang.org/t/efficiently-traverse-binary-tree-represented-as-tuple-of-tuples/26989)

<div class="topic-metadata">

**Author:** [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Replies:** 9\
**Last updated:** [August 7, 2019, 2:25am UTC](https://discourse.julialang.org/t/efficiently-traverse-binary-tree-represented-as-tuple-of-tuples/26989 "2019-08-07T02:25:51Z")

</div>

I’m trying to see if I can squeeze out a bit more performance from the Julia implementation of the computer language benchmark game binary trees test. One thing I noticed was that I could create binary trees very fas…

---

## [Delete Function for a struct instance](https://discourse.julialang.org/t/delete-function-for-a-struct-instance/27248)

<div class="topic-metadata">

**Author:** [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Replies:** 2\
**Last updated:** [August 7, 2019, 12:56am UTC](https://discourse.julialang.org/t/delete-function-for-a-struct-instance/27248 "2019-08-07T00:56:25Z")

</div>

Hello internet. I’m defining my own struct, and it does something on PC internals when it is created. I would to perform other operations (some deleting files) when the struct instance is no more in use. Here an simple …

---

## [Empty dataframe row as a copy of existing DF](https://discourse.julialang.org/t/empty-dataframe-row-as-a-copy-of-existing-df/27245)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 1\
**Last updated:** [August 6, 2019, 11:20pm UTC](https://discourse.julialang.org/t/empty-dataframe-row-as-a-copy-of-existing-df/27245 "2019-08-06T23:20:31Z")

</div>

I found a question very similar to this but it doesn’t work for my situation. I have an existing dataframe. I’m using groupby on it, however, the function which looks at the group is an all or nothing evalution. That i…

---

## [Status of Power9 support?](https://discourse.julialang.org/t/status-of-power9-support/27228)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 4\
**Last updated:** [August 6, 2019, 11:04pm UTC](https://discourse.julialang.org/t/status-of-power9-support/27228 "2019-08-06T23:04:52Z")

</div>

I’m curious, what’s the current status of Julia 1.x on Power9? The reason I’m asking is that while comparatively few people have access to Power9 systems, some of the few relevant Power9 systems (e.g. Summit/Sierra) are…

---

## [Modify arrays in function](https://discourse.julialang.org/t/modify-arrays-in-function/27243)

<div class="topic-metadata">

**Author:** [@elemenopeereste](https://discourse.julialang.org/u/elemenopeereste)\
**Replies:** 4\
**Last updated:** [August 6, 2019, 10:14pm UTC](https://discourse.julialang.org/t/modify-arrays-in-function/27243 "2019-08-06T22:14:22Z")

</div>

How to modify array t=\[1,2,3\] in function like function dosth!( arg ) . . . end In body i wanna in first case change my array to empty(arg = \[ \] ), in second case change table something like ( arg = arg\[2:end\] ) Af…

---

## [How to run a Process in background but still close it on exit?](https://discourse.julialang.org/t/how-to-run-a-process-in-background-but-still-close-it-on-exit/27231)

<div class="topic-metadata">

**Author:** [@NHDaly](https://discourse.julialang.org/u/NHDaly)\
**Replies:** 2\
**Last updated:** [August 6, 2019, 7:36pm UTC](https://discourse.julialang.org/t/how-to-run-a-process-in-background-but-still-close-it-on-exit/27231 "2019-08-06T19:36:30Z")

</div>

In development for the PProf.jl package, we want to spawn a child process (pprof -web ...), and have it run in the background, so that you can keep using julia with the webserver open. (This suggestion came from @gdkrmr,…

---

## [How to read TIFF metadata (tags) as strings in Julia?](https://discourse.julialang.org/t/how-to-read-tiff-metadata-tags-as-strings-in-julia/27121)

<div class="topic-metadata">

**Author:** [@vlandau](https://discourse.julialang.org/u/vlandau)\
**Replies:** 2\
**Last updated:** [August 6, 2019, 7:27pm UTC](https://discourse.julialang.org/t/how-to-read-tiff-metadata-tags-as-strings-in-julia/27121 "2019-08-06T19:27:11Z")

</div>

Hi all, I’m trying to find a way to read .tif image tags as strings to I can get metadata from the image. Specifically, I need to read in a GeoTiff and access several properties of the image to maintain its spatial refe…

---

## [Package registration bottleneck?](https://discourse.julialang.org/t/package-registration-bottleneck/27223)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 5\
**Last updated:** [August 6, 2019, 3:53pm UTC](https://discourse.julialang.org/t/package-registration-bottleneck/27223 "2019-08-06T15:53:22Z")

</div>

I might’ve been extra eager and pushed 2 version updates for Genie over the weekend, out of which none has been merged yet. Wondering: is there any kind of best practice in making registration requests - I don’t want …

---

## [Atom REPL cannot display anything](https://discourse.julialang.org/t/atom-repl-cannot-display-anything/27219)

<div class="topic-metadata">

**Author:** [@Rouzaire](https://discourse.julialang.org/u/Rouzaire)\
**Replies:** 0\
**Last updated:** [August 6, 2019, 2:12pm UTC](https://discourse.julialang.org/t/atom-repl-cannot-display-anything/27219 "2019-08-06T14:12:07Z")

</div>

Hello, I updated julia-client to 0.8.12-beta2 this morning and since then I encountered the following problem : after (and not before) running my (parallelized) code, any entry in the REPL console produces the same out…

---

## [Primitive parametric types](https://discourse.julialang.org/t/primitive-parametric-types/27173)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 5\
**Last updated:** [August 6, 2019, 9:12am UTC](https://discourse.julialang.org/t/primitive-parametric-types/27173 "2019-08-06T09:12:23Z")

</div>

Is it possible to specify the bit size of a primitive type as a parameter? If I try: primitive type MyType{B,T,D} \<: Number B end I get : ERROR: invalid declaration of primitive type MyType additionally, I would lik…

---

## [" Adjusting nev from # to # ". eigs() on a Sparse Array using Arpack](https://discourse.julialang.org/t/adjusting-nev-from-to-eigs-on-a-sparse-array-using-arpack/27163)

<div class="topic-metadata">

**Author:** [@Adan](https://discourse.julialang.org/u/Adan)\
**Replies:** 3\
**Last updated:** [August 6, 2019, 7:06am UTC](https://discourse.julialang.org/t/adjusting-nev-from-to-eigs-on-a-sparse-array-using-arpack/27163 "2019-08-06T07:06:36Z")

</div>

Hi there! I’m trying to solve an eigenvalues problem. Originally I have a 792x792 matrix that I turned into a Sparse Array. For that purpose I’m using Arpack and eigs( ). The dimension of that array is 792 so I expect t…

---

## [\`inmin\` and \`inmax\` not defined](https://discourse.julialang.org/t/inmin-and-inmax-not-defined/27175)

<div class="topic-metadata">

**Author:** [@ryanorsinger](https://discourse.julialang.org/u/ryanorsinger)\
**Replies:** 5\
**Last updated:** [August 5, 2019, 11:31pm UTC](https://discourse.julialang.org/t/inmin-and-inmax-not-defined/27175 "2019-08-05T23:31:16Z")

</div>

Good day! I’m working though “Julia for Data Science” by Voulgaris, and in Chapter 2, the global functions inmin and inmax are not defined. Because the book is written in Julia 0.4. I searched https://docs.julialang.org…

---

## [Making VulkanCore.jl work with latest version of Julia](https://discourse.julialang.org/t/making-vulkancore-jl-work-with-latest-version-of-julia/27108)

<div class="topic-metadata">

**Author:** [@rapasite](https://discourse.julialang.org/u/rapasite)\
**Replies:** 5\
**Last updated:** [August 5, 2019, 7:43pm UTC](https://discourse.julialang.org/t/making-vulkancore-jl-work-with-latest-version-of-julia/27108 "2019-08-05T19:43:07Z")

</div>

ERROR: Unsatisfiable requirements detected for package VulkanCore \[16167f82\]: VulkanCore \[16167f82\] log: ├─possible versions are: 1.0.0 or uninstalled ├─restricted to versions \* by an explicit requirement, leaving onl…

---

## [Cannot install packages on Julia version 1.1.1 due to certificate validation failure](https://discourse.julialang.org/t/cannot-install-packages-on-julia-version-1-1-1-due-to-certificate-validation-failure/26973)

<div class="topic-metadata">

**Author:** [@R366Y](https://discourse.julialang.org/u/R366Y)\
**Replies:** 2\
**Last updated:** [August 5, 2019, 11:24am UTC](https://discourse.julialang.org/t/cannot-install-packages-on-julia-version-1-1-1-due-to-certificate-validation-failure/26973 "2019-08-05T11:24:11Z")

</div>

Hi , I’m new to Julia development and I’m trying to make some small programs in order to learn the language but I cannot install any package due to the error you can see below. I’m at work and I use several IDE like In…

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

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