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

Struct containing a tuple of unknown length

@jbaxter wrote: I’m thinking about some kind of immutable version of the following mutable object: mutable struct MGlob id::Int children::Array{MGlob} end For example the immutable version, called...

View Article


Preallocating Array in a Memory Efficient Way

@jmcastro2109 wrote: Hi, I need to work with a very big Array z=zeros(Int64,2^K,2^K,K,T) What is the proper way of pre-allocating this Array in such a way that it uses the least memory possible when K...

View Article


Multiplying by a variable in a constraint causing type instability in...

@stop_movn wrote: I am trying to figure out how to avoid type instability in my model that uses some constraints and objectives that include a variable. I can’t seem to avoid a “::Union{Val{false},...

View Article

I am confused using tanh(M)

@floriano wrote: Hello, I am pritty new to Julia and try to find my first steps. I am a bit confused now. In Python I had this (simplyfied) piece of code: import numpy as np a = [[1,2], [3,4]] M =...

View Article

Image may be NSFW.
Clik here to view.

How to Compute the integration of the following formula by HCubature

@Stephen wrote: julia> f2(x)=x[1]*x[2]/(1-x[1]) f2 (generic function with 1 method) julia> a=[0;x[1]] ERROR: UndefVarError: x not defined Stacktrace: [1] top-level scope at none:0 julia>...

View Article


How to control the output of broadcast?

@tomtom wrote: calling fun.() below returns an Array of NamedTuples: julia> function fun(x)::NamedTuple (a = x + 1, b = x - 1) end fun (generic function with 1 method) julia> fun.([1, 2, 3])...

View Article

Why is Julia messing up my variables?

@lko wrote: Can one of you explain to me what is going on here and how to avoid it? Can you reproduce this behaviour? When I define x as x = zeros(10) x .= .05 x I get Vector{Float64} with 10 elements...

View Article

Image may be NSFW.
Clik here to view.

Jldoctest blocks in julia docstrings is not evaluated

@Sijun wrote: Would someone please have a look at the following issue? stackoverflow.com jldoctest blocks in julia docstrings included in documentation but tests not run on them automated-tests,...

View Article


What is a Base.Generator?

@lwhitefox wrote: I’ve been looking at some sample code from th eFlux model zoo, and I came across something like: f(x) = x^2 d = (f(i) for i in 1:10) (this is much simplified to help pose the...

View Article


Critique request: code for generating the mandelbrot set

@jonathan-durbin wrote: If anyone has time, I would greatly appreciate suggestions for code improvement for this repository. I’m still learning julia, so I wouldn’t be surprised if I’m missing some...

View Article

Cannot reassign dict entry with nothing value

@data_dictator wrote: I just started coding in Julia today, and I have a slight problem with Dict(), when I create one that has only “nothing” or “missing” as values, I cannot later reassign the...

View Article

Scope when using multiple modules

@urp wrote: I am new at using Julia. I am writing a PDE solver. I would like to have a struct that stores all mesh/simulation variables that could then be accessed from other modules in my code....

View Article

Julia 1.3 manual not downloadable as PDF

@aerdely wrote: The following link does not work for me: https://raw.githubusercontent.com/JuliaLang/docs.julialang.org/assets/julia-1.3.0.pdf I get the message 404: Not Found Any suggestions? Posts:...

View Article


Image may be NSFW.
Clik here to view.

Wrapping c code and packaging the wrapper

@AlfTetzlaff wrote: Hey everybody! I want to wrap a .so library file which provides access to the cameras of a certain vendor (ZWO ASI). For a start I need it for home use with possible distribution...

View Article

How does SVector manage memory?

@tomtom wrote: julia> using StaticArrays julia> using BenchmarkTools julia> x = [1, 2, 3] julia> y = SVector{3, Int64}(x) julia> @btime exp.($x); 62.574 ns (1 allocation: 112 bytes)...

View Article


Different behaviour during debugging and execution

@Volker wrote: Somehow I get a different behaviour of the following code, but I don´t know why. As you can see from the REPL output during debugging the for-loop was executed successfully, but during...

View Article

Can a function returns a partial function?

@tog wrote: Hi, I am new to Julia coming from Python. In Python we have the “partial” function that allow to derive a function by fixing some arguments. Can we do something similar in Julia? I would...

View Article


How to obtain local variables in functions for nlsolve or minimize

@RangeFu wrote: Hi, I was wondering what is the best practice to export local variables in a objective function for optimization or linear solvers. For example, I have a function that like: function...

View Article

Equivalent Function to licols in Matlab

@jmcastro2109 wrote: Hello, I wonder whether Julia has a function to remove (or identify) the columns of a matrix that are linearly dependent similar as the licols does in Matlab. Posts: 3...

View Article

How to manually install packages on a HPC without internet?

@Massimiliano_Comin wrote: Hello, I want to setup Julia with (of course) some packages on a HPC which does not have access to internet. This means I can only SCP from my local machine to the HPC. In...

View Article
Browsing all 2795 articles
Browse latest View live