# General Usage

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

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

**Page:** 520

---

## [Vim + LanguageServer.jl or something like it](https://discourse.julialang.org/t/vim-languageserver-jl-or-something-like-it/56026)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 7\
**Last updated:** [November 16, 2021, 3:01am UTC](https://discourse.julialang.org/t/vim-languageserver-jl-or-something-like-it/56026 "2021-11-16T03:01:49Z")

</div>

I saw an awesome tool for neovim. Is there any similar thing for vim or neovim? Also, I’d like to how to setup such tools. Please help me :slight\_smile: Thanks.

---

## [Type mapping for Template(parametric) types with CxxWrap.jl](https://discourse.julialang.org/t/type-mapping-for-template-parametric-types-with-cxxwrap-jl/71534)

<div class="topic-metadata">

**Author:** [@kemu](https://discourse.julialang.org/u/kemu)\
**Replies:** 0\
**Last updated:** [November 16, 2021, 12:52am UTC](https://discourse.julialang.org/t/type-mapping-for-template-parametric-types-with-cxxwrap-jl/71534 "2021-11-16T00:52:33Z")

</div>

I’ve been trying to map these structures. # Julia Struct mutable struct Point{T} x::T y::T end // C++ Struct template \<typename T\> struct Point{ T x; T y; }; It is possible that CxxWrap maps Julia parametric…

---

## [I broke my Ubuntu LTS by installing Julia and Genie.jl newapp](https://discourse.julialang.org/t/i-broke-my-ubuntu-lts-by-installing-julia-and-genie-jl-newapp/71532)

<div class="topic-metadata">

**Author:** [@AlanAylmer](https://discourse.julialang.org/u/AlanAylmer)\
**Replies:** 0\
**Last updated:** [November 16, 2021, 12:01am UTC](https://discourse.julialang.org/t/i-broke-my-ubuntu-lts-by-installing-julia-and-genie-jl-newapp/71532 "2021-11-16T00:01:40Z")

</div>

Hello everyone. I have a fresh apache2 and I have an isolated LAN. I am working on a small app that passes a file from a client laptop to a server laptop. I hope to use Genie on an Apache2 server. I can install the who…

---

## [Cannot use buffer with AD?](https://discourse.julialang.org/t/cannot-use-buffer-with-ad/71309)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 11\
**Last updated:** [November 15, 2021, 10:14pm UTC](https://discourse.julialang.org/t/cannot-use-buffer-with-ad/71309 "2021-11-15T22:14:18Z")

</div>

Can I not use a buffer with AD as below? using ForwardDiff function buf(x) similar(x) end function test(x; sto=buf(x)) sto .= x.^2 sum(sto.^2) end function grad(x; sto=buf(x)) ForwardDiff.gradient(x -\>…

---

## [Update a package updates everything?](https://discourse.julialang.org/t/update-a-package-updates-everything/61868)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 6\
**Last updated:** [November 15, 2021, 9:41pm UTC](https://discourse.julialang.org/t/update-a-package-updates-everything/61868 "2021-11-15T21:41:40Z")

</div>

This topic is similar to this old one: But I do not think that a complete answer was provided there. Whenever I update any package, it seems that all other (or a huge number of them) get updated. For example: @v1.6)…

---

## [How to overload +=?](https://discourse.julialang.org/t/how-to-overload/71523)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 8\
**Last updated:** [November 15, 2021, 8:17pm UTC](https://discourse.julialang.org/t/how-to-overload/71523 "2021-11-15T20:17:03Z")

</div>

Is it possible to overload +=? mutable struct A a::Int end function Base.:+=(a::A, b::A) a.a += b.a a end EDIT: As pointed out by @giordano in post 7, the struct A should be defined immutable: struct A a:…

---

## [Understanding weird @code\_warntype warning](https://discourse.julialang.org/t/understanding-weird-code-warntype-warning/71488)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 6\
**Last updated:** [November 15, 2021, 6:24pm UTC](https://discourse.julialang.org/t/understanding-weird-code-warntype-warning/71488 "2021-11-15T18:24:27Z")

</div>

While testing one of my codes for type instability, I stumbled upon what feels like a strange behavior, emphasized by the example below. julia\> test(filepath::String) = @assert ispath(filepath) "File path $filepath is n…

---

## [Reuse Eigen object](https://discourse.julialang.org/t/reuse-eigen-object/71494)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 3\
**Last updated:** [November 15, 2021, 5:43pm UTC](https://discourse.julialang.org/t/reuse-eigen-object/71494 "2021-11-15T17:43:16Z")

</div>

If I do using LinearAlgebra A = randn(100,100) B = A'\*A C = eigen(B) then how could I avoid allocating more memory by the next call to eigen with a 100 by 100 symmetric matrix? In other words, how could I reuse C? (I…

---

## [How to convert Cartesian Index array into a Boolean array?](https://discourse.julialang.org/t/how-to-convert-cartesian-index-array-into-a-boolean-array/71465)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 1\
**Last updated:** [November 15, 2021, 5:39pm UTC](https://discourse.julialang.org/t/how-to-convert-cartesian-index-array-into-a-boolean-array/71465 "2021-11-15T17:39:06Z")

</div>

I have a Cartesian index array like the below: Ind = CartesianIndex{2}\[CartesianIndex(1, 1), CartesianIndex(2, 1), CartesianIndex(3, 1), ...\]; I have an array A with the same number of rows and 35 columns. I want to on…

---

## [How to input complex number in polar coordinate?](https://discourse.julialang.org/t/how-to-input-complex-number-in-polar-coordinate/71502)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 2\
**Last updated:** [November 15, 2021, 3:27pm UTC](https://discourse.julialang.org/t/how-to-input-complex-number-in-polar-coordinate/71502 "2021-11-15T15:27:24Z")

</div>

I have a complex number 25∠10. How can I input it such as polar(magnitude, angle)? what are the functions to convert (from degree to rad) and (rad to degree)?

---

## [Smoothing Noisy Data using Moving Mean](https://discourse.julialang.org/t/smoothing-noisy-data-using-moving-mean/65329)

<div class="topic-metadata">

**Author:** [@sekarsum](https://discourse.julialang.org/u/sekarsum)\
**Replies:** 9\
**Last updated:** [November 15, 2021, 9:54am UTC](https://discourse.julialang.org/t/smoothing-noisy-data-using-moving-mean/65329 "2021-11-15T09:54:50Z")

</div>

Hi there, Is there a function in Julia that is similar to MATLAB’s smooth() function. MATLAB smooth function: z = smooth(y, span, method) where y → input array; span → span of moving average; method → option between…

---

## [Making code available to workers](https://discourse.julialang.org/t/making-code-available-to-workers/71462)

<div class="topic-metadata">

**Author:** [@jonas-schulze](https://discourse.julialang.org/u/jonas-schulze)\
**Replies:** 2\
**Last updated:** [November 15, 2021, 9:06am UTC](https://discourse.julialang.org/t/making-code-available-to-workers/71462 "2021-11-15T09:06:45Z")

</div>

I tried to make some code, that queries information worker processes, reusable inside a module. Why does the code without a module work just fine, while nested in and exported from a module it does not? # nomodule.jl us…

---

## [Adding a new row to a DataFrame](https://discourse.julialang.org/t/adding-a-new-row-to-a-dataframe/1331)

<div class="topic-metadata">

**Author:** [@richthanki](https://discourse.julialang.org/u/richthanki)\
**Replies:** 8\
**Last updated:** [November 15, 2021, 8:34am UTC](https://discourse.julialang.org/t/adding-a-new-row-to-a-dataframe/1331 "2021-11-15T08:34:02Z")

</div>

It’s quite surprising that the DataFrames package documentation doesn’t provide a canonical way of adding a new record to a df. On the web I see approaches using push! append! vcat! and @data macros. Could someone help…

---

## [Pmap, Folds.map and ThreadsX.map perform worse than map for a seemly parallel task](https://discourse.julialang.org/t/pmap-folds-map-and-threadsx-map-perform-worse-than-map-for-a-seemly-parallel-task/71437)

<div class="topic-metadata">

**Author:** [@anneJulia](https://discourse.julialang.org/u/anneJulia)\
**Replies:** 10\
**Last updated:** [November 15, 2021, 8:19am UTC](https://discourse.julialang.org/t/pmap-folds-map-and-threadsx-map-perform-worse-than-map-for-a-seemly-parallel-task/71437 "2021-11-15T08:19:10Z")

</div>

I am trying to parallelize a simple function (doTheTransit in the MWE below). I have opened Julia in the terminal with -p 6 since I have a 6-Core processor. Explanation of my MWE: With the function createNecessary I a…

---

## [How to evaluate(substitute numerical values of params n states) a jacobian in modelingtoolkit using generate\_jacobian or calculate\_jacobian?](https://discourse.julialang.org/t/how-to-evaluate-substitute-numerical-values-of-params-n-states-a-jacobian-in-modelingtoolkit-using-generate-jacobian-or-calculate-jacobian/71466)

<div class="topic-metadata">

**Author:** [@yewalenikhil65](https://discourse.julialang.org/u/yewalenikhil65)\
**Replies:** 3\
**Last updated:** [November 15, 2021, 8:00am UTC](https://discourse.julialang.org/t/how-to-evaluate-substitute-numerical-values-of-params-n-states-a-jacobian-in-modelingtoolkit-using-generate-jacobian-or-calculate-jacobian/71466 "2021-11-15T08:00:21Z")

</div>

i found that ModelingToolkit.calculate\_jacobian() function symbolically generates Jacobian of ODESystem in MTK docs. How does one substitute numerical values of parameters and state varables numerical values in this mat…

---

## [Can't install package CuArrays](https://discourse.julialang.org/t/cant-install-package-cuarrays/71368)

<div class="topic-metadata">

**Author:** [@Niceno](https://discourse.julialang.org/u/Niceno)\
**Replies:** 5\
**Last updated:** [November 15, 2021, 6:31am UTC](https://discourse.julialang.org/t/cant-install-package-cuarrays/71368 "2021-11-15T06:31:58Z")

</div>

Dear all, I am trying to learn CUDA from the book “CUDA by Example” by Sanders and Kandrot. The book is based on C, so I am translating their examples to Julia. I got stuck at their example 3.2.3, which you can see he…

---

## [ReactiveX: observer pattern](https://discourse.julialang.org/t/reactivex-observer-pattern/71474)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 2\
**Last updated:** [November 15, 2021, 2:08am UTC](https://discourse.julialang.org/t/reactivex-observer-pattern/71474 "2021-11-15T02:08:59Z")

</div>

I stumbled upon this ReactiveX web page that provides a list of reactive libraries for various languages. Julia is notably missing in the list. Has anyone thought about building something and put it on that list? :wink: …

---

## [Typealias with a custom constructor](https://discourse.julialang.org/t/typealias-with-a-custom-constructor/71463)

<div class="topic-metadata">

**Author:** [@owiecc](https://discourse.julialang.org/u/owiecc)\
**Replies:** 6\
**Last updated:** [November 14, 2021, 9:17pm UTC](https://discourse.julialang.org/t/typealias-with-a-custom-constructor/71463 "2021-11-14T21:17:17Z")

</div>

Is there a way to create a type alias with a custom constructor? FloatyMcFloatFace = Float64 FloatyMcFloatFace(x) = new(x+1)

---

## [Line feed by spaces](https://discourse.julialang.org/t/line-feed-by-spaces/71439)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 11\
**Last updated:** [November 14, 2021, 3:44pm UTC](https://discourse.julialang.org/t/line-feed-by-spaces/71439 "2021-11-14T15:44:58Z")

</div>

hello, can you tell me how to make a better function that performs line feeds by spaces, than what I did with my natural science education, i, j, l and += 1 ? function feed\_lines(str::String, l::Int) chars = collect…

---

## [Is PyCall slower than directly using Python?](https://discourse.julialang.org/t/is-pycall-slower-than-directly-using-python/71110)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 10\
**Last updated:** [November 14, 2021, 1:03pm UTC](https://discourse.julialang.org/t/is-pycall-slower-than-directly-using-python/71110 "2021-11-14T13:03:42Z")

</div>

I was trying to benchmark some operations in python and since I wanted to do the metaanalysis in a Julia notebook, I found it convenient to use PyCall. I know that PyCall puts some extra overhead on the object conversio…

---

## [How to add package from a folder (not registered) into the the project?](https://discourse.julialang.org/t/how-to-add-package-from-a-folder-not-registered-into-the-the-project/71386)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 10\
**Last updated:** [November 14, 2021, 1:01pm UTC](https://discourse.julialang.org/t/how-to-add-package-from-a-folder-not-registered-into-the-the-project/71386 "2021-11-14T13:01:19Z")

</div>

I am trying to add a package called MyModule (I have designed it) but I am not being able to (@v1.6) pkg\> add MyModule ERROR: The following package names could not be resolved: \* MyModule (not found in project, manifes…

---

## [Align text in loop println](https://discourse.julialang.org/t/align-text-in-loop-println/71438)

<div class="topic-metadata">

**Author:** [@Sbeltranj](https://discourse.julialang.org/u/Sbeltranj)\
**Replies:** 3\
**Last updated:** [November 13, 2021, 11:47pm UTC](https://discourse.julialang.org/t/align-text-in-loop-println/71438 "2021-11-13T23:47:03Z")

</div>

Hi, I would like to align the column (v), how do I do it? vect\_mov = reshape(a,3,nno)' # matrix 3x4 for i = 1:nno u = (round(1000\*vect\_mov\[i,1\], digits = 3)) v = (round(1000\*vect\_mov\[i,2\], digits = 3)) …

---

## [What is the correct way to create a "pointer to pointer"?](https://discourse.julialang.org/t/what-is-the-correct-way-to-create-a-pointer-to-pointer/71442)

<div class="topic-metadata">

**Author:** [@heyx3](https://discourse.julialang.org/u/heyx3)\
**Replies:** 2\
**Last updated:** [November 14, 2021, 8:24am UTC](https://discourse.julialang.org/t/what-is-the-correct-way-to-create-a-pointer-to-pointer/71442 "2021-11-14T08:24:18Z")

</div>

OpenGL has a function for compiling shader source code. It takes an array of strings, a.k.a. const char\*\*. I can see an example in ModernGL.jl of how to do this with pointers: source::String = "..." ptr\_to\_ptr = convert…

---

## [Code file generators examples](https://discourse.julialang.org/t/code-file-generators-examples/71415)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 1\
**Last updated:** [November 14, 2021, 5:46am UTC](https://discourse.julialang.org/t/code-file-generators-examples/71415 "2021-11-14T05:46:19Z")

</div>

Hello, has anyone generated code files? Please give examples of packages. At first I tried on the basis of strings, then I began to create structures-models of code blocks, which is why I decided that it was better to …

---

## [Accented characters in vscode](https://discourse.julialang.org/t/accented-characters-in-vscode/53234)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 22\
**Last updated:** [November 13, 2021, 5:52pm UTC](https://discourse.julialang.org/t/accented-characters-in-vscode/53234 "2021-11-13T17:52:39Z")

</div>

In VScode, if I type θ \\hat tab then the hat comes after the θ but the variable is usable. θ̂ = 2.0 If instead I type \\hat tab θ I get the hat sitting on top of the θ but Julia gives an error. This issue is not speci…

---

## [Expression type identifier symbols](https://discourse.julialang.org/t/expression-type-identifier-symbols/71409)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 3\
**Last updated:** [November 13, 2021, 1:55pm UTC](https://discourse.julialang.org/t/expression-type-identifier-symbols/71409 "2021-11-13T13:55:29Z")

</div>

hello, is there any documentation on expression type identifier symbols? except Metaprogramming · The Julia Language :call :kw :macrocall :quote …

---

## [How to work with type unstable functions?](https://discourse.julialang.org/t/how-to-work-with-type-unstable-functions/56389)

<div class="topic-metadata">

**Author:** [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Replies:** 2\
**Last updated:** [November 12, 2021, 3:47pm UTC](https://discourse.julialang.org/t/how-to-work-with-type-unstable-functions/56389 "2021-11-12T15:47:37Z")

</div>

The question is: consider that I have a function, which is by the nature of the problem should return a heterogeneous result. Is there any way, approach, or design ideas, how to build a workflow that can work with these …

---

## [A stack of inverse matrices calculation when comparing to python](https://discourse.julialang.org/t/a-stack-of-inverse-matrices-calculation-when-comparing-to-python/71318)

<div class="topic-metadata">

**Author:** [@Fesh](https://discourse.julialang.org/u/Fesh)\
**Replies:** 8\
**Last updated:** [November 13, 2021, 9:54am UTC](https://discourse.julialang.org/t/a-stack-of-inverse-matrices-calculation-when-comparing-to-python/71318 "2021-11-13T09:54:03Z")

</div>

When using pyjulia to compute a stack of inverse matrices, I find it’s slower than directly using numpy.linalg.inv. But this shows using julia is faster than using python. This makes me confused. Here is my julia script…

---

## [ERROR: Unsatisfiable requirements detected for package HDF5 \[f67ccb44\]](https://discourse.julialang.org/t/error-unsatisfiable-requirements-detected-for-package-hdf5-f67ccb44/71404)

<div class="topic-metadata">

**Author:** [@Jing\_Zhang](https://discourse.julialang.org/u/Jing_Zhang)\
**Replies:** 3\
**Last updated:** [November 13, 2021, 12:19am UTC](https://discourse.julialang.org/t/error-unsatisfiable-requirements-detected-for-package-hdf5-f67ccb44/71404 "2021-11-13T00:19:56Z")

</div>

I tried to \]rm HDF5 and then \]add HDF5. But here is what it showed Can anyone help on this? Thank you so much!

---

## [Round vector Float64](https://discourse.julialang.org/t/round-vector-float64/71413)

<div class="topic-metadata">

**Author:** [@Sbeltranj](https://discourse.julialang.org/u/Sbeltranj)\
**Replies:** 1\
**Last updated:** [November 13, 2021, 12:13am UTC](https://discourse.julialang.org/t/round-vector-float64/71413 "2021-11-13T00:13:15Z")

</div>

Hi I want to round a vector, I want each element to round 0.1. how I do this?

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

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