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

How to understand place of numbers with Irrational type in Julia?

I recently try to understand how numbers of Irrational type as \pi, e, \gamma (Euler-Mascheroni constant) works in Julia. At these moment I think of them as living in vast space between constants...

View Article


Difference between Base.product and Iterators.product?

They seem identical down to the documentation: help?> Base.product product(iters...) Return an iterator over the product of several iterators. Each generated element is a tuple whose ith element...

View Article


How to dispatch by value?

Very beginner question about using “where” in function declaration. Is it possible to do something like this? function p(c::Structure) where c.id == :x do something now I know c.id == :x end function...

View Article

Image may be NSFW.
Clik here to view.

Dispatch on all binary operations

Hi all, been using Julia for sometime now, first time I’m posting here. Is it possible for me to dispatch over all binary operations which have specific type arguments? I’m working on a Fuzzy...

View Article

How to print string with assigned variable and an "!" character?

I tried a simple code with julia: x = readline() print(String(“Hello, $x!”)) and Julia took the variable as “x!”, instead of “x”. But, it was just fine when I changed the “!” with “.” Is “!” a special...

View Article


Surprised by randcycle

Hi, first time poster here! I am fooling around with cyclic permutations today in Julia 1.4.2 and was surprised to see that the randcycle function in Random do not include the identity permutation. As...

View Article

Any function return inference in Julia >1.3?

Has there been any addition in Julia 1.4/1.5 of function return inference, given arg types? As of Julia 1.3, I was using _detect_type(fn, itr) = eltype(map(fn, empty(itr))) function myfunc(fn, itr)...

View Article

Problems with first script: importing CSV-files to DataFrames and analyzing them

Hi! I am trying to learn julia by importing the contents of CSV-files into DataFrames, and subsequently analyze the content. If I get this “base script” to work, I will probably repeatedly copy it and...

View Article


HTTP.jl websockets - iterator?

I’m not sure if this is an HTTP.jl usage question or really a design question, but in any case… I’m trying to code an application for which I can seamlessly swap the bit that provides it with...

View Article


Understanding the dangers of abusing multiple dispatch

Hi, I’d like to understand more about this topic: The dangers of abusing multiple dispatch...

View Article

Update a value in DataFrames.jl

Hello everyone, Im using Julia 1.4.2 and DataFrames.jl 0.21.2 and I have the follow problem. I have an Dict with values that I want to replace in the column of certain DataFrame. The keys is a name...

View Article

ReverseDiff.GradientTape fails for backslash operator when symmetric sparse...

Hi! I am using ReverseDiff to calculate the gradient of a scalar function with respect to its vector input. A simplified piece of code is attached in the end. It’s observed the...

View Article

How to define a heuristic callback using JuMP?

I’m trying to implement integer programming callbacks using JuMP. Basically, my heuristic callback is defined like this: function my_heuristic_callback(cb_data) x_val = [callback_value(cb_data, x_i)...

View Article


Linked arrays of elements

Dear Julia&JuMP support team, if i have a set or an array of elements: A=[“A1”, “A2”, “A3”] I want to define a new array B linked to each element of A: B(“A1”)=[“m1”, “m2”] B(“A2”)=[“m3”, “m4”]...

View Article

Plots build & precompilation error on Linux aarch64

I was trying to use the Plots.jl package on an Nvidia Jetson running Linux aarch64. Unfortunately I am not able to go past building and precompiling the package. During the build I get the following...

View Article


Why travis is not creating the Stable part of the document?

hi, I am trying to create documents for my packge and I have added a document part in travis yml file. Its creating the dev part of the document but not sure why its not creating the stable part. If...

View Article

How to make a struct support subsetting elements 'recursively'

Suppose I have the following: struct mystuff x::Array{Float64,1} y::Array{Float64,1} mystuff(n) = begin s = new(Array{Float64,1}(undef,n),Array{Float64,1}(undef,n)) return s end mystuff(x,y) = begin s...

View Article


Handling "Type IOError has no field status"

I make regular calls to an API. Sometimes the call results in the error “type IOError has no field status”. Rather than my script stopping, I would like to handle that error and permit the script to...

View Article

DistributedArrays

hello! Ihave some distributedArrays to compute but i still getting error, is the any way to divide or multiplica dstributed Arrays?? using OhMyREPL using Distributed addprocs(4) @everywhere using...

View Article

Issue passing array to FORTRAN subroutine

I’m trying to use Julia to wrap a FORTRAN subroutine taking several arrays as arguments. The issue is that the subroutine receives garbage as the array values (1e-314 etc), so I must be defining...

View Article
Browsing all 2795 articles
Browse latest View live