1 + sin(3) s = 0.0 for n = 1:2:10000 s += 1/n - 1/(n+1) end s # an expression on the last line (if it doesn't end with ";") is printed as "Out" Out[2] - log(2) R = rand(500,500) R' * R println("Hello world!\n") println(STDERR, "Börk börk börk, some unicode output on stderr...\n") ccall(:printf, Cint, (Ptr{Uint8},), "Hello from C!!\n"); f(x) = x + 1 println(f(3)) f([1,1,2,3,5,8]) f("Hello?") using PyCall @pyimport scipy.optimize as so so.newton(x -> cos(x) - x, 1) using PyPlot x = linspace(0,2*pi,1000) y = sin(3*x + 4*cos(2*x)) plot(x, y, color="red", linewidth=2.0, linestyle="--") ylabel("the y axis") xlabel("the x axis") title("a sinusoidally-modulated sinusoid") display("text/html", """Hello world in HTML!""") type HTML s::String end import Base.writemime writemime(io::IO, ::@MIME("text/html"), x::HTML) = print(io, x.s) x = HTML("") display(x) println(x)