# General Usage

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

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

**Page:** 919

---

## [Updating older Julia packages with Pkg3](https://discourse.julialang.org/t/updating-older-julia-packages-with-pkg3/17557)

<div class="topic-metadata">

**Author:** [@krcools](https://discourse.julialang.org/u/krcools)\
**Replies:** 1\
**Last updated:** [November 15, 2018, 1:40pm UTC](https://discourse.julialang.org/t/updating-older-julia-packages-with-pkg3/17557 "2018-11-15T13:40:36Z")

</div>

I encountered the following: I tried to install PETsc.jl on Julia-1.0. This triggered an Unsatisfiable Requirement error for one of its dependencies. In an attempt to modify the package as to limit its dependencies to …

---

## [Generic mapping over abstractarrays](https://discourse.julialang.org/t/generic-mapping-over-abstractarrays/17527)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 17\
**Last updated:** [November 15, 2018, 12:47pm UTC](https://discourse.julialang.org/t/generic-mapping-over-abstractarrays/17527 "2018-11-15T12:47:03Z")

</div>

Problem: write f(a::AbstractArray) = ... such that the output is an abstractarray of the same type as a out\[i, j, ...\] = a\[i, j, ...\] + i\*j\*k\*... f is non-allocating with StaticArrays. But you’re not allowed to impor…

---

## [Is there way to avoid \`materialize\` and \`copy\`?](https://discourse.julialang.org/t/is-there-way-to-avoid-materialize-and-copy/17467)

<div class="topic-metadata">

**Author:** [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Replies:** 20\
**Last updated:** [November 15, 2018, 12:37pm UTC](https://discourse.julialang.org/t/is-there-way-to-avoid-materialize-and-copy/17467 "2018-11-15T12:37:37Z")

</div>

I have a function createLLHandGRAD(data, kw...) which returns several callbacks. One of them is the LLH function function LLH(pars) # get a vector of parameters @inbounds res = sum(log(COHSQ(EXTND(data\[e,:\]).\*p…

---

## [Is there a way to preserve overwritten method?](https://discourse.julialang.org/t/is-there-a-way-to-preserve-overwritten-method/17551)

<div class="topic-metadata">

**Author:** [@Liso](https://discourse.julialang.org/u/Liso)\
**Replies:** 5\
**Last updated:** [November 15, 2018, 11:06am UTC](https://discourse.julialang.org/t/is-there-a-way-to-preserve-overwritten-method/17551 "2018-11-15T11:06:35Z")

</div>

I was thinking about switch proposal… We have complex info in REPL about character: julia\> 'a' 'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase) If I want to avoid it I could do julia\> import Base.show juli…

---

## [Yet another broadcast question](https://discourse.julialang.org/t/yet-another-broadcast-question/17526)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 10\
**Last updated:** [November 15, 2018, 9:36am UTC](https://discourse.julialang.org/t/yet-another-broadcast-question/17526 "2018-11-15T09:36:15Z")

</div>

Hi, I want to perform a given computation f1D on all the “rows” of 3D arrays x,y: #2 3D arrays x=ones(Float32,10,10,5) y=ones(Float32,10,10,5) #a function (not parallel) function f1D!(x1d,y1d) for k=2:length(x1d) …

---

## [No documentation for DataType](https://discourse.julialang.org/t/no-documentation-for-datatype/17497)

<div class="topic-metadata">

**Author:** [@peters](https://discourse.julialang.org/u/peters)\
**Replies:** 3\
**Last updated:** [November 15, 2018, 8:34am UTC](https://discourse.julialang.org/t/no-documentation-for-datatype/17497 "2018-11-15T08:34:10Z")

</div>

Surprisingly, I found there is no documentation for DataType. Considering its importance (the supertype of most types), don’t you think it deserves to have some description? -------------------------- Julia ver.1.0.2 …

---

## [How do I enable info messages from a package in the REPL?](https://discourse.julialang.org/t/how-do-i-enable-info-messages-from-a-package-in-the-repl/17354)

<div class="topic-metadata">

**Author:** [@galenlynch](https://discourse.julialang.org/u/galenlynch)\
**Replies:** 1\
**Last updated:** [November 15, 2018, 8:08am UTC](https://discourse.julialang.org/t/how-do-i-enable-info-messages-from-a-package-in-the-repl/17354 "2018-11-15T08:08:34Z")

</div>

LibPQ used to show information about what was happening via @info messages. Recently, it seems these messages have gone away. It may have something to do with the log level of the REPL, but TBH I don’t understand how to …

---

## [Why so complex representation of a char?](https://discourse.julialang.org/t/why-so-complex-representation-of-a-char/17052)

<div class="topic-metadata">

**Author:** [@peters](https://discourse.julialang.org/u/peters)\
**Replies:** 48\
**Last updated:** [November 15, 2018, 7:30am UTC](https://discourse.julialang.org/t/why-so-complex-representation-of-a-char/17052 "2018-11-15T07:30:33Z")

</div>

I think the representation of a char in a terminal is overly complex in Julia. For instance, julia\> 'a' 'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase) Is there any reason underlying the complex representati…

---

## [Parallelizing function returns no output](https://discourse.julialang.org/t/parallelizing-function-returns-no-output/17506)

<div class="topic-metadata">

**Author:** [@Ajaychat3](https://discourse.julialang.org/u/Ajaychat3)\
**Replies:** 6\
**Last updated:** [November 15, 2018, 3:45am UTC](https://discourse.julialang.org/t/parallelizing-function-returns-no-output/17506 "2018-11-15T03:45:32Z")

</div>

I am trying to build a function to run in parallel. The function returns no output when run in parallel but works fine without parallel run. I am sure being new to Julia I am doing something wrong here. The function also…

---

## [How to access Dictionary keys with Variable](https://discourse.julialang.org/t/how-to-access-dictionary-keys-with-variable/17543)

<div class="topic-metadata">

**Author:** [@Rama](https://discourse.julialang.org/u/Rama)\
**Replies:** 2\
**Last updated:** [November 15, 2018, 2:51am UTC](https://discourse.julialang.org/t/how-to-access-dictionary-keys-with-variable/17543 "2018-11-15T02:51:10Z")

</div>

Create a Dictionary of Maps maps = Dict(:Arad =\> Dict(:Zerinda =\> 75,:Sibiu =\> 140,:Timisora =\> 118)) Access Arad key works with the below code maps\[:Arad\] Access nested key works with the below code maps\[:Arad\]\[:Si…

---

## [Gpu out of memory](https://discourse.julialang.org/t/gpu-out-of-memory/17507)

<div class="topic-metadata">

**Author:** [@lannisite110](https://discourse.julialang.org/u/lannisite110)\
**Replies:** 0\
**Last updated:** [November 14, 2018, 8:51am UTC](https://discourse.julialang.org/t/gpu-out-of-memory/17507 "2018-11-14T08:51:21Z")

</div>

i’m running the following sentence of codes one by one. And there occur a problem in the following. julia&gt; rel2\_1=relu.(con2\_1.+KnetArray(reshape(map(Float32,weights\["b2\_1"\]),1,1,size(weights\["b2\_1"\],1),1))); ERROR:…

---

## [Trouble using ArrayPartition and StaticArrays](https://discourse.julialang.org/t/trouble-using-arraypartition-and-staticarrays/17529)

<div class="topic-metadata">

**Author:** [@danielmatz](https://discourse.julialang.org/u/danielmatz)\
**Replies:** 0\
**Last updated:** [November 14, 2018, 8:50pm UTC](https://discourse.julialang.org/t/trouble-using-arraypartition-and-staticarrays/17529 "2018-11-14T20:50:35Z")

</div>

I’ve been using ArrayPartition (from RecursiveArrayTools.jl) and StaticArrays. I’m not sure if this is an expected use case, but I end up with nested ArrayPartitions. When I then do operations on that array, the shapes…

---

## [Simple parametric type question](https://discourse.julialang.org/t/simple-parametric-type-question/17508)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 22\
**Last updated:** [November 14, 2018, 4:03pm UTC](https://discourse.julialang.org/t/simple-parametric-type-question/17508 "2018-11-14T16:03:50Z")

</div>

Hi folks, I guess I have trouble defining a struct of a giving type and creating it, just because of the (failing to know/understand) the syntax. I was used to create structs in the form mutable struct crocodile tee…

---

## [How to use ANACONDA's Python from Julia](https://discourse.julialang.org/t/how-to-use-anacondas-python-from-julia/4082)

<div class="topic-metadata">

**Author:** [@gopal2017](https://discourse.julialang.org/u/gopal2017)\
**Replies:** 8\
**Last updated:** [November 14, 2018, 3:48pm UTC](https://discourse.julialang.org/t/how-to-use-anacondas-python-from-julia/4082 "2018-11-14T15:48:16Z")

</div>

Hi, I am using Pycall to call Python from Julia. From Julia Prompt I used Pkg.add(“PyCall”). During its installation its downloading miniconda for Python. I have anaconda in my PC and want to use Anaconda’s Python. Is …

---

## [Overwrite \`ARGS\` after reading](https://discourse.julialang.org/t/overwrite-args-after-reading/17511)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 4\
**Last updated:** [November 14, 2018, 2:30pm UTC](https://discourse.julialang.org/t/overwrite-args-after-reading/17511 "2018-11-14T14:30:07Z")

</div>

julia\> ARGS = 2 2 (fresh session) julia\> ARGS 0-element Array{String,1} julia\> ARGS = 2 ERROR: cannot assign variable Base.ARGS from module Main Stacktrace: \[1\] top-level scope at none:0 Is it possible to set a glob…

---

## [Help Optimizing Slow Distributed Array Computation](https://discourse.julialang.org/t/help-optimizing-slow-distributed-array-computation/17478)

<div class="topic-metadata">

**Author:** [@JTomlinson](https://discourse.julialang.org/u/JTomlinson)\
**Replies:** 7\
**Last updated:** [November 14, 2018, 1:52pm UTC](https://discourse.julialang.org/t/help-optimizing-slow-distributed-array-computation/17478 "2018-11-14T13:52:04Z")

</div>

I’m in the process of converting some old C code to Julia but am having issues getting the performance to be even close. The specific function that takes most of the time, in the Julia code atleast, is the following @ev…

---

## [Best way to read a string from a struct field written to through shared memory](https://discourse.julialang.org/t/best-way-to-read-a-string-from-a-struct-field-written-to-through-shared-memory/17516)

<div class="topic-metadata">

**Author:** [@dm3](https://discourse.julialang.org/u/dm3)\
**Replies:** 0\
**Last updated:** [November 14, 2018, 1:26pm UTC](https://discourse.julialang.org/t/best-way-to-read-a-string-from-a-struct-field-written-to-through-shared-memory/17516 "2018-11-14T13:26:30Z")

</div>

Hello, I have an embedded Julia setup where there’s a struct holding vectors of other structs allocated in Julia. The parent struct is stored in a global Ref and the pointers to data fields of the parent struct’s vector…

---

## [Try/catch issue](https://discourse.julialang.org/t/try-catch-issue/17512)

<div class="topic-metadata">

**Author:** [@Basosa](https://discourse.julialang.org/u/Basosa)\
**Replies:** 2\
**Last updated:** [November 14, 2018, 1:09pm UTC](https://discourse.julialang.org/t/try-catch-issue/17512 "2018-11-14T13:09:20Z")

</div>

I am new in Julia and I am trying to understand the way that try/catch control flow is working. I need to handle possible errors inside a for loop, correct them and finally do what I should do if there was no error. Ho…

---

## [Type stability problem with NamedTuple of Union{T,Missing}](https://discourse.julialang.org/t/type-stability-problem-with-namedtuple-of-union-t-missing/17514)

<div class="topic-metadata">

**Author:** [@fabiangans](https://discourse.julialang.org/u/fabiangans)\
**Replies:** 1\
**Last updated:** [November 14, 2018, 1:02pm UTC](https://discourse.julialang.org/t/type-stability-problem-with-namedtuple-of-union-t-missing/17514 "2018-11-14T13:02:45Z")

</div>

Does anyone have an idea how to make the following function type-stable? function extracttuple(a,b,i) (a=a\[i\],b=b\[i\]) end a=zeros(Union{Float64,Missing},10) b=zeros(Union{Float64,Missing},10) @code\_warntype extract…

---

## [Array views becoming dominant source of memory allocation](https://discourse.julialang.org/t/array-views-becoming-dominant-source-of-memory-allocation/6465)

<div class="topic-metadata">

**Author:** [@bingcrosby](https://discourse.julialang.org/u/bingcrosby)\
**Replies:** 31\
**Last updated:** [November 14, 2018, 12:27pm UTC](https://discourse.julialang.org/t/array-views-becoming-dominant-source-of-memory-allocation/6465 "2018-11-14T12:27:27Z")

</div>

Hi All, I need to process 2D matrix data in short blocks, for example: function times\_one!(x::SubArray{Float64,2}) @. x= 1.0\*x end function test(dim\_long,dim\_short,step) x= rand(dim\_long,dim\_short) @time for i…

---

## [Makie package](https://discourse.julialang.org/t/makie-package/17445)

<div class="topic-metadata">

**Author:** [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Replies:** 17\
**Last updated:** [November 14, 2018, 9:31am UTC](https://discourse.julialang.org/t/makie-package/17445 "2018-11-14T09:31:29Z")

</div>

I have a problem with Makie package. On testing(Pkg.test(“Makie”)) it passed 81 of 100 tests. For example from these tests it didn’t passed test “heatmap Interpolation” where is the problem with vbox and hbox function w…

---

## [How to Change LogLevel with Logging Package?](https://discourse.julialang.org/t/how-to-change-loglevel-with-logging-package/17501)

<div class="topic-metadata">

**Author:** [@Alex\_Hiller](https://discourse.julialang.org/u/Alex_Hiller)\
**Replies:** 4\
**Last updated:** [November 14, 2018, 5:24am UTC](https://discourse.julialang.org/t/how-to-change-loglevel-with-logging-package/17501 "2018-11-14T05:24:43Z")

</div>

Hi all, I’m having issues understanding how to set the logging level with Logging. This is also my first post, so if this isn’t the right place to post, please just redirect me to the appropriate topic area. I start wi…

---

## [Using Blink AtomShell window() with Jupyter notebook](https://discourse.julialang.org/t/using-blink-atomshell-window-with-jupyter-notebook/17500)

<div class="topic-metadata">

**Author:** [@orhan\_abar](https://discourse.julialang.org/u/orhan_abar)\
**Replies:** 0\
**Last updated:** [November 14, 2018, 2:45am UTC](https://discourse.julialang.org/t/using-blink-atomshell-window-with-jupyter-notebook/17500 "2018-11-14T02:45:49Z")

</div>

When I run these 2 lines on Jupyter notebook: using Blink w = Window() It opens a new window. Is there any way to show this window as Jupyter output?

---

## [Broadcasting in 0.7](https://discourse.julialang.org/t/broadcasting-in-0-7/12346)

<div class="topic-metadata">

**Author:** [@gasagna](https://discourse.julialang.org/u/gasagna)\
**Replies:** 21\
**Last updated:** [November 13, 2018, 11:31pm UTC](https://discourse.julialang.org/t/broadcasting-in-0-7/12346 "2018-11-13T23:31:16Z")

</div>

Hi, I am upgrading a package of mine to v0.7. So far the trickiest bit is updating the broadcasting code to the new broadcasting facilities of v0.7. I have read the relevant manual pages, plus other bits here and there,…

---

## [Easy way to define functions with specific NamedTuple arguments?](https://discourse.julialang.org/t/easy-way-to-define-functions-with-specific-namedtuple-arguments/17483)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 5\
**Last updated:** [November 13, 2018, 8:10pm UTC](https://discourse.julialang.org/t/easy-way-to-define-functions-with-specific-namedtuple-arguments/17483 "2018-11-13T20:10:58Z")

</div>

Do we have an easy way to write functions that take specific kinds of named tuple as arguments? I mean writing a function foo((a, b, c)) That will accept foo((a = 42, b = 4.2, c = \[2, 5\])) but not foo((a = 4.2, b = …

---

## [\`nfields\` giving incorrect number of fields](https://discourse.julialang.org/t/nfields-giving-incorrect-number-of-fields/17489)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 3\
**Last updated:** [November 13, 2018, 7:06pm UTC](https://discourse.julialang.org/t/nfields-giving-incorrect-number-of-fields/17489 "2018-11-13T19:06:25Z")

</div>

The following seems like a bug to me. julia\> struct MyType a b c d e f g h i j k l …

---

## [Quite bad performance of Julia 0.6.4 vs Python+Numpy](https://discourse.julialang.org/t/quite-bad-performance-of-julia-0-6-4-vs-python-numpy/16978)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 26\
**Last updated:** [November 13, 2018, 5:48pm UTC](https://discourse.julialang.org/t/quite-bad-performance-of-julia-0-6-4-vs-python-numpy/16978 "2018-11-13T17:48:09Z")

</div>

Dear all, I guess I could use a piece of good help from the experts here. The fact is that I was about to translate a piece of Monte Carlo code from my old 0.6.4 program library, into Julia 1.0 (going through 0.7 first)…

---

## [Ccall into independent copies C library](https://discourse.julialang.org/t/ccall-into-independent-copies-c-library/17453)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 5\
**Last updated:** [November 13, 2018, 5:52pm UTC](https://discourse.julialang.org/t/ccall-into-independent-copies-c-library/17453 "2018-11-13T17:52:10Z")

</div>

I have a C code (a monte carlo simulation) with lots of global state. I would like to call multiple independent copies of this code from julia (so it can be safely parallelized). Is this possible?

---

## [ImageFiltering: Optimizing frame-by-frame image illumination flattening](https://discourse.julialang.org/t/imagefiltering-optimizing-frame-by-frame-image-illumination-flattening/17463)

<div class="topic-metadata">

**Author:** [@ianshmean](https://discourse.julialang.org/u/ianshmean)\
**Replies:** 8\
**Last updated:** [November 13, 2018, 3:49pm UTC](https://discourse.julialang.org/t/imagefiltering-optimizing-frame-by-frame-image-illumination-flattening/17463 "2018-11-13T15:49:24Z")

</div>

I’m trying to speed up this image illumination flattening routine (i.e. this kind of thing) that highpasses each frame, then rescales the image back to UInt8. I’ve been trying out adding Threads.@threads before the for …

---

## [highlighting matching 'end' statement on jupyter](https://discourse.julialang.org/t/highlighting-matching-end-statement-on-jupyter/17479)

<div class="topic-metadata">

**Author:** [@Eitam\_Arnon](https://discourse.julialang.org/u/Eitam_Arnon)\
**Replies:** 0\
**Last updated:** [November 13, 2018, 3:21pm UTC](https://discourse.julialang.org/t/highlighting-matching-end-statement-on-jupyter/17479 "2018-11-13T15:21:39Z")

</div>

Hi. While writing nested loops that include some conditions I found it hard to match the relevant ‘end’ statement. is it possible to highlight the matching closing statements on jupyter? Thanks.

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

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