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

Zero() and iszero() for mutable structs

Hi there! It is useful for me to store a mutable struct Line in a sparse matrix. I had the impression that it is useful to define Base.zero(::Line) = Line(0,1,0) and Base.zero(::Type{Line}) =...

View Article


How to handle dependencies?

Hi, so imagen I have a file at /home/pascal/projects/foo/main.jl and in that file I want to create code that plots some kind of histogram. For that, I want to use histogram() from the DistPlots...

View Article


How to start and structure a new application?

Hi, I just read the docs about Pkg.jl and there in the glossary we can find the definition of the three words project, package and application. Project: is an umbrella term: packages and applications...

View Article

Image may be NSFW.
Clik here to view.

Is there a way to manually override highlighting in Atom/Juno?

Sometimes it would be nice to give highlighting rules to things like comments to facilitate: code review minimal presentation Regarding comments, is there a way to achieve the following affect:...

View Article

Image may be NSFW.
Clik here to view.

How do I make multiple figures in PGFPlotsX and add a table?

Hello! If I wanted to construct something like this: tex.stackexchange.com Aligning subplots in a pgfplots figure tikz-pgf, pgfplots, vertical-alignment asked by Vivi on 12:04AM - 29 Nov 11 UTC As far...

View Article


Most elegant way to fill an Array inside for loop?

Hi, I am kind of new to the Julia language. I am looking for the most elegant way to fill an Array like in the following code section? (which does not work) dr = Date(2020,9,12):Day(1):Date(2020,9,18)...

View Article

@NamedTuple fails

Hi there, I copied this line: @NamedTuple{a::Int, b::String} from the manual to the REPL and instead of the expected NamedTuple{(:a, :b),Tuple{Int64,String}} it returned an error: ERROR: syntax:...

View Article

JSON3 Package: ArgumentError: invalid JSON at byte .... : InvalidChar?

Suppose I have two Structs one for Tweet and another for Author of the tweet as follows: struct User id::Union{Int64, Nothing} id_str::Union{String, Nothing} created_at::Union{String, Nothing}...

View Article


SQLite.jl execute with "pragma" not working

Hello, why this not working? I do using SQLite db = SQLite.DB("SQLite_test.db") SQLite.execute(db, "PRAGMA count_changes=true;") but then count_changes=false in my database 1 post - 1 participant Read...

View Article


Passing variables to raw strings?

Hello! What I really like about Julia is that it is possible to write something as this: a = 2 t = "The number of apples is $a" println(t) The number of apples is 2 Sometimes though I need to work...

View Article

@showln in Base?

Hi, I found the @tim.holy’s @showln macro pretty useful and I wonder if it should be included into Base ? 5 posts - 4 participants Read full topic

View Article

Readtable function

I am trying to use “readtable” function in Julia 1.5.0. It shows that “readtable” is not found. What to do? Kindly help me out. 5 posts - 3 participants Read full topic

View Article

Any significant difference between string, *, and interpolation for...

I’m writing some training material, and I was wondering if there is any difference between the three methods for concatenation that I should be aware of? The most easiest way to do it is: greet =...

View Article


How to set up convolution layers in Knet.jl vs Flux.jl?

I have trouble understaind the Knet.jl docs For example conv4(w, x; kwargs...) Execute convolutions or cross-correlations using filters specified with w over tensor x. If w has dimensions...

View Article

How to smartly rewrite DataFrames type columns

Hi, Julian wizard people. I want to rewrite the data in the DataFrames column. It works fine for now, but I don’t like this writing method because it’s not smart. The same description is repeated. Is...

View Article


Create and use local module

Hi, I want to make an application. So I do cd ; julia and then switch to Pkg mode and use generate to generate my application. I then have a src/app.jl. Now I want to add a few files that do some...

View Article

Broadcasting function over array of structs?

Hi all, I’m trying to optimize my code by implementing structs instead of just variables. This means changing my functions to receive structs instead of those variables, and I’m trying to broadcast...

View Article


Using IOBuffer with append

I’m reading the documentation on IOBuffer, but I can’t seem to get it to function with append. I know I might be making a foolish mistake but I can’t seem to find it. io = IOBuffer(); write(io,...

View Article

String Indexing - Alright, what am I missing?

Quite new to Julia and am coming from a VBA background mostly Given that I am curious as to why in this code ‘h’ starts on the second letter of the string while ‘v’ starts with the first s1 =...

View Article

Julia-vim and Indentation

I’m using vim and julia-vim. While editing julia files, I think that it supports weird indentation as follows: (Before pressing enter) a = (b + c) # cursor at before b (What I expected) a = ( b + c)...

View Article
Browsing all 2795 articles
Browse latest View live