# General Usage

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

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

**Page:** 788

---

## [When plotting a choropleth map, how to "read" the appropriate value of the topojson file and the dataframe?](https://discourse.julialang.org/t/when-plotting-a-choropleth-map-how-to-read-the-appropriate-value-of-the-topojson-file-and-the-dataframe/34605)

<div class="topic-metadata">

**Author:** [@Aizzaac](https://discourse.julialang.org/u/Aizzaac)\
**Replies:** 21\
**Last updated:** [February 14, 2020, 8:51pm UTC](https://discourse.julialang.org/t/when-plotting-a-choropleth-map-how-to-read-the-appropriate-value-of-the-topojson-file-and-the-dataframe/34605 "2020-02-14T20:51:28Z")

</div>

Hi @oheil @davidanthoff I want to plot a choropleth map using a topojson (I converted the .shp file to a topojson) and a dataframe. The topojson has the “polygons”, coordinates", and the names of the districts. T…

---

## [How to include into local scope?](https://discourse.julialang.org/t/how-to-include-into-local-scope/34634)

<div class="topic-metadata">

**Author:** [@HenrikM](https://discourse.julialang.org/u/HenrikM)\
**Replies:** 27\
**Last updated:** [February 14, 2020, 8:14pm UTC](https://discourse.julialang.org/t/how-to-include-into-local-scope/34634 "2020-02-14T20:14:34Z")

</div>

In quick and dirty development/testing, the ability to just copy-paste code is very handy. If a snippet is used a lot, it can be elevated to a function later. Is there a way to evaluate a file in local scope? The Base.i…

---

## [Glfw examples ? (or general advice using opengl in julia)](https://discourse.julialang.org/t/glfw-examples-or-general-advice-using-opengl-in-julia/34558)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 5\
**Last updated:** [February 14, 2020, 7:18pm UTC](https://discourse.julialang.org/t/glfw-examples-or-general-advice-using-opengl-in-julia/34558 "2020-02-14T19:18:43Z")

</div>

From the Julia package GLFW page: “The Julia interface is almost identical to the underlying C interface, with a few notable differences:” while that’s true, figuring out how to translate things like, glShaderSource(…

---

## [Pointers to structs](https://discourse.julialang.org/t/pointers-to-structs/34629)

<div class="topic-metadata">

**Author:** [@rvignolo](https://discourse.julialang.org/u/rvignolo)\
**Replies:** 10\
**Last updated:** [February 14, 2020, 6:33pm UTC](https://discourse.julialang.org/t/pointers-to-structs/34629 "2020-02-14T18:33:29Z")

</div>

Hi all, I am having trouble defining simple structs and I would like your help! The main issue is how to define a pointer to a struct of type Inner inside a struct of type Outer. So, the first idea is pretty obvious an…

---

## [How a ghost variable never appear but always reported not defined](https://discourse.julialang.org/t/how-a-ghost-variable-never-appear-but-always-reported-not-defined/34630)

<div class="topic-metadata">

**Author:** [@1634](https://discourse.julialang.org/u/1634)\
**Replies:** 2\
**Last updated:** [February 14, 2020, 6:18pm UTC](https://discourse.julialang.org/t/how-a-ghost-variable-never-appear-but-always-reported-not-defined/34630 "2020-02-14T18:18:18Z")

</div>

There is no variable ‘A’ applied or assigned anywhere in this function. With multiple reboost of my laptop and atom, there is still the error report: ‘A not defined’. I really cannot fight against a ghost. Do anyone kno…

---

## [Proxy woes](https://discourse.julialang.org/t/proxy-woes/34441)

<div class="topic-metadata">

**Author:** [@wfrgra](https://discourse.julialang.org/u/wfrgra)\
**Replies:** 2\
**Last updated:** [February 14, 2020, 5:38pm UTC](https://discourse.julialang.org/t/proxy-woes/34441 "2020-02-14T17:38:42Z")

</div>

Hi all, I’m trying to set up Julia at a new workplace and am having some problems with the proxy. I’m using a fresh install of Julia 1.3 on Windows 10. I’ve set ENV\["HTTP\_PROXY"\]="http://proxy\_address:proxy\_port" ENV…

---

## [How to generate a minidump and backtrace for a hanging Julia program on Appveyor/Windows?](https://discourse.julialang.org/t/how-to-generate-a-minidump-and-backtrace-for-a-hanging-julia-program-on-appveyor-windows/33451)

<div class="topic-metadata">

**Author:** [@vlandau](https://discourse.julialang.org/u/vlandau)\
**Replies:** 12\
**Last updated:** [February 14, 2020, 4:56pm UTC](https://discourse.julialang.org/t/how-to-generate-a-minidump-and-backtrace-for-a-hanging-julia-program-on-appveyor-windows/33451 "2020-02-14T16:56:34Z")

</div>

Hello all, I have what appears to be a deadlock(?) bug in my Julia package that is exposed only on Appveyor, and only when I test through the CI – if I enter the Appveyor VM through RDP and manually run tests, they pass…

---

## [Calling module name using string variable](https://discourse.julialang.org/t/calling-module-name-using-string-variable/34632)

<div class="topic-metadata">

**Author:** [@Masicko](https://discourse.julialang.org/u/Masicko)\
**Replies:** 2\
**Last updated:** [February 14, 2020, 3:41pm UTC](https://discourse.julialang.org/t/calling-module-name-using-string-variable/34632 "2020-02-14T15:41:55Z")

</div>

Hello, I would like to specify by string, which module should be used. Something like i have a file foo.jl module foo something = 1.0 end and in the another file (e. g. the\_main\_file.jl) module\_name = "foo" includ…

---

## [How to extract a file in a zip archive (without using OS specific tools)?](https://discourse.julialang.org/t/how-to-extract-a-file-in-a-zip-archive-without-using-os-specific-tools/34585)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 4\
**Last updated:** [February 14, 2020, 11:16am UTC](https://discourse.julialang.org/t/how-to-extract-a-file-in-a-zip-archive-without-using-os-specific-tools/34585 "2020-02-14T11:16:26Z")

</div>

I am trying to extract a file from a zip archive using ZipFile.jl, but I don’t know how to write it back to disk: using ZipFile zarchive = ZipFile.Reader("myarchive.zip") myf = zarchive.files\[1\] out = open(myf.name,"w"…

---

## [CSV stuck on old version](https://discourse.julialang.org/t/csv-stuck-on-old-version/34581)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 12\
**Last updated:** [February 13, 2020, 10:54pm UTC](https://discourse.julialang.org/t/csv-stuck-on-old-version/34581 "2020-02-13T22:54:44Z")

</div>

I made a package (it’s useful only to me and formats data to a database format I need): https://github.com/yakir12/Format2DB.jl where the CSV.jl dependency is set to v0.5.23. But if I start a new fresh environment an…

---

## [Fast alternative to mutable struct](https://discourse.julialang.org/t/fast-alternative-to-mutable-struct/34593)

<div class="topic-metadata">

**Author:** [@kaltsoplyn](https://discourse.julialang.org/u/kaltsoplyn)\
**Replies:** 10\
**Last updated:** [February 13, 2020, 10:02pm UTC](https://discourse.julialang.org/t/fast-alternative-to-mutable-struct/34593 "2020-02-13T22:02:50Z")

</div>

Hi, first discourse topic/question ever, please do tell if this is the wrong place for this type of question. (I’m also new to Julia, so this might be trivial.) I have a function, with a couple of keyword arguments. (D…

---

## [MLJ- Unpack not defined](https://discourse.julialang.org/t/mlj-unpack-not-defined/34577)

<div class="topic-metadata">

**Author:** [@Phillip\_Sutton](https://discourse.julialang.org/u/Phillip_Sutton)\
**Replies:** 5\
**Last updated:** [February 13, 2020, 9:54pm UTC](https://discourse.julialang.org/t/mlj-unpack-not-defined/34577 "2020-02-13T21:54:49Z")

</div>

Getting an error when attempting to unpack the Boston RDataset y, X = MLJBase.unpack(boston, ==(Symbol(outcome\_name)), colname -\> true) UndefVarError: unpack not defined Stacktrace: \[1\] getproperty(::Module, ::Symbol)…

---

## [Is it possible to manipulate GR plots with keyboard and/or mouse?](https://discourse.julialang.org/t/is-it-possible-to-manipulate-gr-plots-with-keyboard-and-or-mouse/34592)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 3\
**Last updated:** [February 13, 2020, 8:12pm UTC](https://discourse.julialang.org/t/is-it-possible-to-manipulate-gr-plots-with-keyboard-and-or-mouse/34592 "2020-02-13T20:12:49Z")

</div>

Zoom in/out, pan, rotate, … The usual stuff. I could not even find how to grab input from GR. Is that possible?

---

## [Find the maximum of a multivariable (arbitrary) function](https://discourse.julialang.org/t/find-the-maximum-of-a-multivariable-arbitrary-function/34578)

<div class="topic-metadata">

**Author:** [@samantp](https://discourse.julialang.org/u/samantp)\
**Replies:** 1\
**Last updated:** [February 13, 2020, 8:03pm UTC](https://discourse.julialang.org/t/find-the-maximum-of-a-multivariable-arbitrary-function/34578 "2020-02-13T20:03:47Z")

</div>

Does anyone know of some helpful functions in a stats package somewhere that can help me solve the following optimization problem? So, I have 2 datasets, DVH1 and DVH2. I also have a function, NTCP, this is a known fun…

---

## [How to change the data type of a specific column of a dataframe?](https://discourse.julialang.org/t/how-to-change-the-data-type-of-a-specific-column-of-a-dataframe/34598)

<div class="topic-metadata">

**Author:** [@Aizzaac](https://discourse.julialang.org/u/Aizzaac)\
**Replies:** 3\
**Last updated:** [February 13, 2020, 7:35pm UTC](https://discourse.julialang.org/t/how-to-change-the-data-type-of-a-specific-column-of-a-dataframe/34598 "2020-02-13T19:35:03Z")

</div>

Hi I have a dataframe of 5 columns. All of them are of type “string”. I want to convert column 2 (“count”) from String to Int 16. So far I have tried: df\_splunkie\[:count\]=Int16(df\_splunkie\[:count\]) This is the error…

---

## [How to hijack UnionAll type creation process?](https://discourse.julialang.org/t/how-to-hijack-unionall-type-creation-process/34599)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 2\
**Last updated:** [February 13, 2020, 7:31pm UTC](https://discourse.julialang.org/t/how-to-hijack-unionall-type-creation-process/34599 "2020-02-13T19:31:35Z")

</div>

Hi, is it possible to do such a thing? struct MM{T} x::T end #when I do this MM{Int} #I want it to return MM{Float64} I tried the following but didn’t work: function (::Base.Type{Type{MM}})(::Type{Int}) …

---

## [Can Zygote do derivatives w.r.t. keyword arguments which get captured in \`kwargs...\`?](https://discourse.julialang.org/t/can-zygote-do-derivatives-w-r-t-keyword-arguments-which-get-captured-in-kwargs/34553)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 7\
**Last updated:** [February 13, 2020, 6:31pm UTC](https://discourse.julialang.org/t/can-zygote-do-derivatives-w-r-t-keyword-arguments-which-get-captured-in-kwargs/34553 "2020-02-13T18:31:18Z")

</div>

Zygote can do derivatives w.r.t. to keyword arguments, which is super cool: foo(;x) = x^2 gradient(x -\> foo(x=x), 2) # gives 4 In my case though, I’m doing some programatic stuff with the keywords of a certain function…

---

## [Addition and UnitRange](https://discourse.julialang.org/t/addition-and-unitrange/34573)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 5\
**Last updated:** [February 13, 2020, 3:48pm UTC](https://discourse.julialang.org/t/addition-and-unitrange/34573 "2020-02-13T15:48:23Z")

</div>

Is there a reason, why (1:23) \* 2 works, but not (1:23) + 2?

---

## [Dispatch in macro?](https://discourse.julialang.org/t/dispatch-in-macro/34565)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 16\
**Last updated:** [February 13, 2020, 3:40pm UTC](https://discourse.julialang.org/t/dispatch-in-macro/34565 "2020-02-13T15:40:27Z")

</div>

suppose I have two custom types A and B, and I wanna build a macro or a generated function that gives different behaviors according to the type, how could I do? I tried the following: struct A data::Int end struct …

---

## [How can I plot a choropleth map from a dataframe?](https://discourse.julialang.org/t/how-can-i-plot-a-choropleth-map-from-a-dataframe/34479)

<div class="topic-metadata">

**Author:** [@Aizzaac](https://discourse.julialang.org/u/Aizzaac)\
**Replies:** 11\
**Last updated:** [February 13, 2020, 3:29pm UTC](https://discourse.julialang.org/t/how-can-i-plot-a-choropleth-map-from-a-dataframe/34479 "2020-02-13T15:29:03Z")

</div>

Hi I have a dataframe with 4 columns: DA\_ID (these are districts) MBR points (these are the coordenates) count (these are the number of times an incident happened. it is just an integer from 0 to 8094). It looks like…

---

## [How to view/ingest data with VegaLite?](https://discourse.julialang.org/t/how-to-view-ingest-data-with-vegalite/34539)

<div class="topic-metadata">

**Author:** [@Aizzaac](https://discourse.julialang.org/u/Aizzaac)\
**Replies:** 2\
**Last updated:** [February 13, 2020, 3:26pm UTC](https://discourse.julialang.org/t/how-to-view-ingest-data-with-vegalite/34539 "2020-02-13T15:26:11Z")

</div>

Hi I have a topojson file and a dataframe. Using a DataFrame I can see a “table” with all my values. But how can I do that using VegaLite? Most of the given examples in the documentation have examples with the Vega da…

---

## [I do not understand this error: MethodError: no method matching iterate(::DataFrame)](https://discourse.julialang.org/t/i-do-not-understand-this-error-methoderror-no-method-matching-iterate-dataframe/34530)

<div class="topic-metadata">

**Author:** [@Aizzaac](https://discourse.julialang.org/u/Aizzaac)\
**Replies:** 8\
**Last updated:** [February 13, 2020, 3:25pm UTC](https://discourse.julialang.org/t/i-do-not-understand-this-error-methoderror-no-method-matching-iterate-dataframe/34530 "2020-02-13T15:25:09Z")

</div>

Hi I want to know what a function is doing. The function can be found here: \[https://nbviewer.jupyter.org/github/JuliaX/iap2014/blob/master/GeoData.ipynb\] I have a dataframe which have columns with type “Shapefile”. …

---

## [Could not resolve host on Win10](https://discourse.julialang.org/t/could-not-resolve-host-on-win10/34008)

<div class="topic-metadata">

**Author:** [@YermolenkoIgor](https://discourse.julialang.org/u/YermolenkoIgor)\
**Replies:** 1\
**Last updated:** [February 13, 2020, 3:07pm UTC](https://discourse.julialang.org/t/could-not-resolve-host-on-win10/34008 "2020-02-13T15:07:39Z")

</div>

‘’’ julia\> versioninfo() Julia Version 1.3.1 Commit 2d5741174c (2019-12-30 21:36 UTC) Platform Info: OS: Windows (i686-w64-mingw32) CPU: Pentium(R) Dual-Core CPU E6500 @ 2.93GHz WORD\_SIZE: 32 LIBM: libopen…

---

## [Problem with ENV in a precompiled package](https://discourse.julialang.org/t/problem-with-env-in-a-precompiled-package/34534)

<div class="topic-metadata">

**Author:** [@wolfgang](https://discourse.julialang.org/u/wolfgang)\
**Replies:** 2\
**Last updated:** [February 13, 2020, 2:44pm UTC](https://discourse.julialang.org/t/problem-with-env-in-a-precompiled-package/34534 "2020-02-13T14:44:34Z")

</div>

I have a problem understanding how to program evaluation of an ENV value into a package. I am kind of unhappy with the RainbowBrackets of OhMyREPL because of low contrast. I understand how I can get rid of them, but I th…

---

## [Gradient of jacobian in Flux v0.10 (zygote)](https://discourse.julialang.org/t/gradient-of-jacobian-in-flux-v0-10-zygote/34572)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 0\
**Last updated:** [February 13, 2020, 1:22pm UTC](https://discourse.julialang.org/t/gradient-of-jacobian-in-flux-v0-10-zygote/34572 "2020-02-13T13:22:31Z")

</div>

Hi all, in our project on modelling probability distributions we need to calculate a gradient of a function, which involves jacobian of the model. Zygote (Flux) crashes with the output that mutating arrays are not suppo…

---

## [ERROR: The following package names could not be resolved - JWAS to perform GWAS](https://discourse.julialang.org/t/error-the-following-package-names-could-not-be-resolved-jwas-to-perform-gwas/34519)

<div class="topic-metadata">

**Author:** [@ayelna](https://discourse.julialang.org/u/ayelna)\
**Replies:** 7\
**Last updated:** [February 13, 2020, 9:31am UTC](https://discourse.julialang.org/t/error-the-following-package-names-could-not-be-resolved-jwas-to-perform-gwas/34519 "2020-02-13T09:31:31Z")

</div>

I am using Julia ( Version 1.0.3) for the first time under linux and I tried to install JWAS package to perform GWAS analysis but unfortantly I got the following error: ERROR: The following package names could not be re…

---

## [Check within struct building](https://discourse.julialang.org/t/check-within-struct-building/34522)

<div class="topic-metadata">

**Author:** [@virgile-baudrot](https://discourse.julialang.org/u/virgile-baudrot)\
**Replies:** 2\
**Last updated:** [February 13, 2020, 8:36am UTC](https://discourse.julialang.org/t/check-within-struct-building/34522 "2020-02-13T08:36:30Z")

</div>

How to add a check between elements of a structure? For instance, how this example couold work? struct paramChecked a::Real b::Real if(a\>b) error("a \> b") end end Thanks

---

## [Using Julia in my Anaconda environment](https://discourse.julialang.org/t/using-julia-in-my-anaconda-environment/34562)

<div class="topic-metadata">

**Author:** [@Nalt](https://discourse.julialang.org/u/Nalt)\
**Replies:** 1\
**Last updated:** [February 13, 2020, 7:47am UTC](https://discourse.julialang.org/t/using-julia-in-my-anaconda-environment/34562 "2020-02-13T07:47:59Z")

</div>

I want to better understand how my Anconda environment and Julia is interacting. In my conda environment I launch julia via: jupyter notebook. I installed the jupyterthemes Package to my conda environment via: pip insta…

---

## [How to design with immutable and also mutable type?](https://discourse.julialang.org/t/how-to-design-with-immutable-and-also-mutable-type/34465)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 21\
**Last updated:** [February 13, 2020, 6:11am UTC](https://discourse.julialang.org/t/how-to-design-with-immutable-and-also-mutable-type/34465 "2020-02-13T06:11:48Z")

</div>

suppose I have a parametric type as follows: struct A{T \<: AbstractVector{Float32} } data::T end setdata!(a::A, x) = (a.data .= x) here T could be Vector{Float32} or a view etc. however, I would like to use SVect…

---

## [How to solve error while running parallel sampling in Julia with Turing and Distributed package?](https://discourse.julialang.org/t/how-to-solve-error-while-running-parallel-sampling-in-julia-with-turing-and-distributed-package/34551)

<div class="topic-metadata">

**Author:** [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Replies:** 5\
**Last updated:** [February 13, 2020, 4:42am UTC](https://discourse.julialang.org/t/how-to-solve-error-while-running-parallel-sampling-in-julia-with-turing-and-distributed-package/34551 "2020-02-13T04:42:08Z")

</div>

Hi, I am trying to run samplers in parallel by using example code in Turing documentation (Parallel Sampling). When I run the following example, I am getting an error. The example is as follows: using Distributed addpr…

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

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