Julia Geeks
32 subscribers
66 photos
2 videos
15 files
231 links
I'll point out what I discover daily about Julia lang on this channel.

The first post of the channel:
https://t.me/JuliaGeeks/3

Most useful hashtags of the channel:
https://t.me/JuliaGeeks/22

Julia's official website:
https://julialang.org
Download Telegram
permutedims Vs transpose

Well, don't use permutedims to transpose a 2-D matrix! The transpose function is by far more efficient in this case. Another thing to be noted is, that the returned objects by these two functions are different in type!
julia> using LinearAlgebra

julia> mat = rand(2, 2);

julia> permutedims(mat) == transpose(mat)
true

julia> typeof.((permutedims(mat), transpose(mat)))
(Matrix{Float64}, LinearAlgebra.Transpose{Float64, Matrix{Float64}})

julia> LinearAlgebra.Transpose{Float64, Matrix{Float64}} <: AbstractMatrix
true


#Tips__JG
❤️ JuliaGeeks
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
The following repository has been officially mentioned as a source of compatible Jupyter/Colan notebooks with Julia. It is worth checking it out.

ageron/julia_notebooks: Julia Jupyter/Colab Notebooks
https://github.com/ageron/julia_notebooks
It is possible to get an interface that is similar to the IPython REPL and the Mathematica notebook with numbered input prompts and output prefixes.
Check this out (Julia v1.9+ required): https://docs.julialang.org/en/v1/stdlib/REPL/#Numbered-prompt

#Tips__JG
❤️ JuliaGeeks ❤️
Please open Telegram to view this post
VIEW IN TELEGRAM
💯211
One of the most important new methods that have been added into Julia through the latest update is in! which pushes a new element to an existing Set, if it isn't already in the Set:

julia> S = Set([1,2,3,4]);

julia> S
Set{Int64} with 4 elements:
4
2
3
1

julia> in!(5, S)
false

julia> S
Set{Int64} with 5 elements:
5
4
2
3
1


⚠️ Note that it returned false since the 5 didn't exist in the Set.
1️⃣ Don't know about the exclamation mark? Check this.
2️⃣ Don't know about Sets in Julia? Check this.

#Tips__JG |#Function__JG
❤️ JuliaGeeks
Please open Telegram to view this post
VIEW IN TELEGRAM
Wow, new functions such as allunique, and allequal that came with Julia 1.11, are super handy:

allunique(itr) [doc]
Return true if all values from itr are distinct compared with isequal. Or if all of [f(x) for x itr] are distinct, for the second method.

  julia> allunique([1, 2, 3])
true

julia> allunique([1, 2, 1, 2])
false


allequal(itr) [doc]
Return true if all values from itr are equal when compared with isequal. Or if all of [f(x) for in itr] are equal, for the second method.

  julia> allequal([1, 1])
true

julia> allequal([1, 2])


#Tips__JG |#Function__JG
❤️ JuliaGeeks
Please open Telegram to view this post
VIEW IN TELEGRAM
Julia Geeks
julia-1.9.0.pdf
Please open Telegram to view this post
VIEW IN TELEGRAM
Julia Geeks pinned a file
I LOVE this progress bar in Julia 1.12 DEV 🥶
It will come with the next Julia minor release 🔥
💯1
Julia Geeks
julia-1.11.1.pdf
😁 Introduction of Memory type

StaticArrays
play an essential role in mathematical operations and the optimization of such operations. However, Julia developers have decided to use a built-in type in spite of using a third-party package in this regard.

So far, they have written dozens of lines of code to provide the optimizations as a built-in type of Memory. It is such a relief to announce that this type can be vastly replaced by Vector{T}. Also, many inner specifications of arrays have been implemented based on Memory type. Hence, performing Array operations is now more efficient and blazingly faster in Julia +1.11.

Later on, I will write more details about this.

#Update__JG
❤️ JuliaGeeks
Please open Telegram to view this post
VIEW IN TELEGRAM
21💯1
Suppose you want to test a package just once without getting involved with the installation and uninstallation process. What would you do?
Well, Julia devs have provided a handy flag, --temp, to activate a temporary environment for such cases. The temporarily-created env would be deleted automatically right after deactivating it. 🤟

To activate such an env, one should enter the following command after entering into the pkg section by hitting the ] key ⌨️:

pkg> activate --temp

🔗 More information in this regard is available on the official documentation.
Do you know about shared environments in Julia?

#Tips__JG |#Environment__JG
❤️ JuliaGeeks
Please open Telegram to view this post
VIEW IN TELEGRAM
3🍾1
Sometimes, you must see all elements within a Vector or something else. The Julia REPL limits the number of elements that can be shown and truncates the output to better fit the screen. One way to do this is to use the following code to avoid the truncation:

show(stdout, "text/plain", rand(30))


The output of this code is exactly the same as when you call the rand(30) code, vertically adjusted but without truncation. However, if you would like to see the elements next to each other separated using a comma (like what we have in Python 📱), you should use the following code:

show(IOContext(stdout, :limit=>false), rand(30))


The output would be something like [0.8223948799776574, 0.01535264435200867, 0.7524808776993049, 0.8567173366672614, 0.19442069230608283, 0.5655759545291479, 0.11702055746225415] (here I truncated the output to avoid a lengthy message)

#Tips__JG
❤️ JuliaGeeks
Please open Telegram to view this post
VIEW IN TELEGRAM
HELL YEAAAA 🎉
Julia 1.10.8 currently is deployed internally by Google fucking Colab 😎
Let's go baby 🥳

#News__JG
❤️ JuliaGeeks
Please open Telegram to view this post
VIEW IN TELEGRAM
6🍾1
Julia 1.12 allows redefining structs 💃

#News@JuliaGeeks
❤️ JuliaGeeks
Please open Telegram to view this post
VIEW IN TELEGRAM
🍾1