From 704b61300fca9833a25bd07d1db9fecc56f5cebc Mon Sep 17 00:00:00 2001 From: Peter Arndt Date: Thu, 14 Jul 2016 14:38:59 +0200 Subject: [PATCH] just before presentation --- Introduction.html | 643 +++++++------- Introduction.ipynb | 1994 +++++--------------------------------------- 2 files changed, 553 insertions(+), 2084 deletions(-) diff --git a/Introduction.html b/Introduction.html index e35390a..44cf36d 100644 --- a/Introduction.html +++ b/Introduction.html @@ -11766,7 +11766,7 @@

Varialbles and Types
-
In [6]:
+
In [1]:
56*8
@@ -11780,7 +11780,7 @@ 

Varialbles and Types -
Out[6]:
+
Out[1]:
@@ -11795,7 +11795,7 @@

Varialbles and Types
-
In [7]:
+
In [2]:
x=7
@@ -11809,7 +11809,7 @@ 

Varialbles and Types -
Out[7]:
+
Out[2]:
@@ -11824,7 +11824,7 @@

Varialbles and Types
-
In [8]:
+
In [3]:
x+1
@@ -11838,7 +11838,7 @@ 

Varialbles and Types -
Out[8]:
+
Out[3]:
@@ -11853,7 +11853,7 @@

Varialbles and Types
-
In [9]:
+
In [4]:
x^2
@@ -11867,7 +11867,7 @@ 

Varialbles and Types -
Out[9]:
+
Out[4]:
@@ -11882,7 +11882,7 @@

Varialbles and Types
-
In [10]:
+
In [5]:
typeof(x)
@@ -11896,7 +11896,7 @@ 

Varialbles and Types -
Out[10]:
+
Out[5]:
@@ -11911,7 +11911,7 @@

Varialbles and Types
-
In [11]:
+
In [6]:
x/3
@@ -11925,7 +11925,7 @@ 

Varialbles and Types -
Out[11]:
+
Out[6]:
@@ -11940,7 +11940,7 @@

Varialbles and Types
-
In [12]:
+
In [7]:
cos(pi)
@@ -11954,7 +11954,7 @@ 

Varialbles and Types -
Out[12]:
+
Out[7]:
@@ -11969,7 +11969,7 @@

Varialbles and Types
-
In [13]:
+
In [8]:
typeof(ans)
@@ -11983,7 +11983,7 @@ 

Varialbles and Types -
Out[13]:
+
Out[8]:
@@ -11998,7 +11998,7 @@

Varialbles and Types
-
In [14]:
+
In [9]:
im^2
@@ -12012,7 +12012,7 @@ 

Varialbles and Types -
Out[14]:
+
Out[9]:
@@ -12027,7 +12027,7 @@

Varialbles and Types
-
In [15]:
+
In [10]:
typeof(ans)
@@ -12041,7 +12041,7 @@ 

Varialbles and Types -
Out[15]:
+
Out[10]:
@@ -12056,7 +12056,7 @@

Varialbles and Types
-
In [16]:
+
In [11]:
"Hello" * " world"
@@ -12070,7 +12070,7 @@ 

Varialbles and Types -
Out[16]:
+
Out[11]:
@@ -12085,7 +12085,7 @@

Varialbles and Types
-
In [17]:
+
In [12]:
typeof(ans)
@@ -12099,7 +12099,7 @@ 

Varialbles and Types -
Out[17]:
+
Out[12]:
@@ -12114,7 +12114,7 @@

Varialbles and Types
-
In [18]:
+
In [13]:
70//15
@@ -12128,7 +12128,7 @@ 

Varialbles and Types -
Out[18]:
+
Out[13]:
+
+
+
In [15]:
12  42
@@ -12157,7 +12186,7 @@ 

Varialbles and Types -
Out[1]:
+
Out[15]:
@@ -12172,7 +12201,7 @@

Varialbles and Types
-
In [3]:
+
In [16]:
2  [6,3,5]
@@ -12186,7 +12215,7 @@ 

Varialbles and Types -
Out[3]:
+
Out[16]:
@@ -12201,7 +12230,7 @@

Varialbles and Types
-
In [19]:
+
In [17]:
typeof(ans)
@@ -12215,11 +12244,11 @@ 

Varialbles and Types -
Out[19]:
+
Out[17]:
-
Rational{Int64}
+
Bool
@@ -12230,7 +12259,7 @@

Varialbles and Types
-
In [20]:
+
In [18]:
"Like in perl you may write x=$x"
@@ -12244,7 +12273,7 @@ 

Varialbles and Types -
Out[20]:
+
Out[18]:
@@ -12259,7 +12288,7 @@

Varialbles and Types
-
In [21]:
+
In [19]:
"... but also $(exp(x))"
@@ -12273,7 +12302,7 @@ 

Varialbles and Types -
Out[21]:
+
Out[19]:
@@ -12318,7 +12347,7 @@

Functions + Multiple Dispatch
-
In [6]:
+
In [20]:
f(x) = x ^ 3
@@ -12332,11 +12361,11 @@ 

Functions + Multiple Dispatch -
Out[6]:
+
Out[20]:
-
f (generic function with 2 methods)
+
f (generic function with 1 method)
@@ -12347,7 +12376,7 @@

Functions + Multiple Dispatch
-
In [7]:
+
In [21]:
f(3)
@@ -12361,7 +12390,7 @@ 

Functions + Multiple Dispatch -
Out[7]:
+
Out[21]:
@@ -12376,7 +12405,7 @@

Functions + Multiple Dispatch
-
In [8]:
+
In [22]:
-
-
-
In [15]:
-
-
-
super(Float)
-
- -
-
-
- -
-
- -
-
-
-LoadError: UndefVarError: Float not defined
-while loading In[15], in expression starting on line 1
-
-
@@ -12441,7 +12434,7 @@

Functions + Multiple Dispatch
-
In [28]:
+
In [23]:
function f(x::AbstractString) 
@@ -12463,7 +12456,7 @@ 

Functions + Multiple Dispatch -
Out[28]:
+
Out[23]:
@@ -12478,7 +12471,7 @@

Functions + Multiple Dispatch
-
In [29]:
+
In [24]:
methods(f)
@@ -12492,10 +12485,10 @@ 

Functions + Multiple Dispatch -
Out[29]:
+
Out[24]:
-3 methods for generic function f:
  • f(x::AbstractString) at In[28]:2
  • f(x::AbstractFloat) at In[28]:7
  • f(x) at In[6]:1
+3 methods for generic function f:
  • f(x::AbstractString) at In[23]:2
  • f(x::AbstractFloat) at In[23]:7
  • f(x) at In[20]:1
@@ -12506,7 +12499,7 @@

Functions + Multiple Dispatch
-
In [32]:
+
In [25]:
@show f(2.5);
@@ -12535,10 +12528,10 @@ 

Functions + Multiple Dispatch
-
In [34]:
+
In [26]:
-
@show f(Float16(2.5));
+
@show f( Float16(2.5) );
 
@@ -12564,7 +12557,7 @@

Functions + Multiple Dispatch
-
In [35]:
+
In [27]:
@show f("abc")
@@ -12597,7 +12590,7 @@ 

Functions + Multiple Dispatch
-
In [38]:
+
In [28]:
methods(print)
@@ -12611,7 +12604,7 @@ 

Functions + Multiple Dispatch -
Out[38]:
+
Out[28]:
18 methods for generic function print: @@ -12625,7 +12618,7 @@

Functions + Multiple Dispatch
-
In [36]:
+
In [29]:
methods(println)
@@ -12639,7 +12632,7 @@ 

Functions + Multiple Dispatch -
Out[36]:
+
Out[29]:
2 methods for generic function println: @@ -12662,7 +12655,7 @@

Composite Types
-
In [39]:
+
In [30]:
type Point
@@ -12679,7 +12672,7 @@ 

Composite Types
-
In [40]:
+
In [31]:
p = Point(2,3,"Siegfried")
@@ -12693,7 +12686,7 @@ 

Composite Types -
Out[40]:
+
Out[31]:
@@ -12708,11 +12701,11 @@

Composite Types
-
In [41]:
+
In [35]:
- -
-
-
In [42]:
-
-
-
methods(g)
-
- -
-
-
- -
-
- - -
Out[42]:
- -
-5 methods for generic function g:
  • g(y::Int64) at In[29]:2
  • g(y::AbstractString) at In[29]:7
  • g(y::AbstractString, z) at In[29]:7
  • g(p::Point) at In[41]:2
  • g(y) at In[26]:2
+
f (generic function with 4 methods)
@@ -12769,10 +12734,10 @@

Composite Types
-
In [43]:
+
In [36]:
-
methodswith(Point)
+
methods(f)
 
@@ -12783,10 +12748,10 @@

Composite Types -
Out[43]:
+
Out[36]:
-1-element Array{Method,1}:
  • g(p::Point) at In[41]:2
+4 methods for generic function f:
  • f(x::AbstractString) at In[23]:2
  • f(x::AbstractFloat) at In[23]:7
  • f(p::Point) at In[35]:2
  • f(x) at In[20]:1
@@ -12797,10 +12762,10 @@

Composite Types
-
In [44]:
+
In [37]:
-
Out[44]:
+
Out[37]:
@@ -12833,7 +12799,7 @@

Composite Types
-
In [45]:
+
In [38]:
p
@@ -12847,11 +12813,11 @@ 

Composite Types -
Out[45]:
+
Out[38]:
-
Point(5,3,"Siegfried")
+
Point(8,3,"Siegfried")
@@ -12871,7 +12837,7 @@

parametric types and methods
-
In [46]:
+
In [39]:
type Line{T}
@@ -12890,7 +12856,7 @@ 

parametric types and methods
-
In [47]:
+
In [40]:
L1=Line(23,3,4,44,"Julia")
@@ -12904,7 +12870,7 @@ 

parametric types and methods -
Out[47]:
+
Out[40]:
@@ -12919,7 +12885,7 @@

parametric types and methods
-
In [48]:
+
In [41]:
L2=Line(23.777,3.5,4.1,4.0,"Rolf")
@@ -12933,7 +12899,7 @@ 

parametric types and methods -
Out[48]:
+
Out[41]:
@@ -12948,11 +12914,11 @@

parametric types and methods
-
In [49]:
+
In [42]:
-
function g{T}(x::Line{T}) 
-    println("in g for $T")
+
function f{T}(x::Line{T}) 
+    println("\nnow in f(x::Line{T}) with x=$x of type $(typeof(x))")
     x.name
 end
 
@@ -12965,11 +12931,11 @@

parametric types and methods -
Out[49]:
+
Out[42]:
-
g (generic function with 6 methods)
+
f (generic function with 5 methods)
@@ -12980,10 +12946,10 @@

parametric types and methods
-
In [50]:
+
In [43]:
-
Out[50]:
+
Out[43]:
-
In [37]:
+
In [44]:
A=[1,2,9]
@@ -13040,7 +13008,7 @@ 

Arrays

-
Out[37]:
+
Out[44]:
@@ -13058,10 +13026,10 @@

Arrays

-
In [38]:
+
In [45]:
-
A+2.1
+
A == 2
 
@@ -13072,14 +13040,11 @@

Arrays

-
Out[38]:
+
Out[45]:
-
3-element Array{Float64,1}:
-  3.1
-  4.1
- 11.1
+
false
@@ -13090,7 +13055,7 @@

Arrays

-
In [41]:
+
In [46]:
A .== 2
@@ -13104,7 +13069,7 @@ 

Arrays

-
Out[41]:
+
Out[46]:
@@ -13122,7 +13087,39 @@

Arrays

-
In [42]:
+
In [47]:
+
+
+
A+2.1
+
+ +
+
+
+ +
+
+ + +
Out[47]:
+ + +
+
3-element Array{Float64,1}:
+  3.1
+  4.1
+ 11.1
+
+ +
+ +
+
+ +
+
+
+
In [48]:
B=[1 2 3; 6 7 4; 6 2 1]
@@ -13136,7 +13133,7 @@ 

Arrays

-
Out[42]:
+
Out[48]:
@@ -13154,7 +13151,7 @@

Arrays

-
In [43]:
+
In [49]:
C=[ i*j for i in 1:3, j in 1:4 ]
@@ -13168,7 +13165,7 @@ 

Arrays

-
Out[43]:
+
Out[49]:
@@ -13186,7 +13183,7 @@

Arrays

-
In [56]:
+
In [50]:
B * A
@@ -13200,7 +13197,7 @@ 

Arrays

-
Out[56]:
+
Out[50]:
@@ -13218,7 +13215,7 @@

Arrays

-
In [57]:
+
In [51]:
#B =rand(500,500)
@@ -13235,12 +13232,12 @@ 

Arrays

-
  0.490006 seconds (285.75 k allocations: 12.694 MB, 1.31% gc time)
+
  0.417821 seconds (288.68 k allocations: 12.865 MB)
 
-
Out[57]:
+
Out[51]:
@@ -13258,7 +13255,7 @@

Arrays

-
In [58]:
+
In [52]:
@time svd(B)
@@ -13274,12 +13271,12 @@ 

Arrays

-
  0.226167 seconds (114.64 k allocations: 5.078 MB, 2.76% gc time)
+
  0.195268 seconds (117.06 k allocations: 5.161 MB)
 
-
Out[58]:
+
Out[52]:
@@ -13313,7 +13310,7 @@

Dictionary
-
In [59]:
+
In [53]:
d = Dict( "A"=>6, "B"=> 20)
@@ -13327,7 +13324,7 @@ 

Dictionary -
Out[59]:
+
Out[53]:
@@ -13344,7 +13341,7 @@

Dictionary
-
In [60]:
+
In [54]:
d["A"]
@@ -13358,7 +13355,7 @@ 

Dictionary -
Out[60]:
+
Out[54]:
@@ -13373,7 +13370,7 @@

Dictionary
-
In [61]:
+
In [55]:
for (key,value) in d
@@ -13412,7 +13409,7 @@ 

Regular Expressions
-
In [62]:
+
In [56]:
my_regex = r"[ABC]"
@@ -13445,7 +13442,7 @@ 

Regular Expressions
-
In [63]:
+
In [57]:
my_regex =r"(\d+)g"
@@ -13460,7 +13457,7 @@ 

Regular Expressions -
Out[63]:
+
Out[57]:
-
In [64]:
+
In [58]:
-
In [65]:
+
In [59]:
for i in 1:10
@@ -13570,7 +13567,7 @@ 

Packages

-
In [66]:
+
In [60]:
Pkg.status()
@@ -13767,6 +13764,19 @@ 

Packages

+
+
+
+
In [ ]:
+
+
+
#Pkg.generate("someName")
+
+ +
+
+
+
@@ -13779,7 +13789,7 @@

DataFrames
-
In [67]:
+
In [61]:
using DataFrames
@@ -13794,10 +13804,10 @@ 

DataFrames -
Out[67]:
+
Out[61]:
-
xy
1210.04611913606157114
2220.8373635242857538
3230.9066330243929763
4240.29675648510293584
5250.026788088896794626
6260.5217667751899686
7270.9032616276257022
8280.20058000081954552
9290.784639890245026
10300.6536073175415043
+
xy
1210.5377985654352477
2220.8080711876006776
3230.9541549857881655
4240.33134837317344057
5250.8443261865933054
6260.4257533982368864
7270.8457130119066063
8280.3766193582981403
9290.9043218651444398
10300.5068968925566211
@@ -13808,7 +13818,7 @@

DataFrames
-
In [68]:
+
In [62]:
mean(d[:x]), mean(d[:y])
@@ -13822,11 +13832,11 @@ 

DataFrames -
Out[68]:
+
Out[62]:
-
(25.5,0.5177515870161777)
+
(25.5,0.653500382473353)
@@ -13837,7 +13847,7 @@

DataFrames
-
In [69]:
+
In [63]:
using StatsBase
@@ -13852,11 +13862,11 @@ 

DataFrames -
Out[69]:
+
Out[63]:
-
0.21569762172381235
+
-0.07597318459490848
@@ -13867,7 +13877,7 @@

DataFrames
-
In [70]:
+
In [64]:
-
Out[70]:
+
Out[64]:
SepalLengthSepalWidthPetalLengthPetalWidthSpecies
15.13.51.40.2setosa
24.93.01.40.2setosa
34.73.21.30.2setosa
44.63.11.50.2setosa
55.03.61.40.2setosa
65.43.91.70.4setosa
@@ -13905,7 +13915,7 @@

DataFrames
-
In [73]:
+
In [65]:
by(iris, :Species, size)
@@ -13919,7 +13929,7 @@ 

DataFrames -
Out[73]:
+
Out[65]:
Speciesx1
1setosa(50,5)
2versicolor(50,5)
3virginica(50,5)
@@ -13933,7 +13943,7 @@

DataFrames
-
In [74]:
+
In [66]:
using DimensionalityReduction
@@ -13949,7 +13959,17 @@ 

DataFrames -
Out[74]:
+
+
+
WARNING: Base.FloatingPoint is deprecated, use AbstractFloat instead.
+  likely near /Users/arndt/.julia/v0.4/DimensionalityReduction/src/nmf.jl:10
+WARNING: Base.FloatingPoint is deprecated, use AbstractFloat instead.
+  likely near /Users/arndt/.julia/v0.4/DimensionalityReduction/src/nmf.jl:10
+
+
+
+ +
Out[66]:
@@ -14045,7 +14065,7 @@

Graphics - PlotlyJS
-
In [75]:
+
In [67]:
using PlotlyJS
@@ -14198,7 +14218,7 @@ 

Graphics - PlotlyJS
-
In [76]:
+
In [68]:
nms = unique(iris[:Species])
@@ -14234,16 +14254,16 @@ 

Graphics - PlotlyJS -
Out[76]:
+
Out[68]:
-
+
@@ -14258,7 +14278,7 @@

Graphics - PlotlyJS
-
In [ ]:
+
In [69]:
In [ ]:
-
PlotlyJS.savefig(p1, "output_filename.pdf")
+
#PlotlyJS.savefig(p1, "output_filename.pdf")
 
@@ -14284,7 +14320,7 @@

Graphics - PlotlyJS
-
In [77]:
+
In [70]:
function clustering_alpha_shapes()
@@ -14340,16 +14376,16 @@ 

Graphics - PlotlyJS -
Out[77]:
+
Out[70]:
-
+
@@ -14374,7 +14410,7 @@

Calling R<

-
In [78]:
+
In [71]:
using RCall
@@ -14387,7 +14423,7 @@ 

Calling R<

-
In [79]:
+
In [72]:
R"rnorm(10)"
@@ -14401,13 +14437,13 @@ 

Calling R<
-
Out[79]:
+
Out[72]:
RCall.RObject{RCall.RealSxp}
- [1] -0.2684685  0.5427448 -0.9213678  0.8288000 -0.3974171  1.8959922
- [7]  0.6632521 -0.3106209  1.6267463  0.5812782
+ [1] -1.80862226  0.52612679 -0.30935616  0.16500632 -0.07844949 -0.32057512
+ [7]  0.37502888  0.50023911  0.36234372 -0.09131232
 
@@ -14419,7 +14455,7 @@

Calling R<

-
In [80]:
+
In [73]:
L = 8
@@ -14437,19 +14473,19 @@ 

Calling R<
-
Out[80]:
+
Out[73]:
8-element Array{Float64,1}:
- -0.0371922
- -0.164406 
-  1.83884  
-  0.562734 
-  1.63202  
-  0.611594 
-  2.38667  
- -0.608195 
+ 1.60154 + 0.360681 + 0.552795 + -0.0579874 + 0.0642647 + -0.468992 + 1.00036 + 1.91809

@@ -14460,7 +14496,7 @@

Calling R<

-
In [81]:
+
In [74]:
rcopy(R"t.test(rnorm(1000))")
@@ -14474,20 +14510,20 @@ 

Calling R<
-
Out[81]:
+
Out[74]:
Dict{Symbol,Any} with 9 entries:
-  :statistic           => 0.10332942684641923
-  symbol("conf.int")   => [-0.05921758561151922,0.06580056524544481]
+  :statistic           => -1.0314510079327326
+  symbol("conf.int")   => [-0.09349989910375861,0.0290728780803126]
   :alternative         => "two.sided"
   :parameter           => 999.0
-  symbol("p.value")    => 0.9177222598844713
+  symbol("p.value")    => 0.3025790137321886
   :method              => "One Sample t-test"
   symbol("data.name")  => "rnorm(1000)"
   symbol("null.value") => 0.0
-  :estimate            => 0.0032914898169627916
+ :estimate => -0.032213510511723005

@@ -14509,7 +14545,7 @@

Calling C/C++
-
In [82]:
+
In [75]:
ccall( (:clock, "libc"), Int32, ())
@@ -14523,11 +14559,11 @@ 

Calling C/C++ -
Out[82]:
+
Out[75]:
-
68447842
+
42531843
@@ -14547,7 +14583,7 @@

Calling external programs
-
In [83]:
+
In [76]:
run(`echo Hello`)
@@ -14574,7 +14610,7 @@ 

Calling external programs
-
In [84]:
+
In [77]:
file = "HelloWorld.jl"
@@ -14615,7 +14651,7 @@ 

BioJulia

-
In [85]:
+
In [78]:
using Bio.Seq
@@ -14631,7 +14667,7 @@ 

BioJulia

-
Out[85]:
+
Out[78]:
@@ -14647,7 +14683,7 @@

BioJulia

-
In [86]:
+
In [79]:
reverse_complement(seq)
@@ -14661,7 +14697,7 @@ 

BioJulia

-
Out[86]:
+
Out[79]:
@@ -14677,7 +14713,7 @@

BioJulia

-
In [87]:
+
In [80]:
seq = dna"ACAGCGTAGCT";
@@ -14718,7 +14754,7 @@ 

Vectorization
-
In [88]:
+
In [81]:
-
In [89]:
+
In [82]:
procs()
@@ -14796,14 +14832,12 @@ 

Parallel Computing - Multiple
-
Out[89]:
+
Out[82]:
-
3-element Array{Int64,1}:
- 1
- 2
- 3
+
1-element Array{Int64,1}:
+ 1
@@ -14814,7 +14848,7 @@

Parallel Computing - Multiple

-
In [90]:
+
In [83]:
addprocs(2)
@@ -14829,16 +14863,14 @@ 

Parallel Computing - Multiple
-
Out[90]:
+
Out[83]:
-
5-element Array{Int64,1}:
+
3-element Array{Int64,1}:
  1
  2
- 3
- 4
- 5
+ 3
@@ -14849,7 +14881,7 @@

Parallel Computing - Multiple

-
In [91]:
+
In [84]:
r = remotecall(2, rand, 2, 2)
@@ -14863,11 +14895,11 @@ 

Parallel Computing - Multiple
-
Out[91]:
+
Out[84]:
-
RemoteRef{Channel{Any}}(2,1,33)
+
RemoteRef{Channel{Any}}(2,1,3)
@@ -14878,7 +14910,7 @@

Parallel Computing - Multiple

-
In [92]:
+
In [85]:
fetch(r)
@@ -14892,13 +14924,13 @@ 

Parallel Computing - Multiple
-
Out[92]:
+
Out[85]:
2x2 Array{Float64,2}:
- 0.692386  0.947491
- 0.120261  0.170056
+ 0.25081 0.223139 + 0.529448 0.892006

@@ -14909,7 +14941,7 @@

Parallel Computing - Multiple

-
In [93]:
+
In [ ]:
#addprocs(fill("ergophobie.molgen.mpg.de",10),dir="/home/arndt",exename="/usr/bin/julia")
@@ -14924,29 +14956,6 @@ 

Parallel Computing - Multiple

-
-
- - -
-
-
  4.478546 seconds (6.06 k allocations: 431.346 KB)
-
-
-
- -
Out[93]:
- - -
-
1000002994
-
- -
- -
-
-
@@ -14959,7 +14968,7 @@

Graphics - Plots
-
In [94]:
+
In [86]:
-
Out[94]:
+
Out[86]:
@@ -15001,7 +15008,7 @@

Graphics - Plots
-
In [95]:
+
In [87]:
Plots.plot(rand(10,5),w=4)
@@ -15022,7 +15029,7 @@ 

Graphics - Plots
Out[95]:
+
Out[87]:
@@ -15049,16 +15056,16 @@

Graphics - Plots Graphics - Plots -0.2 +0.2 -0.4 +0.4 -0.6 +0.6 -0.8 +0.8 2 @@ -15111,31 +15118,31 @@

Graphics - Plots f:
  • f(x::AbstractString) at In[28]:2
  • f(x::AbstractFloat) at In[28]:7
  • f(x) at In[6]:1
" - ], - "text/plain": [ - "# 3 methods for generic function \"f\":\n", - "f(x::AbstractString) at In[28]:2\n", - "f(x::AbstractFloat) at In[28]:7\n", - "f(x) at In[6]:1" - ] - }, - "execution_count": 29, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "methods(f)" ] }, { "cell_type": "code", - "execution_count": 32, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "now in f(x::AbstractFloat) with x=2.5 of type Float64\n", - "f(2.5) = 3.5\n" - ] - } - ], + "outputs": [], "source": [ "@show f(2.5);" ] }, { "cell_type": "code", - "execution_count": 34, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "now in f(x::AbstractFloat) with x=2.5 of type Float16\n", - "f(Float16(2.5)) = 3.5\n" - ] - } - ], + "outputs": [], "source": [ - "@show f(Float16(2.5));" + "@show f( Float16(2.5) );" ] }, { "cell_type": "code", - "execution_count": 35, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "now in f(x::AbstractString) with x=abc of type ASCIIString\n", - "f(\"abc\") = \"Hello abc\"\n", - "\n", - "now in f(x::AbstractString) with x=αβγ of type UTF8String\n", - "f(\"αβγ\") = \"Hello αβγ\"\n" - ] - } - ], + "outputs": [], "source": [ "@show f(\"abc\")\n", "@show f(\"αβγ\");" @@ -654,70 +345,22 @@ }, { "cell_type": "code", - "execution_count": 38, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "18 methods for generic function print:
" - ], - "text/plain": [ - "# 18 methods for generic function \"print\":\n", - "print(io::IO, c::Char) at char.jl:47\n", - "print(io::IO, s::AbstractString) at strings/io.jl:46\n", - "print(io::IO, s::Symbol) at show.jl:5\n", - "print(io::IO, n::Unsigned) at show.jl:145\n", - "print(io::IO, ex::Union{Expr,GlobalRef,GotoNode,LabelNode,LineNumberNode,QuoteNode,SymbolNode,TopNode}) at show.jl:290\n", - "print(io::IO, ip::IPv4) at socket.jl:38\n", - "print(io::IO, ip::IPv6) at socket.jl:95\n", - "print{mime}(io::IO, ::MIME{mime}) at multimedia.jl:19\n", - "print(io::IO, x::Float32) at grisu.jl:121\n", - "print(io::IO, x::Float16) at grisu.jl:122\n", - "print(io::IO, v::VersionNumber) at version.jl:54\n", - "print(io::IO, b::BigFloat) at mpfr.jl:845\n", - "print(::IO, ::Base.WorkerState) at Enums.jl:89\n", - "print(io::IO, t::Text{Function}) at docs/utils.jl:72\n", - "print(io::IO, t::Text{T}) at docs/utils.jl:71\n", - "print(io::IO, x) at strings/io.jl:6\n", - "print(io::IO, xs...) at strings/io.jl:15\n", - "print(xs...) at strings/io.jl:27" - ] - }, - "execution_count": 38, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "methods(print)" ] }, { "cell_type": "code", - "execution_count": 36, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/html": [ - "2 methods for generic function println:" - ], - "text/plain": [ - "# 2 methods for generic function \"println\":\n", - "println(io::IO, xs...) at strings/io.jl:25\n", - "println(xs...) at strings/io.jl:28" - ] - }, - "execution_count": 36, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "methods(println)" ] @@ -731,7 +374,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": null, "metadata": { "collapsed": true }, @@ -746,47 +389,25 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "Point(2,3,\"Siegfried\")" - ] - }, - "execution_count": 40, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "p = Point(2,3,\"Siegfried\")" ] }, { "cell_type": "code", - "execution_count": 41, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "g (generic function with 5 methods)" - ] - }, - "execution_count": 41, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "function g(p::Point)\n", - " println(\"in g(p::Point)\")\n", + "function f(p::Point)\n", + " println(\"\\nnow in f(x::Point) with p=$p of type $(typeof(p))\")\n", " p.x = p.x + p.y\n", " return p.name\n", "end" @@ -794,107 +415,33 @@ }, { "cell_type": "code", - "execution_count": 42, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "5 methods for generic function g:
  • g(y::Int64) at In[29]:2
  • g(y::AbstractString) at In[29]:7
  • g(y::AbstractString, z) at In[29]:7
  • g(p::Point) at In[41]:2
  • g(y) at In[26]:2
" - ], - "text/plain": [ - "# 5 methods for generic function \"g\":\n", - "g(y::Int64) at In[29]:2\n", - "g(y::AbstractString) at In[29]:7\n", - "g(y::AbstractString, z) at In[29]:7\n", - "g(p::Point) at In[41]:2\n", - "g(y) at In[26]:2" - ] - }, - "execution_count": 42, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "methods(g)" - ] - }, - { - "cell_type": "code", - "execution_count": 43, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/html": [ - "1-element Array{Method,1}:
  • g(p::Point) at In[41]:2
" - ], - "text/plain": [ - "1-element Array{Method,1}:\n", - " g(p::Point) at In[41]:2" - ] - }, - "execution_count": 43, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "methodswith(Point)" + "methods(f)" ] }, { "cell_type": "code", - "execution_count": 44, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "in g(p::Point)\n" - ] - }, - { - "data": { - "text/plain": [ - "\"Siegfried\"" - ] - }, - "execution_count": 44, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "g(p)" + "f(p)" ] }, { "cell_type": "code", - "execution_count": 45, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "Point(5,3,\"Siegfried\")" - ] - }, - "execution_count": 45, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "p" ] @@ -908,7 +455,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": null, "metadata": { "collapsed": false }, @@ -925,101 +472,49 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "Line{Int64}(23,3,4,44,\"Julia\")" - ] - }, - "execution_count": 47, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "L1=Line(23,3,4,44,\"Julia\")" ] }, { "cell_type": "code", - "execution_count": 48, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "Line{Float64}(23.777,3.5,4.1,4.0,\"Rolf\")" - ] - }, - "execution_count": 48, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "L2=Line(23.777,3.5,4.1,4.0,\"Rolf\")" ] }, { "cell_type": "code", - "execution_count": 49, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "g (generic function with 6 methods)" - ] - }, - "execution_count": 49, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "function g{T}(x::Line{T}) \n", - " println(\"in g for $T\")\n", + "function f{T}(x::Line{T}) \n", + " println(\"\\nnow in f(x::Line{T}) with x=$x of type $(typeof(x))\")\n", " x.name\n", "end" ] }, { "cell_type": "code", - "execution_count": 50, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "in g for Int64\n", - "in g for Float64\n" - ] - }, - { - "data": { - "text/plain": [ - "(\"Julia\",\"Rolf\")" - ] - }, - "execution_count": 50, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "g(L1),g(L2)" + "f(L1),f(L2)" ] }, { @@ -1031,182 +526,88 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "3-element Array{Int64,1}:\n", - " 1\n", - " 2\n", - " 9" - ] - }, - "execution_count": 37, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "A=[1,2,9]" ] }, { "cell_type": "code", - "execution_count": 38, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "3-element Array{Float64,1}:\n", - " 3.1\n", - " 4.1\n", - " 11.1" - ] - }, - "execution_count": 38, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "A+2.1" + "A == 2" ] }, { "cell_type": "code", - "execution_count": 41, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "3-element BitArray{1}:\n", - " false\n", - " true\n", - " false" - ] - }, - "execution_count": 41, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "A .== 2" ] }, { "cell_type": "code", - "execution_count": 42, + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "A+2.1" + ] + }, + { + "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "3x3 Array{Int64,2}:\n", - " 1 2 3\n", - " 6 7 4\n", - " 6 2 1" - ] - }, - "execution_count": 42, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "B=[1 2 3; 6 7 4; 6 2 1]" ] }, { "cell_type": "code", - "execution_count": 43, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "3x4 Array{Int64,2}:\n", - " 1 2 3 4\n", - " 2 4 6 8\n", - " 3 6 9 12" - ] - }, - "execution_count": 43, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "C=[ i*j for i in 1:3, j in 1:4 ]" ] }, { "cell_type": "code", - "execution_count": 56, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "3-element Array{Int64,1}:\n", - " 32\n", - " 56\n", - " 19" - ] - }, - "execution_count": 56, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "B * A" ] }, { "cell_type": "code", - "execution_count": 57, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " 0.490006 seconds (285.75 k allocations: 12.694 MB, 1.31% gc time)\n" - ] - }, - { - "data": { - "text/plain": [ - "3-element Array{Float64,1}:\n", - " 10.6722 \n", - " -3.25534\n", - " 1.58311" - ] - }, - "execution_count": 57, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "#B =rand(500,500)\n", "@time eigvals(B)" @@ -1214,39 +615,11 @@ }, { "cell_type": "code", - "execution_count": 58, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " 0.226167 seconds (114.64 k allocations: 5.078 MB, 2.76% gc time)\n" - ] - }, - { - "data": { - "text/plain": [ - "(\n", - "3x3 Array{Float64,2}:\n", - " -0.258442 -0.523252 -0.812044\n", - " -0.83751 -0.297569 0.45829 \n", - " -0.481441 0.798536 -0.361324,\n", - "\n", - "[11.912870002845768,3.5155113987276136,1.3132813486506532],\n", - "3x3 Array{Float64,2}:\n", - " -0.685993 0.70617 -0.175321\n", - " -0.616336 -0.435902 0.655835\n", - " -0.386708 -0.557955 -0.734264)" - ] - }, - "execution_count": 58, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "@time svd(B)" ] @@ -1260,66 +633,33 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "Dict{ASCIIString,Int64} with 2 entries:\n", - " \"B\" => 20\n", - " \"A\" => 6" - ] - }, - "execution_count": 59, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "d = Dict( \"A\"=>6, \"B\"=> 20)" ] }, { "cell_type": "code", - "execution_count": 60, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "6" - ] - }, - "execution_count": 60, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "d[\"A\"]" ] }, { "cell_type": "code", - "execution_count": 61, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "B ----> 20\n", - "A ----> 6\n" - ] - } - ], + "outputs": [], "source": [ "for (key,value) in d\n", " print(\"$key ----> $value\\n\")\n", @@ -1335,21 +675,11 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ismatch(my_regex,\"Foo\") = false\n", - "my_regex(\"Bar\") = true\n", - "my_regex(\"boo\") = false\n" - ] - } - ], + "outputs": [], "source": [ "my_regex = r\"[ABC]\"\n", "\n", @@ -1360,22 +690,11 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "RegexMatch(\"500g\", 1=\"500\")" - ] - }, - "execution_count": 63, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "my_regex =r\"(\\d+)g\"\n", "match(my_regex,\"take 500g sugar\")" @@ -1390,23 +709,11 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "1\n", - "2\n", - "3\n", - "4\n", - "5\n" - ] - } - ], + "outputs": [], "source": [ "for i in 1:5 \n", " println(i)\n", @@ -1415,21 +722,11 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "3\n", - "6\n", - "9\n" - ] - } - ], + "outputs": [], "source": [ "for i in 1:10\n", " if i % 3 == 0\n", @@ -1458,123 +755,11 @@ }, { "cell_type": "code", - "execution_count": 66, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "21 required packages:\n", - " - ArgParse 0.3.0\n", - " - Atom 0.4.2+ julia-0.4\n", - " - Bio 0.2.0+ master\n", - " - Bokeh 0.2.0\n", - " - Cairo 0.2.33\n", - " - DataFrames 0.7.5 master\n", - " - DimensionalityReduction 0.1.1\n", - " - DistributedArrays 0.2.0\n", - " - GR 0.13.0\n", - " - Gadfly 0.4.2\n", - " - IJulia 1.1.10\n", - " - Jewel 1.0.8\n", - " - Optim 0.5.0\n", - " - PlotlyJS 0.3.1\n", - " - Plots 0.8.0 master\n", - " - ProfileView 0.1.3\n", - " - PyPlot 2.2.0\n", - " - RCall 0.5.0\n", - " - RDatasets 0.1.3\n", - " - Rsvg 0.0.2\n", - " - UnicodePlots 0.1.3\n", - "82 additional packages:\n", - " - ArndtLabJulia 0.0.0- master (unregistered)\n", - " - ArrayViews 0.6.4\n", - " - AutoHashEquals 0.0.9\n", - " - BinDeps 0.3.21\n", - " - Blink 0.3.4\n", - " - Blosc 0.1.5\n", - " - BufferedStreams 0.1.5\n", - " - Calculus 0.1.15\n", - " - Clustering 0.5.0\n", - " - CodeTools 0.3.0+ master\n", - " - Codecs 0.1.5\n", - " - ColorTypes 0.2.3\n", - " - Colors 0.6.5\n", - " - Compat 0.8.4\n", - " - Compose 0.4.2\n", - " - Conda 0.2.2\n", - " - Contour 0.1.0\n", - " - DataArrays 0.3.6 master\n", - " - DataStructures 0.4.4\n", - " - Dates 0.4.4\n", - " - Distances 0.3.1\n", - " - Distributions 0.9.0\n", - " - Docile 0.5.23\n", - " - DualNumbers 0.2.2\n", - " - FactCheck 0.4.3\n", - " - FileIO 0.1.0\n", - " - FixedPointNumbers 0.1.3\n", - " - FixedSizeArrays 0.2.2\n", - " - GZip 0.2.19\n", - " - Graphics 0.1.3\n", - " - Grid 0.4.0\n", - " - Gtk 0.10.1\n", - " - GtkUtilities 0.0.9\n", - " - HDF5 0.6.3\n", - " - Hexagons 0.0.4\n", - " - Hiccup 0.0.2\n", - " - Homebrew 0.3.1\n", - " - HttpCommon 0.2.6\n", - " - HttpParser 0.1.1\n", - " - HttpServer 0.1.5\n", - " - IndexableBitVectors 0.1.1\n", - " - IntervalTrees 0.0.5\n", - " - Iterators 0.1.9\n", - " - JLD 0.6.3\n", - " - JSON 0.6.0\n", - " - JuliaParser 0.6.4\n", - " - KernelDensity 0.1.2\n", - " - LNR 0.0.2\n", - " - LaTeXStrings 0.1.6\n", - " - Lazy 0.10.1\n", - " - LegacyStrings 0.1.1\n", - " - Libz 0.1.1\n", - " - LightGraphs 0.5.5\n", - " - LightXML 0.2.1\n", - " - Loess 0.0.6\n", - " - MacroTools 0.3.0\n", - " - MbedTLS 0.2.4\n", - " - Measures 0.0.2\n", - " - Media 0.1.2\n", - " - Mustache 0.0.15\n", - " - Mux 0.2.0\n", - " - NaNMath 0.2.1\n", - " - Nettle 0.2.3\n", - " - PDMats 0.4.2\n", - " - ParserCombinator 1.7.8\n", - " - PlotUtils 0.0.3\n", - " - PositiveFactorizations 0.0.1\n", - " - PyCall 1.6.3\n", - " - RecipesBase 0.0.6\n", - " - Reexport 0.0.3\n", - " - Requires 0.2.2\n", - " - SHA 0.1.2\n", - " - Showoff 0.0.7\n", - " - SortingAlgorithms 0.0.6\n", - " - StatsBase 0.8.3\n", - " - StatsFuns 0.2.2\n", - " - SubstitutionModels 0.0.0- master (unregistered)\n", - " - TextWrap 0.1.5\n", - " - URIParser 0.1.5\n", - " - WebSockets 0.1.2\n", - " - WoodburyMatrices 0.1.5\n", - " - ZMQ 0.3.2\n" - ] - } - ], + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "Pkg.status()" ] @@ -1633,6 +818,17 @@ "Pkg.checkout(\"DataFrames\")" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "#Pkg.generate(\"someName\")" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -1642,37 +838,11 @@ }, { "cell_type": "code", - "execution_count": 67, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
xy
1210.04611913606157114
2220.8373635242857538
3230.9066330243929763
4240.29675648510293584
5250.026788088896794626
6260.5217667751899686
7270.9032616276257022
8280.20058000081954552
9290.784639890245026
10300.6536073175415043
" - ], - "text/plain": [ - "10×2 DataFrames.DataFrame\n", - "│ Row │ x │ y │\n", - "├─────┼────┼───────────┤\n", - "│ 1 │ 21 │ 0.0461191 │\n", - "│ 2 │ 22 │ 0.837364 │\n", - "│ 3 │ 23 │ 0.906633 │\n", - "│ 4 │ 24 │ 0.296756 │\n", - "│ 5 │ 25 │ 0.0267881 │\n", - "│ 6 │ 26 │ 0.521767 │\n", - "│ 7 │ 27 │ 0.903262 │\n", - "│ 8 │ 28 │ 0.20058 │\n", - "│ 9 │ 29 │ 0.78464 │\n", - "│ 10 │ 30 │ 0.653607 │" - ] - }, - "execution_count": 67, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "using DataFrames\n", "d = DataFrame(x = 21:30, y = rand(10))" @@ -1680,44 +850,22 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "(25.5,0.5177515870161777)" - ] - }, - "execution_count": 68, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "mean(d[:x]), mean(d[:y])" ] }, { "cell_type": "code", - "execution_count": 69, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "0.21569762172381235" - ] - }, - "execution_count": 69, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "using StatsBase\n", "cov(d[:x], d[:y])" @@ -1725,40 +873,11 @@ }, { "cell_type": "code", - "execution_count": 70, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "size(iris) = (150,5)\n" - ] - }, - { - "data": { - "text/html": [ - "
SepalLengthSepalWidthPetalLengthPetalWidthSpecies
15.13.51.40.2setosa
24.93.01.40.2setosa
34.73.21.30.2setosa
44.63.11.50.2setosa
55.03.61.40.2setosa
65.43.91.70.4setosa
" - ], - "text/plain": [ - "6×5 DataFrames.DataFrame\n", - "│ Row │ SepalLength │ SepalWidth │ PetalLength │ PetalWidth │ Species │\n", - "├─────┼─────────────┼────────────┼─────────────┼────────────┼──────────┤\n", - "│ 1 │ 5.1 │ 3.5 │ 1.4 │ 0.2 │ \"setosa\" │\n", - "│ 2 │ 4.9 │ 3.0 │ 1.4 │ 0.2 │ \"setosa\" │\n", - "│ 3 │ 4.7 │ 3.2 │ 1.3 │ 0.2 │ \"setosa\" │\n", - "│ 4 │ 4.6 │ 3.1 │ 1.5 │ 0.2 │ \"setosa\" │\n", - "│ 5 │ 5.0 │ 3.6 │ 1.4 │ 0.2 │ \"setosa\" │\n", - "│ 6 │ 5.4 │ 3.9 │ 1.7 │ 0.4 │ \"setosa\" │" - ] - }, - "execution_count": 70, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "using RDatasets\n", "iris = dataset(\"datasets\", \"iris\")\n", @@ -1768,124 +887,22 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/html": [ - "
Speciesx1
1setosa(50,5)
2versicolor(50,5)
3virginica(50,5)
" - ], - "text/plain": [ - "3×2 DataFrames.DataFrame\n", - "│ Row │ Species │ x1 │\n", - "├─────┼──────────────┼────────┤\n", - "│ 1 │ \"setosa\" │ (50,5) │\n", - "│ 2 │ \"versicolor\" │ (50,5) │\n", - "│ 3 │ \"virginica\" │ (50,5) │" - ] - }, - "execution_count": 73, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "by(iris, :Species, size)" ] }, { "cell_type": "code", - "execution_count": 74, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "Rotation:\n", - "4x4 Array{Float64,2}:\n", - " 0.360172 -0.608141 0.731739 0.14552 \n", - " -0.0979983 -0.783089 -0.13081 -0.0362072\n", - " 0.855279 -0.0841303 -0.308115 -0.951556 \n", - " 0.359402 -0.0992901 -0.593727 0.268428 \n", - "\n", - "Scores:\n", - "150x4 Array{Float64,2}:\n", - " -2.25714 -0.478424 0.12728 0.0240875 \n", - " -2.07401 0.671883 0.233826 0.102663 \n", - " -2.35634 0.340766 -0.0440539 0.0282823 \n", - " -2.29171 0.5954 -0.0909853 -0.0657353 \n", - " -2.38186 -0.644676 -0.0156856 -0.0358029 \n", - " -2.0687 -1.48421 -0.0268782 0.00658612\n", - " -2.43587 -0.0474851 -0.33435 -0.0366528 \n", - " -2.22539 -0.222403 0.0883994 -0.0245299 \n", - " -2.32685 1.1116 -0.144592 -0.0267695 \n", - " -2.17703 0.467448 0.252918 -0.0397661 \n", - " -2.15908 -1.04021 0.267784 0.0166755 \n", - " -2.31836 -0.132634 -0.0934462 -0.133038 \n", - " -2.21104 0.726243 0.23014 0.00241694\n", - " ⋮ \n", - " 0.921737 -0.0171656 -0.415434 0.00522092\n", - " 1.84586 -0.673871 0.0126298 0.194544 \n", - " 2.00808 -0.611836 -0.426903 0.246712 \n", - " 1.89543 -0.687273 -0.129641 0.468128 \n", - " 1.15402 0.696536 -0.52839 -0.0403855 \n", - " 2.03374 -0.864624 -0.337015 0.0450363 \n", - " 1.99148 -1.04567 -0.630302 0.213331 \n", - " 1.86426 -0.385674 -0.255418 0.387957 \n", - " 1.55936 0.893693 0.0262833 0.219457 \n", - " 1.51609 -0.268171 -0.179577 0.118773 \n", - " 1.3682 -1.00788 -0.930279 0.0260414 \n", - " 0.957448 0.0242504 -0.526485 -0.162534 \n", - "\n", - "Reconstruction:\n", - "150x4 Array{Float64,2}:\n", - " -0.42537 0.578323 -1.95237 -0.832823\n", - " -0.969562 -0.357198 -2.00012 -0.923388\n", - " -1.08404 -0.0311948 -2.05733 -0.84696 \n", - " -1.26364 -0.227386 -1.91956 -0.846387\n", - " -0.482515 0.741605 -1.94402 -0.792335\n", - " 0.138808 1.36827 -1.64244 -0.578403\n", - " -1.09845 0.32096 -1.94146 -0.682068\n", - " -0.605156 0.381571 -1.88852 -0.836799\n", - " -1.62378 -0.622574 -2.0136 -0.867983\n", - " -0.889098 -0.184352 -1.94139 -0.989683\n", - " 0.0533268 0.990527 -1.85748 -0.82721 \n", - " -0.842088 0.348101 -1.8163 -0.800286\n", - " -1.06926 -0.382227 -2.02537 -1.00276 \n", - " ⋮ \n", - " 0.0391933 -0.0227324 0.91282 0.581035\n", - " 1.11219 0.338113 1.44641 0.775038\n", - " 0.818858 0.329244 1.66572 1.10215 \n", - " 1.0739 0.352455 1.27344 0.952093\n", - " -0.400468 -0.58796 1.12964 0.648476\n", - " 1.01826 0.520228 1.87315 1.02897 \n", - " 0.923014 0.698414 1.78245 1.25106 \n", - " 0.775554 0.138687 1.33644 0.9641 \n", - " 0.0693136 -0.864039 1.04157 0.515005\n", - " 0.59502 0.0806172 1.26155 0.710015\n", - " 0.428789 0.775924 1.51684 1.15113 \n", - " -0.0788028 -0.038064 1.13372 0.610661\n", - "\n", - "Standard Deviations:\n", - "[1.7026570894991693,0.9528572479608981,0.38180950276393044,0.14344593936077485]\n", - "\n", - "Proportion of Variance:\n", - "[0.7296244541329988,0.22850761786701754,0.03668921889282881,0.005178709107154805]\n", - "\n", - "Cumulative Variance:\n", - "[0.7296244541329988,0.9581320720000163,0.9948212908928451,1.0]" - ] - }, - "execution_count": 74, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "using DimensionalityReduction\n", "iris_S = convert(Array,DataArray(iris[:,1:4]))\n", @@ -1901,141 +918,11 @@ }, { "cell_type": "code", - "execution_count": 75, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - " \n", - "

Plotly javascript loaded.

\n", - "

To load again call

init_notebook()

\n", - " " - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "using PlotlyJS\n", "using Colors\n", @@ -2047,31 +934,11 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n" - ] - }, - "execution_count": 76, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "nms = unique(iris[:Species])\n", "colors = [RGB(0.89, 0.1, 0.1), RGB(0.21, 0.50, 0.72), RGB(0.28, 0.68, 0.3)]\n", @@ -2117,36 +984,16 @@ }, "outputs": [], "source": [ - "PlotlyJS.savefig(p1, \"output_filename.pdf\")" + "#PlotlyJS.savefig(p1, \"output_filename.pdf\")" ] }, { "cell_type": "code", - "execution_count": 77, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n" - ] - }, - "execution_count": 77, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "function clustering_alpha_shapes()\n", " @eval using DataFrames, RDatasets, Colors\n", @@ -2203,7 +1050,7 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": null, "metadata": { "collapsed": true }, @@ -2214,54 +1061,22 @@ }, { "cell_type": "code", - "execution_count": 79, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "RCall.RObject{RCall.RealSxp}\n", - " [1] -0.2684685 0.5427448 -0.9213678 0.8288000 -0.3974171 1.8959922\n", - " [7] 0.6632521 -0.3106209 1.6267463 0.5812782\n" - ] - }, - "execution_count": 79, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "R\"rnorm(10)\"" ] }, { "cell_type": "code", - "execution_count": 80, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "8-element Array{Float64,1}:\n", - " -0.0371922\n", - " -0.164406 \n", - " 1.83884 \n", - " 0.562734 \n", - " 1.63202 \n", - " 0.611594 \n", - " 2.38667 \n", - " -0.608195 " - ] - }, - "execution_count": 80, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "L = 8\n", "@rput L\n", @@ -2272,31 +1087,11 @@ }, { "cell_type": "code", - "execution_count": 81, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "Dict{Symbol,Any} with 9 entries:\n", - " :statistic => 0.10332942684641923\n", - " symbol(\"conf.int\") => [-0.05921758561151922,0.06580056524544481]\n", - " :alternative => \"two.sided\"\n", - " :parameter => 999.0\n", - " symbol(\"p.value\") => 0.9177222598844713\n", - " :method => \"One Sample t-test\"\n", - " symbol(\"data.name\") => \"rnorm(1000)\"\n", - " symbol(\"null.value\") => 0.0\n", - " :estimate => 0.0032914898169627916" - ] - }, - "execution_count": 81, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "rcopy(R\"t.test(rnorm(1000))\")" ] @@ -2313,22 +1108,11 @@ }, { "cell_type": "code", - "execution_count": 82, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "68447842" - ] - }, - "execution_count": 82, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ " ccall( (:clock, \"libc\"), Int32, ())" ] @@ -2342,40 +1126,22 @@ }, { "cell_type": "code", - "execution_count": 83, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello\n" - ] - } - ], + "outputs": [], "source": [ "run(`echo Hello`)" ] }, { "cell_type": "code", - "execution_count": 84, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "#!/usr/bin/env julia\n", - "\n", - "println(\"Hello World!\")\n" - ] - } - ], + "outputs": [], "source": [ "file = \"HelloWorld.jl\"\n", "\n", @@ -2392,23 +1158,11 @@ }, { "cell_type": "code", - "execution_count": 85, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "6nt DNA Sequence:\n", - "ACGTTT" - ] - }, - "execution_count": 85, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "using Bio.Seq\n", "\n", @@ -2417,44 +1171,22 @@ }, { "cell_type": "code", - "execution_count": 86, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "6nt DNA Sequence:\n", - "AAACGT" - ] - }, - "execution_count": 86, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "reverse_complement(seq)" ] }, { "cell_type": "code", - "execution_count": 87, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "approxsearch(seq,@dna_str(\"AGGG\"),0) = 0:-1\n", - "approxsearch(seq,@dna_str(\"AGGG\"),1) = 3:6\n", - "approxsearch(seq,@dna_str(\"AGGG\"),2) = 1:4\n" - ] - } - ], + "outputs": [], "source": [ "seq = dna\"ACAGCGTAGCT\";\n", "@show approxsearch(seq, dna\"AGGG\", 0)\n", @@ -2471,21 +1203,11 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " 0.588814 seconds (8.57 k allocations: 763.363 MB, 24.01% gc time)\n", - " 0.209379 seconds (2.16 k allocations: 108.431 KB)\n", - " 0.187016 seconds (4.43 k allocations: 220.211 KB)\n" - ] - } - ], + "outputs": [], "source": [ "L = 100000000\n", "A = rand(1:1000,L)\n", @@ -2526,52 +1248,22 @@ }, { "cell_type": "code", - "execution_count": 89, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "3-element Array{Int64,1}:\n", - " 1\n", - " 2\n", - " 3" - ] - }, - "execution_count": 89, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "procs()" ] }, { "cell_type": "code", - "execution_count": 90, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "5-element Array{Int64,1}:\n", - " 1\n", - " 2\n", - " 3\n", - " 4\n", - " 5" - ] - }, - "execution_count": 90, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "addprocs(2)\n", "procs()" @@ -2579,75 +1271,33 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "RemoteRef{Channel{Any}}(2,1,33)" - ] - }, - "execution_count": 91, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "r = remotecall(2, rand, 2, 2)" ] }, { "cell_type": "code", - "execution_count": 92, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "2x2 Array{Float64,2}:\n", - " 0.692386 0.947491\n", - " 0.120261 0.170056" - ] - }, - "execution_count": 92, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "fetch(r)" ] }, { "cell_type": "code", - "execution_count": 93, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " 4.478546 seconds (6.06 k allocations: 431.346 KB)\n" - ] - }, - { - "data": { - "text/plain": [ - "1000002994" - ] - }, - "execution_count": 93, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "#addprocs(fill(\"ergophobie.molgen.mpg.de\",10),dir=\"/home/arndt\",exename=\"/usr/bin/julia\")\n", "nheads() = @parallel (+) for i=1:2000000000\n", @@ -2666,32 +1316,11 @@ }, { "cell_type": "code", - "execution_count": 94, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "INFO: Recompiling stale cache file /Users/arndt/.julia/lib/v0.4/PlotUtils.ji for module PlotUtils.\n", - "INFO: Recompiling stale cache file /Users/arndt/.julia/lib/v0.4/Plots.ji for module Plots.\n", - "WARNING: using Plots.scatter in module Main conflicts with an existing identifier.\n", - "WARNING: using Plots.scatter3d in module Main conflicts with an existing identifier.\n" - ] - }, - { - "data": { - "text/plain": [ - "Plots.GRBackend()" - ] - }, - "execution_count": 94, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "using Plots\n", "#plotlyjs()\n", @@ -2701,178 +1330,11 @@ }, { "cell_type": "code", - "execution_count": 95, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[Plots.jl] Initializing backend: gr\n" - ] - }, - { - "data": { - "text/html": [ - "\n", - "\n", - "\n", - " \n", - " \n", - " \n", - "\n", - "\n", - "\n", - " \n", - " \n", - " \n", - "\n", - "\n", - "\n", - " \n", - " \n", - " \n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0.2\n", - "\n", - "\n", - "0.4\n", - "\n", - "\n", - "0.6\n", - "\n", - "\n", - "0.8\n", - "\n", - "\n", - "\n", - "2\n", - "\n", - "\n", - "4\n", - "\n", - "\n", - "6\n", - "\n", - "\n", - "8\n", - "\n", - "\n", - "10\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "y1\n", - "\n", - "\n", - "\n", - "y2\n", - "\n", - "\n", - "\n", - "y3\n", - "\n", - "\n", - "\n", - "y4\n", - "\n", - "\n", - "\n", - "y5\n", - "\n", - "\n" - ] - }, - "execution_count": 95, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "Plots.plot(rand(10,5),w=4)" ]