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

Kwargs in new(), or safer ways of constructing immutable structs

When creating an immutable struct with a reasonable number of fields and an inner constructor, I find that aligning the arguments to new() with the order of the struct fields to be quite tedious and...

View Article


Flux gradient not defined

Hi, I’m attempting to build a basic perceptron using Flux, and starting with the tutorial code in the documentation here [https://fluxml.ai/Flux.jl/stable/models/basics/]. Entering this code from the...

View Article


Juno Project pane colors

Where is the documentation for the various colors of directories and files in the Project pane? They have something to do with the VC local repo status but I searched “colors” the Juno documentation...

View Article

Initialize weights for Flux.Dense

Hello. I can’t figure out the syntax to initialize the weights for Flux.Dense. using Flux w0 = Float32[1, 2, 3, 4] nn = Dense(4, 1, relu; initW = w0) produces the following error. MethodError: objects...

View Article

Can I customize the accumulator type and result type for my types separately?

In some cases of reduction operations, it may be useful to use special intermediate representations for speed and accuracy. A typical example is computing the sum of fixed-point numbers within the...

View Article


Variance and std of vectors

In Julia Statistics module std() and var() work for arrays of numbers, including complex numbers - expectedly, they do not support arrays of vectors. However, it is often convenient to quantify the...

View Article

Expressing a week before the time right now

Suppose I express the time right now as: rightnow = Dates.format(Dates.now(Dates.UTC),"Y-mm-ddTH:MM:SS.SSSZ") Now I need to express, in the same format, the time at some previous point, say, one week...

View Article

Image may be NSFW.
Clik here to view.

Probably the dumbest question you'll get all day - Proper way to build a...

I feel so new! Even at my age! But… I’ve been watching Julia for a while and decided it a try on a real application. I come from Scala/Akka, C and C++, and a bunch of ancient languages. Julia has some...

View Article


Differential Equations Parameters not recognized when solving in newest packages

I’m having trouble with the updated DifferentialEquations Package (v6.15.0) and it’s dependency DiffEqBase (v6.50.9). I was recently working in a previous version Differential Equations (v6.12.0) and...

View Article


What do ! mean for functions

My question is probably relatively basic, but I haven’t found any information about it anywhere. On the performance tips page, some functions have ! and some don’t. What is the meaning of ! and are...

View Article

Image may be NSFW.
Clik here to view.

How to fix this error (first installation)?

I want to use Julia 0.6 with latest version of Atom/Juno. However, there is a below error during installation. Starting Julia… INFO: Precompiling module Atom. ERROR: LoadError: HttpParser not properly...

View Article

DrWatson and github

I am taking my first steps with Dr.Watson. Any words of wisdom to share? Here is a question: When using @tagsave, I am saving and committing at the same time. But its utility depends on me making sure...

View Article

Image may be NSFW.
Clik here to view.

Turing package(s) + parameter estimation for DiffEq models?

Are there any illustrative notebooks around on how to do proper model fitting of dynamic models with parameter statistics in Turing tools? Can it be done? To be more concrete… take the SIR...

View Article


How to export names from a lower level module without explicitly listing all...

I often organize code into modules inside a single package. Let’s say I have a pacakge named AB.jl, and inside I have modules A.jl, B.jl, all in the src folder. A nice way to organize them is...

View Article

Differences in these expressions?

When learning metaprogramming in Julia, I am a little bit confusing about these behavior like below julia> Meta.show_sexpr(:(:($(1+2)))) (:quote,(:$,(:call,:+,1,2))) julia>...

View Article


Image may be NSFW.
Clik here to view.

Using group in scatter plots correctly?

Hello! I am trying to make a scatterplot where there exist two groups, one called “0” and one called “1”. The group values is stored in a vector “z”. Over time the points in group “0”, come to group...

View Article

No Julia in Jupyter

I’m using Fedora 29 and I have installed Jupyter into root directory. And I have installed JuliaPro to local directory. Then I installed IJulia package and it was a success and if I enter notebook() ,...

View Article


PGFPlotsX - How to save figure?

Hello! I have some code as: p = scatter((data[1,id1],data[2,id1]), markersize = 3.5, markerstrokestyle = :dot, aspect_ratio=:equal, color = :orange, label = "Sick" );...

View Article

Image may be NSFW.
Clik here to view.

Pixel plots in GR.jl

Hello everyone, I am trying to plot a pixel series in GR which might look something like this: In pyplot it is achieved by adding a ',' in the plot command (something like: ax.plot(x, y, ',')). In GR,...

View Article

Using SymPy.jl inside a module

I got the ERROR: ArgumentError: ref of NULL PyObject when I call a function defined inside a module that is using SymPy. seems like the situation is rather similar to this. Unfortunately I have...

View Article
Browsing all 2795 articles
Browse latest View live