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

Updating DistributedArray using the primitive DArray constructor

The following syntax is demonstrated in the manual: DArray(size(d),procs(d)) do I ... end I haven’t seen a loop like this before. What is I? 1 post - 1 participant Read full topic

View Article


Get type containing the types of a set?

Given a set of variables [a,b,c...], I want to find the type T such that typeof(a)<:T, typeof(b)<:T, .... The reason I want to do this is that I have cache variables in my ODE system, which need...

View Article


Image may be NSFW.
Clik here to view.

Met a weird error; UndefVarError

Hi, I’m now writing my codes and encountered a really strange error: image2503×450 67.6 KB As can be seen, the error said "obj_path_tmp not defined". However, in debugging mode (using Debugger), I can...

View Article

How to build julia with existing llvm compiler

Hi, i have latest llvm compiler (v 12.0.0) on my pc. how to build julia with it? 3 posts - 2 participants Read full topic

View Article

Image may be NSFW.
Clik here to view.

Why Base.@kwdef is not exported?

Hi. I have a small question about Base.@kwdef. I think this macro is very useful, already many packages are using Base.@kwdef. GitHub Build software better, together GitHub is where people build...

View Article


Definition of floor

Hi, In base/float.jl I don’t understand the definition of floor: Here floor(::Type{T}, x::AbstractFloat) where {T<:Integer} = trunc(T,round(x, RoundDown)) I don’t get the round. What I understood...

View Article

Fail lauching JuliaPro in ubuntu server 1804

Hi, I am new to Julia, yet quite excited about it. After successfully installed on my Win10 notebook, I eager to install it on my office ubuntu server (1804). With the instruction of [JuliaPro Quick...

View Article

Can't get right ranks when using non-blocking MPI.Irecv!()

I am trying to let rank 0 get other rank indexes, but I got different results from MPI.Irecv!() and MPI.Recv() , and result from MPI.Irecv!() seems odd: import MPI function main() MPI.Init() comm =...

View Article


Macro for decorator (wrapper) in Python

Greetings, What I’m trying to do can be expressed as a Python code like this: def is_convex_repr(is_convex): def wrapper(func): func.is_convex = is_convex return func return wrapper...

View Article


Error installing package using pkg.julialang.org, error with unpack, 7z.exe

setup: Julia 1.5.1, win 10. When trying to install packages using server ‘pkg.julialang.org’ I am getting error in unpacking download files. I think the error happens with ‘unpack’ call github.com...

View Article

Image may be NSFW.
Clik here to view.

Spilt column and save into different column

hoDATAMANGLING674×746 104 KB SOLVE E PART 8 posts - 4 participants Read full topic

View Article

Image may be NSFW.
Clik here to view.

Recursive macro call

As an exercise, I’m trying to make a macro that turns @x a b c into a = b = c = 1234. I tried to write it recursively, but I don’t know how to fix my error Definition: julia> macro x(s::Symbol,...

View Article

Don't understand behaviour of NamedTuple{...,Tuple{...,T}} where T

Here’s an example to enter in the REPL. I don’t understand the behaviour of Z(x) below. I’m using Julia 1.4.2. julia> Y = NamedTuple{(:a,:b), Tuple{String,Real}} julia> Z = NamedTuple{(:a,:b),...

View Article


Installing Julia System Wide

I’m using Windows 10 on my desktop machine and I would like to install Julia system wide. When I follow the instructions to right click and run as administrator, it still wants to install it in my...

View Article

Variables not recalculating while reloading modules

I have a module that i use to input some parameters (used in multiple functions etc, and I did not want to rewrite everywhere). They are lightly manipulated (basic scaling etc) and exported to various...

View Article


PermutedDimsArray slower than permutedims?

I’m struggling to understand why one function for multiplying a batch of matrices with a single matrix is significantly slower than another. The only difference between the functions is that...

View Article

Smoothing Spline with Optimized Knots

I have some (x,y) data with equally-spaced x’s. I would like to smooth the data using (up to) 4 cubic splines and obtain the equations for each spline. I would like the knots connecting the splines to...

View Article


Changing the default solving loop condition in DifferentialEquations.jl

Hi all! I’m trying to implement a solver that will stop if one of the variables passes a certain value instead of time-stepping (I may thus change the title of this topic). Say e.g. u[1] < 0 ||...

View Article

How to keep result one-dimensional even after multiplication?

I am trying several functions who include vectors as variable. The variable (x) is x= [2.0:0.5:5.0;] I like to define the following kinds of functions: f(x) = (x .+ 0.07im)/2.3; g(x) = (1/f(x)).^2...

View Article

Image may be NSFW.
Clik here to view.

How to import this kind of file properly?

Hi! I have a bit of an unusual csv file (for me atleast). It is structured as such: image1487×334 21.5 KB Pos X/Y/Z [m]: 0 0 -1.2 0 0 -1.188 0 0 -1.176 Part Time [s] Vel_0.x [m/s] Vel_0.y [m/s]...

View Article
Browsing all 2795 articles
Browse latest View live