# General Usage

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

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

**Page:** 416

---

## [Time-independent Usage for MOLFiniteDifference()](https://discourse.julialang.org/t/time-independent-usage-for-molfinitedifference/75132)

<div class="topic-metadata">

**Author:** [@Fathya.Salih](https://discourse.julialang.org/u/Fathya.Salih)\
**Replies:** 5\
**Last updated:** [August 1, 2022, 6:57pm UTC](https://discourse.julialang.org/t/time-independent-usage-for-molfinitedifference/75132 "2022-08-01T18:57:36Z")

</div>

Hello, I am trying to use MOLFiniteDifference() to solve a stationary PDE. In the documentation, it says that the continuous or time variable is optional, but I couldn’t find any examples of someone using it for a stead…

---

## [How to find the first time step (column 1) when the values between time steps in column 2 is of a certain difference](https://discourse.julialang.org/t/how-to-find-the-first-time-step-column-1-when-the-values-between-time-steps-in-column-2-is-of-a-certain-difference/85102)

<div class="topic-metadata">

**Author:** [@HelgavonLichtenstein](https://discourse.julialang.org/u/HelgavonLichtenstein)\
**Replies:** 15\
**Last updated:** [August 1, 2022, 6:36pm UTC](https://discourse.julialang.org/t/how-to-find-the-first-time-step-column-1-when-the-values-between-time-steps-in-column-2-is-of-a-certain-difference/85102 "2022-08-01T18:36:45Z")

</div>

Hello, I would like to know how to select the first time step (in column 1) where the difference between values in column 2 is 0.01. df = DataFrame(x=\[0.0, 0.5, 1.0, 1.5, 2.0\], y=\[0.74, 0.64, 0.84, 0.88, 0.89\]) The a…

---

## [Translating a 1d convolution from Python to Julia](https://discourse.julialang.org/t/translating-a-1d-convolution-from-python-to-julia/85080)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 6\
**Last updated:** [August 1, 2022, 6:35pm UTC](https://discourse.julialang.org/t/translating-a-1d-convolution-from-python-to-julia/85080 "2022-08-01T18:35:25Z")

</div>

Hi all, I am trying to port some code written in Python. It performs a 1d convolution on a 3d array. The Python and Julia code output arrays with different dimensions and values. Does anyone know the equivalent code on …

---

## [Preallocating Vectors of NamedTuples](https://discourse.julialang.org/t/preallocating-vectors-of-namedtuples/85105)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 3\
**Last updated:** [August 1, 2022, 5:44pm UTC](https://discourse.julialang.org/t/preallocating-vectors-of-namedtuples/85105 "2022-08-01T17:44:19Z")

</div>

Dear all, I hope you are well! I have a question regarding preallocating Vectors of NamedTuples. I have a custom struct that contains a field that is a NamedTuple. mutable struct MyCustomStruct{T\<:NamedTuple} param…

---

## [Constant propagation vs generated functions](https://discourse.julialang.org/t/constant-propagation-vs-generated-functions/83788)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 26\
**Last updated:** [August 1, 2022, 5:30pm UTC](https://discourse.julialang.org/t/constant-propagation-vs-generated-functions/83788 "2022-08-01T17:30:18Z")

</div>

Before getting started in Julia, I did most of my work in Haskell. It’s a great language, but a few things kept causing me trouble: The strong PL focus of the community was great, but it seemed to come at a cost of con…

---

## [Flux.Conv kernel definition](https://discourse.julialang.org/t/flux-conv-kernel-definition/85109)

<div class="topic-metadata">

**Author:** [@cirobr](https://discourse.julialang.org/u/cirobr)\
**Replies:** 0\
**Last updated:** [August 1, 2022, 5:10pm UTC](https://discourse.julialang.org/t/flux-conv-kernel-definition/85109 "2022-08-01T17:10:14Z")

</div>

Consider the below command line, which defines kernel size as 5x5 and has seven output channels: layer1 = Flux.Conv((5,5), 3 =\> 7, relu; bias = false) Questions: Which kernel(s), given that there are seven output c…

---

## [Sunday Small challenge](https://discourse.julialang.org/t/sunday-small-challenge/85041)

<div class="topic-metadata">

**Author:** [@miguelraz](https://discourse.julialang.org/u/miguelraz)\
**Replies:** 10\
**Last updated:** [August 1, 2022, 4:57pm UTC](https://discourse.julialang.org/t/sunday-small-challenge/85041 "2022-08-01T16:57:20Z")

</div>

Hello Julians! Welcome to the first Sunday Small challenge. I will post 3 lil’ problems - whoever can solve them in Julia (in serial, all architectures allowed) on the input(s) repeated 1000x wins all the internet poin…

---

## [Compiling 1.7.3 on Ubuntu 22.04 stalls](https://discourse.julialang.org/t/compiling-1-7-3-on-ubuntu-22-04-stalls/85070)

<div class="topic-metadata">

**Author:** [@unhandyandy](https://discourse.julialang.org/u/unhandyandy)\
**Replies:** 12\
**Last updated:** [August 1, 2022, 2:52pm UTC](https://discourse.julialang.org/t/compiling-1-7-3-on-ubuntu-22-04-stalls/85070 "2022-08-01T14:52:08Z")

</div>

I have pulled the git repo and I’m trying to compile v1.7.3, but the process stalls here: Sysimage built. Summary: Total ─────── 53.120629 seconds Base: ─────── 22.231496 seconds 41.851% Stdlibs: ──── 30.887624 seco…

---

## [Too many Julia versions?](https://discourse.julialang.org/t/too-many-julia-versions/84538)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 17\
**Last updated:** [August 1, 2022, 1:53pm UTC](https://discourse.julialang.org/t/too-many-julia-versions/84538 "2022-08-01T13:53:40Z")

</div>

We often hear in this forum that the man power working on Julia is limited. Why then do we have 1.6, 1.7, 1.8, and 1.9 being worked on at the same time? Too many balls in the air…?

---

## [Porting fragment code Python to Julia](https://discourse.julialang.org/t/porting-fragment-code-python-to-julia/85099)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 11\
**Last updated:** [August 1, 2022, 12:47pm UTC](https://discourse.julialang.org/t/porting-fragment-code-python-to-julia/85099 "2022-08-01T12:47:41Z")

</div>

selection = np.linspace(0,3,5000000) eps = 0.9 # spikes numpy 1d array ee\_counter = np.array( \[ ( ( spikes \>= selection\[j\] ) & ( spikes \< selection\[j\]+eps ) ).sum() for j in range( len( selection ) ) \] ) pdf = ee\_cou…

---

## [ForwardDiff package: no method for expm](https://discourse.julialang.org/t/forwarddiff-package-no-method-for-expm/5759)

<div class="topic-metadata">

**Author:** [@depasquale](https://discourse.julialang.org/u/depasquale)\
**Replies:** 1\
**Last updated:** [August 1, 2022, 12:25pm UTC](https://discourse.julialang.org/t/forwarddiff-package-no-method-for-expm/5759 "2022-08-01T12:25:14Z")

</div>

Looking to use the ForwardDiff package on code that uses Julias’ matrix exponential, expm, but getting method errors. I guess expm uses some non-native Julia code. Does anyone have any insight here, or a workaround? Any …

---

## [Predator-Prey Plot error: no method matching mapslices](https://discourse.julialang.org/t/predator-prey-plot-error-no-method-matching-mapslices/85098)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [August 1, 2022, 11:01am UTC](https://discourse.julialang.org/t/predator-prey-plot-error-no-method-matching-mapslices/85098 "2022-08-01T11:01:21Z")

</div>

Hi all, I have this code, Here are what I have done: I change the linspace to range but then error occurs and I do not know how to solve this: I change the backend from pyplot() to gr() MethodError: no method matchin…

---

## [Package Entanglement: Why using one package breaks another?](https://discourse.julialang.org/t/package-entanglement-why-using-one-package-breaks-another/85079)

<div class="topic-metadata">

**Author:** [@bogdankjastrzebski](https://discourse.julialang.org/u/bogdankjastrzebski)\
**Replies:** 2\
**Last updated:** [August 1, 2022, 7:20am UTC](https://discourse.julialang.org/t/package-entanglement-why-using-one-package-breaks-another/85079 "2022-08-01T07:20:03Z")

</div>

Hi! I stumped upon an unexpected problem with overall package/library management in julia, that I think is interesting to talk about, because I think it is quite general, and I haven’t found a similar topic. My env: (…

---

## [External polynomial supply to DifferentialEquation.jl](https://discourse.julialang.org/t/external-polynomial-supply-to-differentialequation-jl/84906)

<div class="topic-metadata">

**Author:** [@aasgher385](https://discourse.julialang.org/u/aasgher385)\
**Replies:** 4\
**Last updated:** [August 1, 2022, 6:50am UTC](https://discourse.julialang.org/t/external-polynomial-supply-to-differentialequation-jl/84906 "2022-08-01T06:50:08Z")

</div>

Hi everyone I have a problem solving the Riccati type differential equation. \\frac{dU}{dt} = \\delta \\frac{dD}{dt} - \\lambda U - \\gamma U^2 I have an array of dimension M for D from which, in my opinion we can get …

---

## [Basic Performance Difference Between 1.8.0-rc3 and 1.7.2](https://discourse.julialang.org/t/basic-performance-difference-between-1-8-0-rc3-and-1-7-2/85074)

<div class="topic-metadata">

**Author:** [@Ian\_Slagle](https://discourse.julialang.org/u/Ian_Slagle)\
**Replies:** 2\
**Last updated:** [August 1, 2022, 6:20am UTC](https://discourse.julialang.org/t/basic-performance-difference-between-1-8-0-rc3-and-1-7-2/85074 "2022-08-01T06:20:42Z")

</div>

I have both 1.8.0-rc3 and 1.7.2 installed. I am running the simple benchmark using BenchmarkTools; @benchmark a + b setup=(b = rand(Int64); a = rand(Int64)) which from my understanding, should really just be measuring …

---

## [Converting symbolic function to numeric with SymPy](https://discourse.julialang.org/t/converting-symbolic-function-to-numeric-with-sympy/85072)

<div class="topic-metadata">

**Author:** [@samerb](https://discourse.julialang.org/u/samerb)\
**Replies:** 4\
**Last updated:** [August 1, 2022, 5:36am UTC](https://discourse.julialang.org/t/converting-symbolic-function-to-numeric-with-sympy/85072 "2022-08-01T05:36:19Z")

</div>

I have using SymPy a = Sym("a") g(a) = a^2 - a g\_prime(a) = diff(g(a)) g\_prime(a) \> 2𝑎−1 I would like to get a function numeric g\_prime(a) that I can plug numbers into and evaluate. How do I do that? The Julia SymPy d…

---

## [Why there is no method matching round(::Type{Int64}, ::BitArray{1})](https://discourse.julialang.org/t/why-there-is-no-method-matching-round-type-int64-bitarray-1/32163)

<div class="topic-metadata">

**Author:** [@marouane1994](https://discourse.julialang.org/u/marouane1994)\
**Replies:** 11\
**Last updated:** [August 1, 2022, 3:57am UTC](https://discourse.julialang.org/t/why-there-is-no-method-matching-round-type-int64-bitarray-1/32163 "2022-08-01T03:57:19Z")

</div>

let us suppose that i want to perform this following operation: round(Int,\[2.3,2.5,8.9\].\>0) and then i get a MethodError saying that: ERROR: MethodError: no method matching round(::Type{Int64}, ::BitArray{1}). is the…

---

## [\[Probably\] A Naive Macro Interpolation Doubt](https://discourse.julialang.org/t/probably-a-naive-macro-interpolation-doubt/85082)

<div class="topic-metadata">

**Author:** [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Replies:** 2\
**Last updated:** [August 1, 2022, 2:03am UTC](https://discourse.julialang.org/t/probably-a-naive-macro-interpolation-doubt/85082 "2022-08-01T02:03:19Z")

</div>

Hellos, All that I want to do is a basic a macro to access some arrays. Here is the working code with expressions: # works let N = 5 a = zeros(N) b = collect(1:N) myexp = quote for i = 1:$N …

---

## [How do I transform a vector into a Matrix](https://discourse.julialang.org/t/how-do-i-transform-a-vector-into-a-matrix/85032)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 5\
**Last updated:** [July 31, 2022, 8:13pm UTC](https://discourse.julialang.org/t/how-do-i-transform-a-vector-into-a-matrix/85032 "2022-07-31T20:13:11Z")

</div>

The code below creates three identical matrices, m1, m2, and m3 in three different ways. m3 was created programatically. The function foo could be anything the user would like it to be, subject to converting an Int int…

---

## [Copyto! issue when updating fields of struct](https://discourse.julialang.org/t/copyto-issue-when-updating-fields-of-struct/85052)

<div class="topic-metadata">

**Author:** [@WDM-Computation](https://discourse.julialang.org/u/WDM-Computation)\
**Replies:** 8\
**Last updated:** [July 31, 2022, 6:26pm UTC](https://discourse.julialang.org/t/copyto-issue-when-updating-fields-of-struct/85052 "2022-07-31T18:26:25Z")

</div>

Hello! This is somewhat of a followup question from before. I have some structs using StaticArrays for performance reasons, which has been working great until now. It seems that as long as I am broadcasting ( ‘.=’ ) an …

---

## [How to Plot Fractals using Plots and GR()?](https://discourse.julialang.org/t/how-to-plot-fractals-using-plots-and-gr/85054)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 5\
**Last updated:** [July 31, 2022, 3:54pm UTC](https://discourse.julialang.org/t/how-to-plot-fractals-using-plots-and-gr/85054 "2022-07-31T15:54:24Z")

</div>

Hi all, I have tried this code here: https://gist.github.com/XerxesZorgon/5205facbb7c7ef02999e27ead70a5d59 But I can’t plot it, I am using Jupyter Notebook and Julia REPL it only shows : plotJulia

---

## [DIvide a Polygon Area in small pieces](https://discourse.julialang.org/t/divide-a-polygon-area-in-small-pieces/85014)

<div class="topic-metadata">

**Author:** [@Jesus\_Chavez\_Solano](https://discourse.julialang.org/u/Jesus_Chavez_Solano)\
**Replies:** 4\
**Last updated:** [July 31, 2022, 3:39pm UTC](https://discourse.julialang.org/t/divide-a-polygon-area-in-small-pieces/85014 "2022-07-31T15:39:39Z")

</div>

Hi everyone ,I’m doing a momentum curvature usign Popovic’s Model and found a big problem beacuse to divide a polygon(convex or concave) into small fiber like this image but with more lines: it’s not so easy to do…

---

## [Best way to handle multiple time series in Julia?](https://discourse.julialang.org/t/best-way-to-handle-multiple-time-series-in-julia/85044)

<div class="topic-metadata">

**Author:** [@ejlongman](https://discourse.julialang.org/u/ejlongman)\
**Replies:** 4\
**Last updated:** [July 31, 2022, 11:53am UTC](https://discourse.julialang.org/t/best-way-to-handle-multiple-time-series-in-julia/85044 "2022-07-31T11:53:54Z")

</div>

Is the general consensus that using loops is “more Julian” than storing multiple time series in a matrix? Context: If I want to generate and plot 3 time series, my Python-ian instinct is to store them in a matrix. But Q…

---

## [A\\b vs LinearSolve.jl at JuliaCon 2022](https://discourse.julialang.org/t/a-b-vs-linearsolve-jl-at-juliacon-2022/85030)

<div class="topic-metadata">

**Author:** [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Replies:** 5\
**Last updated:** [July 31, 2022, 10:50am UTC](https://discourse.julialang.org/t/a-b-vs-linearsolve-jl-at-juliacon-2022/85030 "2022-07-31T10:50:44Z")

</div>

I just end watching LinearSolve.jl: because A\\b is not good enough by Chris Rackauckas himself and I’m a bit confused. When I get basic points why such packages was developed, somethings bugs me about A\\b being “deprecat…

---

## [Example for checkboxes in Gtk.jl](https://discourse.julialang.org/t/example-for-checkboxes-in-gtk-jl/85028)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 13\
**Last updated:** [July 31, 2022, 8:13am UTC](https://discourse.julialang.org/t/example-for-checkboxes-in-gtk-jl/85028 "2022-07-31T08:13:07Z")

</div>

I am looking for a simple example how to create a dialog with a few checkboxes with Gtk.jl. Any idea where I could find that?

---

## [Term.jl / logging / sending messages to multiple locations](https://discourse.julialang.org/t/term-jl-logging-sending-messages-to-multiple-locations/84841)

<div class="topic-metadata">

**Author:** [@j\_u](https://discourse.julialang.org/u/j_u)\
**Replies:** 8\
**Last updated:** [July 30, 2022, 11:26pm UTC](https://discourse.julialang.org/t/term-jl-logging-sending-messages-to-multiple-locations/84841 "2022-07-30T23:26:30Z")

</div>

I’d like to ask if sending logging messages both to terminal and to a file is supported by Term.jl \[Logging · Term.jl\]. I read in JuliaLogging documentation that Logging together with LoggingExtras is supporting such opt…

---

## [Type stability in function involving selectdim](https://discourse.julialang.org/t/type-stability-in-function-involving-selectdim/85009)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 3\
**Last updated:** [July 30, 2022, 7:58pm UTC](https://discourse.julialang.org/t/type-stability-in-function-involving-selectdim/85009 "2022-07-30T19:58:22Z")

</div>

So I’m trying to write a function to perform trapezoidal rule: function trapzNd(A, t; dims=1) N = size(A, dims) dt\_shape = ones(Int64, ndims(A)) dt\_shape\[dims\] = length(t) - 1 dt = reshape(diff(t), …

---

## [Get all changes of sign of some vectors](https://discourse.julialang.org/t/get-all-changes-of-sign-of-some-vectors/77790)

<div class="topic-metadata">

**Author:** [@stla](https://discourse.julialang.org/u/stla)\
**Replies:** 7\
**Last updated:** [July 30, 2022, 5:51pm UTC](https://discourse.julialang.org/t/get-all-changes-of-sign-of-some-vectors/77790 "2022-07-30T17:51:37Z")

</div>

Hello, Given some vectors of numbers, I need to get all vectors obtained from the given ones by assigning the signs + or - to the numbers. For example: vctrs = \[\[0.4; 0.3\], \[0.5; 0.0\]\] julia\> changesOfSign(vctrs) 6-ele…

---

## [Calling another function in loop using Base.Threads](https://discourse.julialang.org/t/calling-another-function-in-loop-using-base-threads/85037)

<div class="topic-metadata">

**Author:** [@Amol\_H](https://discourse.julialang.org/u/Amol_H)\
**Replies:** 6\
**Last updated:** [July 30, 2022, 4:09pm UTC](https://discourse.julialang.org/t/calling-another-function-in-loop-using-base-threads/85037 "2022-07-30T16:09:18Z")

</div>

Dear All, I am having a problem running the following code in parallel. Please suggest how to achieve the parallelization to populate an array by a so-called very computationally expensive function. Thanks and Regards …

---

## [How to build this sparsematrix in Julia](https://discourse.julialang.org/t/how-to-build-this-sparsematrix-in-julia/84608)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 43\
**Last updated:** [July 30, 2022, 3:27pm UTC](https://discourse.julialang.org/t/how-to-build-this-sparsematrix-in-julia/84608 "2022-07-30T15:27:24Z")

</div>

I have the below command in Matlab, I could not find how to do it in Julia. Any suggestion please? sparse((1:5)', \[11,22,33,44,55\], \[1,2,3,4,5\])

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

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