# General Usage

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

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

**Page:** 684

---

## [Detect lines with Hough transform](https://discourse.julialang.org/t/detect-lines-with-hough-transform/49307)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 10\
**Last updated:** [October 31, 2020, 8:17am UTC](https://discourse.julialang.org/t/detect-lines-with-hough-transform/49307 "2020-10-31T08:17:44Z")

</div>

I have an image with 3 lines in it: For each of the three lines, I’d like to find the coordinates of their ends (i.e. where in the image are the start and end of each line). I thought that the best tool for the job wo…

---

## [Why doesn't indexing syntax broadcast?](https://discourse.julialang.org/t/why-doesnt-indexing-syntax-broadcast/49353)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [October 31, 2020, 7:34am UTC](https://discourse.julialang.org/t/why-doesnt-indexing-syntax-broadcast/49353 "2020-10-31T07:34:00Z")

</div>

Why don’t these do the same thing? julia\> getindex.(\[\[1,2\], \[3,4\]\], 1) 2-element Array{Int64,1}: 1 3 julia\> \[\[1,2\], \[3,4\]\].\[1\] ERROR: syntax: invalid syntax "\[\[1, 2\], \[3, 4\]\].\[1\]"

---

## [Minimizing allocations from memoized functions](https://discourse.julialang.org/t/minimizing-allocations-from-memoized-functions/49221)

<div class="topic-metadata">

**Author:** [@ash](https://discourse.julialang.org/u/ash)\
**Replies:** 10\
**Last updated:** [October 31, 2020, 7:05am UTC](https://discourse.julialang.org/t/minimizing-allocations-from-memoized-functions/49221 "2020-10-31T07:05:17Z")

</div>

I have the following MWE using a memoized function: using Memoization using FFTW struct Operators{F} K::F # More operators end function run(N, α) M = 512 ω = rand(M) # Cache the kinetic factor …

---

## [A working physics engine package?](https://discourse.julialang.org/t/a-working-physics-engine-package/48184)

<div class="topic-metadata">

**Author:** [@mlg556](https://discourse.julialang.org/u/mlg556)\
**Replies:** 8\
**Last updated:** [October 31, 2020, 3:20am UTC](https://discourse.julialang.org/t/a-working-physics-engine-package/48184 "2020-10-31T03:20:09Z")

</div>

I’ve been trying to find a working physics engine library, but it seems that the ports of Box2D and Chipmunk are out of date. There is RigidBodyDynamics, but as far as I can tell it doesn’t support collisions and contact…

---

## [Distributed Dimensional Arrays](https://discourse.julialang.org/t/distributed-dimensional-arrays/49343)

<div class="topic-metadata">

**Author:** [@hyacykcharel](https://discourse.julialang.org/u/hyacykcharel)\
**Replies:** 0\
**Last updated:** [October 30, 2020, 11:14pm UTC](https://discourse.julialang.org/t/distributed-dimensional-arrays/49343 "2020-10-30T23:14:56Z")

</div>

Hello, I’m trying to run this in parallel but the result is not what I want, and I need My DArray to be synchronized. #2D Heat Equation. using Distributed addprocs(2) @everywhere using DistributedArrays @everywhere usin…

---

## [Calling a Fortran routine from a library which uses LAPACK](https://discourse.julialang.org/t/calling-a-fortran-routine-from-a-library-which-uses-lapack/49124)

<div class="topic-metadata">

**Author:** [@andreasvarga](https://discourse.julialang.org/u/andreasvarga)\
**Replies:** 9\
**Last updated:** [October 30, 2020, 11:07pm UTC](https://discourse.julialang.org/t/calling-a-fortran-routine-from-a-library-which-uses-lapack/49124 "2020-10-30T23:07:02Z")

</div>

I made several wrappers to LAPACK, so I am basically familiar with the mechanism of calling Fortran based LAPACK programs from Julia. I would like to call now subroutines from another Fortran library (called SLICOT), whi…

---

## [Multivariate (multiple response) regression using matrixnormal in Turing](https://discourse.julialang.org/t/multivariate-multiple-response-regression-using-matrixnormal-in-turing/49323)

<div class="topic-metadata">

**Author:** [@Kokora](https://discourse.julialang.org/u/Kokora)\
**Replies:** 0\
**Last updated:** [October 30, 2020, 7:23pm UTC](https://discourse.julialang.org/t/multivariate-multiple-response-regression-using-matrixnormal-in-turing/49323 "2020-10-30T19:23:41Z")

</div>

Hi all, I am new to Turing and wanted to play on a toy example with a multiple response regression. Here is the code. Any help will be greatly appreciated. #— Code started here using Distributions, LinearAlgebra using…

---

## [Fast sympy vectorization on julia Arrays](https://discourse.julialang.org/t/fast-sympy-vectorization-on-julia-arrays/49318)

<div class="topic-metadata">

**Author:** [@CorbinFoucart](https://discourse.julialang.org/u/CorbinFoucart)\
**Replies:** 1\
**Last updated:** [October 30, 2020, 6:52pm UTC](https://discourse.julialang.org/t/fast-sympy-vectorization-on-julia-arrays/49318 "2020-10-30T18:52:10Z")

</div>

I have a python library I’ve built on sympy and specifically sympy.vector which does vector calculus computations (divergence, gradient, curl, laplacians, etc) for calculations related to PDEs. Sympy provides methods tha…

---

## [Help with Registry.toml missing](https://discourse.julialang.org/t/help-with-registry-toml-missing/49304)

<div class="topic-metadata">

**Author:** [@Stephen\_Wild](https://discourse.julialang.org/u/Stephen_Wild)\
**Replies:** 2\
**Last updated:** [October 30, 2020, 1:36pm UTC](https://discourse.julialang.org/t/help-with-registry-toml-missing/49304 "2020-10-30T13:36:59Z")

</div>

Hi everyone, I am starting to learn julia. I am trying to install some new packages, but I receive the following message when I try to install packages: (@v1.5) pkg\> add LinearAlgebra Installing known registries int…

---

## [How to run a Julia file with PyJulia](https://discourse.julialang.org/t/how-to-run-a-julia-file-with-pyjulia/49282)

<div class="topic-metadata">

**Author:** [@Rita\_Paz](https://discourse.julialang.org/u/Rita_Paz)\
**Replies:** 4\
**Last updated:** [October 30, 2020, 1:19pm UTC](https://discourse.julialang.org/t/how-to-run-a-julia-file-with-pyjulia/49282 "2020-10-30T13:19:47Z")

</div>

I have a Julia file called ‘func1.jl’ with two defined functions that uses the ‘LowRankApprox’ package. Julia, it is working well. But I need it to work in Python. When I import to Python, with PyJulia, it doesn’t work. …

---

## [World age problem, when does a generated function get generated?](https://discourse.julialang.org/t/world-age-problem-when-does-a-generated-function-get-generated/49302)

<div class="topic-metadata">

**Author:** [@louisponet](https://discourse.julialang.org/u/louisponet)\
**Replies:** 0\
**Last updated:** [October 30, 2020, 1:02pm UTC](https://discourse.julialang.org/t/world-age-problem-when-does-a-generated-function-get-generated/49302 "2020-10-30T13:02:11Z")

</div>

I’m having a very confusing interaction between GLAbstraction.jl and ColorTypes.jl. I’ve read through pretty much all the world age threads and info I could find but I still don’t understand what is going wrong. The str…

---

## [Packages for instrumenting / rewriting Julia code (at Expr level)?](https://discourse.julialang.org/t/packages-for-instrumenting-rewriting-julia-code-at-expr-level/37742)

<div class="topic-metadata">

**Author:** [@robertfeldt](https://discourse.julialang.org/u/robertfeldt)\
**Replies:** 3\
**Last updated:** [October 30, 2020, 10:29am UTC](https://discourse.julialang.org/t/packages-for-instrumenting-rewriting-julia-code-at-expr-level/37742 "2020-10-30T10:29:40Z")

</div>

I know of Cassette.jl but my impression is that it requires knowledge about lower-level Julia compilation/execution stages. Are there other good options/packages/approaches for instrumenting Julia code at the Expr level? …

---

## [Use stable version of package while developing](https://discourse.julialang.org/t/use-stable-version-of-package-while-developing/49261)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 7\
**Last updated:** [October 30, 2020, 10:05am UTC](https://discourse.julialang.org/t/use-stable-version-of-package-while-developing/49261 "2020-10-30T10:05:15Z")

</div>

I am developing a package, changing the files in .julia/dev/Package. Usually, my development workflow is: using Revise \] dev Package using Package However, from time to time I want to use the stable version of the same…

---

## [Append an array inside a function](https://discourse.julialang.org/t/append-an-array-inside-a-function/49289)

<div class="topic-metadata">

**Author:** [@Nova](https://discourse.julialang.org/u/Nova)\
**Replies:** 6\
**Last updated:** [October 30, 2020, 8:49am UTC](https://discourse.julialang.org/t/append-an-array-inside-a-function/49289 "2020-10-30T08:49:23Z")

</div>

I don’t really understand the scope of the variable SV here. I used it inside a function, so I expect that when I add elements to it, it should work fine: SV = rand(10, 1) function add\_star(SV) for i =1:5 …

---

## [Using SymEngine. Functions not defined](https://discourse.julialang.org/t/using-symengine-functions-not-defined/49270)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 4\
**Last updated:** [October 30, 2020, 7:18am UTC](https://discourse.julialang.org/t/using-symengine-functions-not-defined/49270 "2020-10-30T07:18:28Z")

</div>

using SymEngine julia\> expand(a + 2(b+2)^2 + 2a + 3(a+1)) when I try to do this, I get error, expand not defined. I think that means it’s not fiding SymEngine.

---

## [Calling Windows API from Julia](https://discourse.julialang.org/t/calling-windows-api-from-julia/25123)

<div class="topic-metadata">

**Author:** [@gabrielfreire](https://discourse.julialang.org/u/gabrielfreire)\
**Replies:** 19\
**Last updated:** [October 30, 2020, 3:54am UTC](https://discourse.julialang.org/t/calling-windows-api-from-julia/25123 "2020-10-30T03:54:12Z")

</div>

Hi Julians, I am trying to implement a script that will list all Fonts installed on Windows using Gdi32.dll. First of all, here is the full script so you can make sense of what i’m about to write below: https://github.…

---

## [Defining custom brackets for custom objects](https://discourse.julialang.org/t/defining-custom-brackets-for-custom-objects/49273)

<div class="topic-metadata">

**Author:** [@giancarloantonucci](https://discourse.julialang.org/u/giancarloantonucci)\
**Replies:** 8\
**Last updated:** [October 30, 2020, 1:18am UTC](https://discourse.julialang.org/t/defining-custom-brackets-for-custom-objects/49273 "2020-10-30T01:18:26Z")

</div>

Is it possible to define a method/function/macro/etc so that I can use ⟦⟧ to index a custom vector/struct? I’m looking for some kind of trick that would allow me to do something like the following: struct MyVec data…

---

## [Auto adjust fontsize in Plots.jl](https://discourse.julialang.org/t/auto-adjust-fontsize-in-plots-jl/49276)

<div class="topic-metadata">

**Author:** [@libensvivit](https://discourse.julialang.org/u/libensvivit)\
**Replies:** 0\
**Last updated:** [October 30, 2020, 12:50am UTC](https://discourse.julialang.org/t/auto-adjust-fontsize-in-plots-jl/49276 "2020-10-30T00:50:25Z")

</div>

In Plots, I’m using custom ticks and save the plot in high resolution with size attribute. However, as far as I have seen Plots does not adjust the font size of anything when this attribute is used, and the user has to a…

---

## [Simple benchmarks to run to test WSL2 vs Windows Native](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 8\
**Last updated:** [October 30, 2020, 12:43am UTC](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343 "2020-10-30T00:43:01Z")

</div>

I just upgraded to the new Windows May update which now has WSL 2 (a very lightweight, Hyper V VM running full Linux). I essentially now want to move all my development over to Linux. But I would like to test if there ar…

---

## [Very slow execution time in comparison even to Python](https://discourse.julialang.org/t/very-slow-execution-time-in-comparison-even-to-python/49223)

<div class="topic-metadata">

**Author:** [@Yury\_Kotlyarov](https://discourse.julialang.org/u/Yury_Kotlyarov)\
**Replies:** 35\
**Last updated:** [October 29, 2020, 9:38pm UTC](https://discourse.julialang.org/t/very-slow-execution-time-in-comparison-even-to-python/49223 "2020-10-29T21:38:53Z")

</div>

I am new to Julia. While choosing a programming language for our next project wrote a short program in Julia: using LinearAlgebra using Statistics using Random import Base: +, - struct Point x::Float64 y::Flo…

---

## [How to deploy a machine learning model as a REST endpoint](https://discourse.julialang.org/t/how-to-deploy-a-machine-learning-model-as-a-rest-endpoint/18638)

<div class="topic-metadata">

**Author:** [@rwatts3](https://discourse.julialang.org/u/rwatts3)\
**Replies:** 4\
**Last updated:** [October 29, 2020, 8:51pm UTC](https://discourse.julialang.org/t/how-to-deploy-a-machine-learning-model-as-a-rest-endpoint/18638 "2020-10-29T20:51:16Z")

</div>

Greetings, I will be developing a series of machine learning models that I would like to then deploy via a REST endpoint for a service. I am fairly new to the Julia community so I currently don’t have knowledge of the…

---

## [Defining Unitful Units Programmatically](https://discourse.julialang.org/t/defining-unitful-units-programmatically/49260)

<div class="topic-metadata">

**Author:** [@DrPapa](https://discourse.julialang.org/u/DrPapa)\
**Replies:** 0\
**Last updated:** [October 29, 2020, 8:07pm UTC](https://discourse.julialang.org/t/defining-unitful-units-programmatically/49260 "2020-10-29T20:07:40Z")

</div>

I am processing some datasets involving altitude measurements that mixes MSL and AGL altitude units. I would like to define custom units to minimize opportunity for error. In my case, the reference offset altitude will b…

---

## [How to serialize an object on a x64 system so it'll work on a 32-bit system?](https://discourse.julialang.org/t/how-to-serialize-an-object-on-a-x64-system-so-itll-work-on-a-32-bit-system/49188)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 11\
**Last updated:** [October 29, 2020, 5:41pm UTC](https://discourse.julialang.org/t/how-to-serialize-an-object-on-a-x64-system-so-itll-work-on-a-32-bit-system/49188 "2020-10-29T17:41:59Z")

</div>

I need to run some processes on a x64 system (like most modern computers), save the results (e.g. by serializing them to a file), and then load and use the results on a Raspberry Pi (which is a x86 system). The object in…

---

## [Distributed § Dimensional Arrays](https://discourse.julialang.org/t/distributed-dimensional-arrays/49201)

<div class="topic-metadata">

**Author:** [@hyacykcharel](https://discourse.julialang.org/u/hyacykcharel)\
**Replies:** 2\
**Last updated:** [October 29, 2020, 5:14pm UTC](https://discourse.julialang.org/t/distributed-dimensional-arrays/49201 "2020-10-29T17:14:56Z")

</div>

I’m trying to distribute this Array into 2 processes each should have 5 lines I mean from zeros(10,10,10) each should have zeros(5,5,10) can someone help? I need it to be distributed in Rows and not in Colon, please …

---

## [Package version purgatory](https://discourse.julialang.org/t/package-version-purgatory/49246)

<div class="topic-metadata">

**Author:** [@grahamstark](https://discourse.julialang.org/u/grahamstark)\
**Replies:** 5\
**Last updated:** [October 29, 2020, 5:03pm UTC](https://discourse.julialang.org/t/package-version-purgatory/49246 "2020-10-29T17:03:02Z")

</div>

Hi, I published a package a while back, here: (it’s a slightly niche economics thing). All went well, and it’s in Julia’s package Registry at version 1.0, which is also the GitHub release version. Later I make a sm…

---

## [How to plot bar chart starting from non-zero y-axis?](https://discourse.julialang.org/t/how-to-plot-bar-chart-starting-from-non-zero-y-axis/49215)

<div class="topic-metadata">

**Author:** [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Replies:** 2\
**Last updated:** [October 29, 2020, 11:07am UTC](https://discourse.julialang.org/t/how-to-plot-bar-chart-starting-from-non-zero-y-axis/49215 "2020-10-29T11:07:18Z")

</div>

Hi, I am trying to plot a bar chart as below: using StatsPlots bar(\[4,5,6\],fillcolor=\[:red,:green,:blue\],fillalpha=\[0.2,0.4,0.6\], group=\["a","b","c"\]) But this plot is starting from Y-axis zero. However, I am lookin…

---

## [Reshape and merge an array of images](https://discourse.julialang.org/t/reshape-and-merge-an-array-of-images/49172)

<div class="topic-metadata">

**Author:** [@libensvivit](https://discourse.julialang.org/u/libensvivit)\
**Replies:** 3\
**Last updated:** [October 29, 2020, 8:21am UTC](https://discourse.julialang.org/t/reshape-and-merge-an-array-of-images/49172 "2020-10-29T08:21:52Z")

</div>

Hi, I have an array of images and I simply want to merge them into one, efficiently. Say that my array has 6 images, I would want to form something like; 1 2 or 1 2 3 3 4 4 5 6 5 6 At the time I’m doing t…

---

## [Race condition with local variable in @threads for loop](https://discourse.julialang.org/t/race-condition-with-local-variable-in-threads-for-loop/49163)

<div class="topic-metadata">

**Author:** [@josePereiro](https://discourse.julialang.org/u/josePereiro)\
**Replies:** 5\
**Last updated:** [October 29, 2020, 7:32am UTC](https://discourse.julialang.org/t/race-condition-with-local-variable-in-threads-for-loop/49163 "2020-10-29T07:32:44Z")

</div>

Hi, im trying to figure why this code throw and AssertionError inside the most inner loop. My current understanding is that julia will split the top loop into a number of pieces and spawn each piece to a separate thread.…

---

## [What do you think makes code "Julian" in style?](https://discourse.julialang.org/t/what-do-you-think-makes-code-julian-in-style/49219)

<div class="topic-metadata">

**Author:** [@Reckoner](https://discourse.julialang.org/u/Reckoner)\
**Replies:** 4\
**Last updated:** [October 29, 2020, 6:08am UTC](https://discourse.julialang.org/t/what-do-you-think-makes-code-julian-in-style/49219 "2020-10-29T06:08:23Z")

</div>

There has definitely been past mention of code being “Julian” or not in analogy to Python’s “Pythonic”, but I’ve recently realized that I don’t actually know what “Julian” means to other people. So I’ve come to ask peop…

---

## [How to use function inside a package](https://discourse.julialang.org/t/how-to-use-function-inside-a-package/49214)

<div class="topic-metadata">

**Author:** [@Nova](https://discourse.julialang.org/u/Nova)\
**Replies:** 3\
**Last updated:** [October 29, 2020, 3:01am UTC](https://discourse.julialang.org/t/how-to-use-function-inside-a-package/49214 "2020-10-29T03:01:07Z")

</div>

I would like to use some of the functions included in the following package: https://github.com/danspielman/Laplacians.jl/tree/master/src For example the first file is IJV.jl . My question is how I am supposed to use …

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

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