# General Usage

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

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

**Page:** 127

---

## [@ccall for adslib.so](https://discourse.julialang.org/t/ccall-for-adslib-so/120863)

<div class="topic-metadata">

**Author:** [@yjr](https://discourse.julialang.org/u/yjr)\
**Replies:** 2\
**Last updated:** [October 4, 2024, 7:05am UTC](https://discourse.julialang.org/t/ccall-for-adslib-so/120863 "2024-10-04T07:05:45Z")

</div>

Hello, I sucessfully used the TcAdsDll under windows which is used to communicate with beckhoff hardware. Now I m switching stuff to linux and want to use the library here which produces adslib.so TcAdsDll. Julia can lo…

---

## [How do I move the cursor up?](https://discourse.julialang.org/t/how-do-i-move-the-cursor-up/120882)

<div class="topic-metadata">

**Author:** [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Replies:** 4\
**Last updated:** [October 4, 2024, 5:44am UTC](https://discourse.julialang.org/t/how-do-i-move-the-cursor-up/120882 "2024-10-04T05:44:43Z")

</div>

I want to print an array on the screen, then wait 1 second and print it again in the exact location (it will have changed) such that I only ever see one copy and the screen does not scroll downwards. I just need a escap…

---

## [Defining @ constraint with IntervalConstraintProgramming](https://discourse.julialang.org/t/defining-constraint-with-intervalconstraintprogramming/120884)

<div class="topic-metadata">

**Author:** [@ij05](https://discourse.julialang.org/u/ij05)\
**Replies:** 0\
**Last updated:** [October 4, 2024, 5:19am UTC](https://discourse.julialang.org/t/defining-constraint-with-intervalconstraintprogramming/120884 "2024-10-04T05:19:23Z")

</div>

I am trying to define a constraint using the IntervalConstraintProgramming.jl package as follows: a=3 C = @constraint x^2 + y^2 - $a \<= 0 Here, I wanted x and y to be treated as variables and a as a constant, defined e…

---

## [Windows artifact issue - "access denied" when installing Plots/Makie](https://discourse.julialang.org/t/windows-artifact-issue-access-denied-when-installing-plots-makie/103734)

<div class="topic-metadata">

**Author:** [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Replies:** 10\
**Last updated:** [October 3, 2024, 7:18pm UTC](https://discourse.julialang.org/t/windows-artifact-issue-access-denied-when-installing-plots-makie/103734 "2024-10-03T19:18:19Z")

</div>

For a few days now I’ve been unable to precompile Plots and CairoMakie on my Windows machine due to “access denied” errors with artifacts. Here’s that I see: Precompiling project... ✗ Cairo\_jll ✗ HarfBuzz\_jll ✗ li…

---

## [Calculating Statistics of an Array with A Mask (Masked Array)](https://discourse.julialang.org/t/calculating-statistics-of-an-array-with-a-mask-masked-array/120868)

<div class="topic-metadata">

**Author:** [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Replies:** 1\
**Last updated:** [October 3, 2024, 7:25pm UTC](https://discourse.julialang.org/t/calculating-statistics-of-an-array-with-a-mask-masked-array/120868 "2024-10-03T19:25:23Z")

</div>

I saw a great thread on performance at Slack. I asked to reproduce it here as I think it will be beneficial for many. The participants were: Alexander Plavin, @danielwe, @jar, @mcabbott . It started with Alexander’s q…

---

## [Is \`put!\` of a \`RemoteChannel\` thread-safe](https://discourse.julialang.org/t/is-put-of-a-remotechannel-thread-safe/120866)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 0\
**Last updated:** [October 3, 2024, 6:18pm UTC](https://discourse.julialang.org/t/is-put-of-a-remotechannel-thread-safe/120866 "2024-10-03T18:18:36Z")

</div>

Hello, I have the following RemoteChannel channel = RemoteChannel(() -\> Channel{Bool}(), 1) Is the put!(channel, true) action thread-safe?

---

## [Same performances between type-stable and type-unstable code](https://discourse.julialang.org/t/same-performances-between-type-stable-and-type-unstable-code/120799)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 13\
**Last updated:** [October 3, 2024, 3:22pm UTC](https://discourse.julialang.org/t/same-performances-between-type-stable-and-type-unstable-code/120799 "2024-10-03T15:22:06Z")

</div>

I’m writing some text explaining the importance of having type-stable code in Julia. I made the simple example of global variables: y = 2.4 function bar(x) res = zero(x) for i in 1:1000 res += y \* x …

---

## [Terminate a task](https://discourse.julialang.org/t/terminate-a-task/120855)

<div class="topic-metadata">

**Author:** [@zoythum](https://discourse.julialang.org/u/zoythum)\
**Replies:** 2\
**Last updated:** [October 3, 2024, 1:03pm UTC](https://discourse.julialang.org/t/terminate-a-task/120855 "2024-10-03T13:03:22Z")

</div>

I am using ZMQ to create a publisher subscriber infrastructure. The main problem I am facing is that the recv function blocks the execution of the code. I would like to spawn a Task that is responsible for receiving a ne…

---

## [How to optimise a linear solve in a hot loop?](https://discourse.julialang.org/t/how-to-optimise-a-linear-solve-in-a-hot-loop/120835)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 7\
**Last updated:** [October 3, 2024, 12:55pm UTC](https://discourse.julialang.org/t/how-to-optimise-a-linear-solve-in-a-hot-loop/120835 "2024-10-03T12:55:51Z")

</div>

I have a hot loop that takes the following simplified form: for n in eachindex(result) compute\_A!(A) compute\_b!(b) x = A \\ b result\[n\] = f(x) end Here, A is a tall dense matrix, b is a dense vector, bot…

---

## [Manifest\_usage.toml/pidfile related error](https://discourse.julialang.org/t/manifest-usage-toml-pidfile-related-error/112585)

<div class="topic-metadata">

**Author:** [@Sid1](https://discourse.julialang.org/u/Sid1)\
**Replies:** 1\
**Last updated:** [October 3, 2024, 11:46am UTC](https://discourse.julialang.org/t/manifest-usage-toml-pidfile-related-error/112585 "2024-10-03T11:46:00Z")

</div>

I keep coming across this error (inconsistently) when I run my scripts on a HPC cluster: Activating project at \`/projects\` ERROR: LoadError: On worker 8: IOError: open("/user/.julia/logs/manifest\_usage.toml.pid", 194,…

---

## [Negative integer exponent](https://discourse.julialang.org/t/negative-integer-exponent/120848)

<div class="topic-metadata">

**Author:** [@Andrea\_Pagnani](https://discourse.julialang.org/u/Andrea_Pagnani)\
**Replies:** 4\
**Last updated:** [October 3, 2024, 10:49am UTC](https://discourse.julialang.org/t/negative-integer-exponent/120848 "2024-10-03T10:49:35Z")

</div>

There is something strange that I do not understand: julia\> 2^-3 0.125 works ok. But the following minor generalization does not. julia\> g() = -3; 2^g() ERROR: DomainError with -3: Cannot raise an integer x to a negat…

---

## [Issue with DynamicPolynomials and BigFloat coefficients?](https://discourse.julialang.org/t/issue-with-dynamicpolynomials-and-bigfloat-coefficients/120814)

<div class="topic-metadata">

**Author:** [@chkat](https://discourse.julialang.org/u/chkat)\
**Replies:** 2\
**Last updated:** [October 3, 2024, 10:05am UTC](https://discourse.julialang.org/t/issue-with-dynamicpolynomials-and-bigfloat-coefficients/120814 "2024-10-03T10:05:56Z")

</div>

I am experiencing an issue with the latest version of DynamicPolynomials (0.6) when I evaluate a polynomial with BigFloat coefficients at another BigFloat. I isolated a simple example that shows that I get different resu…

---

## [Readlines(filepath) and read(filepath,String) read different content](https://discourse.julialang.org/t/readlines-filepath-and-read-filepath-string-read-different-content/120777)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 15\
**Last updated:** [October 3, 2024, 9:52am UTC](https://discourse.julialang.org/t/readlines-filepath-and-read-filepath-string-read-different-content/120777 "2024-10-03T09:52:11Z")

</div>

Hey Julianners, This is fairly strange behavior as the readlines(fila\_path) doesn’t read the last enter from the file. Why is that? file\_path="test/playground/test/src/profile\_startup.jl" lines = readlines(file\_path, k…

---

## [TIL: loop variables can be an element of an array, dict, etc](https://discourse.julialang.org/t/til-loop-variables-can-be-an-element-of-an-array-dict-etc/120840)

<div class="topic-metadata">

**Author:** [@screw\_dog](https://discourse.julialang.org/u/screw_dog)\
**Replies:** 1\
**Last updated:** [October 3, 2024, 6:46am UTC](https://discourse.julialang.org/t/til-loop-variables-can-be-an-element-of-an-array-dict-etc/120840 "2024-10-03T06:46:46Z")

</div>

Been using Julia for several years and only just realised that you can use elements of an array, dict, etc as a loop variable. Eg julia\> v = zeros(Int, 3); for v\[1\] ∈ 0:3, v\[2\] ∈ v\[1\]:3, v\[3\] ∈ v\[2\]:3 println(v…

---

## [Why is 1.0f-99 not a subnormal number?](https://discourse.julialang.org/t/why-is-1-0f-99-not-a-subnormal-number/120833)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 1\
**Last updated:** [October 2, 2024, 11:48pm UTC](https://discourse.julialang.org/t/why-is-1-0f-99-not-a-subnormal-number/120833 "2024-10-02T23:48:07Z")

</div>

ulia\> issubnormal(1.0f-37) false julia\> issubnormal(1.0f-38) true julia\> issubnormal(1.0f-39) true julia\> issubnormal(1.0f-99) false For Float64 numbers subnormal starts from exponent -308 to -324 and then it stops j…

---

## [Is there a non-allocating version of findall?](https://discourse.julialang.org/t/is-there-a-non-allocating-version-of-findall/120832)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 1\
**Last updated:** [October 2, 2024, 11:47pm UTC](https://discourse.julialang.org/t/is-there-a-non-allocating-version-of-findall/120832 "2024-10-02T23:47:00Z")

</div>

MWEusing StaticArrays, BenchmarkTools # Data vector dat = collect(1:10); # Always five "trues" but at any indices flag = \[trues(3); falses(5); trues(2)\]; # Index with vector of bools @btime ($dat\[$flag\]); @b…

---

## [How does structural\_simplify work?](https://discourse.julialang.org/t/how-does-structural-simplify-work/120810)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 9\
**Last updated:** [October 2, 2024, 9:22pm UTC](https://discourse.julialang.org/t/how-does-structural-simplify-work/120810 "2024-10-02T21:22:20Z")

</div>

The function structural\_simplify() of the package ModelingToolkit can reduce the number of equations of a DAE a lot, often by 80%. But how does this actually work? does the order of the DAE stays the same? does it int…

---

## [How to calculate opnorm for a sparse matrix in julia?](https://discourse.julialang.org/t/how-to-calculate-opnorm-for-a-sparse-matrix-in-julia/120820)

<div class="topic-metadata">

**Author:** [@usaer](https://discourse.julialang.org/u/usaer)\
**Replies:** 3\
**Last updated:** [October 2, 2024, 5:04pm UTC](https://discourse.julialang.org/t/how-to-calculate-opnorm-for-a-sparse-matrix-in-julia/120820 "2024-10-02T17:04:31Z")

</div>

Please guide on how to calculate the opnorm for p=2 in julia for sparse matrices. When I try I get the error ArgumentError: 2-norm not yet implemented for sparse matrices. Try opnorm(Array(A)) or opnorm(A, p) where p=1 …

---

## [Change xticklabels in PolarAxis (GLMakie)](https://discourse.julialang.org/t/change-xticklabels-in-polaraxis-glmakie/120811)

<div class="topic-metadata">

**Author:** [@NaSi](https://discourse.julialang.org/u/NaSi)\
**Replies:** 3\
**Last updated:** [October 2, 2024, 2:19pm UTC](https://discourse.julialang.org/t/change-xticklabels-in-polaraxis-glmakie/120811 "2024-10-02T14:19:11Z")

</div>

Hello =) I work with GLMakie and I want to plot the following : rticklabels = \["a", "b", "c", "d", "e", "f", "g"\] rticks = 0:10:60 f = Figure(size = (800, 400)) ax = PolarAxis(f\[1, 1\], rticks = rticks, rticklabels = r…

---

## [Trying to understand low performance compared to C++](https://discourse.julialang.org/t/trying-to-understand-low-performance-compared-to-c/120804)

<div class="topic-metadata">

**Author:** [@paulmelis](https://discourse.julialang.org/u/paulmelis)\
**Replies:** 13\
**Last updated:** [October 2, 2024, 1:19pm UTC](https://discourse.julialang.org/t/trying-to-understand-low-performance-compared-to-c/120804 "2024-10-02T13:19:46Z")

</div>

With the toy problem below of approximating Pi by sampling a square I get an almost 4x lower performance with Julia than wit the C++ version. The code is very simple, just two nested 2 loops, no indexing, no type instabi…

---

## [Cases for using Downloads.Downloader()](https://discourse.julialang.org/t/cases-for-using-downloads-downloader/120806)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 0\
**Last updated:** [October 2, 2024, 9:31am UTC](https://discourse.julialang.org/t/cases-for-using-downloads-downloader/120806 "2024-10-02T09:31:26Z")

</div>

Hi, from Downloads · The Julia Language I wonder what are the benefits of using downloader = Downloads.Downloader() apart having more options. For instance, would it be useful if I download multiple files from the sa…

---

## [Issue with SciMLSensitivity and DifferentialEquations](https://discourse.julialang.org/t/issue-with-scimlsensitivity-and-differentialequations/119796)

<div class="topic-metadata">

**Author:** [@Nick1](https://discourse.julialang.org/u/Nick1)\
**Replies:** 10\
**Last updated:** [October 1, 2024, 10:43pm UTC](https://discourse.julialang.org/t/issue-with-scimlsensitivity-and-differentialequations/119796 "2024-10-01T22:43:37Z")

</div>

I installed the SciMLSensitivity library and it removed the BoundaryValueDiffEq, so when I am trying to load the DifferentialEquations package, I get the following error: ERROR: LoadError: Failed to precompile Boundary…

---

## [Community string benchmark suite](https://discourse.julialang.org/t/community-string-benchmark-suite/120771)

<div class="topic-metadata">

**Author:** [@tecosaur](https://discourse.julialang.org/u/tecosaur)\
**Replies:** 3\
**Last updated:** [October 1, 2024, 7:27pm UTC](https://discourse.julialang.org/t/community-string-benchmark-suite/120771 "2024-10-01T19:27:37Z")

</div>

Hello! I’d like your help formulating a high-quality suite of string benchmarks. Over in Internals & Design I’ve started a conversation about potentially renovating String’s memory representation to reduce memory usage …

---

## [Fast evaluation of linear/bilinear expressions and Jacobians from strings](https://discourse.julialang.org/t/fast-evaluation-of-linear-bilinear-expressions-and-jacobians-from-strings/120721)

<div class="topic-metadata">

**Author:** [@Olegg](https://discourse.julialang.org/u/Olegg)\
**Replies:** 1\
**Last updated:** [October 1, 2024, 5:33pm UTC](https://discourse.julialang.org/t/fast-evaluation-of-linear-bilinear-expressions-and-jacobians-from-strings/120721 "2024-10-01T17:33:23Z")

</div>

I have a set of m equality constraints with linear and/or bilinear terms, defined as strings. For example: \[ “P0\_I\_m − F1\_m − F2\_m”, “P0\_E\_m − F6\_m − F7\_m”, “P0\_dS\_m + P0\_E\_m − P0\_I\_m”, “F1\_m + F2\_m + F4\_m − F3\_m”, …

---

## [Throwing my own \`NotImplementedError\` to emulate abstract methods](https://discourse.julialang.org/t/throwing-my-own-notimplementederror-to-emulate-abstract-methods/97680)

<div class="topic-metadata">

**Author:** [@zuckerruebe](https://discourse.julialang.org/u/zuckerruebe)\
**Replies:** 6\
**Last updated:** [October 1, 2024, 3:39pm UTC](https://discourse.julialang.org/t/throwing-my-own-notimplementederror-to-emulate-abstract-methods/97680 "2024-10-01T15:39:11Z")

</div>

Hi there I want to write a piece of software that my users can extend by writing “plugins” for it. Specifically, they would provide their own types in their plugins, that the main program will then operate on. For the m…

---

## [Latency with v1.11-rc3 REPL over SSH](https://discourse.julialang.org/t/latency-with-v1-11-rc3-repl-over-ssh/119498)

<div class="topic-metadata">

**Author:** [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)\
**Replies:** 22\
**Last updated:** [October 1, 2024, 6:40am UTC](https://discourse.julialang.org/t/latency-with-v1-11-rc3-repl-over-ssh/119498 "2024-10-01T06:40:33Z")

</div>

I have a noticeable latency in 1.11-rc3 than in 1.10.5, when working locally it isn’t noticeable, but when using Julia through ssh it is quite noticeable. More info: It’s worst when starting the REPL and it gets smoothe…

---

## [Multiply two hermitian or symmetric matrices](https://discourse.julialang.org/t/multiply-two-hermitian-or-symmetric-matrices/120709)

<div class="topic-metadata">

**Author:** [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Replies:** 4\
**Last updated:** [September 30, 2024, 5:09pm UTC](https://discourse.julialang.org/t/multiply-two-hermitian-or-symmetric-matrices/120709 "2024-09-30T17:09:14Z")

</div>

Hello, is there a specialized mul method in julia that can multiply efficiently Hermitian or symmetric matrices without them being of the Hermitian or Symmetric type ?

---

## [PackageCompiler bundled libraries](https://discourse.julialang.org/t/packagecompiler-bundled-libraries/119168)

<div class="topic-metadata">

**Author:** [@Julian](https://discourse.julialang.org/u/Julian)\
**Replies:** 7\
**Last updated:** [September 30, 2024, 3:08pm UTC](https://discourse.julialang.org/t/packagecompiler-bundled-libraries/119168 "2024-09-30T15:08:57Z")

</div>

I have successfully compiled a DLL using create\_library: But its file size and the amount of bundled libraries seem a bit excessive to me: Basic DLL: 186MB Bundled libraries: 331MB I will not need most of the bund…

---

## [Incorrect \`method overwritten\` warning with optional kwargs..?](https://discourse.julialang.org/t/incorrect-method-overwritten-warning-with-optional-kwargs/120714)

<div class="topic-metadata">

**Author:** [@iago-lito](https://discourse.julialang.org/u/iago-lito)\
**Replies:** 4\
**Last updated:** [September 30, 2024, 2:56pm UTC](https://discourse.julialang.org/t/incorrect-method-overwritten-warning-with-optional-kwargs/120714 "2024-09-30T14:56:27Z")

</div>

My package exposes this caller method, whose behaviour may be controlled by consumers provided they specialize f: TestPkg/src/TestPkg.jl module TestPkg # Entry point for users. caller(a) = f(a; b = 1) export caller #…

---

## [Plots and IJulia format issues](https://discourse.julialang.org/t/plots-and-ijulia-format-issues/120712)

<div class="topic-metadata">

**Author:** [@Simon\_Exner](https://discourse.julialang.org/u/Simon_Exner)\
**Replies:** 0\
**Last updated:** [September 30, 2024, 8:17am UTC](https://discourse.julialang.org/t/plots-and-ijulia-format-issues/120712 "2024-09-30T08:17:55Z")

</div>

Hello, the following MWE of a julia-jupyter notebook (rename to .ipynb) shows a problem with plots: MWE1.ipynb.jl (224.5 KB) no matter the selected output format, the cell outputs an “image/png”, “image/svg+xml” and “…

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

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