SlideShare a Scribd company logo
Groovy: Efficiency Oriented Programming
Lecture 3
Master Proteomics & Bioinformatics - University of Geneva
Alexandre Masselot - summer 2011
Contents

• Eclipse tips
• The Groovy truth
• Control structures
• Regular expressions, a few step forwards
• Introduction to classes
A couple of eclipse tips

• <ctrl>-F : search text in file, replace; regular expressions possible,
A couple of eclipse tips

• <ctrl>-F : search text in file, replace; regular expressions possible,
• <ctrl>-J + word : search text in file, without opening a popup,
A couple of eclipse tips

• <ctrl>-F : search text in file, replace; regular expressions possible,
• <ctrl>-J + word : search text in file, without opening a popup,
• <ctrl>-R + filena : jump to the given filename directly. If multiple files
  correspond to the name entered, they are proposed,
A couple of eclipse tips

• <ctrl>-F : search text in file, replace; regular expressions possible,
• <ctrl>-J + word : search text in file, without opening a popup,
• <ctrl>-R + filena : jump to the given filename directly. If multiple files
  correspond to the name entered, they are proposed,
• select text + <ctrl>-7 [ right button -> source -> toggle comment] :
  passed the whole selection in or out comment mode (prepend // to lines)
A couple of linux (shell) tips

history to list the last console command
 history
 history | grep psql        //the last command with “psql”
A couple of linux (shell) tips

history to list the last console command
 history
 history | grep psql        //the last command with “psql”

<ctrl>-R to find last command
 <ctrl>-r + ls        //jump to last command with “ls”
                      //call <ctrl>-r multiple times
A couple of linux (shell) tips

history to list the last console command
 history
 history | grep psql          //the last command with “psql”

<ctrl>-R to find last command
 <ctrl>-r + ls         //jump to last command with “ls”
                       //call <ctrl>-r multiple times

tab for completion of the current word in plenty of context
 fin<tab>                 //all command start with “fin”
A couple of linux (shell) tips

history to list the last console command
 history
 history | grep psql          //the last command with “psql”

<ctrl>-R to find last command
 <ctrl>-r + ls         //jump to last command with “ls”
                       //call <ctrl>-r multiple times

tab for completion of the current word in plenty of context
 fin<tab>                 //all command start with “fin”
ls to list files
 ls -lrt                  //long format, sorted reverse on time
 ls -lh                   //size in human format (1.2M, 3.5G ...)
 ls -lhrt | tail          //10 most recent 10
Control structures : the Groovy truth

• In many situations, a boolean (true or false) must be deduced from the
  context
Control structures : the Groovy truth

• In many situations, a boolean (true or false) must be deduced from the
  context
• In perl, for example, false can be deduced from
  • undef

  • empty string ‘’
  •0
Groovy truth   (cont’d)
Groovy truth                                                 (cont’d)

In Groovy, several condition produce false (and opposite produces true)
 assert   !false                  //boolean value
 assert   !(‘a’ =~ /b/)           //regular expression
 assert   ![]                     //empty list
 assert   ![:]                    //empty map
 assert   !‘‘                     //empty string
 assert   !0                      //zero
 assert   !null                   //null pointer

 assert   true
 assert   a=~/./
 assert   [1]
 assert   [a:1]
 assert   ‘my funny valentine’
 assert   1
 assert   new Object()
conditional construct

Like in perl, the classic if/else construction
 if(x<10){
   ...
 }else if(x<20){
   ...
 }else{
   ...
 }
conditional construct

Like in perl, the classic if/else construction
 if(x<10){
   ...
 }else if(x<20){
   ...
 }else{
   ...
 }

Or the switch
 switch(x){
   case 1     : println ‘one’; break
   case 2..10 : println ‘between 2 and 10’; break
   default    : println ‘anything else’
 }
Single line conditional statement

Like in other language, the (...)?(...):(...)
 boolean cond=true
 int x
 if(cond){ x=10 }
 else    { x=42 }
Single line conditional statement

Like in other language, the (...)?(...):(...)
 boolean cond=true
 int x
 if(cond){ x=10 }
 else    { x=42 }

Can be replaced by
 int x=cond?10:42
Single line conditional statement

Like in other language, the (...)?(...):(...)
 boolean cond=true
 int x
 if(cond){ x=10 }
 else    { x=42 }

Can be replaced by
 int x=cond?10:42

In the same idea, a default value can be set
 if(params.x){ xVal=params.x } else { xVal=42 }
Single line conditional statement

Like in other language, the (...)?(...):(...)
 boolean cond=true
 int x
 if(cond){ x=10 }
 else    { x=42 }

Can be replaced by
 int x=cond?10:42

In the same idea, a default value can be set
 if(params.x){ xVal=params.x } else { xVal=42 }

Can be replaced with the ?: (the equivalent of perl’s ||)
 xVal=params.x?:42
Single line conditional statement                                                                     (cont’d)

Imagine we want to sort elements on last name, and if they are equals, on
the first name
 def nameList=[[first:'Harry', last:'Potter'],                                                [first:'Ron',
 last:'Weasley'], [first:'Fred', last:'Weasley'],   [first:'Georges', last:'Weasley'], ,   [first:'Hermione', last:'Granger']   ]
Single line conditional statement                                                                     (cont’d)

Imagine we want to sort elements on last name, and if they are equals, on
the first name
 def nameList=[[first:'Harry', last:'Potter'],                                                [first:'Ron',
 last:'Weasley'], [first:'Fred', last:'Weasley'],   [first:'Georges', last:'Weasley'], ,   [first:'Hermione', last:'Granger']   ]

The first “long” way:
 nameList.sort{o1, o2 ->
  if(o1.last == o2.last){
     return o1.first <=> o2.first    // <=> the spaceship
   }else{                            // operator
     return o1.last <=> o2.last      // compares elements
   }
  }.each{println “$it.first $it.last”}
Single line conditional statement                                                                     (cont’d)

Imagine we want to sort elements on last name, and if they are equals, on
the first name
 def nameList=[[first:'Harry', last:'Potter'],                                                [first:'Ron',
 last:'Weasley'], [first:'Fred', last:'Weasley'],   [first:'Georges', last:'Weasley'], ,   [first:'Hermione', last:'Granger']   ]

The first “long” way:
 nameList.sort{o1, o2 ->
  if(o1.last == o2.last){
     return o1.first <=> o2.first    // <=> the spaceship
   }else{                            // operator
     return o1.last <=> o2.last      // compares elements
   }
  }.each{println “$it.first $it.last”}

Or the more compact manner:
 (o1.last <=> o2.last)?:(o1.first <=> o2.first)
While loop

while(cond) is evaluated until the condition is false
 List l=[]
 x=5
 while(x--){
     l << x
 }
 assert l == [4, 3, 2, 1, 0]
While loop

while(cond) is evaluated until the condition is false
 List l=[]
 x=5
 while(x--){
     l << x
 }
 assert l == [4, 3, 2, 1, 0]

A loop scope can be exited with a break
 List l=[]
 x=5
 while(x--){
     l << x
     if(x==3) break         // NB a single line statement, no {}
 }
 assert l == [4, 3]
Loop: breaking the flow                                             (cont’d)

It can be useful to jump directly to the next iteration, without evaluation the
remaining part of the loop, with the continue statement
 int x = 10
 def list=[]
 while(x--){
   if (x%2) continue      // return to the while evaluation
   if (x<4) break         // exit
   list << x
 }
 assert list == [8, 6, 4]
for loop

Although closure makes it less critical, the for statement allows to walk
through a collection
 String t=’’
 for(String s in ‘a’..’d’){
   t+=s
 }
 assert t == ‘abcd’
for loop

Although closure makes it less critical, the for statement allows to walk
through a collection
 String t=’’
 for(String s in ‘a’..’d’){
   t+=s
 }
 assert t == ‘abcd’

It is equivalent to
 (‘a’..’d’).each{t+=it}
for loop

Although closure makes it less critical, the for statement allows to walk
through a collection
 String t=’’
 for(String s in ‘a’..’d’){
   t+=s
 }
 assert t == ‘abcd’

It is equivalent to
 (‘a’..’d’).each{t+=it}

And
 for(int i in 0..<5){println i} //NB the half inclusive ..<
for loop

Although closure makes it less critical, the for statement allows to walk
through a collection
 String t=’’
 for(String s in ‘a’..’d’){
   t+=s
 }
 assert t == ‘abcd’

It is equivalent to
 (‘a’..’d’).each{t+=it}

And
 for(int i in 0..<5){println i} //NB the half inclusive ..<

is equivalent to
 5.times{println it}
Regular Expression

• You want to know if a string match a structure? find the matches? replace
  the matches? Regular expressions are the answer.
Regular Expression

• You want to know if a string match a structure? find the matches? replace
  the matches? Regular expressions are the answer.
• Regular expression is a language by itself. Most of the features are cross
  languages (perl, java, php...).
Regular Expression

• You want to know if a string match a structure? find the matches? replace
  the matches? Regular expressions are the answer.
• Regular expression is a language by itself. Most of the features are cross
  languages (perl, java, php...).
• TIMTOWTDI : regexp is a domain where syntax can become particularly
  ugly, when inappropriate choice are made.
Regular Expression

• You want to know if a string match a structure? find the matches? replace
  the matches? Regular expressions are the answer.
• Regular expression is a language by itself. Most of the features are cross
  languages (perl, java, php...).
• TIMTOWTDI : regexp is a domain where syntax can become particularly
  ugly, when inappropriate choice are made.
• A large toolkit is available, and we’ll try to present here the most commonly
  used and groovy oriented syntax.
Regular Expression

• You want to know if a string match a structure? find the matches? replace
  the matches? Regular expressions are the answer.
• Regular expression is a language by itself. Most of the features are cross
  languages (perl, java, php...).
• TIMTOWTDI : regexp is a domain where syntax can become particularly
  ugly, when inappropriate choice are made.
• A large toolkit is available, and we’ll try to present here the most commonly
  used and groovy oriented syntax.
• “Mastering Regular Expressions” by Jeffrey E.L Friedl (O'Reilly).
Regular Expression

• You want to know if a string match a structure? find the matches? replace
  the matches? Regular expressions are the answer.
• Regular expression is a language by itself. Most of the features are cross
  languages (perl, java, php...).
• TIMTOWTDI : regexp is a domain where syntax can become particularly
  ugly, when inappropriate choice are made.
• A large toolkit is available, and we’ll try to present here the most commonly
  used and groovy oriented syntax.
• “Mastering Regular Expressions” by Jeffrey E.L Friedl (O'Reilly).

• http://www.regexp.info/
regexp: find or match

Two operators are commonly used
regexp: find or match

Two operators are commonly used
The find operator: is a substring matching the pattern?
 assert “The Lord of the Rings” =~ /Lord/
regexp: find or match

Two operators are commonly used
The find operator: is a substring matching the pattern?
 assert “The Lord of the Rings” =~ /Lord/

The match operator: is the whole string matching the pattern?
 assert ! “The Lord of the Rings” ==~ /Lord/
 assert   “The Lord of the Rings” ==~ /.*Lord.*/
regexp: anchoring
regexp: anchoring

When finding a pattern, we can anchor it
regexp: anchoring

When finding a pattern, we can anchor it
To the start of the line ^
 assert   ‘The Lord of the Rings’ =~ /^The Lord/
 assert ! ‘The Lord of the Rings’ =~ /^Lord/
regexp: anchoring

When finding a pattern, we can anchor it
To the start of the line ^
 assert   ‘The Lord of the Rings’ =~ /^The Lord/
 assert ! ‘The Lord of the Rings’ =~ /^Lord/

To the end of the line $
 assert   ‘The Lord of the Rings’ =~ /the Rings$/
 assert ! ‘The Lord of the Rings’ =~ /Lord$/
regexp: anchoring

When finding a pattern, we can anchor it
To the start of the line ^
 assert   ‘The Lord of the Rings’ =~ /^The Lord/
 assert ! ‘The Lord of the Rings’ =~ /^Lord/

To the end of the line $
 assert   ‘The Lord of the Rings’ =~ /the Rings$/
 assert ! ‘The Lord of the Rings’ =~ /Lord$/

A word boundary b
 assert       ‘The Lord of the Rings’ =~ /bLor/
 assert       ‘The Lord of the Rings’ =~ /bThe Lor/
 assert       ‘The Lord of the Rings’ =~ /ordb/
regexp: character classes

assert   ‘The Lord’ =~ /L.rd/   // . matches any character
assert   ‘The Lord’ =~ /L..d/
assert ! ‘The Lord’ =~ /.The/
regexp: character classes

assert   ‘The Lord’ =~ /L.rd/   // . matches any character
assert   ‘The Lord’ =~ /L..d/
assert ! ‘The Lord’ =~ /.The/
assert   ‘The Lord’ =~ /L[eoi]rd/ //character set
assert   ‘The Lord’ =~ /L[A-Za-z0-9]rd/
assert   ’12:23:56’ =~ /[0-2][0-9]:[0-5][0-9]:[0-5][0-9]/
regexp: character classes

assert   ‘The Lord’ =~ /L.rd/     // . matches any character
assert   ‘The Lord’ =~ /L..d/
assert ! ‘The Lord’ =~ /.The/
assert   ‘The Lord’ =~ /L[eoi]rd/ //character set
assert   ‘The Lord’ =~ /L[A-Za-z0-9]rd/
assert   ’12:23:56’ =~ /[0-2][0-9]:[0-5][0-9]:[0-5][0-9]/
assert   ‘12_;45’ ==~ /[^a-z]*/    //anything but [a-z]
regexp: character classes

assert   ‘The Lord’ =~ /L.rd/     // . matches any character
assert   ‘The Lord’ =~ /L..d/
assert ! ‘The Lord’ =~ /.The/
assert   ‘The Lord’ =~ /L[eoi]rd/ //character set
assert   ‘The Lord’ =~ /L[A-Za-z0-9]rd/
assert   ’12:23:56’ =~ /[0-2][0-9]:[0-5][0-9]:[0-5][0-9]/
assert   ‘12_;45’ ==~ /[^a-z]*/    //anything but [a-z]
assert   ‘1234’ ==~ /d+/        //any digit
assert ! ‘1234’ =~ /D/          //anything but digit
assert   ‘The_12_ring’ ==~ /w/ //word char [a-zA-Z0-9_]
assert ! ‘The_12_ring’ =~ /W/ //non-word char
assert   ‘of the Rings =~ /ofsth //space char [ trnf]
regexp: repetitions
regexp: repetitions

? : 0 or 1 matches
 ‘‘     ==~ /w?/
 ‘a‘    ==~ /w?/
 ‘aa’ ! ==~ /w?/
regexp: repetitions

? : 0 or 1 matches
 ‘‘     ==~ /w?/
 ‘a‘    ==~ /w?/
 ‘aa’ ! ==~ /w?/

* : zero or more
 ‘‘       ==~ /w*/
 ‘a‘      ==~ /w*/
 ‘aa‘     ==~ /w*/
regexp: repetitions

? : 0 or 1 matches
 ‘‘     ==~ /w?/
 ‘a‘    ==~ /w?/
 ‘aa’ ! ==~ /w?/

* : zero or more
 ‘‘       ==~ /w*/
 ‘a‘      ==~ /w*/
 ‘aa‘     ==~ /w*/

+ : one or more
 ‘‘   ! ==~ /w+/
 ‘a‘    ==~ /w+/
 ‘aa‘   ==~ /w+/
regexp: repetitions   (cont’d)
regexp: repetitions          (cont’d)

{n} : n times
 assert ‘abcd’ ==~ /w{4}/
regexp: repetitions             (cont’d)

{n} : n times
 assert ‘abcd’ ==~ /w{4}/

{n,m} : between n and m times
 assert ‘abcd’ ==~ /w{3,6}/
regexp: repetitions               (cont’d)

{n} : n times
 assert ‘abcd’ ==~ /w{4}/

{n,m} : between n and m times
 assert ‘abcd’ ==~ /w{3,6}/

{n,} : ≥ n times
 assert ‘abc’      ==~ /w{3,}/
regexp: repetitions                                            (cont’d)

{n} : n times
 assert ‘abcd’ ==~ /w{4}/

{n,m} : between n and m times
 assert ‘abcd’ ==~ /w{3,6}/

{n,} : ≥ n times
 assert ‘abc’      ==~ /w{3,}/
Greedy or not greedy ? Repetitions by default tries to consume the most
characters possible. Adding a question mark ‘?’ put the expanding operator
in restrictive mode
 ‘the Lord of the Rings’ =~ /.*s/
 ‘the Lord of the Rings’ =~ /.*?s/
regexp: matching this or that
regexp: matching this or that

We can match “multiple choices”
 assert ‘this’ ==~ /this|that/
 assert ‘this’ ==~ /th(is|at)/
regexp: matching this or that

We can match “multiple choices”
 assert ‘this’ ==~ /this|that/
 assert ‘this’ ==~ /th(is|at)/
Leftmost match: the order of the choice will infer the match
 ‘"So you're going to go        through with it, then", Gandalf
 the Wizard said slowly’        =~ /going|go/
 ‘"So you're going to go        through with it, then", Gandalf
 the Wizard said slowly’        =~ /go|going/
regexp: modifiers

It is possible to modify the behavior of the matching engine
regexp: modifiers

It is possible to modify the behavior of the matching engine
Case sensitivity: by default, regular expression are case sensitive

 assert ! ‘The Lord of the Rings’ =~ /ring/
 assert   ‘The Lord of the Rings’ =~ /(?i)ring/
regexp: modifiers

It is possible to modify the behavior of the matching engine
Case sensitivity: by default, regular expression are case sensitive

 assert ! ‘The Lord of the Rings’ =~ /ring/
 assert   ‘The Lord of the Rings’ =~ /(?i)ring/
Multi or single line: by default, regular expression are not evaluated across
new line char (n are not covered by s or .)
regexp: modifiers

It is possible to modify the behavior of the matching engine
Case sensitivity: by default, regular expression are case sensitive

 assert ! ‘The Lord of the Rings’ =~ /ring/
 assert   ‘The Lord of the Rings’ =~ /(?i)ring/
Multi or single line: by default, regular expression are not evaluated across
new line char (n are not covered by s or .)

In other word, with single line modifier, n is considered just like another
character
 ‘’’The   Lord               //NB ‘’’ for multi line string
 of the   Rings’’’ =~ /.+/
 ‘’’The   Lord
 of the   Rings’’’ =~ /(?s).+/
regexp: looking around

Regular expression usually consume character
regexp: looking around

Regular expression usually consume character
Let’s consider cleaving a protein sequence with trypsin
 ‘ACDEFKPGHRILKM’ =~/(w+?[KR])[^P]/             // the I is consumed
regexp: looking around

Regular expression usually consume character
Let’s consider cleaving a protein sequence with trypsin
 ‘ACDEFKPGHRILKM’ =~/(w+?[KR])[^P]/              // the I is consumed
If the next amino acid is consumed, it will not be caught in a situation where
we want to capture all the matches of the regular expression
regexp: looking around

Regular expression usually consume character
Let’s consider cleaving a protein sequence with trypsin
 ‘ACDEFKPGHRILKM’ =~/(w+?[KR])[^P]/              // the I is consumed
If the next amino acid is consumed, it will not be caught in a situation where
we want to capture all the matches of the regular expression
Hopefully, we can ‘lookahead’

 ‘ACDEFKPGHRILKM’ =~/(w+?[KR])(?=[^P])/
regexp: looking around

Regular expression usually consume character
Let’s consider cleaving a protein sequence with trypsin
 ‘ACDEFKPGHRILKM’ =~/(w+?[KR])[^P]/              // the I is consumed
If the next amino acid is consumed, it will not be caught in a situation where
we want to capture all the matches of the regular expression
Hopefully, we can ‘lookahead’

 ‘ACDEFKPGHRILKM’ =~/(w+?[KR])(?=[^P])/
Respectively, it is possible to check is a regexp matches before the captured
string (look behind)
 (?<=...)
regexp at works : splitting a string

One of the most commons use of the regular expression is to split a string
into an array
regexp at works : splitting a string

One of the most commons use of the regular expression is to split a string
into an array
Splitting point can be defined by a regular expression
 assert “a b c d”.split(/s+/)==[‘a’, ‘b’, ‘c’, ‘d’]
regexp at works : splitting a string

One of the most commons use of the regular expression is to split a string
into an array
Splitting point can be defined by a regular expression
 assert “a b c d”.split(/s+/)==[‘a’, ‘b’, ‘c’, ‘d’]
An extra argument can be passed, to limit the number of elements in the
returned list
 assert “a b c d”.split(/s+/, 3)==[‘a’, ‘b’, ‘c d’]
regexp at works : splitting a string

One of the most commons use of the regular expression is to split a string
into an array
Splitting point can be defined by a regular expression
 assert “a b c d”.split(/s+/)==[‘a’, ‘b’, ‘c’, ‘d’]
An extra argument can be passed, to limit the number of elements in the
returned list
 assert “a b c d”.split(/s+/, 3)==[‘a’, ‘b’, ‘c d’]
Do not forget to pipe to an collect closure
 assert “0 1 2”.split(/s+/).collect{it as Integer}
regexp at works : splitting a string

One of the most commons use of the regular expression is to split a string
into an array
Splitting point can be defined by a regular expression
 assert “a b c d”.split(/s+/)==[‘a’, ‘b’, ‘c’, ‘d’]
An extra argument can be passed, to limit the number of elements in the
returned list
 assert “a b c d”.split(/s+/, 3)==[‘a’, ‘b’, ‘c d’]
Do not forget to pipe to an collect closure
 assert “0 1 2”.split(/s+/).collect{it as Integer}

Or use splitEachLine
 txt.splitEachLine(/regexp/){it.action}
regexp: loop across matches

All the occurrence of a match is returned into a list:
 String title = "The Lord of the Rings"
 assert (title=~/(?i)thes+w+/).collect{"<$it>"} ==
        [‘<The Lord>’, ‘<the Rings>’]
regexp: loop across matches

All the occurrence of a match is returned into a list:
 String title = "The Lord of the Rings"
 assert (title=~/(?i)thes+w+/).collect{"<$it>"} ==
        [‘<The Lord>’, ‘<the Rings>’]
It is also natural to loop across all such occurrences:
 (title=~/(?i)thes+w+/).each{println "<$it>"}
regexp: loop across matches

All the occurrence of a match is returned into a list:
 String title = "The Lord of the Rings"
 assert (title=~/(?i)thes+w+/).collect{"<$it>"} ==
        [‘<The Lord>’, ‘<the Rings>’]
It is also natural to loop across all such occurrences:
 (title=~/(?i)thes+w+/).each{println "<$it>"}
Is equivalent to
 title.eachMatch(/(?i)thes+w+/){println "<$it>"}
regexp: capturing

Like in perl, it is possible to define with parenthesis sub patterns to be
captured in the pattern
regexp: capturing

Like in perl, it is possible to define with parenthesis sub patterns to be
captured in the pattern
If such parenthesis are present, the java.util.regex.Matcher structure
returned is different
 def matcher = title=~/(?i)thes+(w+)/
 assert matcher.hasGroup()
 assert matcher[0][0] == ‘The Lord’ //the whole match
 assert matcher[0][1] == ‘Lord‘      //first captured block
regexp: capturing

Like in perl, it is possible to define with parenthesis sub patterns to be
captured in the pattern
If such parenthesis are present, the java.util.regex.Matcher structure
returned is different
 def matcher = title=~/(?i)thes+(w+)/
 assert matcher.hasGroup()
 assert matcher[0][0] == ‘The Lord’ //the whole match
 assert matcher[0][1] == ‘Lord‘      //first captured block

It is possible to loop around with a closure
 (title=~/(?i)thes+(w+)/).each{all, name ->
                     println "all: <$all>, capt:<$name>"
                                }

More Related Content

What's hot

Rust ⇋ JavaScript
Rust ⇋ JavaScriptRust ⇋ JavaScript
Rust ⇋ JavaScript
Ingvar Stepanyan
 
PHP Language Trivia
PHP Language TriviaPHP Language Trivia
PHP Language Trivia
Nikita Popov
 
Template Haskell Tutorial
Template Haskell TutorialTemplate Haskell Tutorial
Template Haskell Tutorialkizzx2
 
Haste (Same Language, Multiple Platforms) and Tagless Final Style (Same Synta...
Haste (Same Language, Multiple Platforms) and Tagless Final Style (Same Synta...Haste (Same Language, Multiple Platforms) and Tagless Final Style (Same Synta...
Haste (Same Language, Multiple Platforms) and Tagless Final Style (Same Synta...
takeoutweight
 
PHP PPT FILE
PHP PPT FILEPHP PPT FILE
PHP PPT FILE
AbhishekSharma2958
 
(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy
Alonso Torres
 
Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020
Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020
Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020
Andrew Lavers
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Ahmed Salama
 
Interceptors: Into the Core of Pedestal
Interceptors: Into the Core of PedestalInterceptors: Into the Core of Pedestal
Interceptors: Into the Core of Pedestal
Kent Ohashi
 
Perl 6 by example
Perl 6 by examplePerl 6 by example
Perl 6 by example
Andrew Shitov
 
JavaScript Neednt Hurt - JavaBin talk
JavaScript Neednt Hurt - JavaBin talkJavaScript Neednt Hurt - JavaBin talk
JavaScript Neednt Hurt - JavaBin talk
Thomas Kjeldahl Nilsson
 
Functional pe(a)rls: Huey's zipper
Functional pe(a)rls: Huey's zipperFunctional pe(a)rls: Huey's zipper
Functional pe(a)rls: Huey's zipper
osfameron
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Kang-min Liu
 
Template Haskell とか
Template Haskell とかTemplate Haskell とか
Template Haskell とか
Hiromi Ishii
 
Rust言語紹介
Rust言語紹介Rust言語紹介
Rust言語紹介
Paweł Rusin
 
Implementing a many-to-many Relationship with Slick
Implementing a many-to-many Relationship with SlickImplementing a many-to-many Relationship with Slick
Implementing a many-to-many Relationship with Slick
Hermann Hueck
 
Perl 5.10
Perl 5.10Perl 5.10
Perl 5.10
acme
 
Rust-lang
Rust-langRust-lang
Quebec pdo
Quebec pdoQuebec pdo
Quebec pdo
Valentine Dianov
 

What's hot (20)

Rust ⇋ JavaScript
Rust ⇋ JavaScriptRust ⇋ JavaScript
Rust ⇋ JavaScript
 
PHP Language Trivia
PHP Language TriviaPHP Language Trivia
PHP Language Trivia
 
Template Haskell Tutorial
Template Haskell TutorialTemplate Haskell Tutorial
Template Haskell Tutorial
 
Haste (Same Language, Multiple Platforms) and Tagless Final Style (Same Synta...
Haste (Same Language, Multiple Platforms) and Tagless Final Style (Same Synta...Haste (Same Language, Multiple Platforms) and Tagless Final Style (Same Synta...
Haste (Same Language, Multiple Platforms) and Tagless Final Style (Same Synta...
 
PHP PPT FILE
PHP PPT FILEPHP PPT FILE
PHP PPT FILE
 
(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy
 
Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020
Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020
Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Interceptors: Into the Core of Pedestal
Interceptors: Into the Core of PedestalInterceptors: Into the Core of Pedestal
Interceptors: Into the Core of Pedestal
 
Perl 6 by example
Perl 6 by examplePerl 6 by example
Perl 6 by example
 
JavaScript Neednt Hurt - JavaBin talk
JavaScript Neednt Hurt - JavaBin talkJavaScript Neednt Hurt - JavaBin talk
JavaScript Neednt Hurt - JavaBin talk
 
Functional pe(a)rls: Huey's zipper
Functional pe(a)rls: Huey's zipperFunctional pe(a)rls: Huey's zipper
Functional pe(a)rls: Huey's zipper
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
Template Haskell とか
Template Haskell とかTemplate Haskell とか
Template Haskell とか
 
Rust言語紹介
Rust言語紹介Rust言語紹介
Rust言語紹介
 
Implementing a many-to-many Relationship with Slick
Implementing a many-to-many Relationship with SlickImplementing a many-to-many Relationship with Slick
Implementing a many-to-many Relationship with Slick
 
Perl 5.10
Perl 5.10Perl 5.10
Perl 5.10
 
Rust-lang
Rust-langRust-lang
Rust-lang
 
Php 101: PDO
Php 101: PDOPhp 101: PDO
Php 101: PDO
 
Quebec pdo
Quebec pdoQuebec pdo
Quebec pdo
 

Similar to groovy & grails - lecture 3

Talk Unix Shell Script
Talk Unix Shell ScriptTalk Unix Shell Script
Talk Unix Shell ScriptDr.Ravi
 
Talk Unix Shell Script 1
Talk Unix Shell Script 1Talk Unix Shell Script 1
Talk Unix Shell Script 1Dr.Ravi
 
Hammurabi
HammurabiHammurabi
Hammurabi
Mario Fusco
 
Scala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar ProkopecScala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar ProkopecLoïc Descotte
 
The Magnificent Seven
The Magnificent SevenThe Magnificent Seven
The Magnificent SevenMike Fogus
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to PerlSway Wang
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
Aleksandar Prokopec
 
Introduction to regular expressions
Introduction to regular expressionsIntroduction to regular expressions
Introduction to regular expressions
Ben Brumfield
 
Groovy puzzlers по русски с Joker 2014
Groovy puzzlers по русски с Joker 2014Groovy puzzlers по русски с Joker 2014
Groovy puzzlers по русски с Joker 2014
Baruch Sadogursky
 
Class 5 - PHP Strings
Class 5 - PHP StringsClass 5 - PHP Strings
Class 5 - PHP Strings
Ahmed Swilam
 
Scala in a Java 8 World
Scala in a Java 8 WorldScala in a Java 8 World
Scala in a Java 8 World
Daniel Blyth
 
Swift Study #7
Swift Study #7Swift Study #7
Swift Study #7
chanju Jeon
 
First steps in C-Shell
First steps in C-ShellFirst steps in C-Shell
First steps in C-Shell
Brahma Killampalli
 
Crystal presentation in NY
Crystal presentation in NYCrystal presentation in NY
Crystal presentation in NY
Crystal Language
 
Class 31: Deanonymizing
Class 31: DeanonymizingClass 31: Deanonymizing
Class 31: Deanonymizing
David Evans
 
Groovy closures
Groovy closuresGroovy closures
Groovy closures
Vijay Shukla
 
Introduction to Swift programming language.
Introduction to Swift programming language.Introduction to Swift programming language.
Introduction to Swift programming language.
Icalia Labs
 
Pattern Matching in Scala
Pattern Matching in ScalaPattern Matching in Scala
Pattern Matching in Scala
Derek Chen-Becker
 
Perl File Handling and Regex
Perl File Handling and RegexPerl File Handling and Regex
Perl File Handling and Regex
Jayant Parida
 
Unit vii wp ppt
Unit vii wp pptUnit vii wp ppt
Unit vii wp ppt
Bhavsingh Maloth
 

Similar to groovy & grails - lecture 3 (20)

Talk Unix Shell Script
Talk Unix Shell ScriptTalk Unix Shell Script
Talk Unix Shell Script
 
Talk Unix Shell Script 1
Talk Unix Shell Script 1Talk Unix Shell Script 1
Talk Unix Shell Script 1
 
Hammurabi
HammurabiHammurabi
Hammurabi
 
Scala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar ProkopecScala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar Prokopec
 
The Magnificent Seven
The Magnificent SevenThe Magnificent Seven
The Magnificent Seven
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Introduction to regular expressions
Introduction to regular expressionsIntroduction to regular expressions
Introduction to regular expressions
 
Groovy puzzlers по русски с Joker 2014
Groovy puzzlers по русски с Joker 2014Groovy puzzlers по русски с Joker 2014
Groovy puzzlers по русски с Joker 2014
 
Class 5 - PHP Strings
Class 5 - PHP StringsClass 5 - PHP Strings
Class 5 - PHP Strings
 
Scala in a Java 8 World
Scala in a Java 8 WorldScala in a Java 8 World
Scala in a Java 8 World
 
Swift Study #7
Swift Study #7Swift Study #7
Swift Study #7
 
First steps in C-Shell
First steps in C-ShellFirst steps in C-Shell
First steps in C-Shell
 
Crystal presentation in NY
Crystal presentation in NYCrystal presentation in NY
Crystal presentation in NY
 
Class 31: Deanonymizing
Class 31: DeanonymizingClass 31: Deanonymizing
Class 31: Deanonymizing
 
Groovy closures
Groovy closuresGroovy closures
Groovy closures
 
Introduction to Swift programming language.
Introduction to Swift programming language.Introduction to Swift programming language.
Introduction to Swift programming language.
 
Pattern Matching in Scala
Pattern Matching in ScalaPattern Matching in Scala
Pattern Matching in Scala
 
Perl File Handling and Regex
Perl File Handling and RegexPerl File Handling and Regex
Perl File Handling and Regex
 
Unit vii wp ppt
Unit vii wp pptUnit vii wp ppt
Unit vii wp ppt
 

More from Alexandre Masselot

Offshoring software development in Switzerland: You can do it
Offshoring software development in Switzerland: You can do itOffshoring software development in Switzerland: You can do it
Offshoring software development in Switzerland: You can do it
Alexandre Masselot
 
Dev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data Stack
Dev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data StackDev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data Stack
Dev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data Stack
Alexandre Masselot
 
Swiss Transport in Real Time: Tribulations in the Big Data Stack
Swiss Transport in Real Time: Tribulations in the Big Data StackSwiss Transport in Real Time: Tribulations in the Big Data Stack
Swiss Transport in Real Time: Tribulations in the Big Data Stack
Alexandre Masselot
 
groovy & grails - lecture 8
groovy & grails - lecture 8groovy & grails - lecture 8
groovy & grails - lecture 8
Alexandre Masselot
 
groovy & grails - lecture 10
groovy & grails - lecture 10groovy & grails - lecture 10
groovy & grails - lecture 10
Alexandre Masselot
 
groovy & grails - lecture 1
groovy & grails - lecture 1groovy & grails - lecture 1
groovy & grails - lecture 1
Alexandre Masselot
 
groovy & grails - lecture 11
groovy & grails - lecture 11groovy & grails - lecture 11
groovy & grails - lecture 11
Alexandre Masselot
 
groovy & grails - lecture 12
groovy & grails - lecture 12groovy & grails - lecture 12
groovy & grails - lecture 12
Alexandre Masselot
 
groovy & grails - lecture 13
groovy & grails - lecture 13groovy & grails - lecture 13
groovy & grails - lecture 13
Alexandre Masselot
 
groovy & grails - lecture 9
groovy & grails - lecture 9groovy & grails - lecture 9
groovy & grails - lecture 9
Alexandre Masselot
 
groovy & grails - lecture 7
groovy & grails - lecture 7groovy & grails - lecture 7
groovy & grails - lecture 7
Alexandre Masselot
 
groovy & grails - lecture 6
groovy & grails - lecture 6groovy & grails - lecture 6
groovy & grails - lecture 6
Alexandre Masselot
 
groovy & grails - lecture 5
groovy & grails - lecture 5groovy & grails - lecture 5
groovy & grails - lecture 5
Alexandre Masselot
 

More from Alexandre Masselot (13)

Offshoring software development in Switzerland: You can do it
Offshoring software development in Switzerland: You can do itOffshoring software development in Switzerland: You can do it
Offshoring software development in Switzerland: You can do it
 
Dev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data Stack
Dev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data StackDev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data Stack
Dev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data Stack
 
Swiss Transport in Real Time: Tribulations in the Big Data Stack
Swiss Transport in Real Time: Tribulations in the Big Data StackSwiss Transport in Real Time: Tribulations in the Big Data Stack
Swiss Transport in Real Time: Tribulations in the Big Data Stack
 
groovy & grails - lecture 8
groovy & grails - lecture 8groovy & grails - lecture 8
groovy & grails - lecture 8
 
groovy & grails - lecture 10
groovy & grails - lecture 10groovy & grails - lecture 10
groovy & grails - lecture 10
 
groovy & grails - lecture 1
groovy & grails - lecture 1groovy & grails - lecture 1
groovy & grails - lecture 1
 
groovy & grails - lecture 11
groovy & grails - lecture 11groovy & grails - lecture 11
groovy & grails - lecture 11
 
groovy & grails - lecture 12
groovy & grails - lecture 12groovy & grails - lecture 12
groovy & grails - lecture 12
 
groovy & grails - lecture 13
groovy & grails - lecture 13groovy & grails - lecture 13
groovy & grails - lecture 13
 
groovy & grails - lecture 9
groovy & grails - lecture 9groovy & grails - lecture 9
groovy & grails - lecture 9
 
groovy & grails - lecture 7
groovy & grails - lecture 7groovy & grails - lecture 7
groovy & grails - lecture 7
 
groovy & grails - lecture 6
groovy & grails - lecture 6groovy & grails - lecture 6
groovy & grails - lecture 6
 
groovy & grails - lecture 5
groovy & grails - lecture 5groovy & grails - lecture 5
groovy & grails - lecture 5
 

Recently uploaded

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 

Recently uploaded (20)

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 

groovy & grails - lecture 3

  • 1. Groovy: Efficiency Oriented Programming Lecture 3 Master Proteomics & Bioinformatics - University of Geneva Alexandre Masselot - summer 2011
  • 2. Contents • Eclipse tips • The Groovy truth • Control structures • Regular expressions, a few step forwards • Introduction to classes
  • 3. A couple of eclipse tips • <ctrl>-F : search text in file, replace; regular expressions possible,
  • 4. A couple of eclipse tips • <ctrl>-F : search text in file, replace; regular expressions possible, • <ctrl>-J + word : search text in file, without opening a popup,
  • 5. A couple of eclipse tips • <ctrl>-F : search text in file, replace; regular expressions possible, • <ctrl>-J + word : search text in file, without opening a popup, • <ctrl>-R + filena : jump to the given filename directly. If multiple files correspond to the name entered, they are proposed,
  • 6. A couple of eclipse tips • <ctrl>-F : search text in file, replace; regular expressions possible, • <ctrl>-J + word : search text in file, without opening a popup, • <ctrl>-R + filena : jump to the given filename directly. If multiple files correspond to the name entered, they are proposed, • select text + <ctrl>-7 [ right button -> source -> toggle comment] : passed the whole selection in or out comment mode (prepend // to lines)
  • 7. A couple of linux (shell) tips history to list the last console command history history | grep psql //the last command with “psql”
  • 8. A couple of linux (shell) tips history to list the last console command history history | grep psql //the last command with “psql” <ctrl>-R to find last command <ctrl>-r + ls //jump to last command with “ls” //call <ctrl>-r multiple times
  • 9. A couple of linux (shell) tips history to list the last console command history history | grep psql //the last command with “psql” <ctrl>-R to find last command <ctrl>-r + ls //jump to last command with “ls” //call <ctrl>-r multiple times tab for completion of the current word in plenty of context fin<tab> //all command start with “fin”
  • 10. A couple of linux (shell) tips history to list the last console command history history | grep psql //the last command with “psql” <ctrl>-R to find last command <ctrl>-r + ls //jump to last command with “ls” //call <ctrl>-r multiple times tab for completion of the current word in plenty of context fin<tab> //all command start with “fin” ls to list files ls -lrt //long format, sorted reverse on time ls -lh //size in human format (1.2M, 3.5G ...) ls -lhrt | tail //10 most recent 10
  • 11. Control structures : the Groovy truth • In many situations, a boolean (true or false) must be deduced from the context
  • 12. Control structures : the Groovy truth • In many situations, a boolean (true or false) must be deduced from the context • In perl, for example, false can be deduced from • undef • empty string ‘’ •0
  • 13. Groovy truth (cont’d)
  • 14. Groovy truth (cont’d) In Groovy, several condition produce false (and opposite produces true) assert !false //boolean value assert !(‘a’ =~ /b/) //regular expression assert ![] //empty list assert ![:] //empty map assert !‘‘ //empty string assert !0 //zero assert !null //null pointer assert true assert a=~/./ assert [1] assert [a:1] assert ‘my funny valentine’ assert 1 assert new Object()
  • 15. conditional construct Like in perl, the classic if/else construction if(x<10){ ... }else if(x<20){ ... }else{ ... }
  • 16. conditional construct Like in perl, the classic if/else construction if(x<10){ ... }else if(x<20){ ... }else{ ... } Or the switch switch(x){ case 1 : println ‘one’; break case 2..10 : println ‘between 2 and 10’; break default : println ‘anything else’ }
  • 17. Single line conditional statement Like in other language, the (...)?(...):(...) boolean cond=true int x if(cond){ x=10 } else { x=42 }
  • 18. Single line conditional statement Like in other language, the (...)?(...):(...) boolean cond=true int x if(cond){ x=10 } else { x=42 } Can be replaced by int x=cond?10:42
  • 19. Single line conditional statement Like in other language, the (...)?(...):(...) boolean cond=true int x if(cond){ x=10 } else { x=42 } Can be replaced by int x=cond?10:42 In the same idea, a default value can be set if(params.x){ xVal=params.x } else { xVal=42 }
  • 20. Single line conditional statement Like in other language, the (...)?(...):(...) boolean cond=true int x if(cond){ x=10 } else { x=42 } Can be replaced by int x=cond?10:42 In the same idea, a default value can be set if(params.x){ xVal=params.x } else { xVal=42 } Can be replaced with the ?: (the equivalent of perl’s ||) xVal=params.x?:42
  • 21. Single line conditional statement (cont’d) Imagine we want to sort elements on last name, and if they are equals, on the first name def nameList=[[first:'Harry', last:'Potter'], [first:'Ron', last:'Weasley'], [first:'Fred', last:'Weasley'], [first:'Georges', last:'Weasley'], , [first:'Hermione', last:'Granger'] ]
  • 22. Single line conditional statement (cont’d) Imagine we want to sort elements on last name, and if they are equals, on the first name def nameList=[[first:'Harry', last:'Potter'], [first:'Ron', last:'Weasley'], [first:'Fred', last:'Weasley'], [first:'Georges', last:'Weasley'], , [first:'Hermione', last:'Granger'] ] The first “long” way: nameList.sort{o1, o2 -> if(o1.last == o2.last){ return o1.first <=> o2.first // <=> the spaceship }else{ // operator return o1.last <=> o2.last // compares elements } }.each{println “$it.first $it.last”}
  • 23. Single line conditional statement (cont’d) Imagine we want to sort elements on last name, and if they are equals, on the first name def nameList=[[first:'Harry', last:'Potter'], [first:'Ron', last:'Weasley'], [first:'Fred', last:'Weasley'], [first:'Georges', last:'Weasley'], , [first:'Hermione', last:'Granger'] ] The first “long” way: nameList.sort{o1, o2 -> if(o1.last == o2.last){ return o1.first <=> o2.first // <=> the spaceship }else{ // operator return o1.last <=> o2.last // compares elements } }.each{println “$it.first $it.last”} Or the more compact manner: (o1.last <=> o2.last)?:(o1.first <=> o2.first)
  • 24. While loop while(cond) is evaluated until the condition is false List l=[] x=5 while(x--){ l << x } assert l == [4, 3, 2, 1, 0]
  • 25. While loop while(cond) is evaluated until the condition is false List l=[] x=5 while(x--){ l << x } assert l == [4, 3, 2, 1, 0] A loop scope can be exited with a break List l=[] x=5 while(x--){ l << x if(x==3) break // NB a single line statement, no {} } assert l == [4, 3]
  • 26. Loop: breaking the flow (cont’d) It can be useful to jump directly to the next iteration, without evaluation the remaining part of the loop, with the continue statement int x = 10 def list=[] while(x--){ if (x%2) continue // return to the while evaluation if (x<4) break // exit list << x } assert list == [8, 6, 4]
  • 27. for loop Although closure makes it less critical, the for statement allows to walk through a collection String t=’’ for(String s in ‘a’..’d’){ t+=s } assert t == ‘abcd’
  • 28. for loop Although closure makes it less critical, the for statement allows to walk through a collection String t=’’ for(String s in ‘a’..’d’){ t+=s } assert t == ‘abcd’ It is equivalent to (‘a’..’d’).each{t+=it}
  • 29. for loop Although closure makes it less critical, the for statement allows to walk through a collection String t=’’ for(String s in ‘a’..’d’){ t+=s } assert t == ‘abcd’ It is equivalent to (‘a’..’d’).each{t+=it} And for(int i in 0..<5){println i} //NB the half inclusive ..<
  • 30. for loop Although closure makes it less critical, the for statement allows to walk through a collection String t=’’ for(String s in ‘a’..’d’){ t+=s } assert t == ‘abcd’ It is equivalent to (‘a’..’d’).each{t+=it} And for(int i in 0..<5){println i} //NB the half inclusive ..< is equivalent to 5.times{println it}
  • 31. Regular Expression • You want to know if a string match a structure? find the matches? replace the matches? Regular expressions are the answer.
  • 32. Regular Expression • You want to know if a string match a structure? find the matches? replace the matches? Regular expressions are the answer. • Regular expression is a language by itself. Most of the features are cross languages (perl, java, php...).
  • 33. Regular Expression • You want to know if a string match a structure? find the matches? replace the matches? Regular expressions are the answer. • Regular expression is a language by itself. Most of the features are cross languages (perl, java, php...). • TIMTOWTDI : regexp is a domain where syntax can become particularly ugly, when inappropriate choice are made.
  • 34. Regular Expression • You want to know if a string match a structure? find the matches? replace the matches? Regular expressions are the answer. • Regular expression is a language by itself. Most of the features are cross languages (perl, java, php...). • TIMTOWTDI : regexp is a domain where syntax can become particularly ugly, when inappropriate choice are made. • A large toolkit is available, and we’ll try to present here the most commonly used and groovy oriented syntax.
  • 35. Regular Expression • You want to know if a string match a structure? find the matches? replace the matches? Regular expressions are the answer. • Regular expression is a language by itself. Most of the features are cross languages (perl, java, php...). • TIMTOWTDI : regexp is a domain where syntax can become particularly ugly, when inappropriate choice are made. • A large toolkit is available, and we’ll try to present here the most commonly used and groovy oriented syntax. • “Mastering Regular Expressions” by Jeffrey E.L Friedl (O'Reilly).
  • 36. Regular Expression • You want to know if a string match a structure? find the matches? replace the matches? Regular expressions are the answer. • Regular expression is a language by itself. Most of the features are cross languages (perl, java, php...). • TIMTOWTDI : regexp is a domain where syntax can become particularly ugly, when inappropriate choice are made. • A large toolkit is available, and we’ll try to present here the most commonly used and groovy oriented syntax. • “Mastering Regular Expressions” by Jeffrey E.L Friedl (O'Reilly). • http://www.regexp.info/
  • 37. regexp: find or match Two operators are commonly used
  • 38. regexp: find or match Two operators are commonly used The find operator: is a substring matching the pattern? assert “The Lord of the Rings” =~ /Lord/
  • 39. regexp: find or match Two operators are commonly used The find operator: is a substring matching the pattern? assert “The Lord of the Rings” =~ /Lord/ The match operator: is the whole string matching the pattern? assert ! “The Lord of the Rings” ==~ /Lord/ assert “The Lord of the Rings” ==~ /.*Lord.*/
  • 41. regexp: anchoring When finding a pattern, we can anchor it
  • 42. regexp: anchoring When finding a pattern, we can anchor it To the start of the line ^ assert ‘The Lord of the Rings’ =~ /^The Lord/ assert ! ‘The Lord of the Rings’ =~ /^Lord/
  • 43. regexp: anchoring When finding a pattern, we can anchor it To the start of the line ^ assert ‘The Lord of the Rings’ =~ /^The Lord/ assert ! ‘The Lord of the Rings’ =~ /^Lord/ To the end of the line $ assert ‘The Lord of the Rings’ =~ /the Rings$/ assert ! ‘The Lord of the Rings’ =~ /Lord$/
  • 44. regexp: anchoring When finding a pattern, we can anchor it To the start of the line ^ assert ‘The Lord of the Rings’ =~ /^The Lord/ assert ! ‘The Lord of the Rings’ =~ /^Lord/ To the end of the line $ assert ‘The Lord of the Rings’ =~ /the Rings$/ assert ! ‘The Lord of the Rings’ =~ /Lord$/ A word boundary b assert ‘The Lord of the Rings’ =~ /bLor/ assert ‘The Lord of the Rings’ =~ /bThe Lor/ assert ‘The Lord of the Rings’ =~ /ordb/
  • 45. regexp: character classes assert ‘The Lord’ =~ /L.rd/ // . matches any character assert ‘The Lord’ =~ /L..d/ assert ! ‘The Lord’ =~ /.The/
  • 46. regexp: character classes assert ‘The Lord’ =~ /L.rd/ // . matches any character assert ‘The Lord’ =~ /L..d/ assert ! ‘The Lord’ =~ /.The/ assert ‘The Lord’ =~ /L[eoi]rd/ //character set assert ‘The Lord’ =~ /L[A-Za-z0-9]rd/ assert ’12:23:56’ =~ /[0-2][0-9]:[0-5][0-9]:[0-5][0-9]/
  • 47. regexp: character classes assert ‘The Lord’ =~ /L.rd/ // . matches any character assert ‘The Lord’ =~ /L..d/ assert ! ‘The Lord’ =~ /.The/ assert ‘The Lord’ =~ /L[eoi]rd/ //character set assert ‘The Lord’ =~ /L[A-Za-z0-9]rd/ assert ’12:23:56’ =~ /[0-2][0-9]:[0-5][0-9]:[0-5][0-9]/ assert ‘12_;45’ ==~ /[^a-z]*/ //anything but [a-z]
  • 48. regexp: character classes assert ‘The Lord’ =~ /L.rd/ // . matches any character assert ‘The Lord’ =~ /L..d/ assert ! ‘The Lord’ =~ /.The/ assert ‘The Lord’ =~ /L[eoi]rd/ //character set assert ‘The Lord’ =~ /L[A-Za-z0-9]rd/ assert ’12:23:56’ =~ /[0-2][0-9]:[0-5][0-9]:[0-5][0-9]/ assert ‘12_;45’ ==~ /[^a-z]*/ //anything but [a-z] assert ‘1234’ ==~ /d+/ //any digit assert ! ‘1234’ =~ /D/ //anything but digit assert ‘The_12_ring’ ==~ /w/ //word char [a-zA-Z0-9_] assert ! ‘The_12_ring’ =~ /W/ //non-word char assert ‘of the Rings =~ /ofsth //space char [ trnf]
  • 50. regexp: repetitions ? : 0 or 1 matches ‘‘ ==~ /w?/ ‘a‘ ==~ /w?/ ‘aa’ ! ==~ /w?/
  • 51. regexp: repetitions ? : 0 or 1 matches ‘‘ ==~ /w?/ ‘a‘ ==~ /w?/ ‘aa’ ! ==~ /w?/ * : zero or more ‘‘ ==~ /w*/ ‘a‘ ==~ /w*/ ‘aa‘ ==~ /w*/
  • 52. regexp: repetitions ? : 0 or 1 matches ‘‘ ==~ /w?/ ‘a‘ ==~ /w?/ ‘aa’ ! ==~ /w?/ * : zero or more ‘‘ ==~ /w*/ ‘a‘ ==~ /w*/ ‘aa‘ ==~ /w*/ + : one or more ‘‘ ! ==~ /w+/ ‘a‘ ==~ /w+/ ‘aa‘ ==~ /w+/
  • 53. regexp: repetitions (cont’d)
  • 54. regexp: repetitions (cont’d) {n} : n times assert ‘abcd’ ==~ /w{4}/
  • 55. regexp: repetitions (cont’d) {n} : n times assert ‘abcd’ ==~ /w{4}/ {n,m} : between n and m times assert ‘abcd’ ==~ /w{3,6}/
  • 56. regexp: repetitions (cont’d) {n} : n times assert ‘abcd’ ==~ /w{4}/ {n,m} : between n and m times assert ‘abcd’ ==~ /w{3,6}/ {n,} : ≥ n times assert ‘abc’ ==~ /w{3,}/
  • 57. regexp: repetitions (cont’d) {n} : n times assert ‘abcd’ ==~ /w{4}/ {n,m} : between n and m times assert ‘abcd’ ==~ /w{3,6}/ {n,} : ≥ n times assert ‘abc’ ==~ /w{3,}/ Greedy or not greedy ? Repetitions by default tries to consume the most characters possible. Adding a question mark ‘?’ put the expanding operator in restrictive mode ‘the Lord of the Rings’ =~ /.*s/ ‘the Lord of the Rings’ =~ /.*?s/
  • 59. regexp: matching this or that We can match “multiple choices” assert ‘this’ ==~ /this|that/ assert ‘this’ ==~ /th(is|at)/
  • 60. regexp: matching this or that We can match “multiple choices” assert ‘this’ ==~ /this|that/ assert ‘this’ ==~ /th(is|at)/ Leftmost match: the order of the choice will infer the match ‘"So you're going to go through with it, then", Gandalf the Wizard said slowly’ =~ /going|go/ ‘"So you're going to go through with it, then", Gandalf the Wizard said slowly’ =~ /go|going/
  • 61. regexp: modifiers It is possible to modify the behavior of the matching engine
  • 62. regexp: modifiers It is possible to modify the behavior of the matching engine Case sensitivity: by default, regular expression are case sensitive assert ! ‘The Lord of the Rings’ =~ /ring/ assert ‘The Lord of the Rings’ =~ /(?i)ring/
  • 63. regexp: modifiers It is possible to modify the behavior of the matching engine Case sensitivity: by default, regular expression are case sensitive assert ! ‘The Lord of the Rings’ =~ /ring/ assert ‘The Lord of the Rings’ =~ /(?i)ring/ Multi or single line: by default, regular expression are not evaluated across new line char (n are not covered by s or .)
  • 64. regexp: modifiers It is possible to modify the behavior of the matching engine Case sensitivity: by default, regular expression are case sensitive assert ! ‘The Lord of the Rings’ =~ /ring/ assert ‘The Lord of the Rings’ =~ /(?i)ring/ Multi or single line: by default, regular expression are not evaluated across new line char (n are not covered by s or .) In other word, with single line modifier, n is considered just like another character ‘’’The Lord //NB ‘’’ for multi line string of the Rings’’’ =~ /.+/ ‘’’The Lord of the Rings’’’ =~ /(?s).+/
  • 65. regexp: looking around Regular expression usually consume character
  • 66. regexp: looking around Regular expression usually consume character Let’s consider cleaving a protein sequence with trypsin ‘ACDEFKPGHRILKM’ =~/(w+?[KR])[^P]/ // the I is consumed
  • 67. regexp: looking around Regular expression usually consume character Let’s consider cleaving a protein sequence with trypsin ‘ACDEFKPGHRILKM’ =~/(w+?[KR])[^P]/ // the I is consumed If the next amino acid is consumed, it will not be caught in a situation where we want to capture all the matches of the regular expression
  • 68. regexp: looking around Regular expression usually consume character Let’s consider cleaving a protein sequence with trypsin ‘ACDEFKPGHRILKM’ =~/(w+?[KR])[^P]/ // the I is consumed If the next amino acid is consumed, it will not be caught in a situation where we want to capture all the matches of the regular expression Hopefully, we can ‘lookahead’ ‘ACDEFKPGHRILKM’ =~/(w+?[KR])(?=[^P])/
  • 69. regexp: looking around Regular expression usually consume character Let’s consider cleaving a protein sequence with trypsin ‘ACDEFKPGHRILKM’ =~/(w+?[KR])[^P]/ // the I is consumed If the next amino acid is consumed, it will not be caught in a situation where we want to capture all the matches of the regular expression Hopefully, we can ‘lookahead’ ‘ACDEFKPGHRILKM’ =~/(w+?[KR])(?=[^P])/ Respectively, it is possible to check is a regexp matches before the captured string (look behind) (?<=...)
  • 70. regexp at works : splitting a string One of the most commons use of the regular expression is to split a string into an array
  • 71. regexp at works : splitting a string One of the most commons use of the regular expression is to split a string into an array Splitting point can be defined by a regular expression assert “a b c d”.split(/s+/)==[‘a’, ‘b’, ‘c’, ‘d’]
  • 72. regexp at works : splitting a string One of the most commons use of the regular expression is to split a string into an array Splitting point can be defined by a regular expression assert “a b c d”.split(/s+/)==[‘a’, ‘b’, ‘c’, ‘d’] An extra argument can be passed, to limit the number of elements in the returned list assert “a b c d”.split(/s+/, 3)==[‘a’, ‘b’, ‘c d’]
  • 73. regexp at works : splitting a string One of the most commons use of the regular expression is to split a string into an array Splitting point can be defined by a regular expression assert “a b c d”.split(/s+/)==[‘a’, ‘b’, ‘c’, ‘d’] An extra argument can be passed, to limit the number of elements in the returned list assert “a b c d”.split(/s+/, 3)==[‘a’, ‘b’, ‘c d’] Do not forget to pipe to an collect closure assert “0 1 2”.split(/s+/).collect{it as Integer}
  • 74. regexp at works : splitting a string One of the most commons use of the regular expression is to split a string into an array Splitting point can be defined by a regular expression assert “a b c d”.split(/s+/)==[‘a’, ‘b’, ‘c’, ‘d’] An extra argument can be passed, to limit the number of elements in the returned list assert “a b c d”.split(/s+/, 3)==[‘a’, ‘b’, ‘c d’] Do not forget to pipe to an collect closure assert “0 1 2”.split(/s+/).collect{it as Integer} Or use splitEachLine txt.splitEachLine(/regexp/){it.action}
  • 75. regexp: loop across matches All the occurrence of a match is returned into a list: String title = "The Lord of the Rings" assert (title=~/(?i)thes+w+/).collect{"<$it>"} == [‘<The Lord>’, ‘<the Rings>’]
  • 76. regexp: loop across matches All the occurrence of a match is returned into a list: String title = "The Lord of the Rings" assert (title=~/(?i)thes+w+/).collect{"<$it>"} == [‘<The Lord>’, ‘<the Rings>’] It is also natural to loop across all such occurrences: (title=~/(?i)thes+w+/).each{println "<$it>"}
  • 77. regexp: loop across matches All the occurrence of a match is returned into a list: String title = "The Lord of the Rings" assert (title=~/(?i)thes+w+/).collect{"<$it>"} == [‘<The Lord>’, ‘<the Rings>’] It is also natural to loop across all such occurrences: (title=~/(?i)thes+w+/).each{println "<$it>"} Is equivalent to title.eachMatch(/(?i)thes+w+/){println "<$it>"}
  • 78. regexp: capturing Like in perl, it is possible to define with parenthesis sub patterns to be captured in the pattern
  • 79. regexp: capturing Like in perl, it is possible to define with parenthesis sub patterns to be captured in the pattern If such parenthesis are present, the java.util.regex.Matcher structure returned is different def matcher = title=~/(?i)thes+(w+)/ assert matcher.hasGroup() assert matcher[0][0] == ‘The Lord’ //the whole match assert matcher[0][1] == ‘Lord‘ //first captured block
  • 80. regexp: capturing Like in perl, it is possible to define with parenthesis sub patterns to be captured in the pattern If such parenthesis are present, the java.util.regex.Matcher structure returned is different def matcher = title=~/(?i)thes+(w+)/ assert matcher.hasGroup() assert matcher[0][0] == ‘The Lord’ //the whole match assert matcher[0][1] == ‘Lord‘ //first captured block It is possible to loop around with a closure (title=~/(?i)thes+(w+)/).each{all, name -> println "all: <$all>, capt:<$name>" }

Editor's Notes

  1. \n
  2. horizontal learning\n
  3. read the function shortcuts and try to memorize your most commons\n
  4. read the function shortcuts and try to memorize your most commons\n
  5. read the function shortcuts and try to memorize your most commons\n
  6. read the function shortcuts and try to memorize your most commons\n
  7. \n
  8. \n
  9. \n
  10. \n
  11. ask for perl before bullet 2\n
  12. ask for perl before bullet 2\n
  13. \n
  14. if you don&amp;#x2019;t write the break, next line will be evaluated!!\n
  15. if you don&amp;#x2019;t write the break, next line will be evaluated!!\n
  16. take care if params.x is 0 or &amp;#x2018;&amp;#x2019;\ndepends on the context\nparams.x?:42 + 23 != (params.x?:42) + 23\n
  17. take care if params.x is 0 or &amp;#x2018;&amp;#x2019;\ndepends on the context\nparams.x?:42 + 23 != (params.x?:42) + 23\n
  18. take care if params.x is 0 or &amp;#x2018;&amp;#x2019;\ndepends on the context\nparams.x?:42 + 23 != (params.x?:42) + 23\n
  19. take care if params.x is 0 or &amp;#x2018;&amp;#x2019;\ndepends on the context\nparams.x?:42 + 23 != (params.x?:42) + 23\n
  20. \n
  21. \n
  22. \n
  23. \n
  24. sometimes, while(true) , then break exit for the condition\n
  25. sometimes, while(true) , then break exit for the condition\n
  26. \n
  27. rich scripting =&gt; TIMTOWTDI\nmore than one manner: choose your preferred, but be able to read other people code\n
  28. rich scripting =&gt; TIMTOWTDI\nmore than one manner: choose your preferred, but be able to read other people code\n
  29. rich scripting =&gt; TIMTOWTDI\nmore than one manner: choose your preferred, but be able to read other people code\n
  30. rich scripting =&gt; TIMTOWTDI\nmore than one manner: choose your preferred, but be able to read other people code\n
  31. most of what is seen here was already discussed in winter =&gt; go fast\n
  32. most of what is seen here was already discussed in winter =&gt; go fast\n
  33. most of what is seen here was already discussed in winter =&gt; go fast\n
  34. most of what is seen here was already discussed in winter =&gt; go fast\n
  35. most of what is seen here was already discussed in winter =&gt; go fast\n
  36. most of what is seen here was already discussed in winter =&gt; go fast\n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. always prefer \\s+ to &amp;#x2018; &amp;#x2018; when you suspect tab\ninverse of split is join\n\n
  67. always prefer \\s+ to &amp;#x2018; &amp;#x2018; when you suspect tab\ninverse of split is join\n\n
  68. always prefer \\s+ to &amp;#x2018; &amp;#x2018; when you suspect tab\ninverse of split is join\n\n
  69. always prefer \\s+ to &amp;#x2018; &amp;#x2018; when you suspect tab\ninverse of split is join\n\n
  70. always prefer \\s+ to &amp;#x2018; &amp;#x2018; when you suspect tab\ninverse of split is join\n\n
  71. going through title for line length\n
  72. going through title for line length\n
  73. going through title for line length\n
  74. idem $1, $2 ... in perl\n
  75. idem $1, $2 ... in perl\n
  76. idem $1, $2 ... in perl\n