# General Usage

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

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

**Page:** 539

---

## [CSV.Rows number of columns](https://discourse.julialang.org/t/csv-rows-number-of-columns/69232)

<div class="topic-metadata">

**Author:** [@Laco\_Kovac](https://discourse.julialang.org/u/Laco_Kovac)\
**Replies:** 1\
**Last updated:** [October 5, 2021, 9:07pm UTC](https://discourse.julialang.org/t/csv-rows-number-of-columns/69232 "2021-10-05T21:07:56Z")

</div>

using CSV z = UInt8\[0x44, 0x61, 0x74, 0x65, 0x2c, 0x70, 0x41, 0x2c, 0x70, 0x42, 0x2c, 0x70, 0x43, 0x0d, 0x0a, 0x32, 0x30, 0x30, 0x34, 0x2d, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x20, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x…

---

## [TCP socket allocations](https://discourse.julialang.org/t/tcp-socket-allocations/69254)

<div class="topic-metadata">

**Author:** [@Dilchatto](https://discourse.julialang.org/u/Dilchatto)\
**Replies:** 0\
**Last updated:** [October 5, 2021, 9:00pm UTC](https://discourse.julialang.org/t/tcp-socket-allocations/69254 "2021-10-05T21:00:51Z")

</div>

Hi. I found that this method always dynamically allocates memory. @allocated write(soc::TCPSocket, x) How can I avoid this? Is there some StaticTCPSocket package?

---

## [Can I concatenate expressions in macro?](https://discourse.julialang.org/t/can-i-concatenate-expressions-in-macro/69220)

<div class="topic-metadata">

**Author:** [@Jakub\_Mitura](https://discourse.julialang.org/u/Jakub_Mitura)\
**Replies:** 5\
**Last updated:** [October 5, 2021, 6:47pm UTC](https://discourse.julialang.org/t/can-i-concatenate-expressions-in-macro/69220 "2021-10-05T18:47:36Z")

</div>

i have array of expressions generated in macro and i want to return it all so they will be executed one by one

---

## [How do I get rid of the string fragment \\\\"](https://discourse.julialang.org/t/how-do-i-get-rid-of-the-string-fragment/69240)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 12\
**Last updated:** [October 5, 2021, 5:37pm UTC](https://discourse.julialang.org/t/how-do-i-get-rid-of-the-string-fragment/69240 "2021-10-05T17:37:27Z")

</div>

I have in log part of line: “\\“Mozilla/5.0 (Macintosh; Intel Mac OS X 10\_15\_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36\\”” How do I get rid of the string fragment: \\" On the start end o…

---

## [SharedArrays in function with @distributed](https://discourse.julialang.org/t/sharedarrays-in-function-with-distributed/69096)

<div class="topic-metadata">

**Author:** [@Beh123](https://discourse.julialang.org/u/Beh123)\
**Replies:** 4\
**Last updated:** [October 5, 2021, 5:26pm UTC](https://discourse.julialang.org/t/sharedarrays-in-function-with-distributed/69096 "2021-10-05T17:26:06Z")

</div>

Hi my friends, I have a function with @thread . In this threads function, I use @distribute to speedup calculations loops. But my result is incorrect when I use function. My result is correct without function.

---

## [@which only reports filename instead of full path](https://discourse.julialang.org/t/which-only-reports-filename-instead-of-full-path/69222)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 1\
**Last updated:** [October 5, 2021, 4:33pm UTC](https://discourse.julialang.org/t/which-only-reports-filename-instead-of-full-path/69222 "2021-10-05T16:33:02Z")

</div>

When using @which julia does not report the full file, but only the file name. Hence I cannot jump to the source code. I have installed julia via standard binary installer on nixos. julia\> @which show("hi") show(x) in …

---

## [Printf Error in Custom Package](https://discourse.julialang.org/t/printf-error-in-custom-package/69211)

<div class="topic-metadata">

**Author:** [@graham](https://discourse.julialang.org/u/graham)\
**Replies:** 2\
**Last updated:** [October 5, 2021, 7:05am UTC](https://discourse.julialang.org/t/printf-error-in-custom-package/69211 "2021-10-05T07:05:13Z")

</div>

Hi all, I’m setting up a private package that has the following module definitions Module MainMod Using Printf ... include("paths to submodules") ... using ..Submodules # Will this let me directly call fxns from top…

---

## [How to deal with discontinuities in contour plot?](https://discourse.julialang.org/t/how-to-deal-with-discontinuities-in-contour-plot/69022)

<div class="topic-metadata">

**Author:** [@vini-fda](https://discourse.julialang.org/u/vini-fda)\
**Replies:** 12\
**Last updated:** [October 4, 2021, 9:22pm UTC](https://discourse.julialang.org/t/how-to-deal-with-discontinuities-in-contour-plot/69022 "2021-10-04T21:22:53Z")

</div>

I’m a making a plot of a complex function which has a branch cut discontinuity, and unfortunately it is not easy to parameterize its contour lines, so I rely on calculating the function on the given domain, then taking t…

---

## [Forcing type declaration in Julia](https://discourse.julialang.org/t/forcing-type-declaration-in-julia/69095)

<div class="topic-metadata">

**Author:** [@amit1](https://discourse.julialang.org/u/amit1)\
**Replies:** 19\
**Last updated:** [October 4, 2021, 7:02pm UTC](https://discourse.julialang.org/t/forcing-type-declaration-in-julia/69095 "2021-10-04T19:02:34Z")

</div>

I was pitching Julia as a viable option to my PI. The biggest potential problem they foresaw was same issues as with python, dynamic typing of variables. As most of our codes will be authored by multiple people, I would…

---

## [Writing to CSV files and plotting are getting slower in every run](https://discourse.julialang.org/t/writing-to-csv-files-and-plotting-are-getting-slower-in-every-run/68711)

<div class="topic-metadata">

**Author:** [@fksayaci](https://discourse.julialang.org/u/fksayaci)\
**Replies:** 17\
**Last updated:** [October 4, 2021, 6:08pm UTC](https://discourse.julialang.org/t/writing-to-csv-files-and-plotting-are-getting-slower-in-every-run/68711 "2021-10-04T18:08:39Z")

</div>

Hi, I am using an HPC cluster to solve an optimization model. Usually, solving an optimization model takes hours, and writing results to CSV files takes only minutes. However, it is reverse in my case. Let me show time …

---

## [How to read numerical values out of a NetCDF file and convert them into logical values?](https://discourse.julialang.org/t/how-to-read-numerical-values-out-of-a-netcdf-file-and-convert-them-into-logical-values/69153)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 3\
**Last updated:** [October 4, 2021, 5:01pm UTC](https://discourse.julialang.org/t/how-to-read-numerical-values-out-of-a-netcdf-file-and-convert-them-into-logical-values/69153 "2021-10-04T17:01:07Z")

</div>

I have a land mask that is created using Matlab. Because NetCDF does not allow the use of “logical” data type, I had to store them as float values. My question is in Julia, how do I convert these 1 and 0 values on a m …

---

## [Strange order of operations on SymPy.jl / multiplication with a(1/a)](https://discourse.julialang.org/t/strange-order-of-operations-on-sympy-jl-multiplication-with-a-1-a/69157)

<div class="topic-metadata">

**Author:** [@Brian\_Toomey](https://discourse.julialang.org/u/Brian_Toomey)\
**Replies:** 4\
**Last updated:** [October 4, 2021, 11:43am UTC](https://discourse.julialang.org/t/strange-order-of-operations-on-sympy-jl-multiplication-with-a-1-a/69157 "2021-10-04T11:43:39Z")

</div>

In SymPy.jl I’m seeing a strange order of operations. Is there a way to have a(1/a) == 1 or do I always need to explicitly include the \* operator before the parentheses? Thanks! using SymPy @vars a a(1/a) == 1 / a # == …

---

## [Tracing of optimization algorithm with @debug](https://discourse.julialang.org/t/tracing-of-optimization-algorithm-with-debug/69184)

<div class="topic-metadata">

**Author:** [@stepanzh](https://discourse.julialang.org/u/stepanzh)\
**Replies:** 0\
**Last updated:** [October 4, 2021, 11:32am UTC](https://discourse.julialang.org/t/tracing-of-optimization-algorithm-with-debug/69184 "2021-10-04T11:32:26Z")

</div>

I’m debugging a constatined-optimization algorithm of CubicEoS.jl package. The code is heavily logged with @debug macro. Each of @debug-entry has a unique message like newton or backtracking… I want to post-process log…

---

## [NetCDF file created in Matlab is read differently by Julia?](https://discourse.julialang.org/t/netcdf-file-created-in-matlab-is-read-differently-by-julia/69162)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 5\
**Last updated:** [October 4, 2021, 11:18am UTC](https://discourse.julialang.org/t/netcdf-file-created-in-matlab-is-read-differently-by-julia/69162 "2021-10-04T11:18:54Z")

</div>

I have a NetCDF file that is created using Matlab and it is composed of 'double" values of 1 and 0. I can read the values as they are without any issues inside Matlab. However, when I tried to read it using Julia, their…

---

## [Garbage collector freeing rooted data?](https://discourse.julialang.org/t/garbage-collector-freeing-rooted-data/69176)

<div class="topic-metadata">

**Author:** [@Taaitaaiger](https://discourse.julialang.org/u/Taaitaaiger)\
**Replies:** 0\
**Last updated:** [October 4, 2021, 9:54am UTC](https://discourse.julialang.org/t/garbage-collector-freeing-rooted-data/69176 "2021-10-04T09:54:11Z")

</div>

Hi, last weekend I tried to use Plots/PyPlot when embedding Julia. I’ve written a function that takes a plot function and an arbitrary number of (keyword) arguments, which simply calls the given function with the provide…

---

## [Juno does not display all of unicode](https://discourse.julialang.org/t/juno-does-not-display-all-of-unicode/69093)

<div class="topic-metadata">

**Author:** [@Veenty](https://discourse.julialang.org/u/Veenty)\
**Replies:** 1\
**Last updated:** [October 4, 2021, 7:41am UTC](https://discourse.julialang.org/t/juno-does-not-display-all-of-unicode/69093 "2021-10-04T07:41:53Z")

</div>

Since I installed Juno I have not been able to see all the available unicode characters. I attached a simple example of my problem. Some background: I’m using Version 1.4.1 in macOS Catalina Screen Shot 2021-10-02 at …

---

## [Is there a function to resolve a uuid to a package name and repository?](https://discourse.julialang.org/t/is-there-a-function-to-resolve-a-uuid-to-a-package-name-and-repository/69143)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [October 4, 2021, 7:28am UTC](https://discourse.julialang.org/t/is-there-a-function-to-resolve-a-uuid-to-a-package-name-and-repository/69143 "2021-10-04T07:28:32Z")

</div>

Is there any function that given the uuid of a package resolves to its name and its git repository, default to the registry in use ?

---

## [I encountered a problem when using a convolutional neural network for training by using Flux package](https://discourse.julialang.org/t/i-encountered-a-problem-when-using-a-convolutional-neural-network-for-training-by-using-flux-package/69163)

<div class="topic-metadata">

**Author:** [@wondering](https://discourse.julialang.org/u/wondering)\
**Replies:** 0\
**Last updated:** [October 4, 2021, 2:37am UTC](https://discourse.julialang.org/t/i-encountered-a-problem-when-using-a-convolutional-neural-network-for-training-by-using-flux-package/69163 "2021-10-04T02:37:48Z")

</div>

using Flux, DifferentialEquations, DiffEqSensitivity model = Chain(Conv((3,), 2 =\> N, relu, pad = SamePad()), ) p, re = Flux.destructure(model) ps = Flux.params(p) function ODE(du, u, p, t) Mat = re(p)(rand(N, 2, 1…

---

## [Fully lost with custom broadcasting interface](https://discourse.julialang.org/t/fully-lost-with-custom-broadcasting-interface/69140)

<div class="topic-metadata">

**Author:** [@tpoisot](https://discourse.julialang.org/u/tpoisot)\
**Replies:** 3\
**Last updated:** [October 3, 2021, 8:48pm UTC](https://discourse.julialang.org/t/fully-lost-with-custom-broadcasting-interface/69140 "2021-10-03T20:48:47Z")

</div>

I am trying to implement custom broadcasting for a type, and after spending a few hours with the doc I am well and truly lost. My type looks like this: struct XYZ{T} data::Matrix{Union{T,Nothing}} x::Number …

---

## [How to link the x-axis of subplots using Plots?](https://discourse.julialang.org/t/how-to-link-the-x-axis-of-subplots-using-plots/68906)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 4\
**Last updated:** [October 3, 2021, 5:35pm UTC](https://discourse.julialang.org/t/how-to-link-the-x-axis-of-subplots-using-plots/68906 "2021-10-03T17:35:39Z")

</div>

Essential for zooming in subplots. The command in Matlab is linkaxes(subplots, ‘x’); Plot, then zoom, without “link”: using Plots plotlyjs() plot(rand(100, 4), layout = (4, 1))

---

## [DifferentialEquations, Control Systems, and Linearization](https://discourse.julialang.org/t/differentialequations-control-systems-and-linearization/31178)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 9\
**Last updated:** [October 3, 2021, 2:40pm UTC](https://discourse.julialang.org/t/differentialequations-control-systems-and-linearization/31178 "2021-10-03T14:40:40Z")

</div>

I have a more general question regarding Differential Equations, Control Systems, and Linearization. Thanks to Tamas\_Papp, ssfrr, DrPapa, ChrisRackauckas, and longemen3000 for help in a previous thread on ‘ForwardDiff & …

---

## [How to play the audiobook .m4b file in julia?](https://discourse.julialang.org/t/how-to-play-the-audiobook-m4b-file-in-julia/69091)

<div class="topic-metadata">

**Author:** [@wuxinyu](https://discourse.julialang.org/u/wuxinyu)\
**Replies:** 3\
**Last updated:** [October 3, 2021, 11:27am UTC](https://discourse.julialang.org/t/how-to-play-the-audiobook-m4b-file-in-julia/69091 "2021-10-03T11:27:53Z")

</div>

I want to play a audio book file xxx.m4b in a web app, but I can’t find a package to handle the m4b file. I find a possible package called ffmpeg but I have no idea how to implement it. How can I play a audio book file i…

---

## [Differentiating a function involving the adjoint of a LinearMap (LinearMaps.jl and Zygote.jl)](https://discourse.julialang.org/t/differentiating-a-function-involving-the-adjoint-of-a-linearmap-linearmaps-jl-and-zygote-jl/69078)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 1\
**Last updated:** [October 3, 2021, 9:49am UTC](https://discourse.julialang.org/t/differentiating-a-function-involving-the-adjoint-of-a-linearmap-linearmaps-jl-and-zygote-jl/69078 "2021-10-03T09:49:48Z")

</div>

Hi! I’m trying to write differentiable code using LinearMaps.jl. However, I am running into an issue that I just haven’t been able to fix. Below is a minimum working example of this problem. using Zygote using LinearMap…

---

## [Is it possible to activate an environment by absolute path?](https://discourse.julialang.org/t/is-it-possible-to-activate-an-environment-by-absolute-path/69131)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [October 3, 2021, 7:52am UTC](https://discourse.julialang.org/t/is-it-possible-to-activate-an-environment-by-absolute-path/69131 "2021-10-03T07:52:17Z")

</div>

For example julia\> using Pkg; julia\> Pkg.activate("~/abc") Activating new environment at \`~/Dropbox/JuliaPackages/~/abc/Project.toml\` assumes that the path is relative, however I wanted to use an absolute path here.…

---

## [Question regarding the support of the Geometric distribution in Julia](https://discourse.julialang.org/t/question-regarding-the-support-of-the-geometric-distribution-in-julia/69123)

<div class="topic-metadata">

**Author:** [@conorhassan](https://discourse.julialang.org/u/conorhassan)\
**Replies:** 1\
**Last updated:** [October 3, 2021, 3:18am UTC](https://discourse.julialang.org/t/question-regarding-the-support-of-the-geometric-distribution-in-julia/69123 "2021-10-03T03:18:54Z")

</div>

Hi all, I am evaluating a likelihood involving the Geometric distribution, with a binary latent variable which indicates whether to set the parameter value p of the Geometric distribution to be equal to p=1. As these t…

---

## [Independent version requirements for each dependency to avoid downgrades?](https://discourse.julialang.org/t/independent-version-requirements-for-each-dependency-to-avoid-downgrades/69089)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 18\
**Last updated:** [October 3, 2021, 3:02am UTC](https://discourse.julialang.org/t/independent-version-requirements-for-each-dependency-to-avoid-downgrades/69089 "2021-10-03T03:02:21Z")

</div>

I often run into a problem when installing packages with a large number of dependencies where my environment will be forced to downgrade to old versions because a single dependency hasn’t updated its version requirements…

---

## [Difference in Random numbers between 1.5 & 1.6](https://discourse.julialang.org/t/difference-in-random-numbers-between-1-5-1-6/69090)

<div class="topic-metadata">

**Author:** [@bluesmoon](https://discourse.julialang.org/u/bluesmoon)\
**Replies:** 5\
**Last updated:** [October 3, 2021, 2:27am UTC](https://discourse.julialang.org/t/difference-in-random-numbers-between-1-5-1-6/69090 "2021-10-03T02:27:58Z")

</div>

The HISTORY.md file does not show any changes to Random number generation between v1.5 and v1.6, but I still see different numbers generated with the same seed/RNG: Julia 1.5.4: julia\> VERSION v"1.5.4" julia\> using Ra…

---

## [Using @pywith for PyCall](https://discourse.julialang.org/t/using-pywith-for-pycall/68878)

<div class="topic-metadata">

**Author:** [@rubaiyat](https://discourse.julialang.org/u/rubaiyat)\
**Replies:** 5\
**Last updated:** [October 3, 2021, 12:19am UTC](https://discourse.julialang.org/t/using-pywith-for-pycall/68878 "2021-10-03T00:19:38Z")

</div>

Hello everyone, I’m trying to run a Python package named PyBLP from Julia using Pycall, and ran into an issue using @pywith. All the PyBLP commands run just fine, however when it comes to using “parallel” through a “wi…

---

## [@time a module](https://discourse.julialang.org/t/time-a-module/69121)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [October 2, 2021, 11:51pm UTC](https://discourse.julialang.org/t/time-a-module/69121 "2021-10-02T23:51:21Z")

</div>

I want to know how long it takes to run a module. julia\> @time module Foo; x = 1 end ERROR: syntax: "module" expression not at top level How can I do that?

---

## [How to write a generic rrule?](https://discourse.julialang.org/t/how-to-write-a-generic-rrule/69058)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 1\
**Last updated:** [October 2, 2021, 9:56pm UTC](https://discourse.julialang.org/t/how-to-write-a-generic-rrule/69058 "2021-10-02T21:56:04Z")

</div>

Consider the following example: function ancestor\_accumulate(x::AbstractMatrix, ancestors::AbstractVector{Int}) @assert size(x, 2) == length(ancestors) @assert issorted(ancestors) && all(a .\< 1:length(ancestors)…

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

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