Quantcast
Channel: First steps - JuliaLang
Browsing all 2795 articles
Browse latest View live

Can this be done with an outer constructor?

I recently had a desire for this type of convenience constructor: # Some generic wrapper struct AA{T} a::T end # Create a new wrapper of same inner type AA{T}(a...) where T = AA(T(a...)) # Dummy to...

View Article


Something about nothing

I’m learning Julia from the manual and really enjoying the process. Occasionally I try to do something weird and useless with a new learned concept. Here is an example of it: julia> nothing ==...

View Article


How to distinguish an array from a tuple when doing a copy / assignment

I have a function for which one of the arguments may be either an array or a tuple, though its usage internally is tuple-like. If x is an array that then I will have the line y = copy(x) but if x is a...

View Article

Artifact: Zstd and artifact: MbedTLS installation failure when adding...

PyPlot get installed very well but MAT and IJulia are failed. Any idea? julia> versioninfo() Julia Version 1.4.1 Commit 381693d3df* (2020-04-14 17:20 UTC) Platform Info: OS: Linux...

View Article

Get the name of a function in the argument

I would like to have a function that returns the name of the function in the argument, e.g.: function give_me_my_name(f::Function) return ??? (f); end such that give_me_my_name(sin) returns sin as a...

View Article


Global variables within 2 files

Hello! How can I declare a global variable that is shared between two files? File1.jl import("File2. jl) function1 test() close=false a=0 If a>0 close = true end end File2.jl function2 test2() If...

View Article

Broadcasting Regex in DataFrame to create new column

I’m quite new to Julia using Python and R before. I want to populate a new column in a DataFrame with data extracted from an existing column using Regex. I apply the function match, broadcasting and a...

View Article

Image may be NSFW.
Clik here to view.

[SOLVED] UInt is not Int!

Hi ! I’ve encountered something curious, and here is a minimal example function f(x::UInt,y::UInt)::UInt x + y end And now i want to do f(2,2) but julia says this to me : julia> f(2,2) ERROR:...

View Article


@ode_def not defined

I am using DifferentialEquations.jl in a Julia Notebook. The code starts as: using DifferentalEquations using ParameterizedFunctions sir_ode = @ode_def SIRModel begin dS = -β*S*I dI = β*S*I-γ*I dR =...

View Article


Using CubicSplineInterpolation on a vector (not on a Lazy Array)

I have a small problem that I can’t seem to solve regarding the use of CubicSplineInterpolation on a vector (rather than lazy array). using Interpolations, Plots function spline_interpolation2()...

View Article

Image may be NSFW.
Clik here to view.

Blog -- Reinstall Julia

Just wrote a short post about how to reinstall Julia. Hopefully it would be helpful for who needs to do so. You don't need to prove this Reinstall Julia - You don't need to prove this A couple of days...

View Article

Continous Markov Processes

Hi, I just came across the “ContinuousTimeMarkov” written by Tom Pappas. Unfortunately, there are no examples in the repository and no documentation that I could find. Could somebody, possibly Tom,...

View Article

Image may be NSFW.
Clik here to view.

Circle surface

Hi, I make first steps in Julia and I want to do circle surface. I can only makes surface on rectangles field in 3D. I will be really thankfull for tips. I attach photo, what it should look like 4...

View Article


Image may be NSFW.
Clik here to view.

Efficient way to go from bit-packed value to `Vector{T

I am trying to write a faster Parquet reader (faster than the one in Parquet.jl atm). One interesting problem that I encountered is this: How to efficiently unpack a set of bit-packed integers into...

View Article

String search()

Methods search() and contains() for strings existing?? 9 posts - 5 participants Read full topic

View Article


Purposes of explicit type annotations

From the manual: Adding [type] annotations serves three primary purposes: to take advantage of Julia’s powerful multiple-dispatch mechanism, to improve human readability, and to catch programmer...

View Article

How to plot and save figure, by running code on unix server

How to plot and save figure, by running code on the Unix server. Thank you in advance. 5 posts - 3 participants Read full topic

View Article


Package Compatibility issues (Genie / Nettle)

Hi, I was using Genie (version 0.29.0) on Julia 1.2 without issues, but i had to use use it on another computer (also Julia 1.2) and i can’t add it anymore. (v1.2) pkg> add Genie Resolving package...

View Article

Problem with curl for external dependencies

Dear all, I’ve got the following error when trying to build julia v1.3.0: $ make % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0...

View Article

Evaluate string based on dictionary values

Hello! Is possible to evaluate a string something like “x + y” or “x > y” based on values of x and y taken from dictionary? In python works if I write eval(“x+y”, dict), but in julia I can’t do it....

View Article
Browsing all 2795 articles
Browse latest View live