# General Usage

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

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

**Page:** 593

---

## [Trouble running IJulia (could not open file .julia/packages/IJulia/IDNmS ...)](https://discourse.julialang.org/t/trouble-running-ijulia-could-not-open-file-julia-packages-ijulia-idnms/62234)

<div class="topic-metadata">

**Author:** [@srgree](https://discourse.julialang.org/u/srgree)\
**Replies:** 0\
**Last updated:** [June 1, 2021, 10:54pm UTC](https://discourse.julialang.org/t/trouble-running-ijulia-could-not-open-file-julia-packages-ijulia-idnms/62234 "2021-06-01T22:54:29Z")

</div>

Hello, I recently updated IJulia and am now having trouble starting the kernel from jupyter notebook. From the Terminal, I run jupyter notebook, which opens up jupyter in my browser. (base) ➜ Non-markovian-simulation-…

---

## [Multi layer Dict merge](https://discourse.julialang.org/t/multi-layer-dict-merge/27261)

<div class="topic-metadata">

**Author:** [@YongHee-Kim](https://discourse.julialang.org/u/YongHee-Kim)\
**Replies:** 6\
**Last updated:** [June 1, 2021, 10:52pm UTC](https://discourse.julialang.org/t/multi-layer-dict-merge/27261 "2021-06-01T22:52:45Z")

</div>

I was trying to merge multi-layered Dict which is… x = \[ Dict("d1"=\>"A1") Dict("d1b"=\>Dict("d2a"=\>"B1")) Dict("d1b"=\>Dict("d2b"=\>"C1"))\] julia\>merge(x...) Dict{String,Any} with 2 entries: "d1" =\> "A1" "d1b" …

---

## [Delete a module](https://discourse.julialang.org/t/delete-a-module/62226)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 2\
**Last updated:** [June 1, 2021, 8:47pm UTC](https://discourse.julialang.org/t/delete-a-module/62226 "2021-06-01T20:47:50Z")

</div>

Is it possible to delete a module so it can be GCed?

---

## [How to re-trigger pre-compilation](https://discourse.julialang.org/t/how-to-re-trigger-pre-compilation/62156)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 5\
**Last updated:** [June 1, 2021, 8:39pm UTC](https://discourse.julialang.org/t/how-to-re-trigger-pre-compilation/62156 "2021-06-01T20:39:53Z")

</div>

Hello, I need to re-create the .ji files of my user modules each time I updated my custom sys image. I am using a script to create the custom sys image and I suggest the users of my software to run it again each tim…

---

## [Use a String For a Variable name and convert Dictionaries to DataFrames](https://discourse.julialang.org/t/use-a-string-for-a-variable-name-and-convert-dictionaries-to-dataframes/62107)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 31\
**Last updated:** [June 1, 2021, 8:39pm UTC](https://discourse.julialang.org/t/use-a-string-for-a-variable-name-and-convert-dictionaries-to-dataframes/62107 "2021-06-01T20:39:48Z")

</div>

I’m working on an accounting program, and I want to be able to have a function or macro that adds new account values to my dataframe, or another form that works as a CSV, XLSX or Database. Accounts = Dict( # A Dictiona…

---

## [What is the best practice when you want to modify the source code of an existing package?](https://discourse.julialang.org/t/what-is-the-best-practice-when-you-want-to-modify-the-source-code-of-an-existing-package/62209)

<div class="topic-metadata">

**Author:** [@instrnts](https://discourse.julialang.org/u/instrnts)\
**Replies:** 6\
**Last updated:** [June 1, 2021, 4:59pm UTC](https://discourse.julialang.org/t/what-is-the-best-practice-when-you-want-to-modify-the-source-code-of-an-existing-package/62209 "2021-06-01T16:59:19Z")

</div>

I’m starting to use the package SQLite, and it has a function load! which writes rows from a dataframe into a sqlite database. I want this function to replace rows instead of inserting them. My current solution is to es…

---

## [Unitful: convert to nearest power of ten prefix](https://discourse.julialang.org/t/unitful-convert-to-nearest-power-of-ten-prefix/62150)

<div class="topic-metadata">

**Author:** [@MeinAccount](https://discourse.julialang.org/u/MeinAccount)\
**Replies:** 3\
**Last updated:** [June 1, 2021, 4:28pm UTC](https://discourse.julialang.org/t/unitful-convert-to-nearest-power-of-ten-prefix/62150 "2021-06-01T16:28:16Z")

</div>

Is there a way to convert to the appropriate prefix? From 10\_000ms to 10s and (10^(-6))ms to 1ns

---

## [Properly implement Base.hash() for custom type follow up](https://discourse.julialang.org/t/properly-implement-base-hash-for-custom-type-follow-up/62057)

<div class="topic-metadata">

**Author:** [@anon60034542](https://discourse.julialang.org/u/anon60034542)\
**Replies:** 11\
**Last updated:** [June 1, 2021, 3:25pm UTC](https://discourse.julialang.org/t/properly-implement-base-hash-for-custom-type-follow-up/62057 "2021-06-01T15:25:59Z")

</div>

Before my previous post gets bigger and confusing, I decided to try and implement my own custom hash() method based on the documentation and what was suggested in my previous post. I’m aware of AutoHashEquals.jl, but I …

---

## [Asynchronous Programming and "Threads.@threads for" with limited number of threads](https://discourse.julialang.org/t/asynchronous-programming-and-threads-threads-for-with-limited-number-of-threads/62138)

<div class="topic-metadata">

**Author:** [@AnBenLa](https://discourse.julialang.org/u/AnBenLa)\
**Replies:** 2\
**Last updated:** [June 1, 2021, 3:11pm UTC](https://discourse.julialang.org/t/asynchronous-programming-and-threads-threads-for-with-limited-number-of-threads/62138 "2021-06-01T15:11:50Z")

</div>

Hi, I hope I selected the right topic for my question. Please tell me if I did something wrong as it is my first time posting here. It seems as I am not able to use the @ symbol so I replaced it with \[at\]. I am worki…

---

## [Why doesn't work the module 'const Ref{Task}(@async nothing)' in my package?](https://discourse.julialang.org/t/why-doesnt-work-the-module-const-ref-task-async-nothing-in-my-package/62132)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 3\
**Last updated:** [June 1, 2021, 12:00pm UTC](https://discourse.julialang.org/t/why-doesnt-work-the-module-const-ref-task-async-nothing-in-my-package/62132 "2021-06-01T12:00:57Z")

</div>

Hey all, why can’t I use a module const like module A const TEST = Ref{Task}(@async nothing) end in a package. (@v1.6) pkg\> update Updating git-repo \`C:\\ProjectName\\packages\\julia\\ProjectName\` Updating \`C:\\Us…

---

## [Add a row to a dataframe](https://discourse.julialang.org/t/add-a-row-to-a-dataframe/62170)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 8\
**Last updated:** [June 1, 2021, 10:38am UTC](https://discourse.julialang.org/t/add-a-row-to-a-dataframe/62170 "2021-06-01T10:38:16Z")

</div>

spreadsheet = DataFrame( date=\["Jan 1, 2019"\], #start of the new year #List of Accounts # Start of 2019 #Assets chequing=\[0\], #replace with balance as of Jan 1, 2019 accounts\_reciveable=\[0\], #replace with b…

---

## [Problems registering a package](https://discourse.julialang.org/t/problems-registering-a-package/62182)

<div class="topic-metadata">

**Author:** [@Andrea\_Vigliotti](https://discourse.julialang.org/u/Andrea_Vigliotti)\
**Replies:** 2\
**Last updated:** [June 1, 2021, 9:54am UTC](https://discourse.julialang.org/t/problems-registering-a-package/62182 "2021-06-01T09:54:52Z")

</div>

Hi all I am trying to register this package and the automerge keeps failing saying that guidelines are not met, but I can’t figure out what is wrong this is the pull request this is the part with the error Preco…

---

## [Find the maximum for each position of a set of arrays](https://discourse.julialang.org/t/find-the-maximum-for-each-position-of-a-set-of-arrays/62155)

<div class="topic-metadata">

**Author:** [@maoc](https://discourse.julialang.org/u/maoc)\
**Replies:** 5\
**Last updated:** [May 31, 2021, 10:50pm UTC](https://discourse.julialang.org/t/find-the-maximum-for-each-position-of-a-set-of-arrays/62155 "2021-05-31T22:50:57Z")

</div>

I have an array like this a = \[ rand(1:20,3) for i in 1:2,j in 1:3\] 2×3 Array{Array{Int64,1},2}: 2×3 Array{Array{Int64,1},2}: \[8, 13, 1\] \[12, 4, 9\] \[13, 18, 7\] \[3, 19, 20\] \[8, 3, 11\] \[10, 9, 12\] I would like th…

---

## [Tutorial: Efficient and safe approaches to mutation in data parallelism](https://discourse.julialang.org/t/tutorial-efficient-and-safe-approaches-to-mutation-in-data-parallelism/62105)

<div class="topic-metadata">

**Author:** [@tkf](https://discourse.julialang.org/u/tkf)\
**Replies:** 3\
**Last updated:** [May 31, 2021, 9:55pm UTC](https://discourse.julialang.org/t/tutorial-efficient-and-safe-approaches-to-mutation-in-data-parallelism/62105 "2021-05-31T21:55:48Z")

</div>

Hi, I just wrote another tutorial on data-parallel programming in Julia: Efficient and safe approaches to mutation in data parallelism. This is a sequel of A quick introduction to data parallelism in Julia. As discusse…

---

## [Infinite series in Julia](https://discourse.julialang.org/t/infinite-series-in-julia/62151)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 6\
**Last updated:** [May 31, 2021, 7:56pm UTC](https://discourse.julialang.org/t/infinite-series-in-julia/62151 "2021-05-31T19:56:53Z")

</div>

What is the standard approach for computing an infinite series in Julia? Define the sequence of partial sums: s\_{N} \\equiv \\sum\_{j=1}^{N} f(j) In Julia this is: s(N) = sum(f, 1:N) The only way I know is to either com…

---

## [How to annotate anonymous function parameter type](https://discourse.julialang.org/t/how-to-annotate-anonymous-function-parameter-type/62124)

<div class="topic-metadata">

**Author:** [@peteole](https://discourse.julialang.org/u/peteole)\
**Replies:** 9\
**Last updated:** [May 31, 2021, 6:53pm UTC](https://discourse.julialang.org/t/how-to-annotate-anonymous-function-parameter-type/62124 "2021-05-31T18:53:49Z")

</div>

Hi, I am wondering how you can annote the signature of a function that is passed as a parameter. For example if I wanted to define a (quite useless) method which returns an array of strings which are computed from an i…

---

## [Contrasts coding in MixedModels](https://discourse.julialang.org/t/contrasts-coding-in-mixedmodels/62131)

<div class="topic-metadata">

**Author:** [@Hilary](https://discourse.julialang.org/u/Hilary)\
**Replies:** 1\
**Last updated:** [May 31, 2021, 5:53pm UTC](https://discourse.julialang.org/t/contrasts-coding-in-mixedmodels/62131 "2021-05-31T17:53:38Z")

</div>

Hi guys, I have implemented my SAS Mixed Model on Julia. However, currently there are differences in estimates between SAS and Julia for fixed and random effects. I tried changing the contrasts - maybe this can help t…

---

## [StaticArrays and allocations](https://discourse.julialang.org/t/staticarrays-and-allocations/62123)

<div class="topic-metadata">

**Author:** [@paulmelis](https://discourse.julialang.org/u/paulmelis)\
**Replies:** 27\
**Last updated:** [May 31, 2021, 4:17pm UTC](https://discourse.julialang.org/t/staticarrays-and-allocations/62123 "2021-05-31T16:17:37Z")

</div>

Are there are any guarantees when using StaticArrays that the array values will indeed get stack-allocated? Or is it more like a best-effort guarantee and you may still end up with heap-allocated values? Reason I’m aski…

---

## [Behavior of kwargs with scatter plot in PyPlot](https://discourse.julialang.org/t/behavior-of-kwargs-with-scatter-plot-in-pyplot/62140)

<div class="topic-metadata">

**Author:** [@josimar](https://discourse.julialang.org/u/josimar)\
**Replies:** 0\
**Last updated:** [May 31, 2021, 3:18pm UTC](https://discourse.julialang.org/t/behavior-of-kwargs-with-scatter-plot-in-pyplot/62140 "2021-05-31T15:18:46Z")

</div>

I am looking to understand how to pass kwargs to scatter plot using PyPlot. My version control: (@v1.5) pkg\> st Status \`~/.julia/environments/v1.5/Project.toml\` \[c52e3926\] Atom v0.12.30 \[e5e0dc1b\] Juno v0.8.4 \[d3…

---

## [Plots downgraded GR to 0.52 for no good reason](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115)

<div class="topic-metadata">

**Author:** [@ChunXi\_Zhang](https://discourse.julialang.org/u/ChunXi_Zhang)\
**Replies:** 10\
**Last updated:** [May 31, 2021, 1:52pm UTC](https://discourse.julialang.org/t/plots-downgraded-gr-to-0-52-for-no-good-reason/62115 "2021-05-31T13:52:21Z")

</div>

I’m a person who does \] up all the time, today I found the Plots.jl is downgrading GR.jl back to 0.52 for no reason. If I go to \] dev Plots, and remove older versions of GR in \[compat\], keeps only the latest 0.57, and \]…

---

## [JULIA\_PKG\_SERVER related documentation](https://discourse.julialang.org/t/julia-pkg-server-related-documentation/62117)

<div class="topic-metadata">

**Author:** [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Replies:** 3\
**Last updated:** [May 31, 2021, 10:10am UTC](https://discourse.julialang.org/t/julia-pkg-server-related-documentation/62117 "2021-05-31T10:10:14Z")

</div>

Environmental variable JULIA\_PKG\_SERVER appears rather regularly in questions related to registry update issues (last example is Updating extremly slow today). But where one can find documentation related to this variabl…

---

## [What is an idiomatic Julia code for file I/O with exceptions handled?](https://discourse.julialang.org/t/what-is-an-idiomatic-julia-code-for-file-i-o-with-exceptions-handled/3361)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 9\
**Last updated:** [May 31, 2021, 9:51am UTC](https://discourse.julialang.org/t/what-is-an-idiomatic-julia-code-for-file-i-o-with-exceptions-handled/3361 "2021-05-31T09:51:52Z")

</div>

What is an idiomatic Julia code for tryOpen function below, which tests if 2 files can be opened and handles all exceptions? I’m looking for code replacing the comments or totally different code structure, if needed. fu…

---

## [Sub-sample array until a target number of unique elements is left](https://discourse.julialang.org/t/sub-sample-array-until-a-target-number-of-unique-elements-is-left/61981)

<div class="topic-metadata">

**Author:** [@mlanghinrichs](https://discourse.julialang.org/u/mlanghinrichs)\
**Replies:** 18\
**Last updated:** [May 31, 2021, 9:47am UTC](https://discourse.julialang.org/t/sub-sample-array-until-a-target-number-of-unique-elements-is-left/61981 "2021-05-31T09:47:31Z")

</div>

Hey! I’m in need of a fast method that uniformly subsamples the elements of a given array until only a specified number of unique elements is left. For example input array=\[4,1,2,2,4\] and target\_unique\_el=2, then the (r…

---

## [Updating extremly slow today](https://discourse.julialang.org/t/updating-extremly-slow-today/62112)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 6\
**Last updated:** [May 31, 2021, 8:51am UTC](https://discourse.julialang.org/t/updating-extremly-slow-today/62112 "2021-05-31T08:51:03Z")

</div>

Updating my packages is extremely slow today. My internet connection is fine, no proxy. I am on Linux. Any idea how to debug this? It would be nice if the package manager could print some more debug information, for exa…

---

## [Multiple nested module inclusion](https://discourse.julialang.org/t/multiple-nested-module-inclusion/62089)

<div class="topic-metadata">

**Author:** [@kalcool](https://discourse.julialang.org/u/kalcool)\
**Replies:** 5\
**Last updated:** [May 31, 2021, 6:35am UTC](https://discourse.julialang.org/t/multiple-nested-module-inclusion/62089 "2021-05-31T06:35:03Z")

</div>

Hi there, I am trying to build linked structures, which refer to each other, or to nothing/null, as you would do with pointers in C. In order to do this I am using abstract types and parametric structs in order to break…

---

## [IDE for Julia](https://discourse.julialang.org/t/ide-for-julia/61931)

<div class="topic-metadata">

**Author:** [@AndreaPi](https://discourse.julialang.org/u/AndreaPi)\
**Replies:** 19\
**Last updated:** [May 31, 2021, 4:25am UTC](https://discourse.julialang.org/t/ide-for-julia/61931 "2021-05-31T04:25:08Z")

</div>

Hi, I’m a complete Julia beginner. I just downloaded Julia 1.6.1 and I’d like to move my first steps with the language. My first task will be integrating the heat equation in a simple 2D domain (I’ll write a separate qu…

---

## [Formatting xticks in plotlyJS](https://discourse.julialang.org/t/formatting-xticks-in-plotlyjs/62065)

<div class="topic-metadata">

**Author:** [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Replies:** 7\
**Last updated:** [May 30, 2021, 9:50pm UTC](https://discourse.julialang.org/t/formatting-xticks-in-plotlyjs/62065 "2021-05-30T21:50:40Z")

</div>

Hi. I have a long time series comprising 238 quarterly observations (1960.Q1-2019.Q2)). I want to produce a simple time series plot using PlotlyJS.jl to benefit from interactivity. However, I have a problem with the x-ax…

---

## [What am I doing wrong in this array comprehension?](https://discourse.julialang.org/t/what-am-i-doing-wrong-in-this-array-comprehension/62016)

<div class="topic-metadata">

**Author:** [@stephenjfox](https://discourse.julialang.org/u/stephenjfox)\
**Replies:** 5\
**Last updated:** [May 30, 2021, 9:06pm UTC](https://discourse.julialang.org/t/what-am-i-doing-wrong-in-this-array-comprehension/62016 "2021-05-30T21:06:37Z")

</div>

In the midst of writing some ring arithmetic code, I found my Julia session producing very strange results for an element-wise modulo operation. v = collect(1:20) \[(i, n) for i=1:20, n=(v .^2 .% 17) if i == n\] # produce…

---

## [How to find token for Pluto running on a remote server?](https://discourse.julialang.org/t/how-to-find-token-for-pluto-running-on-a-remote-server/62056)

<div class="topic-metadata">

**Author:** [@yingqiuz](https://discourse.julialang.org/u/yingqiuz)\
**Replies:** 5\
**Last updated:** [May 30, 2021, 7:19pm UTC](https://discourse.julialang.org/t/how-to-find-token-for-pluto-running-on-a-remote-server/62056 "2021-05-30T19:19:30Z")

</div>

Hi I am trying to run Pluto.run(port=1235) on a remote server. And the output showed Go to http://localhost:1235/?secret=gMCHSxJl in your browser to start writing ~ have fun! After I built the tunnel and tried to conn…

---

## [String as a variable name](https://discourse.julialang.org/t/string-as-a-variable-name/2195)

<div class="topic-metadata">

**Author:** [@Aaron1488](https://discourse.julialang.org/u/Aaron1488)\
**Replies:** 27\
**Last updated:** [May 30, 2021, 6:46pm UTC](https://discourse.julialang.org/t/string-as-a-variable-name/2195 "2021-05-30T18:46:02Z")

</div>

How can I convert a string to variable name an assign some value to this variable? In R I use assign() function for this, but I was not able to find its equivalent in Julia.

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

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