# New to Julia

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

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

**Page:** 25

---

## [How do I find the number of bytes for a character?](https://discourse.julialang.org/t/how-do-i-find-the-number-of-bytes-for-a-character/124144)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 3\
**Last updated:** [December 24, 2024, 4:48pm UTC](https://discourse.julialang.org/t/how-do-i-find-the-number-of-bytes-for-a-character/124144 "2024-12-24T16:48:46Z")

</div>

Hello, Please take a look at the following text: Consider the following: julia\> grk = “β+θ” “β+θ” julia\> length(grk) 3 julia\> sizeof(grk) 5 Since β and θ occupy two bytes each, the valid indices into grk are 1 …

---

## [How to code a type-flexible model that is type stable?](https://discourse.julialang.org/t/how-to-code-a-type-flexible-model-that-is-type-stable/124138)

<div class="topic-metadata">

**Author:** [@jmgnve](https://discourse.julialang.org/u/jmgnve)\
**Replies:** 2\
**Last updated:** [December 24, 2024, 9:30am UTC](https://discourse.julialang.org/t/how-to-code-a-type-flexible-model-that-is-type-stable/124138 "2024-12-24T09:30:34Z")

</div>

Hi. I want to write a model where I can swap between different number formats (Float32, Float64…), and at the same time achieve type stability. I have been looking at ShallowWaters.jl for hints how to do this best. I wou…

---

## [JuliaGeo: Combine 2 files with points into one and export to shapefile](https://discourse.julialang.org/t/juliageo-combine-2-files-with-points-into-one-and-export-to-shapefile/124003)

<div class="topic-metadata">

**Author:** [@alecStewart1](https://discourse.julialang.org/u/alecStewart1)\
**Replies:** 4\
**Last updated:** [December 24, 2024, 3:12am UTC](https://discourse.julialang.org/t/juliageo-combine-2-files-with-points-into-one-and-export-to-shapefile/124003 "2024-12-24T03:12:27Z")

</div>

Hello friends, I’ve been trying to combine 2 shapefiles that have point data. I have put in an issue with GeoDataFrames here but I’ll detail my issues here. Initially I tried with a shapefile and a CSV file, but now I…

---

## [Artifact at pole of 3D shape with makie shading](https://discourse.julialang.org/t/artifact-at-pole-of-3d-shape-with-makie-shading/124083)

<div class="topic-metadata">

**Author:** [@aligurbu](https://discourse.julialang.org/u/aligurbu)\
**Replies:** 5\
**Last updated:** [December 23, 2024, 9:43pm UTC](https://discourse.julialang.org/t/artifact-at-pole-of-3d-shape-with-makie-shading/124083 "2024-12-23T21:43:36Z")

</div>

Hello everyone, I’m plotting a 3D red blood cell (RBC) shape using Makie and encountered a shading artifact—a black patch appears at the top pole of the shape. Here’s a minimal reproducible example: using GLMakie GLMak…

---

## [Retain computation results with @btime](https://discourse.julialang.org/t/retain-computation-results-with-btime/62644)

<div class="topic-metadata">

**Author:** [@jinml](https://discourse.julialang.org/u/jinml)\
**Replies:** 18\
**Last updated:** [December 23, 2024, 8:31pm UTC](https://discourse.julialang.org/t/retain-computation-results-with-btime/62644 "2024-12-23T20:31:30Z")

</div>

I’m trying to time a function and keep its return value: b = @btime y = foo(x) but at the end y is not returned. How can get @btime to also return my result?

---

## [What causes the performance of this function to tank?](https://discourse.julialang.org/t/what-causes-the-performance-of-this-function-to-tank/124119)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 5\
**Last updated:** [December 23, 2024, 7:27pm UTC](https://discourse.julialang.org/t/what-causes-the-performance-of-this-function-to-tank/124119 "2024-12-23T19:27:23Z")

</div>

I am doing some work to optimize a slow function call. I have reduced this function down to a simple demonstration example. Here is the “original function”. # alloc: 668.59k, 393.649 MiB function demo( dict::Dict{…

---

## [Why does not G\\\_N\[TAB\] render Unicode for Newton's constant?](https://discourse.julialang.org/t/why-does-not-g-n-tab-render-unicode-for-newtons-constant/124130)

<div class="topic-metadata">

**Author:** [@mocalvao](https://discourse.julialang.org/u/mocalvao)\
**Replies:** 1\
**Last updated:** [December 23, 2024, 6:16pm UTC](https://discourse.julialang.org/t/why-does-not-g-n-tab-render-unicode-for-newtons-constant/124130 "2024-12-23T18:16:38Z")

</div>

Hi I know how to type several Unicode characters for my user-defined variable names (i.e. x\_1\[TAB\] for subscripted x indexed by 1), but I would like to know why it is not possible to type, in the REPL, G\_N\[tab\] for Newt…

---

## [Unable to log long strings](https://discourse.julialang.org/t/unable-to-log-long-strings/99678)

<div class="topic-metadata">

**Author:** [@josephmm1](https://discourse.julialang.org/u/josephmm1)\
**Replies:** 2\
**Last updated:** [June 5, 2023, 3:22pm UTC](https://discourse.julialang.org/t/unable-to-log-long-strings/99678 "2023-06-05T15:22:03Z")

</div>

Hi all, I’m trying to log some long strings to the console to capture some inbound rest requests coming from another application. The problem is they are always limited in size to 1000 charecters, I’ve looked over the do…

---

## [Two questions about Julia](https://discourse.julialang.org/t/two-questions-about-julia/123957)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 11\
**Last updated:** [December 21, 2024, 10:47am UTC](https://discourse.julialang.org/t/two-questions-about-julia/123957 "2024-12-21T10:47:24Z")

</div>

Hello, I have two questions: 1- Why can’t I assign '' to a variable? julia\> ch = '' ERROR: ParseError: # Error @ REPL\[17\]:1:7 ch = '' # └ ── empty character literal Stacktrace: \[1\] top-level scope @ none:1 2-…

---

## [Latitude and longitude decimal range from degrees](https://discourse.julialang.org/t/latitude-and-longitude-decimal-range-from-degrees/123964)

<div class="topic-metadata">

**Author:** [@alecStewart1](https://discourse.julialang.org/u/alecStewart1)\
**Replies:** 33\
**Last updated:** [December 20, 2024, 8:28pm UTC](https://discourse.julialang.org/t/latitude-and-longitude-decimal-range-from-degrees/123964 "2024-12-20T20:28:05Z")

</div>

Hello friends! One of the use cases for Julia that I’m finding for work is for geographical purposes. However geography wasn’t my specialization in school. :sweat\_smile: One of the things I’m wanting to do is collect d…

---

## [Overflow issue?](https://discourse.julialang.org/t/overflow-issue/124009)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 3\
**Last updated:** [December 20, 2024, 4:40pm UTC](https://discourse.julialang.org/t/overflow-issue/124009 "2024-12-20T16:40:48Z")

</div>

Hello everyone, Is this a bug ? Why is it false for some specific numbers while true for others? julia\> 3 \* 1e-5 \* 1e5 == 3.0 false julia\> 5 \* 1e-5 \* 1e5 == 5.0 true julia\> 6 \* 1e-5 \* 1e5 == 6.0 false julia\> 7 \*…

---

## [Folding comments in VSCode](https://discourse.julialang.org/t/folding-comments-in-vscode/109896)

<div class="topic-metadata">

**Author:** [@cby](https://discourse.julialang.org/u/cby)\
**Replies:** 2\
**Last updated:** [December 20, 2024, 11:15am UTC](https://discourse.julialang.org/t/folding-comments-in-vscode/109896 "2024-12-20T11:15:13Z")

</div>

I moved over from Atom belatedly but find that the shortcuts for folding all or folding block comments are not working with Julia block comments. Atom also used to fold a series of single line comments, which I found hel…

---

## [About pluto sliders and documentation](https://discourse.julialang.org/t/about-pluto-sliders-and-documentation/123982)

<div class="topic-metadata">

**Author:** [@Geoff\_Russell](https://discourse.julialang.org/u/Geoff_Russell)\
**Replies:** 6\
**Last updated:** [December 20, 2024, 8:10am UTC](https://discourse.julialang.org/t/about-pluto-sliders-and-documentation/123982 "2024-12-20T08:10:15Z")

</div>

Is there a formal description of the @bind command somewhere. I want to put labels before and after the slider … Slider Label: …slider… Units label e.g., Battery power: … MW Battery energy: … MWh I’m mai…

---

## [Type unstability with args](https://discourse.julialang.org/t/type-unstability-with-args/123987)

<div class="topic-metadata">

**Author:** [@hbrochet](https://discourse.julialang.org/u/hbrochet)\
**Replies:** 3\
**Last updated:** [December 19, 2024, 1:17pm UTC](https://discourse.julialang.org/t/type-unstability-with-args/123987 "2024-12-19T13:17:24Z")

</div>

Hello, I would like to make the following function type stable: function f(args…) t = Tuple(\[arg\] for arg in args) return t end f(1,2.0,“s”) a run from @code\_warntype gives me julia\> @code\_warntype f2(1,2.0,“s…

---

## [Formatting floating point values as fixed width for printing with "$(value)"?](https://discourse.julialang.org/t/formatting-floating-point-values-as-fixed-width-for-printing-with-value/123968)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 3\
**Last updated:** [December 19, 2024, 1:23am UTC](https://discourse.julialang.org/t/formatting-floating-point-values-as-fixed-width-for-printing-with-value/123968 "2024-12-19T01:23:37Z")

</div>

I’m trying to add some logging to an existing codebase. I am trying to add some timing information to these logs. Logs are quite simple, they are just println statements wrapped by some functions. I would like to be a…

---

## [How to take Continuous Haar Wavelet Transform of a function?](https://discourse.julialang.org/t/how-to-take-continuous-haar-wavelet-transform-of-a-function/123770)

<div class="topic-metadata">

**Author:** [@optim](https://discourse.julialang.org/u/optim)\
**Replies:** 2\
**Last updated:** [December 18, 2024, 1:50pm UTC](https://discourse.julialang.org/t/how-to-take-continuous-haar-wavelet-transform-of-a-function/123770 "2024-12-18T13:50:47Z")

</div>

I’ve explored multiple Julia packages like DSP.jl, Wavelets.jl, and ContinuousWavelets.jl for computing continuous Haar wavelet transforms. While it appears that ContinuousWavelets.jl supports Haar wavelets, the exact sy…

---

## [Finding the greater word](https://discourse.julialang.org/t/finding-the-greater-word/123909)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 19\
**Last updated:** [December 18, 2024, 9:53am UTC](https://discourse.julialang.org/t/finding-the-greater-word/123909 "2024-12-18T09:53:03Z")

</div>

Hello, I have a file with the following contents: \>\>\>Goodness ^ Of ^ Grace: Come :;You broken! \> Heavy laden.. .. \<\<\<+Come! You helpless!?.() come You in despair:-(.. I wrote the following code to find the greater wor…

---

## [Test package with check-bounds=no](https://discourse.julialang.org/t/test-package-with-check-bounds-no/123938)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 5\
**Last updated:** [December 18, 2024, 9:01am UTC](https://discourse.julialang.org/t/test-package-with-check-bounds-no/123938 "2024-12-18T09:01:49Z")

</div>

Hi, Is there a way to test a package with check-bounds=no? It seems that it isnalways yes by default. I was thinking about something like: pkg\> test --check-bounds=no Thank you

---

## [How to implement a sparse decoder layer in Flux.jl?](https://discourse.julialang.org/t/how-to-implement-a-sparse-decoder-layer-in-flux-jl/123931)

<div class="topic-metadata">

**Author:** [@Flavio\_Barros](https://discourse.julialang.org/u/Flavio_Barros)\
**Replies:** 1\
**Last updated:** [December 17, 2024, 9:16pm UTC](https://discourse.julialang.org/t/how-to-implement-a-sparse-decoder-layer-in-flux-jl/123931 "2024-12-17T21:16:42Z")

</div>

I’m new to Julia and Flux.jl and I’m trying to implement a Variational Autoencoder (VAE). My decoder has a single layer mapping to the output, but I need to apply different weights to each example. Instead of a dense l…

---

## [Seeking API Design Advice for Setting Defaults](https://discourse.julialang.org/t/seeking-api-design-advice-for-setting-defaults/123845)

<div class="topic-metadata">

**Author:** [@g-gundam](https://discourse.julialang.org/u/g-gundam)\
**Replies:** 5\
**Last updated:** [December 17, 2024, 3:02pm UTC](https://discourse.julialang.org/t/seeking-api-design-advice-for-setting-defaults/123845 "2024-12-17T15:02:20Z")

</div>

I have a constructor for a mutable Chart struct that is used like this. using OnlineTechnicalIndicators using TechnicalIndicatorCharts golden\_cross\_chart = Chart( "AAPL", Week(1); indicators = \[ SMA{Flo…

---

## [Symbolics expand derivative throws an error](https://discourse.julialang.org/t/symbolics-expand-derivative-throws-an-error/123868)

<div class="topic-metadata">

**Author:** [@elvispy](https://discourse.julialang.org/u/elvispy)\
**Replies:** 4\
**Last updated:** [December 15, 2024, 6:52pm UTC](https://discourse.julialang.org/t/symbolics-expand-derivative-throws-an-error/123868 "2024-12-15T18:52:00Z")

</div>

How do I fix the following piece of code?. This seems like an issue to me, however I’m somewhat new to Julia and I’m not sure if i’m missing something or if this is a real ‘bug’ @variables r g = Symbolics.variable("f", …

---

## [A question about SubString](https://discourse.julialang.org/t/a-question-about-substring/123838)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 8\
**Last updated:** [December 15, 2024, 8:21am UTC](https://discourse.julialang.org/t/a-question-about-substring/123838 "2024-12-15T08:21:55Z")

</div>

Hello, What is the difference between SubString and Indexing? I did: julia\> str = "Where the mind is without fear" "Where the mind is without fear" julia\> SubString(str, 1, 5) "Where" julia\> str\[1:5\] "Where" The res…

---

## [Combining LaTeX with variables in PyPlot title](https://discourse.julialang.org/t/combining-latex-with-variables-in-pyplot-title/41128)

<div class="topic-metadata">

**Author:** [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Replies:** 9\
**Last updated:** [December 14, 2024, 12:30am UTC](https://discourse.julialang.org/t/combining-latex-with-variables-in-pyplot-title/41128 "2024-12-14T00:30:57Z")

</div>

This is somewhat similar to PyPlot: how to include a variable in a title, but with the added complication of including LaTeX in the title too. See I have this code: PyPlot.title(L"Plot of the 1st eigenfunction, correspo…

---

## [Dereferencing Ptr{Ptr{Int32}}](https://discourse.julialang.org/t/dereferencing-ptr-ptr-int32/123709)

<div class="topic-metadata">

**Author:** [@NimaPoshtiban](https://discourse.julialang.org/u/NimaPoshtiban)\
**Replies:** 21\
**Last updated:** [December 13, 2024, 1:34pm UTC](https://discourse.julialang.org/t/dereferencing-ptr-ptr-int32/123709 "2024-12-13T13:34:58Z")

</div>

Hi I’m using the Julia C interface to call a function from my dll Everything works fine Until I try to dereference it first\_row = unsafe\_load(result\_ptr) firsr\_num = unsafe\_load(first\_row) #= The matrix form is so…

---

## [How to correctly detect closed TCP connection](https://discourse.julialang.org/t/how-to-correctly-detect-closed-tcp-connection/92287)

<div class="topic-metadata">

**Author:** [@plukes](https://discourse.julialang.org/u/plukes)\
**Replies:** 2\
**Last updated:** [December 13, 2024, 10:06am UTC](https://discourse.julialang.org/t/how-to-correctly-detect-closed-tcp-connection/92287 "2024-12-13T10:06:47Z")

</div>

Hi, I have been trying to implement a simple TCP server that sends periodically data to a created connection. Based on the manual I can implement a minimal working example as follows: function write\_data(sock) whil…

---

## [Packages not found](https://discourse.julialang.org/t/packages-not-found/123756)

<div class="topic-metadata">

**Author:** [@odipus](https://discourse.julialang.org/u/odipus)\
**Replies:** 3\
**Last updated:** [December 12, 2024, 4:56pm UTC](https://discourse.julialang.org/t/packages-not-found/123756 "2024-12-12T16:56:43Z")

</div>

I have created a docker image # Use the official Julia image FROM julia:1.9 ENV JULIA\_CPU\_TARGET="generic;sandybridge,-xsaveopt,clone\_all;haswell,-rdrnd,base(1)" # # Install Julia dependencies RUN julia -e "using Pkg; …

---

## [Nothing and type stability in kwargs](https://discourse.julialang.org/t/nothing-and-type-stability-in-kwargs/123532)

<div class="topic-metadata">

**Author:** [@kockahonza](https://discourse.julialang.org/u/kockahonza)\
**Replies:** 6\
**Last updated:** [December 11, 2024, 10:50am UTC](https://discourse.julialang.org/t/nothing-and-type-stability-in-kwargs/123532 "2024-12-11T10:50:29Z")

</div>

Hi, so this is a fairly general question, but is it possible to use Nothing without type stability related performance hits? A specific example I have now is a simple simulator where I want to implement multiple optional…

---

## [HDF5.jl and YAXArrays.jl integration](https://discourse.julialang.org/t/hdf5-jl-and-yaxarrays-jl-integration/123674)

<div class="topic-metadata">

**Author:** [@kamilmroz12](https://discourse.julialang.org/u/kamilmroz12)\
**Replies:** 3\
**Last updated:** [December 11, 2024, 8:30am UTC](https://discourse.julialang.org/t/hdf5-jl-and-yaxarrays-jl-integration/123674 "2024-12-11T08:30:44Z")

</div>

Hi, I am working on a script to create a YAXArrays dataset from an HDF5 file. The idea is to iterate over the datasets in a selected group and combine them into a single dataset. The first issue I encountered is the ina…

---

## [Julia SEGFAULT debian](https://discourse.julialang.org/t/julia-segfault-debian/123682)

<div class="topic-metadata">

**Author:** [@alexcu2718](https://discourse.julialang.org/u/alexcu2718)\
**Replies:** 3\
**Last updated:** [December 11, 2024, 1:46am UTC](https://discourse.julialang.org/t/julia-segfault-debian/123682 "2024-12-11T01:46:16Z")

</div>

Hi all, This is a reissue of my issue from reddit: I’ve been trying to learn Julia lately, originally I was getting along pretty well. However, since I reinstalled my distro (switched from Ubuntu to Debian 12), I’ve n…

---

## [Trouble importing Dataset from MLDataset using VScode](https://discourse.julialang.org/t/trouble-importing-dataset-from-mldataset-using-vscode/123585)

<div class="topic-metadata">

**Author:** [@Abhay\_Chandra](https://discourse.julialang.org/u/Abhay_Chandra)\
**Replies:** 1\
**Last updated:** [December 10, 2024, 5:57pm UTC](https://discourse.julialang.org/t/trouble-importing-dataset-from-mldataset-using-vscode/123585 "2024-12-10T17:57:59Z")

</div>

I am trying to use the CIFAR10 Dataset using the MLDataset pakage of Julia, but I confirm for confirmation to download, the REPL gets stuck(i guess), and via VS code notifications I just see this (attached below) wh…

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

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