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

PrettyTables.jl: @ptconf tf argument not able to find custom tf

Hi, I’m currently using PrettyTables, and I’m not sure what’s going on with my codes below. I defined a custom tf as follows: using JuliaDB using PrettyTables tf_compact2 = TextFormat(up_right_corner...

View Article


Empty JSON3.Object

I am quite new to Julia and struggling with quite simple task. mutable struct XYZ id::Int64 item::JSON3.Object end To that structure I am trying to add default/empty constructor (setting item to empty...

View Article


Need example of processing csv file in chunks

I have big 10+GB files which I need to load and process line by line. I’m trying to use CSV package, but appears this package preload entire file. Can anyone help or point to example of code which...

View Article

Proper way of organizing code into subpackages

Hi all, I am in the process of converting a fairly complicated proprietary simulation model that I wrote in Python to Julia 1.5.3. The code is broken into around 20 different sub packages on the file...

View Article

Anyone can help me to solve this error?

julia> import Printf julia> @printf("%3.2f", 3.1416) ERROR: LoadError: UndefVarError: @printf not defined in expression starting at REPL[12]:1 3 posts - 2 participants Read full topic

View Article


Unable to find compatible target in system image

I have a multi-stage centos7-based dockerfile that has Julia 1.5.3 installed to /root/julia in the image base. PackageCompiler is v1.2.4 for this. Here is the relevant part: ####################...

View Article

Package does not have AnotherPackage in its dependencies

I have a small functioning Julia project. I needed to add JSONSchema package so I did: pkg> add JSONSchema It added following line to my Project.toml under [deps]: JSONSchema =...

View Article

Repl_history depending on current working directory

So I am working concurrently on two separate projects, let us call them A and B. When I am in the working directory of project A, anything in repl_history.jl that is connected to project B is...

View Article


Problem with trivial arithmetic

In my function “main” I have: floor1 = floor(Int64, 4382/6) println("floor1 = ", floor1) Hfloor1 = 6floor1 println("Hfloor1 = ", Hfloor1) missing1 = 4382 - Hfloor1 println("missing1 = ", missing1)...

View Article


How to create a Flux model from parameter vector?

Hi, I have a parameter vector and shape array as below: shape =[((2,5),2),((2,2),2)] #shape of layers : weights and bias w = rand(18) #weights and bias together. In this case elements of w are divided...

View Article

Struggling with signatures

Hi, I’m struggling with type signatures. The following code only works if all the types I pass are of the exact same type. abstract type S end struct S1 <: S value::Int64 end struct S2 <: S...

View Article

Silly SymPy question

I want to convert some symbolic computations from Maple to Julia/SymPy, specifically regarding the Park transformation. Question: how do I use coefficients like sqrt(3/2) and make sure that these are...

View Article

While loop and UndefVarError

The variable gets undefined in a while loop. julia> index = length(fruits) 4 julia> while index > 0 println(fruits[index]) index -= 1 end ERROR: UndefVarError: index not defined Stacktrace:...

View Article


DifferentialEquations.jl: ODE returns "retcode: success" but interpolation...

Hello Julia community, I am currently going through a toy-problem trying to solve the heat PDE using the FFT (I’m following this series by Steve Brunton https://youtu.be/BkA7ncY0b7I). This is the code...

View Article

Help in using the Cbc solver

Hi Could someone help me in using Cbc. I don’t know what happens but every time I try to compile an error message appears. I’m using JuMP v0.18.6 and Cbc v0.7.1, I tried to update these packages but I...

View Article


Add and kill one new agent every time step

I am playing with the Agents.jl Flocking example here (Flocking · Agents.jl). I would like to add a new agent and kill the oldest agent every time step. I can kill an agent by including age::Int as a...

View Article

Parametrically-constrained arguments not working?

The module testModule (below) defines method iterlocal that calls localindices. testModule uses DistributedArrays and SharedArrays, which impose mutually-exclusive parametric constraints on...

View Article


Included code behaves different than code in place

Included code behaves different than code in place In file test.jl: module test function sumto(n) s = 0 for i = 1:n s = s + i end s end end # module test This works: julia>include("test.jl")...

View Article

How to adjust string into item in JSON structure

My code is validating input json using JSONSchema.isvalid If it is not valid, code takes string returned by JSONSchema.diagnose and it should return that string as json containing error. The code...

View Article

Getting Error while creating Documentation using Documenter.jl

I was using the julia documentor.jl package as mentioned in documentation to create an empty documentation. But when i run the command: julia --color=yes make.jl I get the following error : $ julia...

View Article
Browsing all 2795 articles
Browse latest View live