# General Usage

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

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

**Page:** 797

---

## [BSON unable to load struct with array of subtypes](https://discourse.julialang.org/t/bson-unable-to-load-struct-with-array-of-subtypes/33483)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 0\
**Last updated:** [January 17, 2020, 11:25am UTC](https://discourse.julialang.org/t/bson-unable-to-load-struct-with-array-of-subtypes/33483 "2020-01-17T11:25:11Z")

</div>

Am I coding wrong or should I open an issue ? BSON cannot load an struct that has an array of a subtype field. julia\> using BSON julia\> mutable struct Bar arrreal::Array{\<:Real,1} end julia\> bar = Bar(Re…

---

## [API design for dispatching on type of action](https://discourse.julialang.org/t/api-design-for-dispatching-on-type-of-action/33478)

<div class="topic-metadata">

**Author:** [@pszufe](https://discourse.julialang.org/u/pszufe)\
**Replies:** 1\
**Last updated:** [January 17, 2020, 11:22am UTC](https://discourse.julialang.org/t/api-design-for-dispatching-on-type-of-action/33478 "2020-01-17T11:22:44Z")

</div>

Which is prefered design of an API - dispatching on Type or dispatching on type of argument? Consider the simple code below abstract type Ab end struct B \<: Ab end struct C \<: Ab end f(x::Int,::Type{B}) = "I am B and …

---

## [Can Versions.toml point to git branch instead of fixed git commit?](https://discourse.julialang.org/t/can-versions-toml-point-to-git-branch-instead-of-fixed-git-commit/33442)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 7\
**Last updated:** [January 16, 2020, 4:51pm UTC](https://discourse.julialang.org/t/can-versions-toml-point-to-git-branch-instead-of-fixed-git-commit/33442 "2020-01-16T16:51:11Z")

</div>

for creating one’s own registry one has to specify Versions.toml for each package currently it seems like you have to link versions to concrete git commits via hash, however for development it would be very helpful to l…

---

## [When should we use \`@nospecialize\`?](https://discourse.julialang.org/t/when-should-we-use-nospecialize/10392)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 8\
**Last updated:** [January 17, 2020, 8:04am UTC](https://discourse.julialang.org/t/when-should-we-use-nospecialize/10392 "2020-01-17T08:04:40Z")

</div>

The manual is sketchy about the use of @nospecialize (maybe it is still WIP?). I gather it is a necessary optimisation to avoid overburdening the dispatch tables. Is the end user advised to use this macro in some specifi…

---

## ["higher level" c interface package](https://discourse.julialang.org/t/higher-level-c-interface-package/33381)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 2\
**Last updated:** [January 17, 2020, 6:00am UTC](https://discourse.julialang.org/t/higher-level-c-interface-package/33381 "2020-01-17T06:00:26Z")

</div>

I seem to remember a package mentioned in these hallowed threads, which implemented a higher level C interface, in particular, I think that it handled structures well, especially if they had things like bitfields. it do…

---

## [How to fix blurry PyPlot plots in hidpi machine in jupyter](https://discourse.julialang.org/t/how-to-fix-blurry-pyplot-plots-in-hidpi-machine-in-jupyter/33471)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 0\
**Last updated:** [January 17, 2020, 4:45am UTC](https://discourse.julialang.org/t/how-to-fix-blurry-pyplot-plots-in-hidpi-machine-in-jupyter/33471 "2020-01-17T04:45:03Z")

</div>

In a hidpi machine, the inline plots of jupyter via PyPlot.jl are blurry. Previously, I usually use the PyPlot.svg(true) option. However, this will slow down the browser considerably if the plot is really large. I noti…

---

## [Cannot find var's name when I eval an expr](https://discourse.julialang.org/t/cannot-find-vars-name-when-i-eval-an-expr/33460)

<div class="topic-metadata">

**Author:** [@Fang](https://discourse.julialang.org/u/Fang)\
**Replies:** 2\
**Last updated:** [January 17, 2020, 4:19am UTC](https://discourse.julialang.org/t/cannot-find-vars-name-when-i-eval-an-expr/33460 "2020-01-17T04:19:44Z")

</div>

Hi I wanna use eval an expr but the error says that the var’s name cannot be found. My function is below : function cal(jac, rate, Q) n\_spec = size(jac, 1) jac\_value = zeros(Float64, n\_spec, n\_spec) for i…

---

## [Changing package dependency revisions (AWSCore/HTTP)](https://discourse.julialang.org/t/changing-package-dependency-revisions-awscore-http/33428)

<div class="topic-metadata">

**Author:** [@jade\_mackay](https://discourse.julialang.org/u/jade_mackay)\
**Replies:** 2\
**Last updated:** [January 17, 2020, 12:14am UTC](https://discourse.julialang.org/t/changing-package-dependency-revisions-awscore-http/33428 "2020-01-17T00:14:21Z")

</div>

I need to use AWSCore though a proxy. The current release of AWSCore (0.6.7) specifies compatibility with dependency HTTP version 0.8. The HTTP proxy functionality I need has been merged to master but has yet to be relea…

---

## [CSV.Write DataFrame boolean columns as 0 or 1, not as string: "false" and "true"](https://discourse.julialang.org/t/csv-write-dataframe-boolean-columns-as-0-or-1-not-as-string-false-and-true/33449)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 8\
**Last updated:** [January 16, 2020, 9:06pm UTC](https://discourse.julialang.org/t/csv-write-dataframe-boolean-columns-as-0-or-1-not-as-string-false-and-true/33449 "2020-01-16T21:06:23Z")

</div>

When I save a DataFrame with boolean columns, CSV.write them as strings: “false” and “true”, so it increases file sizes. How to save the boolean columns into 0 and 1. Thank you in advance.

---

## [Yet another Artifacts question - when is a download triggered?](https://discourse.julialang.org/t/yet-another-artifacts-question-when-is-a-download-triggered/33452)

<div class="topic-metadata">

**Author:** [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Replies:** 1\
**Last updated:** [January 16, 2020, 8:08pm UTC](https://discourse.julialang.org/t/yet-another-artifacts-question-when-is-a-download-triggered/33452 "2020-01-16T20:08:49Z")

</div>

My Artifacts.toml file contains \[TestData\] git-tree-sha1 = "9d575764bc1c1a7860c34c5b153251e5f2ee6704" lazy = true \[\[TestData.download\]\] sha256 = "7fcd1e390c59530e9ea00939afd1798813e3727b" url = "https://ndo…

---

## [TensorFlow Issue with Logistic Regression Example](https://discourse.julialang.org/t/tensorflow-issue-with-logistic-regression-example/33454)

<div class="topic-metadata">

**Author:** [@abianco](https://discourse.julialang.org/u/abianco)\
**Replies:** 0\
**Last updated:** [January 16, 2020, 8:00pm UTC](https://discourse.julialang.org/t/tensorflow-issue-with-logistic-regression-example/33454 "2020-01-16T20:00:33Z")

</div>

After a fresh installation of Julia on CentOS 7.2, I added TensorFlow, ran the “basic usage” test in README.md and passed it. Then, after installing also the Distributions and Printf packages, I tried to run the “logisti…

---

## [Add fill method accepting constructor function](https://discourse.julialang.org/t/add-fill-method-accepting-constructor-function/33424)

<div class="topic-metadata">

**Author:** [@Alex1](https://discourse.julialang.org/u/Alex1)\
**Replies:** 10\
**Last updated:** [January 16, 2020, 5:05pm UTC](https://discourse.julialang.org/t/add-fill-method-accepting-constructor-function/33424 "2020-01-16T17:05:06Z")

</div>

Initialising array of arrays fill(\[\], 2) would end up in an error, as all arrays will be actually the same array. I suggest provide additional method for fill function, accepting constructor function fill(() -\> \[\], 2). …

---

## [Best Way to Declare Arrays](https://discourse.julialang.org/t/best-way-to-declare-arrays/33411)

<div class="topic-metadata">

**Author:** [@squirrel](https://discourse.julialang.org/u/squirrel)\
**Replies:** 11\
**Last updated:** [January 16, 2020, 4:20pm UTC](https://discourse.julialang.org/t/best-way-to-declare-arrays/33411 "2020-01-16T16:20:06Z")

</div>

I’m trying to wrap my head around arrays in Julia. In Java, if you have an array (int\[\] arr, for example) with 100 elements, then to add another element, you have to make another array with size 101 and copy all the old…

---

## [How to use a minimise mean squared loss function in Julia for gradient descent?](https://discourse.julialang.org/t/how-to-use-a-minimise-mean-squared-loss-function-in-julia-for-gradient-descent/33439)

<div class="topic-metadata">

**Author:** [@PyDataBlog](https://discourse.julialang.org/u/PyDataBlog)\
**Replies:** 0\
**Last updated:** [January 16, 2020, 1:00pm UTC](https://discourse.julialang.org/t/how-to-use-a-minimise-mean-squared-loss-function-in-julia-for-gradient-descent/33439 "2020-01-16T13:00:22Z")

</div>

Hi everyone, I’m very new to Julia and I’m currently trying to understand the language by building from scratch multivariate linear regression using gradient descent. I’m coming from a Python/R background so apologies if…

---

## [Multithreading and ProductIterator](https://discourse.julialang.org/t/multithreading-and-productiterator/33405)

<div class="topic-metadata">

**Author:** [@Yunde](https://discourse.julialang.org/u/Yunde)\
**Replies:** 6\
**Last updated:** [January 16, 2020, 12:30pm UTC](https://discourse.julialang.org/t/multithreading-and-productiterator/33405 "2020-01-16T12:30:29Z")

</div>

Trying to use @threads to Base.Iterators.ProductIterator for optimization problem. Here is a simplified example: x = 1:3; y = 5:7; Threads.@threads for i in Iterators.product(x, y) id = Threads.threadid(); @info…

---

## [Packed struct](https://discourse.julialang.org/t/packed-struct/33394)

<div class="topic-metadata">

**Author:** [@garychow](https://discourse.julialang.org/u/garychow)\
**Replies:** 2\
**Last updated:** [January 16, 2020, 11:16am UTC](https://discourse.julialang.org/t/packed-struct/33394 "2020-01-16T11:16:29Z")

</div>

Hi, I have some binary data which I would like to unpack to some struct. However, as far as I know julia does not support the packed (ie non aligned without padding) struct and that make it impossible to use unsafe\_wrap…

---

## [Install package of Julia in Cocalc](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239)

<div class="topic-metadata">

**Author:** [@1634](https://discourse.julialang.org/u/1634)\
**Replies:** 14\
**Last updated:** [January 13, 2020, 5:43pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239 "2020-01-13T17:43:44Z")

</div>

Hi community, Do anyone have a suggested instruction for doing so? My attempts are listed as below. As there is no existent manual for installing package of Julia in Cocalc, I attempted to read an equivalent for R. " …

---

## [Closures as "classic object-oriented programming"](https://discourse.julialang.org/t/closures-as-classic-object-oriented-programming/33434)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 3\
**Last updated:** [January 16, 2020, 10:49am UTC](https://discourse.julialang.org/t/closures-as-classic-object-oriented-programming/33434 "2020-01-16T10:49:06Z")

</div>

This blog post shows how one could use closures to implement public/private members. I cannot understand why I can access for instance get\_age with the dot newDuck("Bill").get\_age(): I thought the only way to access it …

---

## [Concatenating iterables without allocating memory](https://discourse.julialang.org/t/concatenating-iterables-without-allocating-memory/33282)

<div class="topic-metadata">

**Author:** [@Jakub\_Wronowski](https://discourse.julialang.org/u/Jakub_Wronowski)\
**Replies:** 34\
**Last updated:** [January 16, 2020, 4:06am UTC](https://discourse.julialang.org/t/concatenating-iterables-without-allocating-memory/33282 "2020-01-16T04:06:57Z")

</div>

Hi, for a library I am working now I need to find minimum and maximum values. I am looking elegant way to express that. signal1 = rand(10000000) signal2 = rand(10000000) @time lo, hi = extrema(vcat(signal1, signal2)) …

---

## [OpenBLAS vs MKL](https://discourse.julialang.org/t/openblas-vs-mkl/17362)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 7\
**Last updated:** [January 16, 2020, 1:01am UTC](https://discourse.julialang.org/t/openblas-vs-mkl/17362 "2020-01-16T01:01:30Z")

</div>

I just build Julia 1.0.1 on a cluster and linked it against MKL (2019). As a simple benchmark, I compared the performance of squaring a 1000 x 1000 matrix against the Julia binaries from the website (OpenBLAS). I remembe…

---

## [DataFrame | multiply set of colums](https://discourse.julialang.org/t/dataframe-multiply-set-of-colums/33421)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 4\
**Last updated:** [January 16, 2020, 12:09am UTC](https://discourse.julialang.org/t/dataframe-multiply-set-of-colums/33421 "2020-01-16T00:09:33Z")

</div>

Would you suggest, I have a list of columns (many of them). How to multiply all of them. I know how to sum, but I have no idea, how to multiply sum.(eachrow(qf\[:,\[:a,:b\]\])) Thanks

---

## [Looking for advice on threading](https://discourse.julialang.org/t/looking-for-advice-on-threading/33301)

<div class="topic-metadata">

**Author:** [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Replies:** 6\
**Last updated:** [January 15, 2020, 9:25pm UTC](https://discourse.julialang.org/t/looking-for-advice-on-threading/33301 "2020-01-15T21:25:47Z")

</div>

Are there any (fairly simple) examples of how to work with Threads.@threads? Background;: so far I have tried splitting up my computations in threaded chunks and eventually recombine the results from the chunks, similar…

---

## [LaTeX amsmath in Documenter](https://discourse.julialang.org/t/latex-amsmath-in-documenter/33356)

<div class="topic-metadata">

**Author:** [@squirrel](https://discourse.julialang.org/u/squirrel)\
**Replies:** 2\
**Last updated:** [January 15, 2020, 3:07pm UTC](https://discourse.julialang.org/t/latex-amsmath-in-documenter/33356 "2020-01-15T15:07:34Z")

</div>

I’d like to make a matrix with LaTeX’s amsmath package in Documenter. I found this bit on MkDocs and MathJax, but I’m not sure how to manipulate python. Could anyone help me out or direct me to a more in-depth tutorial? …

---

## [Pkg instantiate a package](https://discourse.julialang.org/t/pkg-instantiate-a-package/33396)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 5\
**Last updated:** [January 15, 2020, 3:07pm UTC](https://discourse.julialang.org/t/pkg-instantiate-a-package/33396 "2020-01-15T15:07:24Z")

</div>

Hi, I currently develop interdependent Julia packages and look for an easy way to share my work to others. The packages are all un-registered yet. What I understood so far to realize this: define dependencies by refe…

---

## [Difficulty defining \`==\` for a custom type](https://discourse.julialang.org/t/difficulty-defining-for-a-custom-type/33390)

<div class="topic-metadata">

**Author:** [@ColinCaine](https://discourse.julialang.org/u/ColinCaine)\
**Replies:** 1\
**Last updated:** [January 15, 2020, 11:17am UTC](https://discourse.julialang.org/t/difficulty-defining-for-a-custom-type/33390 "2020-01-15T11:17:17Z")

</div>

I’ve defined two == methods for a custom type, and they work, but I was a bit surprised that: There is not a symmetry fallback for == as there is for promote\_rule There is not a promotion fallback for == The code belo…

---

## [Commit Artifacts.toml?](https://discourse.julialang.org/t/commit-artifacts-toml/33366)

<div class="topic-metadata">

**Author:** [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)\
**Replies:** 0\
**Last updated:** [January 14, 2020, 10:12pm UTC](https://discourse.julialang.org/t/commit-artifacts-toml/33366 "2020-01-14T22:12:20Z")

</div>

Hi, I’m using artifacts to grab some testdata files using the method from the “working with artifacts” section in this blog. Overall it is a pleasure to use it so big kudos to the developers! I do have some questions …

---

## [Implementation of Norvigs spellchecker (Code critique + performance help)](https://discourse.julialang.org/t/implementation-of-norvigs-spellchecker-code-critique-performance-help/33038)

<div class="topic-metadata">

**Author:** [@dunefox](https://discourse.julialang.org/u/dunefox)\
**Replies:** 21\
**Last updated:** [January 14, 2020, 8:21pm UTC](https://discourse.julialang.org/t/implementation-of-norvigs-spellchecker-code-critique-performance-help/33038 "2020-01-14T20:21:34Z")

</div>

I know python relatively well and wanted to learn Julia, so for my first steps I tried to implement Norvigs spellchecker (How to Write a Spelling Corrector). It’s working as intended and I kept it as close as possible bu…

---

## [How get username from :headers in AMQPClient with using RabbitMQ?](https://discourse.julialang.org/t/how-get-username-from-headers-in-amqpclient-with-using-rabbitmq/26793)

<div class="topic-metadata">

**Author:** [@Martin\_Florek](https://discourse.julialang.org/u/Martin_Florek)\
**Replies:** 8\
**Last updated:** [January 14, 2020, 7:15pm UTC](https://discourse.julialang.org/t/how-get-username-from-headers-in-amqpclient-with-using-rabbitmq/26793 "2020-01-14T19:15:50Z")

</div>

All or @tanmaykm I’m using AMQPClient and I would like get user name from message. When I run commands gChannel = channel(conn, AMQPClient.UNUSED\_CHANNEL, true) msg = basic\_get(gChannel, “rQueue”, false) I get Me…

---

## [Solution of underdetermined systems using LAPACK](https://discourse.julialang.org/t/solution-of-underdetermined-systems-using-lapack/33000)

<div class="topic-metadata">

**Author:** [@lucas711642](https://discourse.julialang.org/u/lucas711642)\
**Replies:** 9\
**Last updated:** [January 14, 2020, 9:19am UTC](https://discourse.julialang.org/t/solution-of-underdetermined-systems-using-lapack/33000 "2020-01-14T09:19:12Z")

</div>

I need to get any solution of a bunch of underdetermined systems A\*x = b fastly and cheaply. My first thought is to compute a minimum norm solution using the LQ decomposition of A (which can be used as workspace to minim…

---

## [System Images, source code and implementation protection and portability (environment distribution)](https://discourse.julialang.org/t/system-images-source-code-and-implementation-protection-and-portability-environment-distribution/33334)

<div class="topic-metadata">

**Author:** [@MikeErd](https://discourse.julialang.org/u/MikeErd)\
**Replies:** 0\
**Last updated:** [January 14, 2020, 7:30am UTC](https://discourse.julialang.org/t/system-images-source-code-and-implementation-protection-and-portability-environment-distribution/33334 "2020-01-14T07:30:29Z")

</div>

Hi all! As far as I understoodd system images, the main idea behind this mechanism is, to reduce Julia startup times by removing the need to spend compile time at startup. Has anybody an idea, how to solve the followin…

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

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