# General Usage

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

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

**Page:** 404

---

## [Pkg behavior that confused me](https://discourse.julialang.org/t/pkg-behavior-that-confused-me/86453)

<div class="topic-metadata">

**Author:** [@JackStrauss](https://discourse.julialang.org/u/JackStrauss)\
**Replies:** 18\
**Last updated:** [August 29, 2022, 9:40am UTC](https://discourse.julialang.org/t/pkg-behavior-that-confused-me/86453 "2022-08-29T09:40:17Z")

</div>

Hello all I spent a long time chasing something very confusing to me in Pkg. when I run our code on the command line as we always do, it seems to run julia -e 'push!(LOAD\_PATH,"Zinstrument/");using Zinstrument;Process…

---

## [Most effective way to check if neighboring values in a matrix are the same](https://discourse.julialang.org/t/most-effective-way-to-check-if-neighboring-values-in-a-matrix-are-the-same/86291)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 19\
**Last updated:** [August 30, 2022, 12:07am UTC](https://discourse.julialang.org/t/most-effective-way-to-check-if-neighboring-values-in-a-matrix-are-the-same/86291 "2022-08-30T00:07:01Z")

</div>

Suppose A is the following matrix. 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 1.0 1.0 0.0 0.0 0.0 1.0 1.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 1.0 I want to check each row of the matrix for the number of times …

---

## [Roadblocks to using Julia in a university](https://discourse.julialang.org/t/roadblocks-to-using-julia-in-a-university/86313)

<div class="topic-metadata">

**Author:** [@uje](https://discourse.julialang.org/u/uje)\
**Replies:** 38\
**Last updated:** [August 29, 2022, 10:59pm UTC](https://discourse.julialang.org/t/roadblocks-to-using-julia-in-a-university/86313 "2022-08-29T22:59:14Z")

</div>

Yesterday, in my university, our professor had a discussion with us yesterday on what programming language we’d love to use as the defacto to teach concepts from the foundation to the expert level on concepts like: Mu…

---

## [Searchsorted with predicate](https://discourse.julialang.org/t/searchsorted-with-predicate/86495)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 5\
**Last updated:** [August 29, 2022, 6:56pm UTC](https://discourse.julialang.org/t/searchsorted-with-predicate/86495 "2022-08-29T18:56:45Z")

</div>

Often when using the searchsorted function family, I wish predicate versions of those functions existed: searchsorted(==(5), array) searchsorted(\>(5), array) searchsortedfirst(\>(5), array) searchsortedlast(\<=(5), array)…

---

## [The following package names could not be resolved: in manifest but not in project](https://discourse.julialang.org/t/the-following-package-names-could-not-be-resolved-in-manifest-but-not-in-project/86509)

<div class="topic-metadata">

**Author:** [@Xavier\_Gonzalez](https://discourse.julialang.org/u/Xavier_Gonzalez)\
**Replies:** 1\
**Last updated:** [August 29, 2022, 6:42pm UTC](https://discourse.julialang.org/t/the-following-package-names-could-not-be-resolved-in-manifest-but-not-in-project/86509 "2022-08-29T18:42:05Z")

</div>

I am getting weird errors with ChainRules in Julia 1.8 To try to fix the problem, I went into the package manager for my project, and tried both rm ChainRules and rm Zygote. Both times I got the following error message: …

---

## [How to round symbolic matrix](https://discourse.julialang.org/t/how-to-round-symbolic-matrix/86507)

<div class="topic-metadata">

**Author:** [@Starpower\_Power](https://discourse.julialang.org/u/Starpower_Power)\
**Replies:** 1\
**Last updated:** [August 29, 2022, 5:44pm UTC](https://discourse.julialang.org/t/how-to-round-symbolic-matrix/86507 "2022-08-29T17:44:13Z")

</div>

i want that output in round form for emp: 1e-17 =0 should be zero. thanks

---

## [Does the singular value degeneracy cause the gradient to be NAN？](https://discourse.julialang.org/t/does-the-singular-value-degeneracy-cause-the-gradient-to-be-nan/86412)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 11\
**Last updated:** [August 29, 2022, 5:37pm UTC](https://discourse.julialang.org/t/does-the-singular-value-degeneracy-cause-the-gradient-to-be-nan/86412 "2022-08-29T17:37:07Z")

</div>

I recently encountered a situation where the result of a computation was of type NAN. I got the following example after a step-by-step debug: using Zygote using OMEinsum using LinearAlgebra function f(T) @ein M\[ b…

---

## [\[JLD2\] How to save an obj on file, replacing that object but not the whole file](https://discourse.julialang.org/t/jld2-how-to-save-an-obj-on-file-replacing-that-object-but-not-the-whole-file/86460)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 7\
**Last updated:** [August 29, 2022, 3:42pm UTC](https://discourse.julialang.org/t/jld2-how-to-save-an-obj-on-file-replacing-that-object-but-not-the-whole-file/86460 "2022-08-29T15:42:23Z")

</div>

In JLD2 I would like to save an object to a sort of “library file”, replacing the same object name if it exists, but keeping the other object if they exists. The problem is that even with append JLD2 returns an error if…

---

## [How does one initialize data into a module only once?](https://discourse.julialang.org/t/how-does-one-initialize-data-into-a-module-only-once/85775)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 12\
**Last updated:** [August 29, 2022, 3:48pm UTC](https://discourse.julialang.org/t/how-does-one-initialize-data-into-a-module-only-once/85775 "2022-08-29T15:48:37Z")

</div>

I need to load and parse a large file and have that data available before a module is used. I thought to put it in \_\_init\_\_ but discovered it was being called multiple times. module A function \_\_init\_\_() println("Load…

---

## [Pluto notebook in Julia v1.7.3 vs v1.8.0](https://discourse.julialang.org/t/pluto-notebook-in-julia-v1-7-3-vs-v1-8-0/86465)

<div class="topic-metadata">

**Author:** [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Replies:** 4\
**Last updated:** [August 29, 2022, 3:05pm UTC](https://discourse.julialang.org/t/pluto-notebook-in-julia-v1-7-3-vs-v1-8-0/86465 "2022-08-29T15:05:49Z")

</div>

I have a relatively small Pluto notebook. It uses the following packages: using PlotlyBase, HypertextLiteral, PlutoUI using Symbolics:@variables using LinearAlgebra, NLsolve using Dates, PeriodicalDates using DataFrame…

---

## [Force type stability (over block of code)](https://discourse.julialang.org/t/force-type-stability-over-block-of-code/86501)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 1\
**Last updated:** [August 29, 2022, 2:41pm UTC](https://discourse.julialang.org/t/force-type-stability-over-block-of-code/86501 "2022-08-29T14:41:43Z")

</div>

Hi Julianners, I saw many attempt on type table block. @code\_warntype to trace them. But in the end I don’t find what is the way to force type stability over a specific block. I want the code to stop or do a warn mes…

---

## [Improving loading time of own package](https://discourse.julialang.org/t/improving-loading-time-of-own-package/85778)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 3\
**Last updated:** [August 29, 2022, 1:36pm UTC](https://discourse.julialang.org/t/improving-loading-time-of-own-package/85778 "2022-08-29T13:36:53Z")

</div>

I’m currently working on creating a package. I’ve got everything working but the time first using it in a project takes quite long, about 17 seconds. Packages that I’m using which are way larger take much less time to lo…

---

## [Automating download of a fetch api in a website](https://discourse.julialang.org/t/automating-download-of-a-fetch-api-in-a-website/86380)

<div class="topic-metadata">

**Author:** [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Replies:** 21\
**Last updated:** [August 29, 2022, 1:16pm UTC](https://discourse.julialang.org/t/automating-download-of-a-fetch-api-in-a-website/86380 "2022-08-29T13:16:55Z")

</div>

I’m trying to automate a procedure in a Julia script which is equivalent to going on this page: https://mercado.ren.pt/EN/Electr/MarketInfo/MarketResults/OMIE/Pages/Prices.aspx and downloading a .xls file for the day, …

---

## [Simple communication between tasks](https://discourse.julialang.org/t/simple-communication-between-tasks/86480)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 3\
**Last updated:** [August 29, 2022, 1:14pm UTC](https://discourse.julialang.org/t/simple-communication-between-tasks/86480 "2022-08-29T13:14:30Z")

</div>

I’d like to have two simple tasks, that would symmetrically send values to each other. function task1(other\_task) res1 = send\_to\_other\_task(other\_task, 10) # switch to task2 and blocks until it sends a value @…

---

## [CUDA memory isn't freed and cannot be backtracked](https://discourse.julialang.org/t/cuda-memory-isnt-freed-and-cannot-be-backtracked/83292)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 9\
**Last updated:** [August 29, 2022, 11:03am UTC](https://discourse.julialang.org/t/cuda-memory-isnt-freed-and-cannot-be-backtracked/83292 "2022-08-29T11:03:26Z")

</div>

Hey Julianners, I checked the following topics but couldn’t resolve my issue. https://discourse.julialang.org/t/memory-is-not-freed-with-cuda-and-two-repls/60706 https://cuda.juliagpu.org/stable/usage/memory/ I think…

---

## [Generating functions through an interface (QML)](https://discourse.julialang.org/t/generating-functions-through-an-interface-qml/81362)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 4\
**Last updated:** [May 25, 2022, 2:32pm UTC](https://discourse.julialang.org/t/generating-functions-through-an-interface-qml/81362 "2022-05-25T14:32:56Z")

</div>

Hi all, I ran into the world age problem. What I’m trying to do is to make an interface to a physics simulation (classical spin ising) where the interaction function can be edited by the user. As an example, the interact…

---

## [Documenter warnings](https://discourse.julialang.org/t/documenter-warnings/86464)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 10\
**Last updated:** [August 29, 2022, 8:23am UTC](https://discourse.julialang.org/t/documenter-warnings/86464 "2022-08-29T08:23:59Z")

</div>

When I try to build the documentation of the package GitHub - ufechner7/KiteUtils.jl: Utilities for kite power system simulations using the command: include("docs/make.jl") I get the following warnings: First warning: …

---

## [Julia 1.8.0 via conda-forge is now available](https://discourse.julialang.org/t/julia-1-8-0-via-conda-forge-is-now-available/86472)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 0\
**Last updated:** [August 28, 2022, 9:15pm UTC](https://discourse.julialang.org/t/julia-1-8-0-via-conda-forge-is-now-available/86472 "2022-08-28T21:15:13Z")

</div>

Julia 1.8.0 is now available via conda-forge Linux and Mac OS X running on Intel x86\_64 processors. https://anaconda.org/conda-forge/julia Please direct any issues with that build to the julia-feedstock repository with…

---

## [Reading VTK files into Julia?](https://discourse.julialang.org/t/reading-vtk-files-into-julia/86420)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 8\
**Last updated:** [August 28, 2022, 5:19pm UTC](https://discourse.julialang.org/t/reading-vtk-files-into-julia/86420 "2022-08-28T17:19:33Z")

</div>

Hello! Is there any Julia library which wraps the VTK library in such a way that both legacy and new vtk file formats can be read? The top search item is “ReadVTK.jl”, which supposedly can read the new XML vtk file for…

---

## [Can't override method](https://discourse.julialang.org/t/cant-override-method/86419)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 9\
**Last updated:** [August 28, 2022, 3:11pm UTC](https://discourse.julialang.org/t/cant-override-method/86419 "2022-08-28T15:11:16Z")

</div>

I tried to pirate this method so it doesn’t throw but it is ignored and throws an error. What is wrong? Julia 1.7.1, PrettyTables master \[08abe8d2\] PrettyTables v1.3.1 \`https://github.com/ronisbr/PrettyTables.jl.git#ma…

---

## [What is the best way to avoid world age problem in this case?](https://discourse.julialang.org/t/what-is-the-best-way-to-avoid-world-age-problem-in-this-case/85621)

<div class="topic-metadata">

**Author:** [@Ali\_Vahdati](https://discourse.julialang.org/u/Ali_Vahdati)\
**Replies:** 12\
**Last updated:** [August 28, 2022, 2:01pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-avoid-world-age-problem-in-this-case/85621 "2022-08-28T14:01:45Z")

</div>

I am writing a package that uses a YML file as the user interface. Some parameters in the YML file are numbers which are easy to handle. A few parameters need to be functions. I ask the user to put those functions in som…

---

## [Plot of Cubic Root is not showing the negative f / codomain](https://discourse.julialang.org/t/plot-of-cubic-root-is-not-showing-the-negative-f-codomain/86452)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [August 28, 2022, 8:42am UTC](https://discourse.julialang.org/t/plot-of-cubic-root-is-not-showing-the-negative-f-codomain/86452 "2022-08-28T08:42:18Z")

</div>

Hi all, I want to know why is my Cubic Root graph only showing positive f ? using Plots, LaTeXStrings, Plots.PlotMeasures gr() f(x) = x^(1/3) plot(f,-10,10, xticks=false, xlims=(-13,13), ylims=(-13,13), bottom…

---

## [How to List Integer Only / Returns Integer?](https://discourse.julialang.org/t/how-to-list-integer-only-returns-integer/86432)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 14\
**Last updated:** [August 28, 2022, 5:56am UTC](https://discourse.julialang.org/t/how-to-list-integer-only-returns-integer/86432 "2022-08-28T05:56:51Z")

</div>

Hi all, I have this simple array (p,q) and want to calculate (p1,q1) and (p2,q2) by calculating (p1,q1) first then (p2,q2). The rule is simple pq’ = qp’ I try to create a simple looping here: # Operations on Rational …

---

## [Why is this a "malformed expression"?](https://discourse.julialang.org/t/why-is-this-a-malformed-expression/86391)

<div class="topic-metadata">

**Author:** [@digital\_carver](https://discourse.julialang.org/u/digital_carver)\
**Replies:** 6\
**Last updated:** [August 28, 2022, 3:05am UTC](https://discourse.julialang.org/t/why-is-this-a-malformed-expression/86391 "2022-08-28T03:05:23Z")

</div>

julia\> import Base: first julia\> (first((t,)), b) = 3, 5 ERROR: syntax: malformed expression Stacktrace: \[1\] top-level scope @ REPL\[23\]:1 julia\> first((t,)) = 3; #DON'T DO THIS, MESSES UP REPL DISPLAY julia\> (firs…

---

## [Best practices for automatic generation of Jacobians](https://discourse.julialang.org/t/best-practices-for-automatic-generation-of-jacobians/68035)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 7\
**Last updated:** [August 27, 2022, 9:33pm UTC](https://discourse.julialang.org/t/best-practices-for-automatic-generation-of-jacobians/68035 "2022-08-27T21:33:24Z")

</div>

Hi everyone, I would like to discuss the best practices for automatic generation of Jacobians when solving PDEs. I understand that the ‘way to go’ is to (1) define a residual function (in loop-style - pure Julia), (2) u…

---

## [DataFrame query](https://discourse.julialang.org/t/dataframe-query/86430)

<div class="topic-metadata">

**Author:** [@roh\_codeur](https://discourse.julialang.org/u/roh_codeur)\
**Replies:** 7\
**Last updated:** [August 27, 2022, 8:06pm UTC](https://discourse.julialang.org/t/dataframe-query/86430 "2022-08-27T20:06:11Z")

</div>

hi I have a dataframe as below Row │ Date Ticker Close frontContract secondContract │ Date String Float64 String String ───────┼───────────────────────────────────────…

---

## [Can I make type alias show up in a stack trace?](https://discourse.julialang.org/t/can-i-make-type-alias-show-up-in-a-stack-trace/86360)

<div class="topic-metadata">

**Author:** [@cgeoga](https://discourse.julialang.org/u/cgeoga)\
**Replies:** 9\
**Last updated:** [August 27, 2022, 8:03pm UTC](https://discourse.julialang.org/t/can-i-make-type-alias-show-up-in-a-stack-trace/86360 "2022-08-27T20:03:52Z")

</div>

I’ve seen a lot of style guides that suggest being sparing with closures. Which is concerning, because I use a ton of closures. Part of the motivation for that advice seems to be because stack traces are hard to learn fr…

---

## [Behavior of isready on unbuffered Channel](https://discourse.julialang.org/t/behavior-of-isready-on-unbuffered-channel/86438)

<div class="topic-metadata">

**Author:** [@MiguelAlonso](https://discourse.julialang.org/u/MiguelAlonso)\
**Replies:** 2\
**Last updated:** [August 27, 2022, 6:46pm UTC](https://discourse.julialang.org/t/behavior-of-isready-on-unbuffered-channel/86438 "2022-08-27T18:46:54Z")

</div>

Hello, The documentation for Base.isready says that the function returns true if there are tasks waiting on a put!. However, on Julia 1.8 I tried this: function unbuffered\_channel\_test() channel = Channel{Int64}(…

---

## [Create struct from YAML](https://discourse.julialang.org/t/create-struct-from-yaml/86429)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 5\
**Last updated:** [August 27, 2022, 4:08pm UTC](https://discourse.julialang.org/t/create-struct-from-yaml/86429 "2022-08-27T16:08:38Z")

</div>

I have the following code: using YAML, StructTypes, Parameters @with\_kw struct Test can\_log::String sys\_log::String version::String info::String end data = YAML.load\_file("data/config.yaml") test = da…

---

## [Transpose of symbolic matrix](https://discourse.julialang.org/t/transpose-of-symbolic-matrix/86433)

<div class="topic-metadata">

**Author:** [@Starpower\_Power](https://discourse.julialang.org/u/Starpower_Power)\
**Replies:** 1\
**Last updated:** [August 27, 2022, 3:36pm UTC](https://discourse.julialang.org/t/transpose-of-symbolic-matrix/86433 "2022-08-27T15:36:37Z")

</div>

i want output as \[cos(t) sin(t) 0; -sin(t) cos(t) 0; 0 0 1\] please someone help

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

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