In [1]:
println("Greetings! স্বাগতম!")


Greetings! স্বাগতম!

In [2]:
julia -v


julia not defined
while loading In[2], in expression starting on line 1

In [3]:
print(julia -v)


julia not defined
while loading In[3], in expression starting on line 1

In [4]:
pi


Out[4]:
π = 3.1415926535897...

In [5]:
typeof(1)


Out[5]:
Int64

In [6]:
WORD_SIZE


Out[6]:
64

In [7]:
typeof(ans)


Out[7]:
Int64

In [8]:
1/Inf


Out[8]:
0.0

In [9]:
1/0


Out[9]:
Inf

In [10]:
x = 3
(x-1)x


Out[10]:
6

In [11]:
x = 1
x+= 3


Out[11]:
4

In [12]:
z = hypot(1, 3)


Out[12]:
3.1622776601683795

In [13]:
! + 2 im


syntax: extra token "im" after end of expression
while loading In[13], in expression starting on line 1

In [14]:
1 + 2im


Out[14]:
1 + 2im

In [15]:
sqrt(4)


Out[15]:
2.0

In [16]:
sqrt(-1)


DomainError
while loading In[16], in expression starting on line 1

 in sqrt at math.jl:133

In [17]:
2//3


Out[17]:
2//3

In [18]:
Int("x")


type cannot be constructed
while loading In[18], in expression starting on line 1

In [19]:
Int('x')


type cannot be constructed
while loading In[19], in expression starting on line 1

In [20]:
Char(120)


type cannot be constructed
while loading In[20], in expression starting on line 1

In [21]:
'A' < 'a'


Out[21]:
true

In [22]:
str = "Hello, World"


Out[22]:
"Hello, World"

In [23]:
str[1]


Out[23]:
'H'

In [24]:
str[10]


Out[24]:
'r'

In [25]:
str[end]


Out[25]:
'd'

In [26]:
endof(str)


Out[26]:
12

In [1]:
mystring = "Hello World"


Out[1]:
"Hello World"

In [2]:
mystring[6:6]


Out[2]:
" "

In [3]:
mystring[6:7]


Out[3]:
" W"

In [4]:
this67 = mystring[6:7]


Out[4]:
" W"

In [5]:
typeof(this67)


Out[5]:
ASCIIString (constructor with 2 methods)

In [6]:
length(mystring)


Out[6]:
11

In [7]:
for i = 1:endof(mystring)
    try
        println(mystring[i])
    catch
        #ignore index error
    end
end


H
e
l
l
o
 
W
o
r
l
d

In [9]:
greet = "Hello"
whom = "World"
bothtogether = string(greet, ", ", whom)


Out[9]:
"Hello, World"

In [10]:
$greet $whom


unsupported or misplaced expression $
while loading In[10], in expression starting on line 1

In [11]:
"$greet, $whom"


Out[11]:
"Hello, World"

In [12]:
v = [1,2,3]


Out[12]:
3-element Array{Int64,1}:
 1
 2
 3

In [13]:
world = "world"
"Hello, $world"


Out[13]:
"Hello, world"

In [14]:
contains("Hello World", "world")


Out[14]:
false

In [15]:
contains("Hello World", "World")


Out[15]:
true

In [16]:
contains("Hello World", 'o')


`contains` has no method matching contains(::ASCIIString, ::Char)
while loading In[16], in expression starting on line 1

In [17]:
in("Hello World", 'o')


Out[17]:
false

In [18]:
# create repeats
myreps = repeat("x", 10)


Out[18]:
"xxxxxxxxxx"

In [19]:
# you can join words and letters
thisJoined = join(["a", "b"],"," )


Out[19]:
"a,b"

In [23]:
myreg = r"^\x*(?:#|$)"


Out[23]:
r"^\x*(?:#|$)"

In [21]:
typeof(ans)


Out[21]:
Regex (constructor with 3 methods)

In [24]:
ismatch(myreg, "not a comment")


Out[24]:
false

In [25]:
match(myreg, "not a comment")
# will not result in anything

In [26]:
match(myreg, "# a comment")
# will result in hash


Out[26]:
RegexMatch("#")

In [27]:
function myf(x,y)
    z = x * y
end
myf(2,3)


Out[27]:
6

In [28]:
myf


Out[28]:
myf (generic function with 1 method)

In [31]:
function g(x,y)
    #return x * y
    return x + y
end
g(2,3)


Out[31]:
5

In [32]:
+(1,2,3)


Out[32]:
6

In [46]:
function hypot(x,y)
    x = abs(x)
    y = abs(y)
    if x > y
        r = y/x
        return x * sqrt(1+r*r)
    end
    if y == 0
        return zero(x)
    end
    r = x/y
    return y*sqrt(1+r*r)
end
hypot(5,2)


Out[46]:
5.385164807134505

In [48]:
hypot(6,5)


Out[48]:
7.810249675906656

In [49]:
hypot(6,0)


Out[49]:
6.0

In [50]:
*(1,2,4)


Out[50]:
8

In [51]:
function foo(a,b)
    a+b, a*b
end
foo(2,3)


Out[51]:
(5,6)

In [52]:
x,y = foo(2,3); x


Out[52]:
5

In [53]:
y


Out[53]:
6

In [54]:
## compound expressions
# single expression evaluates several subexpressions
# returns the value of last expression

x = begin
    a = 1
    b = 2
    a+b
end


Out[54]:
3

In [55]:
x


Out[55]:
3

In [56]:
# Another way to write the same thing
p = (d = 1; e = 2; d + e)
p


Out[56]:
3

In [58]:
# Yet another way
q = begin g1 = 1; h = 2; g1 + h end
q


Out[58]:
3

In [59]:
## Conditional evaluation

a = 10
b = 20

function test(a,b)
if a < b
    println("a is less than b")
elseif a == b
    println("a is equal to b")
else 
    println("a is not less than b")
end
end


Out[59]:
test (generic function with 1 method)

In [60]:
test(10,20)


a is less than b

In [61]:
test(20,10)


a is not less than b

In [62]:
test (10, 10)


a is equal to b

In [65]:
## if blocks are leaky and you can use new variables within if

function test2(x,y)
    if x < y
        relation = "less"
    elseif x == y
        relation = "same"
    else 
        relation = "more"
    end
    println("x is ", relation, "  y")
end

test2(10, 20)


x is less  y

In [66]:
# note the variable "relation" is defined within if block
# it can still be used outside of the if block

In [67]:
# Example of chaining
x = 1; y = 2
println(x < y ? "less than" : "more than")


less than

In [68]:
x = 7; y = 2
println(x < y ? "less than" : "more than")


more than

In [69]:
i = 1; 
while i <= 5 
    println(i) 
    i += 1
end


1
2
3
4
5

In [71]:
## use of for
for i = 1:5
    println(i)
end


1
2
3
4
5

In [72]:
function producer()
    produce("start")
    for n = 1:4 # that is n has a value from 1 to 4
        produce(2n) # multiple n with 2
    end
    produce("stop")
end;

## now, we are going to consume the values produced
p = Task(producer)
consume(p)


Out[72]:
"start"

In [73]:
consume(p)


Out[73]:
2

In [74]:
# what happens when we do a for loop on this?
for x in Task(producer)
    println(x)
end


start
2
4
6
8
stop

Scope of variables

  • Region of code where a variable is visible
  • Avoids name conflicts
  • scope blocks (blocks of code used like that)

In [75]:
function foo(n)
    x = 0
    for i = 1:n
        x = x + 1
    end
    x
end


Out[75]:
foo (generic function with 2 methods)

In [76]:
foo(10)


Out[76]:
10

In [77]:
function foo(n)
    x = 0
    for i = 1:n
        local x
        x = 1
    end
    x
end
foo(10)


Out[77]:
0

Why 0?

  • Because x exists only inside the loop

In [78]:
# x need not come before
function foo(n)
    f = y -> n + x + y
    x = 1
    f(2)
end
foo(10)


Out[78]:
13

In [79]:
const e


syntax: expected assignment after "const"
while loading In[79], in expression starting on line 1

In [80]:
const e = 2.71
const pi = 3.141


cannot declare e constant; it already has a value
while loading In[80], in expression starting on line 1

In [81]:
methods(+)


Out[81]:
119 methods for generic function +:

In [82]:
methods(for)


syntax: unexpected )
while loading In[82], in expression starting on line 1

In [83]:
methods("for")


`methods` has no method matching methods(::ASCIIString)
while loading In[83], in expression starting on line 1

In [84]:
mean(Squares(100))


Squares not defined
while loading In[84], in expression starting on line 1

In [85]:
25 in Squares(10)


Squares not defined
while loading In[85], in expression starting on line 1

In [90]:
immutable Squares
    count::Int
end
Base.start(::Squares) = 1
Base.next(S::Squares, state) = (state*state, state+1)
Base.done(S::Squares, s) = s > S.count
Base.eltype(::Type{Squares}) = Int
Base.length(S::Squares) = S.count

for i in Squares(7)
    println(1)
end


1
1
1
1
1
1
1

In [91]:
25 in Squares(10)


Out[91]:
true

In [92]:
mean(Squares(100))


Out[92]:
3383.5

In [93]:
for i in Squares(7)
    println(i)
end


1
4
9
16
25
36
49

In [94]:
prog = "1 + 1" # julia programme starts as a string


Out[94]:
"1 + 1"

In [95]:
## parse each string such as 1+1 into an object.
# this object is called expression
expression1 = parse(prog)
expression1


Out[95]:
:(1 + 1)

In [96]:
## This has three parts:
# A symbol
expression1.head


Out[96]:
:call

In [97]:
# next, expression arguments,
expression1.args


Out[97]:
3-element Array{Any,1}:
  :+
 1  
 1  

In [98]:
# third, the result type
expression1.typ


Out[98]:
Any

In [99]:
# Another way to write the programme above,
Exp2 = Expr(:call, :+, 1, 1)


Out[99]:
:(1 + 1)

In [101]:
## Expression1 and Exp2 are same, see
expression1 == Exp2 # will return true


Out[101]:
true

In [102]:
## Here is the data structure
datastruct = dump(Exp2)


Expr 
  head: Symbol call
  args: Array(Any,(3,))
    1: Symbol +
    2: Int64 1
    3: Int64 1
  typ: Any

In [103]:
# ":" is a symbol
:foo


Out[103]:
:foo

In [104]:
typeof(ans)


Out[104]:
Symbol

In [105]:
# Use : to create expression objectis
ex1 = :(a+b*c+1)


Out[105]:
:(a + b * c + 1)

In [106]:
typeof(ex1)


Out[106]:
Expr

In [107]:
## ehre is the structure
parse(ex1)


`parse` has no method matching parse(::Expr)
while loading In[107], in expression starting on line 2

In [108]:
ex1.head


Out[108]:
:call

In [109]:
dump(ex1)


Expr 
  head: Symbol call
  args: Array(Any,(4,))
    1: Symbol +
    2: Symbol a
    3: Expr 
      head: Symbol call
      args: Array(Any,(3,))
        1: Symbol *
        2: Symbol b
        3: Symbol c
      typ: Any
    4: Int64 1
  typ: Any

In [110]:
eval(ex1)


c not defined
while loading In[110], in expression starting on line 1

In [111]:
:(1+2)


Out[111]:
:(1 + 2)

In [112]:
eval(ans)


Out[112]:
3

In [113]:
ex = :(a+b)


Out[113]:
:(a + b)

In [114]:
eval(ex)


Out[114]:
30

In [115]:
a = 5; b = 10


Out[115]:
10

In [116]:
eval(ex)


Out[116]:
15

In [117]:
macro sayHello()
    return :(println("Hello World"))
end

In [118]:
@sayHello()


Hello World

In [119]:
macro sayHello(name)
    return :(println("Hello ", $name))
end
@sayHello(John)


John not defined
while loading In[119], in expression starting on line 4

In [120]:
@sayHello("John")


Hello John

In [121]:
const x = rand(8)


cannot declare x constant; it already has a value
while loading In[121], in expression starting on line 1

In [122]:
x = rand(8)


Out[122]:
8-element Array{Float64,1}:
 0.151211 
 0.0135414
 0.227328 
 0.183847 
 0.351597 
 0.477987 
 0.44913  
 0.44848  

In [131]:
Float64[ 0.25 * x[i-1]  for i = 2:length(x)-1]


Out[131]:
6-element Array{Float64,1}:
 0.0378028 
 0.00338535
 0.0568321 
 0.0459619 
 0.0878993 
 0.119497  

In [132]:
Pkg.status()


25 required packages:
 - DataArrays                    0.2.20
 - DataFrames                    0.6.10
 - Distances                     0.2.1
 - Distributions                 0.8.7
 - GLM                           0.4.8
 - Gadfly                        0.3.18
 - GitHub                        1.0.3
 - Graphs                        0.6.0
 - HypothesisTests               0.2.10
 - IJulia                        1.1.8
 - Jewel                         1.0.6
 - LaTeX                         0.0.2
 - LaTeXStrings                  0.1.6
 - MLBase                        0.5.2
 - Markdown                      0.3.0
 - MultivariateStats             0.2.1
 - NHST                          0.0.2
 - PyPlot                        2.1.1
 - RCall                         0.3.1
 - RDatasets                     0.1.2
 - Rif                           0.0.12
 - Stats                         0.1.0
 - StatsBase                     0.7.4
 - TimeSeries                    0.5.11
 - Weave                         0.0.4
58 additional packages:
 - ArgParse                      0.3.0
 - ArrayViews                    0.6.4
 - BinDeps                       0.3.19
 - Calculus                      0.1.14
 - Codecs                        0.1.5
 - ColorTypes                    0.1.7
 - ColorVectorSpace              0.0.5
 - Colors                        0.5.4
 - Compat                        0.7.7
 - Compose                       0.3.18
 - Conda                         0.1.8
 - Contour                       0.0.8
 - DataStructures                0.3.13
 - Dates                         0.3.2
 - Docile                        0.5.19
 - DualNumbers                   0.1.5
 - FactCheck                     0.4.1
 - FixedPointNumbers             0.0.12
 - ForwardDiff                   0.0.3
 - GZip                          0.2.18
 - GnuTLS                        0.0.5
 - Graphics                      0.1.0
 - Grid                          0.3.11
 - Hexagons                      0.0.4
 - Homebrew                      0.2.0
 - HttpCommon                    0.1.2
 - HttpParser                    0.0.13
 - Images                        0.4.50
 - ImmutableArrays               0.0.11
 - Iterators                     0.1.9
 - JSON                          0.5.0
 - JuliaParser                   0.6.2
 - KernelDensity                 0.1.2
 - LNR                           0.0.1
 - Lazy                          0.10.1
 - Loess                         0.0.5
 - MacroTools                    0.2.0
 - NaNMath                       0.1.1
 - Nettle                        0.2.0
 - Optim                         0.4.4
 - PDMats                        0.3.6
 - Polynomials                   0.0.4
 - PyCall                        1.2.0
 - Reexport                      0.0.3
 - Requests                      0.2.4
 - Requires                      0.2.0
 - Roots                         0.1.20
 - SHA                           0.1.2
 - SIUnits                       0.0.6
 - Showoff                       0.0.6
 - SortingAlgorithms             0.0.6
 - StatsFuns                     0.2.0
 - TexExtensions                 0.0.3
 - TextWrap                      0.1.5
 - URIParser                     0.0.7
 - WoodburyMatrices              0.1.2
 - ZMQ                           0.3.1
 - Zlib                          0.1.12

In [133]:
julia -v


julia not defined
while loading In[133], in expression starting on line 1

In [134]:
versioninfo()


Julia Version 0.3.11
Commit 483dbf5* (2015-07-27 06:18 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

Beyond this, I am going to update Julia to version. 0.4 and update Ijulia as well. So download Julia, install, then do Pkg.add(IJulia)


In [1]:
Pkg.add("RCall")


INFO: Nothing to be done

In [2]:
using RCall


LoadError: LoadError: RCall not properly installed. Please run Pkg.build("RCall")
while loading /Users/arindambose/.julia/v0.4/RCall/src/RCall.jl, in expression starting on line 24
while loading In[2], in expression starting on line 1

 in error at /Applications/Julia-0.4.1.app/Contents/Resources/julia/lib/julia/sys.dylib
 in include at /Applications/Julia-0.4.1.app/Contents/Resources/julia/lib/julia/sys.dylib
 in include_from_node1 at /Applications/Julia-0.4.1.app/Contents/Resources/julia/lib/julia/sys.dylib
 in require at /Applications/Julia-0.4.1.app/Contents/Resources/julia/lib/julia/sys.dylib

In [1]:
Pkg.add("Interact")


INFO: Cloning cache of Interact from git://github.com/JuliaLang/Interact.jl.git
INFO: Cloning cache of Reactive from git://github.com/JuliaLang/Reactive.jl.git
INFO: Installing DataStructures v0.3.13
INFO: Installing FactCheck v0.4.1
INFO: Installing Interact v0.2.1
INFO: Installing Reactive v0.2.4
INFO: Package database updated

In [2]:
Pkg.add("Gadfly")


INFO: Cloning cache of Measures from git://github.com/dcjones/Measures.jl.git
INFO: Installing Codecs v0.1.5
INFO: Installing ColorTypes v0.2.0
INFO: Installing Colors v0.6.0
INFO: Installing Compose v0.4.0
INFO: Installing Contour v0.0.8
INFO: Installing FixedPointNumbers v0.1.1
INFO: Installing Gadfly v0.4.0
INFO: Installing Grid v0.4.0
INFO: Installing Hexagons v0.0.4
INFO: Installing ImmutableArrays v0.0.11
INFO: Installing Iterators v0.1.9
INFO: Installing KernelDensity v0.1.2
INFO: Installing Loess v0.0.5
INFO: Installing Measures v0.0.1
INFO: Installing Showoff v0.0.6
INFO: Installing WoodburyMatrices v0.1.2
INFO: Package database updated

In [3]:
Pkg.add("Pyplot")


LoadError: unknown package Pyplot
 in error at /Applications/Julia-0.4.1.app/Contents/Resources/julia/lib/julia/sys.dylib
 [inlined code] from pkg/entry.jl:49
 in anonymous at task.jl:447
while loading In[3], in expression starting on line 1

 in sync_end at /Applications/Julia-0.4.1.app/Contents/Resources/julia/lib/julia/sys.dylib
 [inlined code] from task.jl:422
 in add at pkg/entry.jl:46
 in add at pkg/entry.jl:73
 in anonymous at pkg/dir.jl:31
 in cd at file.jl:22
 in cd at pkg/dir.jl:31
 in add at pkg.jl:23

In [4]:
Pkg.add("Pycall")


LoadError: unknown package Pycall
 in error at /Applications/Julia-0.4.1.app/Contents/Resources/julia/lib/julia/sys.dylib
 [inlined code] from pkg/entry.jl:49
 in anonymous at task.jl:447
while loading In[4], in expression starting on line 1

 in sync_end at /Applications/Julia-0.4.1.app/Contents/Resources/julia/lib/julia/sys.dylib
 [inlined code] from task.jl:422
 in add at pkg/entry.jl:46
 in add at pkg/entry.jl:73
 in anonymous at pkg/dir.jl:31
 in cd at file.jl:22
 in cd at pkg/dir.jl:31
 in add at pkg.jl:23

In [5]:
Pkg.add("PyPlot"); Pkg.add("PyCall"); Pkg.add("Winston")


INFO: Installing LaTeXStrings v0.1.6
INFO: Installing PyCall v1.2.0
INFO: Installing PyPlot v2.1.1
INFO: Building PyCall
INFO: PyCall is using python (Python 2.7.10) at /Users/arindambose/anaconda/bin/python, libpython = /Users/arindambose/anaconda/lib/libpython2.7.dylib
INFO: Package database updated
INFO: No packages to install, update or remove
INFO: Package database updated
INFO: Updating cache of Cairo...
INFO: Cloning cache of IniFile from git://github.com/JuliaLang/IniFile.jl.git
INFO: Cloning cache of Tk from git://github.com/JuliaLang/Tk.jl.git
INFO: Cloning cache of Winston from git://github.com/nolta/Winston.jl.git
INFO: Installing Cairo v0.2.31
INFO: Installing Graphics v0.1.3
INFO: Installing IniFile v0.2.4
INFO: Installing Tk v0.3.6
INFO: Installing Winston v0.11.13
INFO: Building Homebrew
From https://github.com/Homebrew/homebrew
   71af634..0f37e29  master     -> origin/master
HEAD is now at 0f37e29 tomcat 9.0.0.M1 (devel)
HEAD is now at 4a13095 Merge pull request #85 from staticfloat/staging
INFO: Building Cairo
==> Installing gettext from staticfloat/homebrew-juliadeps
==> Downloading https://juliabottles.s3.amazonaws.com/gettext-0.19.6.el_capitan.bottle.tar.gz
Already downloaded: /Users/arindambose/Library/Caches/Homebrew.jl/gettext-0.19.6.el_capitan.bottle.tar.gz
==> Pouring gettext-0.19.6.el_capitan.bottle.tar.gz
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/gettext/0.19.6: 1921 files, 22M
Warning: Already linked: /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/gettext/0.19.6
==> Installing glib from staticfloat/homebrew-juliadeps
==> Installing dependencies for staticfloat/juliadeps/glib: libffi
==> Installing staticfloat/juliadeps/glib dependency: libffi
==> Downloading https://homebrew.bintray.com/bottles/libffi-3.0.13.el_capitan.bottle.tar.gz
==> Pouring libffi-3.0.13.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /Users/arindambose/.julia/v0.4/Homebrew/deps/usr.

Some formulae require a newer version of libffi.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/Users/arindambose/.julia/v0.4/Homebrew/deps/usr/opt/libffi/lib

==> Summary
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/libffi/3.0.13: 14 files, 408K
==> Installing staticfloat/juliadeps/glib
==> Downloading https://juliabottles.s3.amazonaws.com/glib-2.46.1.el_capitan.bottle.tar.gz
Already downloaded: /Users/arindambose/Library/Caches/Homebrew.jl/glib-2.46.1.el_capitan.bottle.tar.gz
==> Pouring glib-2.46.1.el_capitan.bottle.tar.gz
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/glib/2.46.1: 416 files, 19M
Warning: Already linked: /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/glib/2.46.1
==> Installing cairo from staticfloat/homebrew-juliadeps
==> Installing dependencies for staticfloat/juliadeps/cairo: libpng, freetype, staticfloat/juliadeps/fontconfig, staticfloat/juliadeps/pixman
==> Installing staticfloat/juliadeps/cairo dependency: libpng
==> Downloading https://homebrew.bintray.com/bottles/libpng-1.6.19.el_capitan.bottle.tar.gz
Already downloaded: /Users/arindambose/Library/Caches/Homebrew.jl/libpng-1.6.19.el_capitan.bottle.tar.gz
==> Pouring libpng-1.6.19.el_capitan.bottle.tar.gz
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/libpng/1.6.19: 17 files, 1.2M
==> Installing staticfloat/juliadeps/cairo dependency: freetype
==> Downloading https://homebrew.bintray.com/bottles/freetype-2.6_1.el_capitan.bottle.tar.gz
Already downloaded: /Users/arindambose/Library/Caches/Homebrew.jl/freetype-2.6_1.el_capitan.bottle.tar.gz
==> Pouring freetype-2.6_1.el_capitan.bottle.tar.gz
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/freetype/2.6_1: 60 files, 2.6M
==> Installing staticfloat/juliadeps/cairo dependency: staticfloat/juliadeps/fontconfig
==> Downloading https://juliabottles.s3.amazonaws.com/fontconfig-2.11.1.el_capitan.bottle.3.tar.gz
==> Pouring fontconfig-2.11.1.el_capitan.bottle.3.tar.gz
==> /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/fontconfig/2.11.1/bin/fc-cache -frv
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/fontconfig/2.11.1: 448 files, 3.6M
==> Installing staticfloat/juliadeps/cairo dependency: staticfloat/juliadeps/pixman
==> Downloading https://juliabottles.s3.amazonaws.com/pixman-0.32.8.el_capitan.bottle.1.tar.gz
Already downloaded: /Users/arindambose/Library/Caches/Homebrew.jl/pixman-0.32.8.el_capitan.bottle.1.tar.gz
==> Pouring pixman-0.32.8.el_capitan.bottle.1.tar.gz
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/pixman/0.32.8: 11 files, 1.2M
==> Installing staticfloat/juliadeps/cairo
==> Downloading https://juliabottles.s3.amazonaws.com/cairo-1.14.4.el_capitan.bottle.tar.gz
Already downloaded: /Users/arindambose/Library/Caches/Homebrew.jl/cairo-1.14.4.el_capitan.bottle.tar.gz
==> Pouring cairo-1.14.4.el_capitan.bottle.tar.gz
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/cairo/1.14.4: 112 files, 6.1M
Warning: Already linked: /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/cairo/1.14.4
==> Installing pango from staticfloat/homebrew-juliadeps
==> Installing dependencies for staticfloat/juliadeps/pango: staticfloat/juliadeps/icu4c, staticfloat/juliadeps/harfbuzz, staticfloat/juliadeps/pkg-config, staticfloat/juliadeps/gobject-introspection
==> Installing staticfloat/juliadeps/pango dependency: staticfloat/juliadeps/icu4c
==> Downloading https://juliabottles.s3.amazonaws.com/icu4c-56.1.el_capitan.bottle.tar.gz
Already downloaded: /Users/arindambose/Library/Caches/Homebrew.jl/icu4c-56.1.el_capitan.bottle.tar.gz
==> Pouring icu4c-56.1.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /Users/arindambose/.julia/v0.4/Homebrew/deps/usr.

OS X provides libicucore.dylib (but nothing else).

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/Users/arindambose/.julia/v0.4/Homebrew/deps/usr/opt/icu4c/lib
    CPPFLAGS: -I/Users/arindambose/.julia/v0.4/Homebrew/deps/usr/opt/icu4c/include

==> Summary
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/icu4c/56.1: 244 files, 64M
==> Installing staticfloat/juliadeps/pango dependency: staticfloat/juliadeps/harfbuzz
==> Downloading https://juliabottles.s3.amazonaws.com/harfbuzz-0.9.42.el_capitan.bottle.tar.gz
Already downloaded: /Users/arindambose/Library/Caches/Homebrew.jl/harfbuzz-0.9.42.el_capitan.bottle.tar.gz
==> Pouring harfbuzz-0.9.42.el_capitan.bottle.tar.gz
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/harfbuzz/0.9.42: 72 files, 3.1M
==> Installing staticfloat/juliadeps/pango dependency: staticfloat/juliadeps/pkg-config
==> Downloading https://juliabottles.s3.amazonaws.com/pkg-config-0.28_1.el_capitan.bottle.tar.gz
Already downloaded: /Users/arindambose/Library/Caches/Homebrew.jl/pkg-config-0.28_1.el_capitan.bottle.tar.gz
==> Pouring pkg-config-0.28_1.el_capitan.bottle.tar.gz
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/pkg-config/0.28_1: 10 files, 600K
==> Installing staticfloat/juliadeps/pango dependency: staticfloat/juliadeps/gobject-introspection
==> Downloading https://juliabottles.s3.amazonaws.com/gobject-introspection-1.46.0.el_capitan.bottle.tar.gz
Already downloaded: /Users/arindambose/Library/Caches/Homebrew.jl/gobject-introspection-1.46.0.el_capitan.bottle.tar.gz
==> Pouring gobject-introspection-1.46.0.el_capitan.bottle.tar.gz
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/gobject-introspection/1.46.0: 198 files, 10M
==> Installing staticfloat/juliadeps/pango
==> Downloading https://juliabottles.s3.amazonaws.com/pango-1.38.1_1.el_capitan.bottle.tar.gz
Already downloaded: /Users/arindambose/Library/Caches/Homebrew.jl/pango-1.38.1_1.el_capitan.bottle.tar.gz
==> Pouring pango-1.38.1_1.el_capitan.bottle.tar.gz
🍺  /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/pango/1.38.1_1: 117 files, 4.6M
Warning: Already linked: /Users/arindambose/.julia/v0.4/Homebrew/deps/usr/Cellar/pango/1.38.1_1
INFO: Building Tk
INFO: Package database updated

In [6]:
Pkg.clone("https://github.com/randy3k/RCalling.jl.git")
Pkg.build("RCalling")


INFO: Cloning RCalling from https://github.com/randy3k/RCalling.jl.git
INFO: Computing changes...
INFO: No packages to install, update or remove
INFO: Building RCalling
WARNING: Base.String is deprecated, use AbstractString instead.
  likely near /Users/arindambose/.julia/v0.4/RCalling/deps/build.jl:1
WARNING: Base.String is deprecated, use AbstractString instead.
  likely near /Users/arindambose/.julia/v0.4/RCalling/deps/build.jl:1
WARNING: Base.String is deprecated, use AbstractString instead.
  likely near /Users/arindambose/.julia/v0.4/RCalling/deps/build.jl:5
make: R: Command not found
make: R: Command not found
make: R: Command not found
make: R: Command not found
make: R: Command not found
ERROR: UndefVarError: dlpath not defined
 in process_options at /Applications/Julia-0.4.1.app/Contents/Resources/julia/lib/julia/sys.dylib
 in _start at /Applications/Julia-0.4.1.app/Contents/Resources/julia/lib/julia/sys.dylib
rm -f *.o *.so
make: R: Command not found
make: R: Command not found
make: R: Command not found
make: R: Command not found
make: R: Command not found
ERROR: UndefVarError: dlpath not defined
 in process_options at /Applications/Julia-0.4.1.app/Contents/Resources/julia/lib/julia/sys.dylib
 in _start at /Applications/Julia-0.4.1.app/Contents/Resources/julia/lib/julia/sys.dylib
gcc -g -O2 -std=gnu99 -Wall -I./uv/ -I/Applications/Julia-0.4.1.app/Contents/Resources/julia/include/julia  -fPIC -c environment.c -o environment.o
environment.c:2:10: fatal error: 'R.h' file not found
#include <R.h>
         ^
1 error generated.
make: *** [environment.o] Error 1
==============================[ ERROR: RCalling ]===============================

LoadError: failed process: Process(`make`, ProcessExited(2)) [2]
while loading /Users/arindambose/.julia/v0.4/RCalling/deps/build.jl, in expression starting on line 32

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: RCalling had build errors.

 - packages with build errors remain installed in /Users/arindambose/.julia/v0.4
 - build the package(s) and all dependencies with `Pkg.build("RCalling")`
 - build a single package by running its `deps/build.jl` script

================================================================================

In [7]:
typeof(5)


Out[7]:
Int64

In [8]:
plothist(randn(1000))


LoadError: UndefVarError: plothist not defined
while loading In[8], in expression starting on line 1

In [9]:
Using PyPlot
Using Gadfly


LoadError: syntax: extra token "PyPlot" after end of expression
while loading In[9], in expression starting on line 1

In [ ]:
using PyPlot
using Gadfly

In [11]:
Pkg.dir()


Out[11]:
"/Users/arindambose/.julia/v0.4"

In [ ]:
plot(rand(10))

In [ ]: