# General Usage

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

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

**Page:** 305

---

## [Freeze a weight with Flux](https://discourse.julialang.org/t/freeze-a-weight-with-flux/97441)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 1\
**Last updated:** [April 14, 2023, 6:07am UTC](https://discourse.julialang.org/t/freeze-a-weight-with-flux/97441 "2023-04-14T06:07:23Z")

</div>

I have a few linear layers created with Flux. I ran these layers for a few epochs, and would now to freeze all the weights of one of the linear layers, but leaving the bias unfrozen. Could somebody post a MWE demonstrati…

---

## ["Julian" way to include external scripts/modules without name conflicts](https://discourse.julialang.org/t/julian-way-to-include-external-scripts-modules-without-name-conflicts/97023)

<div class="topic-metadata">

**Author:** [@Deduction42](https://discourse.julialang.org/u/Deduction42)\
**Replies:** 7\
**Last updated:** [April 13, 2023, 10:57pm UTC](https://discourse.julialang.org/t/julian-way-to-include-external-scripts-modules-without-name-conflicts/97023 "2023-04-13T22:57:52Z")

</div>

I’m trying to manage a set of machine-learning models, each with its own custom-defined data preprocessing pipeline to highlight important features. In a directory, I have one folder per model and within each folder, I h…

---

## [Convert array to string and separate each element with underscore](https://discourse.julialang.org/t/convert-array-to-string-and-separate-each-element-with-underscore/97452)

<div class="topic-metadata">

**Author:** [@jianqixi](https://discourse.julialang.org/u/jianqixi)\
**Replies:** 2\
**Last updated:** [April 13, 2023, 9:54pm UTC](https://discourse.julialang.org/t/convert-array-to-string-and-separate-each-element-with-underscore/97452 "2023-04-13T21:54:52Z")

</div>

Hi I am trying to convert one array, like A=\[“a”, “b”, “c”\] into one string, like str=“a\_b\_c”. I am wondering, in Julia, how can we get it. Thanks

---

## [UndefVarError: \_throw\_dmrs not defined but "\_throw\_dmrs" is nowhere in my code](https://discourse.julialang.org/t/undefvarerror-throw-dmrs-not-defined-but-throw-dmrs-is-nowhere-in-my-code/97445)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 1\
**Last updated:** [April 13, 2023, 9:46pm UTC](https://discourse.julialang.org/t/undefvarerror-throw-dmrs-not-defined-but-throw-dmrs-is-nowhere-in-my-code/97445 "2023-04-13T21:46:37Z")

</div>

What does this error mean? It happens in the context of a NLsolve but I have no idea what “\_throw\_dmrs” is.

---

## [Leading Zeros got truncated from df column](https://discourse.julialang.org/t/leading-zeros-got-truncated-from-df-column/97409)

<div class="topic-metadata">

**Author:** [@Sandy45](https://discourse.julialang.org/u/Sandy45)\
**Replies:** 7\
**Last updated:** [April 13, 2023, 9:03pm UTC](https://discourse.julialang.org/t/leading-zeros-got-truncated-from-df-column/97409 "2023-04-13T21:03:59Z")

</div>

I have dataframe with integer field and it’s usually consists of time for ex. 0001, 1020, 2359 etc. When there are leading zeros in the column they are being truncated and I’ve tried applying lpad which seems to be does…

---

## [Edgelist of a graph](https://discourse.julialang.org/t/edgelist-of-a-graph/97423)

<div class="topic-metadata">

**Author:** [@ahmad88](https://discourse.julialang.org/u/ahmad88)\
**Replies:** 6\
**Last updated:** [April 13, 2023, 3:30pm UTC](https://discourse.julialang.org/t/edgelist-of-a-graph/97423 "2023-04-13T15:30:35Z")

</div>

I have the follwoing graph in graphml format \<?xml version="1.0"?\> \<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdra…

---

## [Plotlyjs and composite figures](https://discourse.julialang.org/t/plotlyjs-and-composite-figures/97320)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 8\
**Last updated:** [April 13, 2023, 10:32am UTC](https://discourse.julialang.org/t/plotlyjs-and-composite-figures/97320 "2023-04-13T10:32:11Z")

</div>

Hi all, I’m trying to create composite figures which involve a heatmap as well as an overlying contour. I’d like to control the aspect ratio, the contour thickness and the colorbars. I chose plotlyjs backend of Plots be…

---

## [Using GLMakie to animate crank mechanism](https://discourse.julialang.org/t/using-glmakie-to-animate-crank-mechanism/79594)

<div class="topic-metadata">

**Author:** [@Ogweno\_Emmanuel](https://discourse.julialang.org/u/Ogweno_Emmanuel)\
**Replies:** 18\
**Last updated:** [April 13, 2023, 4:44am UTC](https://discourse.julialang.org/t/using-glmakie-to-animate-crank-mechanism/79594 "2023-04-13T04:44:15Z")

</div>

I am trying to animate a crank mechanism using the GLMakie package. I was following this youtube tutorial, Making animations and interactive applications in Makie.jl - YouTube , and here’s the code I wrote. using GLMaki…

---

## [Is the Julia plugin compatible with VSCode 1.77](https://discourse.julialang.org/t/is-the-julia-plugin-compatible-with-vscode-1-77/97421)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 2\
**Last updated:** [April 13, 2023, 9:14am UTC](https://discourse.julialang.org/t/is-the-julia-plugin-compatible-with-vscode-1-77/97421 "2023-04-13T09:14:13Z")

</div>

I upgraded to VSCode 1.77, but the Julia plugin does not work on my system. Is this to be expected or is it perhaps a system-specific problem?

---

## [How do I get the indexes for matrix columns whose elements are all the same?](https://discourse.julialang.org/t/how-do-i-get-the-indexes-for-matrix-columns-whose-elements-are-all-the-same/97402)

<div class="topic-metadata">

**Author:** [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Replies:** 12\
**Last updated:** [April 13, 2023, 8:41am UTC](https://discourse.julialang.org/t/how-do-i-get-the-indexes-for-matrix-columns-whose-elements-are-all-the-same/97402 "2023-04-13T08:41:17Z")

</div>

Suppose you have a matrix m, how do you get the indexes of all the columns whose values are all the same. For example, if m is such as below, the answer should be 1 because only the first column has all entries equal. m…

---

## [How to create an exe file from julia code?](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004)

<div class="topic-metadata">

**Author:** [@vinod\_kc](https://discourse.julialang.org/u/vinod_kc)\
**Replies:** 56\
**Last updated:** [April 13, 2023, 8:37am UTC](https://discourse.julialang.org/t/how-to-create-an-exe-file-from-julia-code/30004 "2023-04-13T08:37:27Z")

</div>

Hi all, I am new to julia. I just started loving this language at first sight, Elegant ! My area of interest is windows desktop applications. I just set up all the beginning steps in atom and execute my Hello World app…

---

## [Guarantees on order of evaluation?](https://discourse.julialang.org/t/guarantees-on-order-of-evaluation/96259)

<div class="topic-metadata">

**Author:** [@lmtzx9h4qqnt](https://discourse.julialang.org/u/lmtzx9h4qqnt)\
**Replies:** 12\
**Last updated:** [April 13, 2023, 4:52am UTC](https://discourse.julialang.org/t/guarantees-on-order-of-evaluation/96259 "2023-04-13T04:52:18Z")

</div>

Are there any guarantees on the order in which sub-parts of expressions (e. g. function arguments) are evaluated? It seems like Julia evaluates from left to right, but there doesn’t actually seem to be anything in the do…

---

## [Bitshifting using GMP.MPZ](https://discourse.julialang.org/t/bitshifting-using-gmp-mpz/97356)

<div class="topic-metadata">

**Author:** [@x13420x](https://discourse.julialang.org/u/x13420x)\
**Replies:** 7\
**Last updated:** [April 11, 2023, 10:49pm UTC](https://discourse.julialang.org/t/bitshifting-using-gmp-mpz/97356 "2023-04-11T22:49:53Z")

</div>

I am noticing that the GMP functions are faster that the native julia functions for example: Base.GMP.MPZ.gcd(a,b) 20 percent faster …only tried 2 values…sorry I am certain for 1000 digit numbers I wil…

---

## [Calling a Julia script from the Linux terminal (with inputs)](https://discourse.julialang.org/t/calling-a-julia-script-from-the-linux-terminal-with-inputs/97380)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 8\
**Last updated:** [April 12, 2023, 4:30pm UTC](https://discourse.julialang.org/t/calling-a-julia-script-from-the-linux-terminal-with-inputs/97380 "2023-04-12T16:30:40Z")

</div>

Hi all. I have a script that I need to run as a part of a shell script. Inside julia I can just put the name of the file, but in my workflow I need to parse this file name to the julia script (from a shelle script) and …

---

## [Issue for Implementing the Runge Kutta CQ method](https://discourse.julialang.org/t/issue-for-implementing-the-runge-kutta-cq-method/97397)

<div class="topic-metadata">

**Author:** [@khaledharizb](https://discourse.julialang.org/u/khaledharizb)\
**Replies:** 0\
**Last updated:** [April 12, 2023, 3:27pm UTC](https://discourse.julialang.org/t/issue-for-implementing-the-runge-kutta-cq-method/97397 "2023-04-12T15:27:39Z")

</div>

I would like to solve convolution equation numerically by the so-called convolution quadrature (CQ) (see the picture) based on Runge-Kutta CQ method. However, I didn’t arrive to get the expected solution as in the attac…

---

## [Unsatisfiable requirements (at installing specified package)](https://discourse.julialang.org/t/unsatisfiable-requirements-at-installing-specified-package/97052)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 11\
**Last updated:** [April 12, 2023, 3:02pm UTC](https://discourse.julialang.org/t/unsatisfiable-requirements-at-installing-specified-package/97052 "2023-04-12T15:02:52Z")

</div>

Hi guys, For me this is pretty nonsense and just cannot understand what is going on. I want to use the HTTP@1.7.4 version as I got downgraded somehow to a very low package that doesn1t support literally anything. What c…

---

## [How to reset current repl settings to default?](https://discourse.julialang.org/t/how-to-reset-current-repl-settings-to-default/97392)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 1\
**Last updated:** [April 12, 2023, 1:01pm UTC](https://discourse.julialang.org/t/how-to-reset-current-repl-settings-to-default/97392 "2023-04-12T13:01:37Z")

</div>

julia\> Base.active\_repl.interface.modes\[1\].prompt = "my\_prompt\> " my\_prompt\> # Is there a universal way to fallback to default prompt? my\_prompt\> # without Base.active\_repl.interface.modes\[1\].prompt = "julia\> " my\_prompt\>…

---

## [Parquet2: Reading parquet files with varying sensor names](https://discourse.julialang.org/t/parquet2-reading-parquet-files-with-varying-sensor-names/97390)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 0\
**Last updated:** [April 12, 2023, 11:17am UTC](https://discourse.julialang.org/t/parquet2-reading-parquet-files-with-varying-sensor-names/97390 "2023-04-12T11:17:00Z")

</div>

Hello! It is a tad difficult for me to make a MWE for this, so I will see if my explanation with words can do it. I noticed that if I have a folder consisting of multiple parquet files, but with different data, for exa…

---

## [Juliahub packages feature request: detect and mark deprecated or archived packages](https://discourse.julialang.org/t/juliahub-packages-feature-request-detect-and-mark-deprecated-or-archived-packages/97370)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 2\
**Last updated:** [April 12, 2023, 7:01am UTC](https://discourse.julialang.org/t/juliahub-packages-feature-request-detect-and-mark-deprecated-or-archived-packages/97370 "2023-04-12T07:01:52Z")

</div>

Perhaps there should be a feature to mark your package as deprecated on Juliahub? Once a package’s source code repository get’s archived, I think it would make sense for this fact to be prominently displayed on Juli…

---

## [Write and read json file](https://discourse.julialang.org/t/write-and-read-json-file/97379)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 1\
**Last updated:** [April 12, 2023, 6:56am UTC](https://discourse.julialang.org/t/write-and-read-json-file/97379 "2023-04-12T06:56:32Z")

</div>

I tried to save and read the following json file, but there is some problem for the presence of nothing. using YFinance, JSON3 aapl\_json=get\_quoteSummary("AAPL") aapl\_json\_string=string(aapl\_json) open("aapl.json", "w"…

---

## [PythonCall array indexing](https://discourse.julialang.org/t/pythoncall-array-indexing/97099)

<div class="topic-metadata">

**Author:** [@polhager](https://discourse.julialang.org/u/polhager)\
**Replies:** 3\
**Last updated:** [April 12, 2023, 6:45am UTC](https://discourse.julialang.org/t/pythoncall-array-indexing/97099 "2023-04-12T06:45:00Z")

</div>

Hello! In trying to use PythonCall in place of PyCall I find a strange behaviour when indexing a matrix in Python using only one index. As an example, I have the python file pythoncall\_test.py: def test(q): return q…

---

## [Map over vector with union eltype makes type-inference worse](https://discourse.julialang.org/t/map-over-vector-with-union-eltype-makes-type-inference-worse/97332)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [April 12, 2023, 2:15am UTC](https://discourse.julialang.org/t/map-over-vector-with-union-eltype-makes-type-inference-worse/97332 "2023-04-12T02:15:16Z")

</div>

julia\> struct A end julia\> struct B end julia\> struct C{AA,BB} a :: AA b :: BB end julia\> v = Union{C{A,B}, C{B,B}}\[C(A(), B()), C(B(),B())\] 2-element Vector{Union{C{A, B}, C{B, B}}}: C{A, B}(A…

---

## [What is the most efficiency way to read the 3D matrix?](https://discourse.julialang.org/t/what-is-the-most-efficiency-way-to-read-the-3d-matrix/97184)

<div class="topic-metadata">

**Author:** [@manu\_han](https://discourse.julialang.org/u/manu_han)\
**Replies:** 5\
**Last updated:** [April 12, 2023, 2:01am UTC](https://discourse.julialang.org/t/what-is-the-most-efficiency-way-to-read-the-3d-matrix/97184 "2023-04-12T02:01:40Z")

</div>

Here is 3 D array. TD=rand(150,27,55) I have saved ‘TD’ in a various way as follow. DataFrame(λ\_SPS=collect(eachslice(λ\_SPS,dims=3))) CSV.write(“TD.csv”, TD) DataFrame(λ\_SPS=collect(eachslice(λ\_SPS,dims=1))) CSV.wr…

---

## [Question: Improve the speed of for loop](https://discourse.julialang.org/t/question-improve-the-speed-of-for-loop/97204)

<div class="topic-metadata">

**Author:** [@manu\_han](https://discourse.julialang.org/u/manu_han)\
**Replies:** 20\
**Last updated:** [April 12, 2023, 1:49am UTC](https://discourse.julialang.org/t/question-improve-the-speed-of-for-loop/97204 "2023-04-12T01:49:08Z")

</div>

I have written massive ‘for loop’ code as follows: Meta\_start=390; Meta\_end=400; Meta\_div=trunc(Int,((Meta\_end-Meta\_start)\*100)); #temporary Meta\_cal=LinRange(Meta\_start,Meta\_end,Meta\_div); k=1:1:Meta\_div #::Vec…

---

## [PyCall.jl with SparseArrays](https://discourse.julialang.org/t/pycall-jl-with-sparsearrays/97316)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 6\
**Last updated:** [April 11, 2023, 11:21pm UTC](https://discourse.julialang.org/t/pycall-jl-with-sparsearrays/97316 "2023-04-11T23:21:22Z")

</div>

I am trying to diagonalize a huge sparse Hermitian matrix (original thread here: Suggestions needed: diagonalizing large Hermitian sparse matrix) and am exploring the possibility of utilizing the PRIMME package. Since th…

---

## [Sharing a package global dictionary with other packages](https://discourse.julialang.org/t/sharing-a-package-global-dictionary-with-other-packages/97326)

<div class="topic-metadata">

**Author:** [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Replies:** 3\
**Last updated:** [April 11, 2023, 9:08pm UTC](https://discourse.julialang.org/t/sharing-a-package-global-dictionary-with-other-packages/97326 "2023-04-11T21:08:07Z")

</div>

I want to define a dictionary in one package that other client packages can access and update. For a proof of concept, let’s define a “base” module Foo and a client module Bar: # module \`Foo\` defines a global dictionary…

---

## [How to translate a directory named "A" with src files in it to a package named "B.jl" using PkgTemplates without loosing the git commit history?](https://discourse.julialang.org/t/how-to-translate-a-directory-named-a-with-src-files-in-it-to-a-package-named-b-jl-using-pkgtemplates-without-loosing-the-git-commit-history/97319)

<div class="topic-metadata">

**Author:** [@martinmestre](https://discourse.julialang.org/u/martinmestre)\
**Replies:** 15\
**Last updated:** [April 11, 2023, 8:38pm UTC](https://discourse.julialang.org/t/how-to-translate-a-directory-named-a-with-src-files-in-it-to-a-package-named-b-jl-using-pkgtemplates-without-loosing-the-git-commit-history/97319 "2023-04-11T20:38:22Z")

</div>

The situation is that I have recently decided to use PkgTemplates and would like to adapt some directories where I have been coding (neither of them is yet a package but they will be). Maybe this is a basic git question…

---

## [Type inference for map and broadcast differs on empty vectors](https://discourse.julialang.org/t/type-inference-for-map-and-broadcast-differs-on-empty-vectors/97321)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 3\
**Last updated:** [April 11, 2023, 8:02pm UTC](https://discourse.julialang.org/t/type-inference-for-map-and-broadcast-differs-on-empty-vectors/97321 "2023-04-11T20:02:28Z")

</div>

Both map and broadcast can infer the element type if a function is applied to an empty vector, at least in many circumstances: julia\> f(x) = 3\*x julia\> map(f, Int\[\]) Int64\[\] julia\> f.(Int\[\]) Int64\[\] However, if used wi…

---

## [Tullio with pre-computed index broadcasting](https://discourse.julialang.org/t/tullio-with-pre-computed-index-broadcasting/97345)

<div class="topic-metadata">

**Author:** [@ovt](https://discourse.julialang.org/u/ovt)\
**Replies:** 2\
**Last updated:** [April 11, 2023, 1:58pm UTC](https://discourse.julialang.org/t/tullio-with-pre-computed-index-broadcasting/97345 "2023-04-11T13:58:12Z")

</div>

It’s my first time with Tullio, so my problem may look very basic. Here is a minimal example that provides the error "expected integers!" : using Tullio m,r = 5,5 rr = div(r\*(r-1),2) A = rand(m,rr) B = rand(m,r) C = si…

---

## [A way to set logging level in Pluto notebooks](https://discourse.julialang.org/t/a-way-to-set-logging-level-in-pluto-notebooks/95074)

<div class="topic-metadata">

**Author:** [@AsgerHB](https://discourse.julialang.org/u/AsgerHB)\
**Replies:** 13\
**Last updated:** [April 11, 2023, 10:05am UTC](https://discourse.julialang.org/t/a-way-to-set-logging-level-in-pluto-notebooks/95074 "2023-04-11T10:05:05Z")

</div>

Is there a way to set the logging level of a cell in Pluto? By default it will show everything, including debug. Or even just a way to set it globally? Pluto notebooks are a great way to debug newly developed code, …

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

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