# General Usage

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

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

**Page:** 211

---

## [ArnoldiMethod: strange error](https://discourse.julialang.org/t/arnoldimethod-strange-error/108876)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 2\
**Last updated:** [January 16, 2024, 9:23pm UTC](https://discourse.julialang.org/t/arnoldimethod-strange-error/108876 "2024-01-16T21:23:53Z")

</div>

For those who are familiar with ArnoldiMethod.jl: This works function (SI::ShiftAndInvert)(y, x) mul!(SI.temp, SI.B, x) y .= SI.A\_factorization \\ SI.temp # x -\> PtL \\ (B \* (PtL' \\ x)), # y .= SI.A\_fact…

---

## [Generated LLVM code causes register spills on x86\_64](https://discourse.julialang.org/t/generated-llvm-code-causes-register-spills-on-x86-64/108144)

<div class="topic-metadata">

**Author:** [@akrishnamoorthy](https://discourse.julialang.org/u/akrishnamoorthy)\
**Replies:** 11\
**Last updated:** [January 16, 2024, 8:30pm UTC](https://discourse.julialang.org/t/generated-llvm-code-causes-register-spills-on-x86-64/108144 "2024-01-16T20:30:55Z")

</div>

This question concerns circshift implemented here, which is reproduced below. function circshift(x::Tuple, shift::Integer) @inline j = mod1(shift, length(x)) ntuple(k -\> \_\_safe\_getindex(x, k-j+ifelse(k\>j,0,l…

---

## [Updated Julia and now I can't plot](https://discourse.julialang.org/t/updated-julia-and-now-i-cant-plot/108479)

<div class="topic-metadata">

**Author:** [@charperflow](https://discourse.julialang.org/u/charperflow)\
**Replies:** 28\
**Last updated:** [January 16, 2024, 5:46pm UTC](https://discourse.julialang.org/t/updated-julia-and-now-i-cant-plot/108479 "2024-01-16T17:46:16Z")

</div>

I am running arch linux using sway as my tiling compositor for wayland. The Arch Wiki recommends using the AUR version, so that is what I have installed on my machine. I updated to Julia 1.10.0, and now when I try to plo…

---

## [Estimating time periods of oscillators](https://discourse.julialang.org/t/estimating-time-periods-of-oscillators/108791)

<div class="topic-metadata">

**Author:** [@Sh\_166](https://discourse.julialang.org/u/Sh_166)\
**Replies:** 13\
**Last updated:** [January 16, 2024, 2:57pm UTC](https://discourse.julialang.org/t/estimating-time-periods-of-oscillators/108791 "2024-01-16T14:57:09Z")

</div>

As the title says, I want to estimate the time periods of a certain kind of oscillation that comes out of an ODE solution: This behaviour has a large period among other smaller ones (in this image, the time period of…

---

## [How to tell if a Pluto notebook is being run in Pluto or from REPL?](https://discourse.julialang.org/t/how-to-tell-if-a-pluto-notebook-is-being-run-in-pluto-or-from-repl/84282)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 3\
**Last updated:** [January 16, 2024, 1:49pm UTC](https://discourse.julialang.org/t/how-to-tell-if-a-pluto-notebook-is-being-run-in-pluto-or-from-repl/84282 "2024-01-16T13:49:34Z")

</div>

I have a Pluto notebook that uses the Pluto package manager. I can run that notebook within Pluto. I’d like to also be able to run it from the Julia REPL. When run from the REPL, I’d like some of the output to be writ…

---

## [One batch containing many SQL commands using ODBC.jl does not work with SQL Server](https://discourse.julialang.org/t/one-batch-containing-many-sql-commands-using-odbc-jl-does-not-work-with-sql-server/108856)

<div class="topic-metadata">

**Author:** [@Miroslav-Stimac](https://discourse.julialang.org/u/Miroslav-Stimac)\
**Replies:** 5\
**Last updated:** [January 16, 2024, 1:16pm UTC](https://discourse.julialang.org/t/one-batch-containing-many-sql-commands-using-odbc-jl-does-not-work-with-sql-server/108856 "2024-01-16T13:16:52Z")

</div>

Hello, I am using ODBC.jl to create a connection to a Microsoft SQL Server Database. conn = ODBC.Connection(Driver=ODBC Driver 17 for SQL Server;SERVER=MyServer;DATABASE=MyDatabase;Trusted\_Connection=Yes") Then I am e…

---

## [Suspicious file in artifacts folder](https://discourse.julialang.org/t/suspicious-file-in-artifacts-folder/108860)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 1\
**Last updated:** [January 16, 2024, 10:21am UTC](https://discourse.julialang.org/t/suspicious-file-in-artifacts-folder/108860 "2024-01-16T10:21:26Z")

</div>

The virus scanner blocked the file tokei.exe I’m quite sure it’s a legit file, but it would be nice to be able to learn more about it before I ask our IT to unblock it.

---

## [Excessive Memory Allocation?](https://discourse.julialang.org/t/excessive-memory-allocation/108841)

<div class="topic-metadata">

**Author:** [@freestatelabs](https://discourse.julialang.org/u/freestatelabs)\
**Replies:** 6\
**Last updated:** [January 16, 2024, 9:03am UTC](https://discourse.julialang.org/t/excessive-memory-allocation/108841 "2024-01-16T09:03:57Z")

</div>

I have a program I’m writing that reads in two Matrices, performs a bit of linear algebra in a pair of nested loops, then outputs a new Matrix. Because eventually it needs to operate on very large input Matrices, I’ve be…

---

## [Add ForwardDiff rule to allow complex arguments\`](https://discourse.julialang.org/t/add-forwarddiff-rule-to-allow-complex-arguments/108821)

<div class="topic-metadata">

**Author:** [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Replies:** 9\
**Last updated:** [January 15, 2024, 9:18pm UTC](https://discourse.julialang.org/t/add-forwarddiff-rule-to-allow-complex-arguments/108821 "2024-01-15T21:18:45Z")

</div>

I’m having trouble getting the derivative of a function which uses a complex variable internally. The key function is Di(x,y,T) = real(expintx(complex(-(1+T^2),(x+y\*T)\*√(1+T^2)))) which Zygote is happy to deal with, but …

---

## [Question about Setting BLAS Threads on Cluster](https://discourse.julialang.org/t/question-about-setting-blas-threads-on-cluster/108852)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 0\
**Last updated:** [January 16, 2024, 4:42am UTC](https://discourse.julialang.org/t/question-about-setting-blas-threads-on-cluster/108852 "2024-01-16T04:42:37Z")

</div>

Hello, I have a question about how BLAS threads are specified. For context, I am on my University’s HPC in an interactive session on our shared memory cluster. The partition that I am using has nodes which consist of tw…

---

## [How to save a string as a PDF](https://discourse.julialang.org/t/how-to-save-a-string-as-a-pdf/108830)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 11\
**Last updated:** [January 15, 2024, 7:24pm UTC](https://discourse.julialang.org/t/how-to-save-a-string-as-a-pdf/108830 "2024-01-15T19:24:01Z")

</div>

Hello, I would like to save a string as a PDF. I tried the following method, but it did not produce a valid file. my\_string = "this is my string" file = open("test.pdf", "w") write(file, my\_string) close(file) Is ther…

---

## [Multiplication and increment between elements whose index is stored in vectors without allocation: possible?](https://discourse.julialang.org/t/multiplication-and-increment-between-elements-whose-index-is-stored-in-vectors-without-allocation-possible/108819)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 5\
**Last updated:** [January 15, 2024, 6:25pm UTC](https://discourse.julialang.org/t/multiplication-and-increment-between-elements-whose-index-is-stored-in-vectors-without-allocation-possible/108819 "2024-01-15T18:25:26Z")

</div>

Hello, I have 3 arrays (x,y,w) where I want elementwise y += x \* w but the specific element indexes are stored in 3 separate vectors of SArrays, x\_ids, y\_ids and w\_ids. The problem is that the operation hugely allocates…

---

## [Export md-files to PDF via Weave](https://discourse.julialang.org/t/export-md-files-to-pdf-via-weave/89278)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 0\
**Last updated:** [October 26, 2022, 7:46am UTC](https://discourse.julialang.org/t/export-md-files-to-pdf-via-weave/89278 "2022-10-26T07:46:11Z")

</div>

Yesterday I struggled to export md-files via package Weave to pdf. Fist mistake was a search for a portable package for XeLaTeX, it took a while to understand that it is the best to install MiKTeX. As XeLaTeX is incor…

---

## [How to deal with name conflict between functions from different packages?](https://discourse.julialang.org/t/how-to-deal-with-name-conflict-between-functions-from-different-packages/108820)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 6\
**Last updated:** [January 15, 2024, 4:05pm UTC](https://discourse.julialang.org/t/how-to-deal-with-name-conflict-between-functions-from-different-packages/108820 "2024-01-15T16:05:35Z")

</div>

Packages A and B contain functions with different names such as func\_of\_A and func\_of\_B respectively, and functions with the same name such as func\_in\_both. At first, I only needed to use the function func\_in\_both of pa…

---

## [What is the best way to trigger debug messages in the logger?](https://discourse.julialang.org/t/what-is-the-best-way-to-trigger-debug-messages-in-the-logger/108754)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 2\
**Last updated:** [January 15, 2024, 3:54pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-trigger-debug-messages-in-the-logger/108754 "2024-01-15T15:54:44Z")

</div>

I have been looking at the Logging and LoggingExtras packages to better understand how to use them. So I finally understand how to setup the logging messages and such. One question that I was not clear on, was what is t…

---

## [How to compile to stand-alone executable using StaticCompiler in Windows?](https://discourse.julialang.org/t/how-to-compile-to-stand-alone-executable-using-staticcompiler-in-windows/106767)

<div class="topic-metadata">

**Author:** [@Thomas008](https://discourse.julialang.org/u/Thomas008)\
**Replies:** 8\
**Last updated:** [January 15, 2024, 3:03pm UTC](https://discourse.julialang.org/t/how-to-compile-to-stand-alone-executable-using-staticcompiler-in-windows/106767 "2024-01-15T15:03:24Z")

</div>

I published this question already in https://stackoverflow.com/questions/77551695/how-to-compile-julia-code-as-stand-alone-executable-with-help-of-staticcompiler. I’d like to compile to small executable in Windows, e.g.…

---

## [Inplace version for LU decomposition in Julia](https://discourse.julialang.org/t/inplace-version-for-lu-decomposition-in-julia/108795)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 8\
**Last updated:** [January 15, 2024, 2:55pm UTC](https://discourse.julialang.org/t/inplace-version-for-lu-decomposition-in-julia/108795 "2024-01-15T14:55:06Z")

</div>

Hi there! I have to compute the lu decomposition of a matrix that is dependent - I was thinking to create a buffer first and then inplace compute the lu decomposition when needed, but after googling and searching throug…

---

## [Fastest \`sqrt\` and \`log\` with negative check](https://discourse.julialang.org/t/fastest-sqrt-and-log-with-negative-check/107575)

<div class="topic-metadata">

**Author:** [@DanDoe](https://discourse.julialang.org/u/DanDoe)\
**Replies:** 17\
**Last updated:** [January 14, 2024, 12:23pm UTC](https://discourse.julialang.org/t/fastest-sqrt-and-log-with-negative-check/107575 "2024-01-14T12:23:15Z")

</div>

NaNMath.jl implements special functions such as sqrt and log which return NaN if called with negative argument. The implementation of sqrt is given by sqrt(x::T) where {T\<:AbstractFloat} = x \< 0.0 ? T(NaN) : Base.sqrt(…

---

## [Undefined Variable Error only on Github CI tests](https://discourse.julialang.org/t/undefined-variable-error-only-on-github-ci-tests/108804)

<div class="topic-metadata">

**Author:** [@Tortar](https://discourse.julialang.org/u/Tortar)\
**Replies:** 1\
**Last updated:** [January 14, 2024, 11:34pm UTC](https://discourse.julialang.org/t/undefined-variable-error-only-on-github-ci-tests/108804 "2024-01-14T23:34:30Z")

</div>

I got this mysterious error on github: Got exception outside of a @test On worker 2: UndefVarError: \`#323#326\` not defined along with other two very similar errors. What is really strange though is that locally …

---

## [\[a...\] vs \[a\]](https://discourse.julialang.org/t/a-vs-a/108757)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 7\
**Last updated:** [January 14, 2024, 11:32pm UTC](https://discourse.julialang.org/t/a-vs-a/108757 "2024-01-14T23:32:34Z")

</div>

What does this line of code mean? adds = add isa Union{AbstractArray, Tuple}? \[add...\] : \[add\] Here ‘add’ is supposed to be a vector or a single number.

---

## [How to pass flag-like commandline ARGS to julia -e](https://discourse.julialang.org/t/how-to-pass-flag-like-commandline-args-to-julia-e/108797)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 2\
**Last updated:** [January 14, 2024, 9:00pm UTC](https://discourse.julialang.org/t/how-to-pass-flag-like-commandline-args-to-julia-e/108797 "2024-01-14T21:00:37Z")

</div>

Hello, I just run into the issue, that julia will interprete flags even if passed after -e. The -- also does not seem to help, because it demands a file, but I really just want the -e and no extra file.

---

## [Dictionary of dictionaries as decision tree](https://discourse.julialang.org/t/dictionary-of-dictionaries-as-decision-tree/108783)

<div class="topic-metadata">

**Author:** [@leoflotor](https://discourse.julialang.org/u/leoflotor)\
**Replies:** 3\
**Last updated:** [January 14, 2024, 5:33pm UTC](https://discourse.julialang.org/t/dictionary-of-dictionaries-as-decision-tree/108783 "2024-01-14T17:33:22Z")

</div>

Hi! I am trying to do a decision tree using my implementation of ID3 but I am having some problems with one of my functions. For example, I have the following data frame: julia\> df 14×6 DataFrame Row │ pa as …

---

## [What is the best practice for parallel dictionary comprehensions?](https://discourse.julialang.org/t/what-is-the-best-practice-for-parallel-dictionary-comprehensions/108786)

<div class="topic-metadata">

**Author:** [@cdawg](https://discourse.julialang.org/u/cdawg)\
**Replies:** 3\
**Last updated:** [January 14, 2024, 12:51pm UTC](https://discourse.julialang.org/t/what-is-the-best-practice-for-parallel-dictionary-comprehensions/108786 "2024-01-14T12:51:14Z")

</div>

I’m trying to work out a good template for the parallel part of my experiments. I’m looking for rock-solid example code to copy and and extend based on the current ecosystem. Usually, I’m in the embarrassingly || space…

---

## [Julia is slower than matlab when it comes to matrix diagonalization?](https://discourse.julialang.org/t/julia-is-slower-than-matlab-when-it-comes-to-matrix-diagonalization/108658)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 39\
**Last updated:** [January 14, 2024, 1:50am UTC](https://discourse.julialang.org/t/julia-is-slower-than-matlab-when-it-comes-to-matrix-diagonalization/108658 "2024-01-14T01:50:08Z")

</div>

The following julia script is a literal translation of the original matlab code, using LinearAlgebra, SparseArrays using Arpack, Plots function bhm\_basis(N, M, dim, weight) basis = zeros(UInt8, M, dim) basis\[1,…

---

## [Having installed several versions of Julia on machine. How to open a specific version of julia from PowerShell?](https://discourse.julialang.org/t/having-installed-several-versions-of-julia-on-machine-how-to-open-a-specific-version-of-julia-from-powershell/78134)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 13\
**Last updated:** [January 13, 2024, 6:11pm UTC](https://discourse.julialang.org/t/having-installed-several-versions-of-julia-on-machine-how-to-open-a-specific-version-of-julia-from-powershell/78134 "2024-01-13T18:11:46Z")

</div>

I have two versions of Julia installed on my machine 1.6.3 and 1.8.0-beta 1. When I write julia in the PowerShell, it opens 1.6.3, how can I select the demanded version? I tried something like below, but it didn’t work C…

---

## [@btime inside function](https://discourse.julialang.org/t/btime-inside-function/108773)

<div class="topic-metadata">

**Author:** [@scheinerman](https://discourse.julialang.org/u/scheinerman)\
**Replies:** 2\
**Last updated:** [January 13, 2024, 3:51pm UTC](https://discourse.julialang.org/t/btime-inside-function/108773 "2024-01-13T15:51:03Z")

</div>

I would like to create a function to time test various operations, but it seems that invoking @btime (from BenchmarkTools) doesn’t work in this situation. Is there a way to use @btime inside a function. (Note: @time work…

---

## [Anaconda interfering with vscode](https://discourse.julialang.org/t/anaconda-interfering-with-vscode/108764)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 3\
**Last updated:** [January 13, 2024, 1:55pm UTC](https://discourse.julialang.org/t/anaconda-interfering-with-vscode/108764 "2024-01-13T13:55:59Z")

</div>

I have both vscode and anaconda on my windows desktop. Both can be used to run julia and python. Each time I start vscode and try to run a julia script, I get the error: \[ Info: Precompiling VSCodeServer \[9f5989ce-84fe…

---

## [Filter = Returns(false)](https://discourse.julialang.org/t/filter-returns-false/108758)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 3\
**Last updated:** [January 13, 2024, 12:46pm UTC](https://discourse.julialang.org/t/filter-returns-false/108758 "2024-01-13T12:46:28Z")

</div>

This is used as a default keyword argument in some function. What does it mean? What does ‘Returns()’ mean? Is it a function?

---

## [How to enter unicode letter with hat?](https://discourse.julialang.org/t/how-to-enter-unicode-letter-with-hat/108766)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [January 13, 2024, 10:28am UTC](https://discourse.julialang.org/t/how-to-enter-unicode-letter-with-hat/108766 "2024-01-13T10:28:58Z")

</div>

How can I enter this character \\hat U using Unicode?

---

## [Issue with Differential Equation Solver](https://discourse.julialang.org/t/issue-with-differential-equation-solver/105008)

<div class="topic-metadata">

**Author:** [@A\_09](https://discourse.julialang.org/u/A_09)\
**Replies:** 35\
**Last updated:** [January 13, 2024, 10:51am UTC](https://discourse.julialang.org/t/issue-with-differential-equation-solver/105008 "2024-01-13T10:51:43Z")

</div>

For this code: begin Parameters, variables, and derivatives @parameters t x @variables T(..) Dt = Differential(t) Dx = Differential(x) Dxx = Differential(x)^2 MOL Discretization parameters x\_max = L x\_min = 0 nc …

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

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