# New to Julia

**URL:** https://discourse.julialang.org/c/first-steps/8.md?page=62

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

**Page:** 63

---

## [Is there a clean one-liner to subset a vector of vectors?](https://discourse.julialang.org/t/is-there-a-clean-one-liner-to-subset-a-vector-of-vectors/107249)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 6\
**Last updated:** [December 7, 2023, 8:34pm UTC](https://discourse.julialang.org/t/is-there-a-clean-one-liner-to-subset-a-vector-of-vectors/107249 "2023-12-07T20:34:30Z")

</div>

I have something like this: julia\> A = \[\[1,\[2,3\]\], \[4,\[5,6\]\], \[7,\[8,9\]\]\] 3-element Vector{Vector{Any}}: \[1, \[2, 3\]\] \[4, \[5, 6\]\] \[7, \[8, 9\]\] julia\> B = \[A\[i\]\[2\]\[1\] for i in 1:length(A)\] 3-element Vector{Int64}: 2 5…

---

## [Out of Memory Sparse Matrix](https://discourse.julialang.org/t/out-of-memory-sparse-matrix/107292)

<div class="topic-metadata">

**Author:** [@Tommaso\_Tenna](https://discourse.julialang.org/u/Tommaso_Tenna)\
**Replies:** 1\
**Last updated:** [December 7, 2023, 4:49pm UTC](https://discourse.julialang.org/t/out-of-memory-sparse-matrix/107292 "2023-12-07T16:49:52Z")

</div>

Good evening, I’m new to Julia and I was trying to rewrite a MATLAB code, to speed it up. The main problem is that the code generates an “Out of Memory” error and I don’t understand why. Outside a while loop I define A…

---

## [Plotting data showing 2 sets of data](https://discourse.julialang.org/t/plotting-data-showing-2-sets-of-data/107272)

<div class="topic-metadata">

**Author:** [@Kearney](https://discourse.julialang.org/u/Kearney)\
**Replies:** 1\
**Last updated:** [December 7, 2023, 2:33pm UTC](https://discourse.julialang.org/t/plotting-data-showing-2-sets-of-data/107272 "2023-12-07T14:33:57Z")

</div>

this is my code ‘’'begin 2 wind = CSV.File(WindGenFile) |\> DataFrame 3 rename!(wind, :" REGION" =\> :Region, :“DATE & TIME” =\> :DateTime, :" ACTUAL WIND(MW)" =\> :ActualWind, :" FORECAST REGION(MW)" =\> :ForecastWind) 5 …

---

## [How to get a vector of results from cellfield](https://discourse.julialang.org/t/how-to-get-a-vector-of-results-from-cellfield/99682)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 1\
**Last updated:** [December 7, 2023, 2:07pm UTC](https://discourse.julialang.org/t/how-to-get-a-vector-of-results-from-cellfield/99682 "2023-12-07T14:07:05Z")

</div>

Hi, I am going to use affineFEoperator and solve for linear plasticity the out put of this is singlefieldfunction while using matrix form and dividing a/b of weak form gives a vector form. I need the vector solution of …

---

## [Failed to download from https://pkg.julialang.org/registry](https://discourse.julialang.org/t/failed-to-download-from-https-pkg-julialang-org-registry/107225)

<div class="topic-metadata">

**Author:** [@michelg45](https://discourse.julialang.org/u/michelg45)\
**Replies:** 1\
**Last updated:** [December 6, 2023, 11:07pm UTC](https://discourse.julialang.org/t/failed-to-download-from-https-pkg-julialang-org-registry/107225 "2023-12-06T23:07:45Z")

</div>

I am running Julia 1.9.4 in a Linux partition (Ubuntu 22.04.02 LTS) under Windows 11 / WSL. I am trying to create a project template using the following file (Template.Judyn.jl) with the command using PkgTemplate…

---

## [How do I add a command to a button in Tk?](https://discourse.julialang.org/t/how-do-i-add-a-command-to-a-button-in-tk/107237)

<div class="topic-metadata">

**Author:** [@Cyberbully](https://discourse.julialang.org/u/Cyberbully)\
**Replies:** 0\
**Last updated:** [December 6, 2023, 10:48pm UTC](https://discourse.julialang.org/t/how-do-i-add-a-command-to-a-button-in-tk/107237 "2023-12-06T22:48:07Z")

</div>

I’m familiar with python Tkinter and I’m also learning Julia Tk. Today I was experimenting with creating buttons but I couldn’t figure out how to execute a function when the button is pressed. Example of my code: funct…

---

## [Debugger not stopping inside open do blocks](https://discourse.julialang.org/t/debugger-not-stopping-inside-open-do-blocks/107190)

<div class="topic-metadata">

**Author:** [@feribg](https://discourse.julialang.org/u/feribg)\
**Replies:** 8\
**Last updated:** [December 6, 2023, 10:20pm UTC](https://discourse.julialang.org/t/debugger-not-stopping-inside-open-do-blocks/107190 "2023-12-06T22:20:49Z")

</div>

Using VSCode with latest Julia ext and Julia 1.9.4 Consider the following example: current\_files = 0 n\_markets = 0 open("report.log", "w") do fpReport println(fpReport, "CHOOSER log with IS\_n=$(is\_…

---

## [DataDrivenDiffEq.jl - Package](https://discourse.julialang.org/t/datadrivendiffeq-jl-package/107209)

<div class="topic-metadata">

**Author:** [@npsasikumar](https://discourse.julialang.org/u/npsasikumar)\
**Replies:** 0\
**Last updated:** [December 6, 2023, 10:08am UTC](https://discourse.julialang.org/t/datadrivendiffeq-jl-package/107209 "2023-12-06T10:08:31Z")

</div>

I am new to Julia, and I am a researcher in mathematics working with the synchronization of nonlinear dynamical systems. While implementing koopman\_res as in the nonlinear\_forced.jl the link: for my system, its showing…

---

## [Failed to load module canberra-gtk-module](https://discourse.julialang.org/t/failed-to-load-module-canberra-gtk-module/96402)

<div class="topic-metadata">

**Author:** [@samq](https://discourse.julialang.org/u/samq)\
**Replies:** 3\
**Last updated:** [December 6, 2023, 5:27am UTC](https://discourse.julialang.org/t/failed-to-load-module-canberra-gtk-module/96402 "2023-12-06T05:27:31Z")

</div>

OS = Ubuntu 18.04 Julia version = Version 1.8.5 (2023-01-08) When using Julia REPL, I type 'using Gtk and every time I get 3 ‘Gtk-Message: 09:14:02.463: Failed to load module “canberra-gtk-module”’ messages. If I type …

---

## [String indices : byte indexing feels wrong](https://discourse.julialang.org/t/string-indices-byte-indexing-feels-wrong/107164)

<div class="topic-metadata">

**Author:** [@hlbnet](https://discourse.julialang.org/u/hlbnet)\
**Replies:** 18\
**Last updated:** [December 5, 2023, 10:41pm UTC](https://discourse.julialang.org/t/string-indices-byte-indexing-feels-wrong/107164 "2023-12-05T22:41:39Z")

</div>

I am discovering Julia language (from C++, Java and Python background), and I really love several concepts of Julia, especially how Julia handles types. But I consider the choice to “almost disallow” usage of indices wi…

---

## [Lux tutorial: AMDGPU 20x slower than CPU](https://discourse.julialang.org/t/lux-tutorial-amdgpu-20x-slower-than-cpu/107053)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 17\
**Last updated:** [December 5, 2023, 8:55pm UTC](https://discourse.julialang.org/t/lux-tutorial-amdgpu-20x-slower-than-cpu/107053 "2023-12-05T20:55:18Z")

</div>

So far, during my quest to get deep learning working in Julia, I found FastAI to have multiple dependency issues (see my previous posts). And Flux itself currently requires a downgrade of AMDGPU to v0.6.x, so I also had …

---

## [How to generate new Module template without Git/Github](https://discourse.julialang.org/t/how-to-generate-new-module-template-without-git-github/107169)

<div class="topic-metadata">

**Author:** [@roeya](https://discourse.julialang.org/u/roeya)\
**Replies:** 0\
**Last updated:** [December 5, 2023, 1:53pm UTC](https://discourse.julialang.org/t/how-to-generate-new-module-template-without-git-github/107169 "2023-12-05T13:53:17Z")

</div>

When you want to generate new module the documentation points you to PkgTemplates however if for some reason you do not have a Git or Github account you will get an error: Git hosting service username is required, set o…

---

## [When i from julia import ScenTrees in python,errro,ImportError: ScenTrees not found](https://discourse.julialang.org/t/when-i-from-julia-import-scentrees-in-python-errro-importerror-scentrees-not-found/107148)

<div class="topic-metadata">

**Author:** [@wang\_ruoxu](https://discourse.julialang.org/u/wang_ruoxu)\
**Replies:** 0\
**Last updated:** [December 5, 2023, 8:12am UTC](https://discourse.julialang.org/t/when-i-from-julia-import-scentrees-in-python-errro-importerror-scentrees-not-found/107148 "2023-12-05T08:12:36Z")

</div>

When I use python to call julia to import the ScenTrees package, I get the error “ScenTrees not found”,but other pkg is ok. when i using ScenTrees in julia env,it’s ok julia env: I’m confused how to solve it …

---

## [How to round up DateTime to the next whole Hour?](https://discourse.julialang.org/t/how-to-round-up-datetime-to-the-next-whole-hour/107135)

<div class="topic-metadata">

**Author:** [@atBNE](https://discourse.julialang.org/u/atBNE)\
**Replies:** 2\
**Last updated:** [December 4, 2023, 11:34pm UTC](https://discourse.julialang.org/t/how-to-round-up-datetime-to-the-next-whole-hour/107135 "2023-12-04T23:34:28Z")

</div>

How to round up DateTime to the next whole Hour? The Dates docs is heavy, and a beginner can get lost in it. using Dates function gvt(p1) dly = Hour(2) # a constant delay of 2 hours tym = now() # H…

---

## [How do I get a list of functions defined in a module?](https://discourse.julialang.org/t/how-do-i-get-a-list-of-functions-defined-in-a-module/22266)

<div class="topic-metadata">

**Author:** [@Elmer\_Cusipuma](https://discourse.julialang.org/u/Elmer_Cusipuma)\
**Replies:** 9\
**Last updated:** [December 4, 2023, 3:18pm UTC](https://discourse.julialang.org/t/how-do-i-get-a-list-of-functions-defined-in-a-module/22266 "2023-12-04T15:18:09Z")

</div>

Is there a command in Julia 1.1 that lists all the methods that are available in a module? e.g. module MyMod test1() = 1 test2() = 2 test3() = 3 end Which would return: \[test1,test2,test3\]

---

## [Dataframes](https://discourse.julialang.org/t/dataframes/107112)

<div class="topic-metadata">

**Author:** [@Kearney](https://discourse.julialang.org/u/Kearney)\
**Replies:** 2\
**Last updated:** [December 4, 2023, 1:12pm UTC](https://discourse.julialang.org/t/dataframes/107112 "2023-12-04T13:12:09Z")

</div>

i need to generate two plots of two datasets and save them, as .png files, respectively, wind-gen.png and system-demand.png. The first plot should be of the wind data, showing both actual power generated and what was fo…

---

## [Matrix multiplication and type stability](https://discourse.julialang.org/t/matrix-multiplication-and-type-stability/107020)

<div class="topic-metadata">

**Author:** [@denshd](https://discourse.julialang.org/u/denshd)\
**Replies:** 1\
**Last updated:** [December 4, 2023, 9:32am UTC](https://discourse.julialang.org/t/matrix-multiplication-and-type-stability/107020 "2023-12-04T09:32:06Z")

</div>

Hello! Let’s consider MVE: using LinearAlgebra using AlgebraicNumbers M = AlgebraicNumber.(\[ 1 2 3 4 \]) b = AlgebraicNumber.(\[5; 6\]) println(typeof(M)) println(typeof(b)) x = M \* b println(typeof(x)) Expe…

---

## [Precompiling error for unknown reason](https://discourse.julialang.org/t/precompiling-error-for-unknown-reason/107073)

<div class="topic-metadata">

**Author:** [@Wooheon](https://discourse.julialang.org/u/Wooheon)\
**Replies:** 10\
**Last updated:** [December 3, 2023, 11:09pm UTC](https://discourse.julialang.org/t/precompiling-error-for-unknown-reason/107073 "2023-12-03T23:09:32Z")

</div>

I tried to precompile CSV into julia v1.84 but failed showing error message about call. I thought maybe the version update is the problem so I downloaded v1.94 and again have the problem. From import Pkg; Pkg.precompil…

---

## [How to do Multithreading the right way?](https://discourse.julialang.org/t/how-to-do-multithreading-the-right-way/107044)

<div class="topic-metadata">

**Author:** [@Melancholic\_Octopus](https://discourse.julialang.org/u/Melancholic_Octopus)\
**Replies:** 1\
**Last updated:** [December 2, 2023, 5:51pm UTC](https://discourse.julialang.org/t/how-to-do-multithreading-the-right-way/107044 "2023-12-02T17:51:25Z")

</div>

Hi, I was trying to learn how to do multi-threading in julia, but everywhere i found just how not to do it I need to perform multiple searches in a recursive data structure, and i wanted to try parallelize it. Given it…

---

## [The ‘where’ keyword](https://discourse.julialang.org/t/the-where-keyword/107030)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 3\
**Last updated:** [December 2, 2023, 3:18am UTC](https://discourse.julialang.org/t/the-where-keyword/107030 "2023-12-02T03:18:18Z")

</div>

function dimension(::BoseFS{N,M}) where {N,M} return binomial(BigInt(N + M - 1), BigInt(N)) end what does the ‘where’ keyword mean? I tend to interprete it like the english clause, but I cannot make sense of it

---

## [An old question: how do I output a vector of UInt8 in binary?](https://discourse.julialang.org/t/an-old-question-how-do-i-output-a-vector-of-uint8-in-binary/107016)

<div class="topic-metadata">

**Author:** [@rmfritz](https://discourse.julialang.org/u/rmfritz)\
**Replies:** 3\
**Last updated:** [December 1, 2023, 10:18pm UTC](https://discourse.julialang.org/t/an-old-question-how-do-i-output-a-vector-of-uint8-in-binary/107016 "2023-12-01T22:18:15Z")

</div>

So far, I am writing the bytes individually. That seems inefficient. Are there better alternatives, perhaps converting the vector to a byte string?

---

## [Help with Project Euler #2: undef inits, printing, multiplication by juxtaposition, and more](https://discourse.julialang.org/t/help-with-project-euler-2-undef-inits-printing-multiplication-by-juxtaposition-and-more/106930)

<div class="topic-metadata">

**Author:** [@chandra](https://discourse.julialang.org/u/chandra)\
**Replies:** 22\
**Last updated:** [December 1, 2023, 8:06pm UTC](https://discourse.julialang.org/t/help-with-project-euler-2-undef-inits-printing-multiplication-by-juxtaposition-and-more/106930 "2023-12-01T20:06:57Z")

</div>

A = \[0, 1, undef\] A\[3\] = 1 println(A) In the above script, is there any way to suppress the Any appearing in front of the array values in (square) brackets of array A?

---

## [Failed to precompile OpenCL in julia V1.9, for GPU programming, AMD Radeon graphics](https://discourse.julialang.org/t/failed-to-precompile-opencl-in-julia-v1-9-for-gpu-programming-amd-radeon-graphics/106695)

<div class="topic-metadata">

**Author:** [@Beatha\_Shilongo](https://discourse.julialang.org/u/Beatha_Shilongo)\
**Replies:** 13\
**Last updated:** [December 1, 2023, 4:58pm UTC](https://discourse.julialang.org/t/failed-to-precompile-opencl-in-julia-v1-9-for-gpu-programming-amd-radeon-graphics/106695 "2023-12-01T16:58:55Z")

</div>

Hello. Anyone to kindly assist. Am trying to instal OpenCL library in julia but getting a precompile OpenCL error. Any suggestions on getting this library to work. Below is the error am getting: Failed to precompile O…

---

## [Redefine the show function](https://discourse.julialang.org/t/redefine-the-show-function/106993)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 3\
**Last updated:** [December 1, 2023, 3:28pm UTC](https://discourse.julialang.org/t/redefine-the-show-function/106993 "2023-12-01T15:28:45Z")

</div>

function Base.show(io::IO, b::BasisSetRep) print(io, "BasisSetRep($(b.h)) with dimension $(dimension(b)) and $(nnz(b.sm)) stored entries:") show(io, MIME"text/plain"(), b.sm) end This is some people’s code. I a…

---

## [Solving PDE with MethodOfLines](https://discourse.julialang.org/t/solving-pde-with-methodoflines/106936)

<div class="topic-metadata">

**Author:** [@Cwmeyer](https://discourse.julialang.org/u/Cwmeyer)\
**Replies:** 3\
**Last updated:** [December 1, 2023, 9:17am UTC](https://discourse.julialang.org/t/solving-pde-with-methodoflines/106936 "2023-12-01T09:17:40Z")

</div>

Hi, I am new to Julia. I’m trying to solve a PDE using Method of lines but I am running into a unexpected error. ERROR: type Term has no field lhs. My code as follows: using DifferentialEquations using Plots using Metho…

---

## [3d Plots - change axis intersection // inverse axis](https://discourse.julialang.org/t/3d-plots-change-axis-intersection-inverse-axis/51109)

<div class="topic-metadata">

**Author:** [@neo\_abs](https://discourse.julialang.org/u/neo_abs)\
**Replies:** 11\
**Last updated:** [December 1, 2023, 7:00am UTC](https://discourse.julialang.org/t/3d-plots-change-axis-intersection-inverse-axis/51109 "2023-12-01T07:00:24Z")

</div>

I have a 3d plot: using Plots x = \[0,0,0,1,1,1,2,2,2\] y=\[0,1,2,0,1,2,0,1,2\] z = 10\*rand(9) .+ 2\*collect(1:9) plot(x,y,z, st=:surface,camera = (60,15)) axes intersect at: How can I change it so: z and y on min z and…

---

## [Can I change axis position in Plots](https://discourse.julialang.org/t/can-i-change-axis-position-in-plots/38966)

<div class="topic-metadata">

**Author:** [@Eris](https://discourse.julialang.org/u/Eris)\
**Replies:** 12\
**Last updated:** [December 1, 2023, 6:59am UTC](https://discourse.julialang.org/t/can-i-change-axis-position-in-plots/38966 "2023-12-01T06:59:10Z")

</div>

I’m trying to change an axis position. For example make the xaxis at y=0 instead of y=-3 here using Plots f(x)=x-3 plot(f,0,5,xlabel=“x”,ylabel= “y”) I tried the documentation for Plots but I didn’t find a possible…

---

## [Can't use Process type even though it's in Base.jl](https://discourse.julialang.org/t/cant-use-process-type-even-though-its-in-base-jl/106974)

<div class="topic-metadata">

**Author:** [@Conrad\_Wiebe](https://discourse.julialang.org/u/Conrad_Wiebe)\
**Replies:** 1\
**Last updated:** [December 1, 2023, 4:22am UTC](https://discourse.julialang.org/t/cant-use-process-type-even-though-its-in-base-jl/106974 "2023-12-01T04:22:31Z")

</div>

I see Process defined in process.jl: and included in Base here: but if I use it in code, it isn’t recognized: why is this? Tested on versions: 1.10.0-beta3+0.aarch64.apple.darwin14 1.10.0-rc1+0.aarch64.ap…

---

## [How to use AlgebraOfGraphics to plot three figures together](https://discourse.julialang.org/t/how-to-use-algebraofgraphics-to-plot-three-figures-together/106920)

<div class="topic-metadata">

**Author:** [@Chao](https://discourse.julialang.org/u/Chao)\
**Replies:** 3\
**Last updated:** [November 30, 2023, 9:58pm UTC](https://discourse.julialang.org/t/how-to-use-algebraofgraphics-to-plot-three-figures-together/106920 "2023-11-30T21:58:26Z")

</div>

Hello, the current plots I have are as follows: These are three different figures. I just paste them together. I want to have them in one figure. This is my code: using AlgebraOfGraphics, CairoMakie gdfc data(gdfc)…

---

## [Trying to develop an extension](https://discourse.julialang.org/t/trying-to-develop-an-extension/106921)

<div class="topic-metadata">

**Author:** [@feribg](https://discourse.julialang.org/u/feribg)\
**Replies:** 5\
**Last updated:** [November 30, 2023, 6:55pm UTC](https://discourse.julialang.org/t/trying-to-develop-an-extension/106921 "2023-11-30T18:55:07Z")

</div>

I find the process of developing an extension and all the steps extremely puzzling. So far i have these files: – Package.jk – – Utils.jl Package is as follows: module Package include("Utils.jl") export Utils.Marsa…

[Previous page](https://discourse.julialang.org/c/first-steps/8.md?page=61)

[Next page](https://discourse.julialang.org/c/first-steps/8.md?page=63)
