# General Usage

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

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

**Page:** 358

---

## [Why the 1x1 matrix \[2\] is printed \[2;;\]?](https://discourse.julialang.org/t/why-the-1x1-matrix-2-is-printed-2/91486)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 12\
**Last updated:** [December 10, 2022, 8:49pm UTC](https://discourse.julialang.org/t/why-the-1x1-matrix-2-is-printed-2/91486 "2022-12-10T20:49:30Z")

</div>

Hello, julia\> x = repeat(\[2\], 1, 1) 1x1 Matrix{Int64}: 2 julia\> print(x) \[2;;\] Why \[2;;\]?

---

## [Version of Libgit2 on Windows different from from Linux?](https://discourse.julialang.org/t/version-of-libgit2-on-windows-different-from-from-linux/90695)

<div class="topic-metadata">

**Author:** [@hellemo](https://discourse.julialang.org/u/hellemo)\
**Replies:** 1\
**Last updated:** [December 10, 2022, 12:13am UTC](https://discourse.julialang.org/t/version-of-libgit2-on-windows-different-from-from-linux/90695 "2022-12-10T00:13:42Z")

</div>

We have some issues accessing packages hosted on private repos at GitHub. Long story short, using v1.8.3 on windows and ssh-agent with the appropriate key added to known\_hosts, and get the error: SSH host verification: …

---

## [Removing a Solid Color Background from an image](https://discourse.julialang.org/t/removing-a-solid-color-background-from-an-image/91513)

<div class="topic-metadata">

**Author:** [@GameDungeon](https://discourse.julialang.org/u/GameDungeon)\
**Replies:** 1\
**Last updated:** [December 10, 2022, 7:58pm UTC](https://discourse.julialang.org/t/removing-a-solid-color-background-from-an-image/91513 "2022-12-10T19:58:15Z")

</div>

I have an image with a solid color background. I don’t know what color it will be in advance. I want to take this background and use it as a mask. I’ve tried the image segmentation library, but I don’t know how to make i…

---

## [Unexpected result from ==](https://discourse.julialang.org/t/unexpected-result-from/91499)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 8\
**Last updated:** [December 10, 2022, 4:11pm UTC](https://discourse.julialang.org/t/unexpected-result-from/91499 "2022-12-10T16:11:28Z")

</div>

A dictionary in my code is not working because keys that are supposed to be equal are comparing as unequal. Here is a snippet (Julia 1.8.2). Is this a bug, or am I misunderstanding how == is supposed to work? julia\> ab…

---

## [The latex symbol is not working in a plot title](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768)

<div class="topic-metadata">

**Author:** [@maoc](https://discourse.julialang.org/u/maoc)\
**Replies:** 9\
**Last updated:** [December 10, 2022, 3:22pm UTC](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768 "2022-12-10T15:22:25Z")

</div>

I’m using the symbol latex \\lambda in Julia scripts (\\lambda = 5). When I plot, I need to put the \\lambda symbol in the Title, but it’s not working. I am using the Jupyter Notebook on Chrome! using Plots title\_ = \["λ …

---

## [ZMQ and Distributed](https://discourse.julialang.org/t/zmq-and-distributed/75669)

<div class="topic-metadata">

**Author:** [@hagi](https://discourse.julialang.org/u/hagi)\
**Replies:** 1\
**Last updated:** [December 10, 2022, 9:28am UTC](https://discourse.julialang.org/t/zmq-and-distributed/75669 "2022-12-10T09:28:20Z")

</div>

I have a problem using ZMQ with Distributed on another worker. This is my first try with Distributed package. I am working on a project, where I receive data from a measurement device using the ZMQ protocol. Every sec…

---

## [I can ssh to a server but can't addprocs: ETIMEDOUT](https://discourse.julialang.org/t/i-can-ssh-to-a-server-but-cant-addprocs-etimedout/91502)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 0\
**Last updated:** [December 10, 2022, 7:24am UTC](https://discourse.julialang.org/t/i-can-ssh-to-a-server-but-cant-addprocs-etimedout/91502 "2022-12-10T07:24:45Z")

</div>

I can ssh to a server but can’t connect using addprocs. Any ideas? julia\> run(\`ssh $addr -- '/u/local/apps/julia/1.8.1/bin/julia --version '\`); julia version 1.8.1 julia\> procs = addprocs(\[addr\]; exename="/u/local/app…

---

## [Is there a Julia function similar to the R function \`with\`?](https://discourse.julialang.org/t/is-there-a-julia-function-similar-to-the-r-function-with/91493)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 7\
**Last updated:** [December 10, 2022, 3:40am UTC](https://discourse.julialang.org/t/is-there-a-julia-function-similar-to-the-r-function-with/91493 "2022-12-10T03:40:36Z")

</div>

Hello, In R, when you have a list like mylist \<- list(a = 2, b = 3), then instead of doing mylist$a + mylist$b you can do with(mylist, a + b). Is there something similar in Julia for a named tuple like (a = 2, b = 3)?

---

## [All ways to define functions in Julia?](https://discourse.julialang.org/t/all-ways-to-define-functions-in-julia/45816)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 51\
**Last updated:** [December 10, 2022, 6:49am UTC](https://discourse.julialang.org/t/all-ways-to-define-functions-in-julia/45816 "2022-12-10T06:49:01Z")

</div>

I tried to list all the ways one can define functions in Julia. Some are practical, some are silly but collecting them all is fun. Planning to make a video for fun exploring this. function name(a, b) a + b end na…

---

## [Using @which inside a macro on expr](https://discourse.julialang.org/t/using-which-inside-a-macro-on-expr/91372)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 5\
**Last updated:** [December 9, 2022, 10:59pm UTC](https://discourse.julialang.org/t/using-which-inside-a-macro-on-expr/91372 "2022-12-09T22:59:02Z")

</div>

What is the best way to call a macro with an Expr and then get the evaluated output of the macro? I want to write a macro that needs to call @which on its input and then use the returned method. Here is my current attemp…

---

## [Julia on Windows Store/juliaup?](https://discourse.julialang.org/t/julia-on-windows-store-juliaup/91489)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 3\
**Last updated:** [December 9, 2022, 8:57pm UTC](https://discourse.julialang.org/t/julia-on-windows-store-juliaup/91489 "2022-12-09T20:57:30Z")

</div>

I’m trying to install Julia from Windows Store on a new laptop running Windows 11 Pro. The installation seems to work, and “Install” changes to “Open” in Windows Store. However… If I click on “Open”, nothing happens I…

---

## [Independent custom colorbar in Plots?](https://discourse.julialang.org/t/independent-custom-colorbar-in-plots/91479)

<div class="topic-metadata">

**Author:** [@sim](https://discourse.julialang.org/u/sim)\
**Replies:** 3\
**Last updated:** [December 9, 2022, 6:39pm UTC](https://discourse.julialang.org/t/independent-custom-colorbar-in-plots/91479 "2022-12-09T18:39:23Z")

</div>

Hi, let’s suppose I have the following (essentially empty) plot: plot(xlabel="x axis", ylabel="y axis") plot!(rand(10)) Now, for some reason, I want to add a colorbar to this figure (yes, the colorbar has nothing to …

---

## [Oddities with loop with dummy variable in Tullio](https://discourse.julialang.org/t/oddities-with-loop-with-dummy-variable-in-tullio/91484)

<div class="topic-metadata">

**Author:** [@Andrea\_Pagnani](https://discourse.julialang.org/u/Andrea_Pagnani)\
**Replies:** 2\
**Last updated:** [December 9, 2022, 6:10pm UTC](https://discourse.julialang.org/t/oddities-with-loop-with-dummy-variable-in-tullio/91484 "2022-12-09T18:10:05Z")

</div>

Hi there I spotred possibly a strange bug using Tullio on CPU. Here is my package status (Julia-1.8.2) \[bdcacae8\] LoopVectorization v0.12.141 \[bc48ee85\] Tullio v0.3.5 And my minimal non-wroking example using LoopVec…

---

## [Quantifying "damping" rate of ODE](https://discourse.julialang.org/t/quantifying-damping-rate-of-ode/91276)

<div class="topic-metadata">

**Author:** [@ANasc](https://discourse.julialang.org/u/ANasc)\
**Replies:** 14\
**Last updated:** [December 9, 2022, 3:03pm UTC](https://discourse.julialang.org/t/quantifying-damping-rate-of-ode/91276 "2022-12-09T15:03:43Z")

</div>

Hi, I’m trying to figure out a way to compare how fast the oscillations in two ODE models decay. For example, the two figures below show the solution of a model that differs only in temperature, and I want to be able to…

---

## [Problem of eachcol in function](https://discourse.julialang.org/t/problem-of-eachcol-in-function/91458)

<div class="topic-metadata">

**Author:** [@Xuekui\_wang](https://discourse.julialang.org/u/Xuekui_wang)\
**Replies:** 6\
**Last updated:** [December 9, 2022, 1:58pm UTC](https://discourse.julialang.org/t/problem-of-eachcol-in-function/91458 "2022-12-09T13:58:57Z")

</div>

When I see a program, a funciton f3 defined as follows. In manual: eachcol means: Create a generator that iterates over the second dimension of matrix A, returning the columns as AbstractVector views. The function retu…

---

## [Simple CRPS optimization](https://discourse.julialang.org/t/simple-crps-optimization/91473)

<div class="topic-metadata">

**Author:** [@cmarcotte](https://discourse.julialang.org/u/cmarcotte)\
**Replies:** 1\
**Last updated:** [December 9, 2022, 1:53pm UTC](https://discourse.julialang.org/t/simple-crps-optimization/91473 "2022-12-09T13:53:06Z")

</div>

I have a short function for computing the Continuous Ranked Probability Score (CRPS) from an ensemble of states Xb::Array{Float64,2} and a set comparison state y::Array{Float64,1}, where y may have varying sparsity (i.e.…

---

## [How to find rankings of each tuple in the list of tuples?](https://discourse.julialang.org/t/how-to-find-rankings-of-each-tuple-in-the-list-of-tuples/91428)

<div class="topic-metadata">

**Author:** [@Phuntsho](https://discourse.julialang.org/u/Phuntsho)\
**Replies:** 7\
**Last updated:** [December 9, 2022, 8:41am UTC](https://discourse.julialang.org/t/how-to-find-rankings-of-each-tuple-in-the-list-of-tuples/91428 "2022-12-09T08:41:29Z")

</div>

I have a list of tuples something like as shown: v = \[(i,rand(1:15)) for i=1:30\] Now I want to rank each tuple according to the second value, which I was able to achieve using many functions as shown. vcat(\[map(k-\>(k\[…

---

## [Is there any way to remove the docstrings for all methods of a function?](https://discourse.julialang.org/t/is-there-any-way-to-remove-the-docstrings-for-all-methods-of-a-function/1497)

<div class="topic-metadata">

**Author:** [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Replies:** 11\
**Last updated:** [December 6, 2022, 9:18am UTC](https://discourse.julialang.org/t/is-there-any-way-to-remove-the-docstrings-for-all-methods-of-a-function/1497 "2022-12-06T09:18:09Z")

</div>

Lorem ipsum dolor sit amet

---

## [Atom for Julia](https://discourse.julialang.org/t/atom-for-julia/91436)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 4\
**Last updated:** [December 9, 2022, 7:33am UTC](https://discourse.julialang.org/t/atom-for-julia/91436 "2022-12-09T07:33:22Z")

</div>

Dear all, I opened the Atom today and the following message appears: and when I click to update the package “julia-client”: failed to updade…How can I solve this issue? Yesterday this was normal. Many thanks!

---

## [Reduce compilation time for long and nested tuples](https://discourse.julialang.org/t/reduce-compilation-time-for-long-and-nested-tuples/91392)

<div class="topic-metadata">

**Author:** [@osimonn](https://discourse.julialang.org/u/osimonn)\
**Replies:** 4\
**Last updated:** [December 9, 2022, 2:45am UTC](https://discourse.julialang.org/t/reduce-compilation-time-for-long-and-nested-tuples/91392 "2022-12-09T02:45:24Z")

</div>

Details: I am calling C functions and using C structures from Julia by using the Clang.jl to automate the wrapping process. In the C code, there are multiple arrays of one or more dimensions. In order to have a one-to-o…

---

## [Precompilation of Module](https://discourse.julialang.org/t/precompilation-of-module/91383)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 5\
**Last updated:** [December 9, 2022, 2:29am UTC](https://discourse.julialang.org/t/precompilation-of-module/91383 "2022-12-09T02:29:00Z")

</div>

I am working in VSC (Visual Studio Code) and added ModelingToolkit.jl to the packages. All went well, and then I typed using ModelingToolkit, and all was good. Then I went to a different window, and started up Julia on t…

---

## [Help using Python in Julia with PythonCall and DLPack](https://discourse.julialang.org/t/help-using-python-in-julia-with-pythoncall-and-dlpack/91441)

<div class="topic-metadata">

**Author:** [@Dale\_James\_Black](https://discourse.julialang.org/u/Dale_James_Black)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 9:27pm UTC](https://discourse.julialang.org/t/help-using-python-in-julia-with-pythoncall-and-dlpack/91441 "2022-12-08T21:27:27Z")

</div>

I am trying to utilize TorchIO on some Julia Arrays. I have gone with the combination of PythonCall.jl and DLPack.jl. Currently, the TorchIO augmentations work when the array is below a specific size, but fall apart afte…

---

## [Matrix product \`M \* transpose(M)\`](https://discourse.julialang.org/t/matrix-product-m-transpose-m/61212)

<div class="topic-metadata">

**Author:** [@stla](https://discourse.julialang.org/u/stla)\
**Replies:** 10\
**Last updated:** [December 8, 2022, 6:02pm UTC](https://discourse.julialang.org/t/matrix-product-m-transpose-m/61212 "2022-12-08T18:02:45Z")

</div>

Hello, Is there a function in Julia to efficiently compute the matrix product M \* transpose(M)? This matrix is symmetric, so there should be a more efficient way than doing M \* transpose(M). In R one can use the tcross…

---

## [How to ignore unnecessary function arguments?](https://discourse.julialang.org/t/how-to-ignore-unnecessary-function-arguments/91440)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 7:26pm UTC](https://discourse.julialang.org/t/how-to-ignore-unnecessary-function-arguments/91440 "2022-12-08T19:26:18Z")

</div>

\# Hello, i have any structures with kwargs, like this Base.@kwdef struct Foo a b c end # and i have any named tuples like this nt = (a=1, b=2, c=3, d=4, e=5, f=6, g=7) # ... # always : issubset(fieldnames(Foo), …

---

## [How to easily troubleshoot type instability traps in complex code?](https://discourse.julialang.org/t/how-to-easily-troubleshoot-type-instability-traps-in-complex-code/91439)

<div class="topic-metadata">

**Author:** [@tiZ](https://discourse.julialang.org/u/tiZ)\
**Replies:** 1\
**Last updated:** [December 8, 2022, 6:45pm UTC](https://discourse.julialang.org/t/how-to-easily-troubleshoot-type-instability-traps-in-complex-code/91439 "2022-12-08T18:45:16Z")

</div>

I know that type stability is very important in Julia, so how can I get a warning when there is a type change in my code? For example, I now have a very long code function f(x) that runs slowly, and I want to find out i…

---

## [Safe base64decode](https://discourse.julialang.org/t/safe-base64decode/91367)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 8\
**Last updated:** [December 8, 2022, 12:48pm UTC](https://discourse.julialang.org/t/safe-base64decode/91367 "2022-12-08T12:48:13Z")

</div>

I’d like to be able to base64decode a string without any risk of an ArgumentError("malformed base64 sequence") (see here). To that end, I can think of two main options: Make a safe version of the base64decode function …

---

## [How to Fill Area between y-axis and the curve $x^{2}$ correctly?](https://discourse.julialang.org/t/how-to-fill-area-between-y-axis-and-the-curve-x-2-correctly/91417)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 11:27am UTC](https://discourse.julialang.org/t/how-to-fill-area-between-y-axis-and-the-curve-x-2-correctly/91417 "2022-12-08T11:27:47Z")

</div>

Hi all, I want to recreate this plot. My code currently create this far away from the desired plot: using Plots, LaTeXStrings, Plots.PlotMeasures gr() f(x) = x^(2) plot(f, ylims= (0,33), xlims=(-2,10), framestyle=…

---

## [Where do I find the GTK widget properties?](https://discourse.julialang.org/t/where-do-i-find-the-gtk-widget-properties/80299)

<div class="topic-metadata">

**Author:** [@Rossati](https://discourse.julialang.org/u/Rossati)\
**Replies:** 5\
**Last updated:** [December 8, 2022, 8:56am UTC](https://discourse.julialang.org/t/where-do-i-find-the-gtk-widget-properties/80299 "2022-12-08T08:56:03Z")

</div>

Hi I started using Julia to build a form generator by GTK and I haven’t find a list of widget properties so, for example, for set the button width. I have tried this: function createButton(caption,width) btn = …

---

## [Expected Performance of Julia within a Spark Environment?](https://discourse.julialang.org/t/expected-performance-of-julia-within-a-spark-environment/91377)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 7\
**Last updated:** [December 7, 2022, 10:26pm UTC](https://discourse.julialang.org/t/expected-performance-of-julia-within-a-spark-environment/91377 "2022-12-07T22:26:28Z")

</div>

Hey folks, I need some help on answering a question I was posed: Assuming an algorithm is written in R or Python with some attempt to leverage the optomizations available in a Spark environment for parallelization etc…

---

## [Using OffsetArrays within a struct causes AbstractVector type](https://discourse.julialang.org/t/using-offsetarrays-within-a-struct-causes-abstractvector-type/91366)

<div class="topic-metadata">

**Author:** [@markowkes](https://discourse.julialang.org/u/markowkes)\
**Replies:** 2\
**Last updated:** [December 7, 2022, 8:15pm UTC](https://discourse.julialang.org/t/using-offsetarrays-within-a-struct-causes-abstractvector-type/91366 "2022-12-07T20:15:02Z")

</div>

I’m putting offset arrays in a struct and it is causing a type warning and slow performance. Here is a MWE module test using Parameters using OffsetArrays # Define struct with standard vector and offset vector @wit…

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

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