SlideShare una empresa de Scribd logo
1 de 42
Descargar para leer sin conexión
Chaining Operator in
                                                                        Climb




                                                                  Introduction
         Chaining Operator in Climb                               Method Chaining
                                                                   jQuery
                                                                   Method Chaining
                                                                   Extended

                                                                  Climb
                 Christopher Chedeau                               Image Processing
                                                                   Implementation
                                                                   Attempts
                                                                   Dollar macro
                                LRDE
                                                                  Extensions
         Laboratoire de Recherche et D´veloppement d’EPITA
                                      e                            Modifiers
                                                                   Parallel

                                                                  Example
                         July 5, 2011
                                                                  Conclusion




                http://lrde.epita.fr/


1 / 19                                                       Christopher Chedeau
Chaining Operator in
                                           Climb
   Introduction
   Method Chaining
                                     Introduction
      jQuery
                                     Method Chaining
      Method Chaining                 jQuery
                                      Method Chaining
      Extended                        Extended

                                     Climb
   Climb                              Image Processing
                                      Implementation
                                      Attempts
      Image Processing                Dollar macro

      Implementation Attempts        Extensions
                                      Modifiers
      Dollar macro                    Parallel

                                     Example
   Extensions                        Conclusion

      Modifiers
      Parallel
   Example
   Conclusion

2 / 19                          Christopher Chedeau
Chaining Operator in
                                                                         Climb
 jQuery
              Old browsers are full of compatibility issues
                                                                   Introduction

                                                                   Method Chaining
                                                                    jQuery
                                                                    Method Chaining
                                                                    Extended

                                                                   Climb
                                                                    Image Processing
                                                                    Implementation
                                                                    Attempts
              jQuery1 is a [...] JavaScript Library that            Dollar macro

                                                                   Extensions
              simplifies HTML document traversing                    Modifiers
                                                                    Parallel

                                                                   Example

                                                                   Conclusion




         1
             http://jquery.com/
3 / 19                                                        Christopher Chedeau
Chaining Operator in
                                                                     Climb
 Method Chaining
                                                               Introduction

                                                               Method Chaining
                                                                jQuery
                                                                Method Chaining
                                                                Extended
         Intuitive API                                         Climb
                                                                Image Processing
         Heavily rely on Method Chaining                        Implementation
                                                                Attempts
                                                                Dollar macro
         $(”a”)                                                Extensions
           .addClass(”external”)                                Modifiers
                                                                Parallel
           .attr(”target”, ” blank”)                           Example
           .click(function () { /∗ analytics call ∗/ })        Conclusion




4 / 19                                                    Christopher Chedeau
Chaining Operator in
                                                                   Climb
 Method Chaining in Javascript
   function Object() {}        It works in any Object        Introduction

                                                             Method Chaining
   Object.prototype = {        Oriented language:             jQuery

      methodA: function () {        C++
                                                              Method Chaining
                                                              Extended

         // do something                                     Climb
                                    Java                      Image Processing
          return this;                                        Implementation
                                                              Attempts

      },                            PHP                       Dollar macro

                                                             Extensions
      methodB: function () {        C#                        Modifiers
                                                              Parallel
         // do something            ...                      Example
          return this;                                       Conclusion
      }
   };

   var obj = new Object();
    obj.methodA().methodB();

5 / 19                                                  Christopher Chedeau
Chaining Operator in
                                                                       Climb
 Extended Chaining
         HTML Document Traversing
                                                                 Introduction
            $(”li”)                 // li: List Item             Method Chaining
                                                                  jQuery
              .has(”ul”)            // ul: Unordered List         Method Chaining
                                                                  Extended
              .eq(1)
                                                                 Climb
              .parent()                                           Image Processing
                                                                  Implementation
                                                                  Attempts
                                                                  Dollar macro

                                                                 Extensions
                                                                  Modifiers
                                                                  Parallel

                                                                 Example

                                                                 Conclusion




6 / 19                                                      Christopher Chedeau
Chaining Operator in
                                                                       Climb
 Extended Chaining
         HTML Document Traversing
                                                                 Introduction
            $(”li”)                 // li: List Item             Method Chaining
                                                                  jQuery
              .has(”ul”)            // ul: Unordered List         Method Chaining
                                                                  Extended
              .eq(1)
                                                                 Climb
              .parent()                                           Image Processing
                                                                  Implementation
                                                                  Attempts
         SQL Query                                                Dollar macro

                                                                 Extensions
            SQL(”select”)                                         Modifiers
                                                                  Parallel
             .field(”∗”)
                                                                 Example
             .table(”users”)
                                                                 Conclusion
             .limit(10)




6 / 19                                                      Christopher Chedeau
Chaining Operator in
                                                                         Climb
 Extended Chaining
         HTML Document Traversing
                                                                   Introduction
             $(”li”)                  // li: List Item             Method Chaining
                                                                    jQuery
               .has(”ul”)             // ul: Unordered List         Method Chaining
                                                                    Extended
               .eq(1)
                                                                   Climb
               .parent()                                            Image Processing
                                                                    Implementation
                                                                    Attempts
         SQL Query                                                  Dollar macro

                                                                   Extensions
             SQL(”select”)                                          Modifiers
                                                                    Parallel
              .field(”∗”)
                                                                   Example
              .table(”users”)
                                                                   Conclusion
              .limit(10)
         Asynchronous Tasks
             $(”<div/>”)
               .fetch(”navigation.html”) // Asynchronous
               .addClass(”column”)
               .appendTo(”#side”)
6 / 19                                                        Christopher Chedeau
Chaining Operator in
                                                                       Climb
 Image processing
                                                                 Introduction

                                                                 Method Chaining
                                                                  jQuery
                                                                  Method Chaining

         Image processing chains can be expressed through         Extended

                                                                 Climb
         method chaining                                          Image Processing
                                                                  Implementation
                                                                  Attempts
         Image(”lena.jpg”)                                        Dollar macro

           .togray()                                             Extensions
                                                                  Modifiers
           .otsu()                                                Parallel

                                                                 Example
           .opening(8 connectivity)
                                                                 Conclusion
           .save(”lena opening.png”)




7 / 19                                                      Christopher Chedeau
Chaining Operator in
                                                                   Climb
 Straight Common Lisp Implementation
                                                             Introduction

                                                             Method Chaining
                                                              jQuery
                                                              Method Chaining
         Common Lisp methods do not belong to classes         Extended

                                                             Climb
         (let ((img (load ”lena.jpg”)))                       Image Processing
                                                              Implementation
          (setf img (togray img))                             Attempts
                                                              Dollar macro
          (setf img (otsu img))                              Extensions
          (setf img (opening img (8-connectivity)))           Modifiers
                                                              Parallel

          (save img ”lena opening.png”))                     Example

                                                             Conclusion




8 / 19                                                  Christopher Chedeau
Chaining Operator in
                                                                   Climb
 Straight Common Lisp Implementation
                                                             Introduction

                                                             Method Chaining
                                                              jQuery
                                                              Method Chaining
         Common Lisp methods do not belong to classes         Extended

                                                             Climb
         (let ((img (load ”lena.jpg”)))                       Image Processing
                                                              Implementation
          (setf img (togray img))                             Attempts
                                                              Dollar macro
          (setf img (otsu img))                              Extensions
          (setf img (opening img (8-connectivity)))           Modifiers
                                                              Parallel

          (save img ”lena opening.png”))                     Example

                                                             Conclusion


         The temporary variable is written 8 times




8 / 19                                                  Christopher Chedeau
Chaining Operator in
                                                Climb
 Without Temporary Variable
                                          Introduction
         (save                            Method Chaining
           (opening                        jQuery
                                           Method Chaining

             (otsu                         Extended

                                          Climb
               (togray                     Image Processing
                                           Implementation
                 (load ”lena.jpg”)         Attempts
                                           Dollar macro
               )                          Extensions
             )                             Modifiers
                                           Parallel
           (8−connectivity))              Example

         ”lena opening.png”)              Conclusion




9 / 19                               Christopher Chedeau
Chaining Operator in
                                                                 Climb
 Without Temporary Variable
                                                           Introduction
         (save                                             Method Chaining
           (opening                                         jQuery
                                                            Method Chaining

             (otsu                                          Extended

                                                           Climb
               (togray                                      Image Processing
                                                            Implementation
                 (load ”lena.jpg”)                          Attempts
                                                            Dollar macro
               )                                           Extensions
             )                                              Modifiers
                                                            Parallel
           (8−connectivity))                               Example

         ”lena opening.png”)                               Conclusion



           Functions executed last are written first




9 / 19                                                Christopher Chedeau
Chaining Operator in
                                                                  Climb
 Without Temporary Variable
                                                            Introduction
         (save                                              Method Chaining
           (opening                                          jQuery
                                                             Method Chaining

             (otsu                                           Extended

                                                            Climb
               (togray                                       Image Processing
                                                             Implementation
                 (load ”lena.jpg”)                           Attempts
                                                             Dollar macro
               )                                            Extensions
             )                                               Modifiers
                                                             Parallel
           (8−connectivity))                                Example

         ”lena opening.png”)                                Conclusion



           Functions executed last are written first
           Arguments are far away from function name



9 / 19                                                 Christopher Chedeau
Chaining Operator in
                                                                         Climb
  Introduction of Dollar $ Macro
    Dollar $ Macro                 Method Chaining                 Introduction

                                                                   Method Chaining
    ($ (load ”lena.jpg”)         Image(”lena.jpg”)                  jQuery
                                                                    Method Chaining
       (togray)                    .togray()                        Extended

                                                                   Climb
       (otsu)                      .otsu()                          Image Processing
       (opening 8−connectivity)    .opening(8 connectivity)         Implementation
                                                                    Attempts
                                                                    Dollar macro
       (save ”lena opening.png”)) .save(”lena opening.png”)
                                                                   Extensions
                                                                    Modifiers
                                                                    Parallel

                                                                   Example
          It takes a sequence of actions                           Conclusion




10 / 19                                                       Christopher Chedeau
Chaining Operator in
                                                                            Climb
  Introduction of Dollar $ Macro
    Dollar $ Macro                Method Chaining                     Introduction

                                                                      Method Chaining
    ($ (load ”lena.jpg”)         Image(”lena.jpg”)                     jQuery
                                                                       Method Chaining
       (togray )                   .togray()                           Extended

                                                                      Climb
       (otsu)                      .otsu()                             Image Processing
       (opening 8−connectivity)    .opening(8 connectivity)            Implementation
                                                                       Attempts
                                                                       Dollar macro
       (save ”lena opening.png”)) .save(”lena opening.png”)
                                                                      Extensions
                                                                       Modifiers
                                                                       Parallel

                                                                      Example
          It takes a sequence of actions                              Conclusion

          The result of each action is passed as first argument
          on the next
          Rewritten either with or without temporary variable
          Can express all the method chaining features

10 / 19                                                          Christopher Chedeau
Chaining Operator in
                                                                  Climb
  Modifiers
                                                            Introduction

                                                            Method Chaining
                                                             jQuery
                                                             Method Chaining
                                                             Extended

          Not everything fits in the chaining pattern        Climb
                                                             Image Processing
                                                             Implementation
          ($ (action)                                        Attempts
                                                             Dollar macro
            ’(print ”Something”)                            Extensions
                                                             Modifiers
             (action))                                       Parallel

                                                            Example

                                                            Conclusion




11 / 19                                                Christopher Chedeau
Chaining Operator in
                                                                  Climb
  Modifiers
                                                            Introduction

                                                            Method Chaining
                                                             jQuery
                                                             Method Chaining
                                                             Extended

          Not everything fits in the chaining pattern        Climb
                                                             Image Processing
                                                             Implementation
          ($ (action)                                        Attempts
                                                             Dollar macro
            ’(print ”Something”)                            Extensions
                                                             Modifiers
             (action))                                       Parallel

                                                            Example
          We introduce the quote ’ modifier                  Conclusion




11 / 19                                                Christopher Chedeau
Chaining Operator in
                                       Climb
  Modifiers
          Normal behavior        Introduction

          (before)               Method Chaining
                                  jQuery
          (action arg)            Method Chaining
                                  Extended
          (after )               Climb
                                  Image Processing
                                  Implementation
                                  Attempts
                                  Dollar macro

                                 Extensions
                                  Modifiers
                                  Parallel

                                 Example

                                 Conclusion




12 / 19                     Christopher Chedeau
Chaining Operator in
                                                     Climb
  Modifiers
          Normal behavior                      Introduction

          (before)                             Method Chaining
                                                jQuery
          (action arg)                          Method Chaining
                                                Extended
          (after )                             Climb
                                                Image Processing

          Quote ’ Modifier                       Implementation
                                                Attempts
                                                Dollar macro

          (before)           $1, $2 ...        Extensions
                                                Modifiers
          ’(action arg $1)                      Parallel

          (after )                             Example

                                               Conclusion




12 / 19                                   Christopher Chedeau
Chaining Operator in
                                                     Climb
  Modifiers
          Normal behavior                      Introduction

          (before)                             Method Chaining
                                                jQuery
          (action arg)                          Method Chaining
                                                Extended
          (after )                             Climb
                                                Image Processing

          Quote ’ Modifier                       Implementation
                                                Attempts
                                                Dollar macro

          (before)           $1, $2 ...        Extensions
                                                Modifiers
          ’(action arg $1)                      Parallel

          (after )                             Example

                                               Conclusion

          Sharp # Modifier
          (before)           $1, $2 ...
          #(action arg $1)
          (after )


12 / 19                                   Christopher Chedeau
Chaining Operator in
                                      Climb
  Grouped Actions
    Image(”lena.png”)           Introduction

      .preprocess()             Method Chaining
                                 jQuery
                                 Method Chaining
                                 Extended
          .background()         Climb
            .fill(red)            Image Processing
                                 Implementation
                                 Attempts
                                 Dollar macro

                                Extensions
                                 Modifiers
          .foreground()          Parallel

             .fill(green)        Example

                                Conclusion

    .




13 / 19                    Christopher Chedeau
Chaining Operator in
                                                                             Climb
  Grouped Actions
    Image(”lena.png”)                [lena]                            Introduction

      .preprocess()                  [lena,   proc]                    Method Chaining
                                                                        jQuery
                                     .                                  Method Chaining
                                                                        Extended
          .background()              [lena,   proc, background]        Climb
            .fill(red)                [lena,   proc, background]         Image Processing
                                                                        Implementation
          .end()                     [lena,   proc]                     Attempts
                                                                        Dollar macro

                                     .                                 Extensions
                                                                        Modifiers
          .foreground()              [lena,   proc, foreground]         Parallel

             .fill(green)             [lena,   proc, foreground]        Example

          .end()                     [lena,   proc]                    Conclusion

    .

             Feels more like a hack
             Hard to know which methods push to the stack
             Elements in the stack cannot be garbage collected
13 / 19                                                           Christopher Chedeau
Chaining Operator in
                                        Climb
  Introduction of // Macro
    ($ (load ”lena.png”)          Introduction

      (preprocess)                Method Chaining
                                   jQuery
                                   Method Chaining
                                   Extended
          (//                     Climb
            ((background)          Image Processing
                                   Implementation
             (fill red))            Attempts
                                   Dollar macro

                                  Extensions
           ((foreground)           Modifiers
                                   Parallel

            (fill green))))        Example

                                  Conclusion




14 / 19                      Christopher Chedeau
Chaining Operator in
                                                        Climb
  Introduction of // Macro
    ($ (load ”lena.png”)                          Introduction

      (preprocess)                                Method Chaining
                                                   jQuery
                                                   Method Chaining
                                                   Extended
          (//                                     Climb
            ((background   )                       Image Processing
                                                   Implementation
             (fill red))                            Attempts
                                                   Dollar macro

                                                  Extensions
           ((foreground )                          Modifiers
                                                   Parallel

            (fill green))))                        Example

                                                  Conclusion




            Explicit dispatch of the value



14 / 19                                      Christopher Chedeau
Chaining Operator in
                                                               Climb
  Introduction of // Macro
    ($ (load ”lena.png”)                                 Introduction

      (preprocess)                                       Method Chaining
                                                          jQuery
                                                          Method Chaining
                                                          Extended
          (//                                            Climb
            ((background)                                 Image Processing
                                                          Implementation
             (fill red))                                   Attempts
                                                          Dollar macro

                                                         Extensions
           ((foreground)                                  Modifiers
                                                          Parallel

            (fill green)))                                Example

                                                         Conclusion

          (combine      ))

            Explicit dispatch of the value
            Last value of branch can be collected


14 / 19                                             Christopher Chedeau
Chaining Operator in
                                                                     Climb
  Example
                                                               Introduction

                                                               Method Chaining
           Otsu             Sauvola 1       Sauvola 5           jQuery
                                                                Method Chaining
                                                                Extended

                                                               Climb
                                                                Image Processing
                                                                Implementation
                                                                Attempts
                                                                Dollar macro

                                                               Extensions
                                                                Modifiers
                                                                Parallel

      Otsu - Sauvola 1   Otsu - Sauvola 5 Sauvola 1 - 5        Example

                                                               Conclusion




15 / 19                                                   Christopher Chedeau
Chaining Operator in
                                          Climb
  Example
    ($ (load ”lenagray.png”)
                                    Introduction

                                    Method Chaining
                                     jQuery
                                     Method Chaining
                                     Extended

                                    Climb
                                     Image Processing
                                     Implementation
                                     Attempts
                                     Dollar macro

                                    Extensions
                                     Modifiers
                                     Parallel

                                    Example

                                    Conclusion




16 / 19                        Christopher Chedeau
Chaining Operator in
                                          Climb
  Example
    ($ (load ”lenagray.png”)
                                    Introduction
       (//                          Method Chaining
                                     jQuery
                                     Method Chaining
                                     Extended

                                    Climb
                                     Image Processing
                                     Implementation
                                     Attempts
                                     Dollar macro

                                    Extensions
                                     Modifiers
                                     Parallel

                                    Example

                                    Conclusion




16 / 19                        Christopher Chedeau
Chaining Operator in
                                          Climb
  Example
    ($ (load ”lenagray.png”)
                                    Introduction
       (//                          Method Chaining
         (’(timer−start)             jQuery
                                     Method Chaining
                                     Extended

                                    Climb
                                     Image Processing
                                     Implementation
                                     Attempts
                                     Dollar macro

                                    Extensions
                                     Modifiers
                                     Parallel

                                    Example

                                    Conclusion




16 / 19                        Christopher Chedeau
Chaining Operator in
                                             Climb
  Example
    ($ (load ”lenagray.png”)
                                       Introduction
       (//                             Method Chaining
         (’(timer−start) (otsu)         jQuery
                                        Method Chaining
                                        Extended

                                       Climb
                                        Image Processing
                                        Implementation
                                        Attempts
                                        Dollar macro

                                       Extensions
                                        Modifiers
                                        Parallel

                                       Example

                                       Conclusion




16 / 19                           Christopher Chedeau
Chaining Operator in
                                             Climb
  Example
    ($ (load ”lenagray.png”)
                                       Introduction
       (//                             Method Chaining
         (’(timer−start) (otsu)         jQuery
                                        Method Chaining
          ’(timer−print ”Otsu”)         Extended

                                       Climb
                                        Image Processing
                                        Implementation
                                        Attempts
                                        Dollar macro

                                       Extensions
                                        Modifiers
                                        Parallel

                                       Example

                                       Conclusion




16 / 19                           Christopher Chedeau
Chaining Operator in
                                                                     Climb
  Example
    ($ (load ”lenagray.png”)
                                                               Introduction
       (//                                                     Method Chaining
         (’(timer−start) (otsu)                                 jQuery
                                                                Method Chaining
          ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1         Extended

                                                               Climb
                                                                Image Processing
                                                                Implementation
                                                                Attempts
                                                                Dollar macro

                                                               Extensions
                                                                Modifiers
                                                                Parallel

                                                               Example

                                                               Conclusion




16 / 19                                                   Christopher Chedeau
Chaining Operator in
                                                                              Climb
  Example
    ($ (load ”lenagray.png”)
                                                                        Introduction
       (//                                                              Method Chaining
         (’(timer−start) (otsu)                                          jQuery
                                                                         Method Chaining
          ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1                  Extended

         (’(timer−start) (sauvola (box2d 1))                            Climb
                                                                         Image Processing
          ’(timer−print ”Sauvola 1”) (save ”sauvola1.png”)) ; $2         Implementation
                                                                         Attempts
                                                                         Dollar macro

                                                                        Extensions
                                                                         Modifiers
                                                                         Parallel

                                                                        Example

                                                                        Conclusion




16 / 19                                                            Christopher Chedeau
Chaining Operator in
                                                                               Climb
  Example
    ($ (load ”lenagray.png”)
                                                                         Introduction
       (//                                                               Method Chaining
         (’(timer−start) (otsu)                                           jQuery
                                                                          Method Chaining
          ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1                   Extended

         (’(timer−start) (sauvola (box2d 1))                             Climb
                                                                          Image Processing
          ’(timer−print ”Sauvola 1”) (save ”sauvola1.png”)) ; $2          Implementation
                                                                          Attempts

         (’(timer−start) (sauvola (box2d 5))                              Dollar macro

                                                                         Extensions
          ’(timer−print ”Sauvola 5”) (save ”sauvola5.png”))) ; $3         Modifiers
                                                                          Parallel

                                                                         Example

                                                                         Conclusion




16 / 19                                                             Christopher Chedeau
Chaining Operator in
                                                                               Climb
  Example
    ($ (load ”lenagray.png”)
                                                                         Introduction
       (//                                                               Method Chaining
         (’(timer−start) (otsu)                                           jQuery
                                                                          Method Chaining
          ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1                   Extended

         (’(timer−start) (sauvola (box2d 1))                             Climb
                                                                          Image Processing
          ’(timer−print ”Sauvola 1”) (save ”sauvola1.png”)) ; $2          Implementation
                                                                          Attempts

         (’(timer−start) (sauvola (box2d 5))                              Dollar macro

                                                                         Extensions
          ’(timer−print ”Sauvola 5”) (save ”sauvola5.png”))) ; $3         Modifiers
                                                                          Parallel
       (//
                                                                         Example
         (#(diff $1 $2)
                                                                         Conclusion




16 / 19                                                             Christopher Chedeau
Chaining Operator in
                                                                               Climb
  Example
    ($ (load ”lenagray.png”)
                                                                         Introduction
       (//                                                               Method Chaining
         (’(timer−start) (otsu)                                           jQuery
                                                                          Method Chaining
          ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1                   Extended

         (’(timer−start) (sauvola (box2d 1))                             Climb
                                                                          Image Processing
          ’(timer−print ”Sauvola 1”) (save ”sauvola1.png”)) ; $2          Implementation
                                                                          Attempts

         (’(timer−start) (sauvola (box2d 5))                              Dollar macro

                                                                         Extensions
          ’(timer−print ”Sauvola 5”) (save ”sauvola5.png”))) ; $3         Modifiers
                                                                          Parallel
       (//
                                                                         Example
         (#(diff $1 $2) (save ”diff1.png”))
                                                                         Conclusion




16 / 19                                                             Christopher Chedeau
Chaining Operator in
                                                                               Climb
  Example
    ($ (load ”lenagray.png”)
                                                                         Introduction
       (//                                                               Method Chaining
         (’(timer−start) (otsu)                                           jQuery
                                                                          Method Chaining
          ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1                   Extended

         (’(timer−start) (sauvola (box2d 1))                             Climb
                                                                          Image Processing
          ’(timer−print ”Sauvola 1”) (save ”sauvola1.png”)) ; $2          Implementation
                                                                          Attempts

         (’(timer−start) (sauvola (box2d 5))                              Dollar macro

                                                                         Extensions
          ’(timer−print ”Sauvola 5”) (save ”sauvola5.png”))) ; $3         Modifiers
                                                                          Parallel
       (//
                                                                         Example
         (#(diff $1 $2) (save ”diff1.png”))
                                                                         Conclusion
         (#(diff $1 $3) (save ”diff2.png”))
         (#(diff $2 $3) (save ”diff3.png”))))




16 / 19                                                             Christopher Chedeau
Chaining Operator in
                                                                               Climb
  Example
    ($ (load ”lenagray.png”)
                                                                         Introduction
       (//                                                               Method Chaining
         (’(timer−start) (otsu)                                           jQuery
                                                                          Method Chaining
          ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1                   Extended

         (’(timer−start) (sauvola (box2d 1))                             Climb
                                                                          Image Processing
          ’(timer−print ”Sauvola 1”) (save ”sauvola1.png”)) ; $2          Implementation
                                                                          Attempts

         (’(timer−start) (sauvola (box2d 5))                              Dollar macro

                                                                         Extensions
          ’(timer−print ”Sauvola 5”) (save ”sauvola5.png”))) ; $3         Modifiers
                                                                          Parallel
       (//
                                                                         Example
         (#(diff $1 $2) (save ”diff1.png”))
                                                                         Conclusion
         (#(diff $1 $3) (save ”diff2.png”))
         (#(diff $2 $3) (save ”diff3.png”))))

    ; Otsu: 101ms
    ; Sauvola 1: 263ms
    ; Sauvola 5: 3407ms
16 / 19                                                             Christopher Chedeau
Chaining Operator in
                                                                        Climb
  Conclusion
                                                                  Introduction

                                                                  Method Chaining
          Chaining Operator                                        jQuery
                                                                   Method Chaining
            •   Ease of use                                        Extended

            •   Entire API has to be rethought                    Climb
                                                                   Image Processing
          Related Work                                             Implementation
                                                                   Attempts
                                                                   Dollar macro
            •   Implementation of two Component Tree              Extensions
                algorithms ([NC04], [BGL+ 07])                     Modifiers
                                                                   Parallel
            •   Overhaul of Value representation                  Example
            •   Rationalization of Site Set interface             Conclusion

          Next Steps
            •   New design patterns from dynamic languages
            •   Explore image processing in the browser



17 / 19                                                      Christopher Chedeau
Chaining Operator in
                           Climb
  Questions ?
                     Introduction

                     Method Chaining
                      jQuery
                      Method Chaining
                      Extended

                     Climb
                      Image Processing
                      Implementation
                      Attempts
                      Dollar macro

                     Extensions
                      Modifiers
                      Parallel

                     Example

                     Conclusion




18 / 19         Christopher Chedeau
Chaining Operator in
                                                                            Climb
  Bibliography
                                                                      Introduction
          Christophe Berger, Thierry G´raud, Roland Levillain,
                                       e                              Method Chaining
                                                                       jQuery
          Nicolas Widynski, Anthony Baillard, and Emmanuel             Method Chaining
                                                                       Extended
          Bertin, Effective component tree computation with            Climb
          application to pattern recognition in astronomical           Image Processing
                                                                       Implementation
          imaging, Proceedings of the IEEE International               Attempts
                                                                       Dollar macro

          Conference on Image Processing (ICIP) (San                  Extensions
                                                                       Modifiers
          Antonio, TX, USA), vol. 4, September 2007,                   Parallel


          pp. IV–41–IV–44.                                            Example

                                                                      Conclusion

          L. Najman and M. Couprie, Quasi-linear algorithm
          for the component tree, IS&T/SPIE Symposium on
          Electronic Imaging, In Vision Geometry XII, 2004,
          pp. 18–22.


19 / 19                                                          Christopher Chedeau

Más contenido relacionado

Último

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Último (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Slides

  • 1. Chaining Operator in Climb Introduction Chaining Operator in Climb Method Chaining jQuery Method Chaining Extended Climb Christopher Chedeau Image Processing Implementation Attempts Dollar macro LRDE Extensions Laboratoire de Recherche et D´veloppement d’EPITA e Modifiers Parallel Example July 5, 2011 Conclusion http://lrde.epita.fr/ 1 / 19 Christopher Chedeau
  • 2. Chaining Operator in Climb Introduction Method Chaining Introduction jQuery Method Chaining Method Chaining jQuery Method Chaining Extended Extended Climb Climb Image Processing Implementation Attempts Image Processing Dollar macro Implementation Attempts Extensions Modifiers Dollar macro Parallel Example Extensions Conclusion Modifiers Parallel Example Conclusion 2 / 19 Christopher Chedeau
  • 3. Chaining Operator in Climb jQuery Old browsers are full of compatibility issues Introduction Method Chaining jQuery Method Chaining Extended Climb Image Processing Implementation Attempts jQuery1 is a [...] JavaScript Library that Dollar macro Extensions simplifies HTML document traversing Modifiers Parallel Example Conclusion 1 http://jquery.com/ 3 / 19 Christopher Chedeau
  • 4. Chaining Operator in Climb Method Chaining Introduction Method Chaining jQuery Method Chaining Extended Intuitive API Climb Image Processing Heavily rely on Method Chaining Implementation Attempts Dollar macro $(”a”) Extensions .addClass(”external”) Modifiers Parallel .attr(”target”, ” blank”) Example .click(function () { /∗ analytics call ∗/ }) Conclusion 4 / 19 Christopher Chedeau
  • 5. Chaining Operator in Climb Method Chaining in Javascript function Object() {} It works in any Object Introduction Method Chaining Object.prototype = { Oriented language: jQuery methodA: function () { C++ Method Chaining Extended // do something Climb Java Image Processing return this; Implementation Attempts }, PHP Dollar macro Extensions methodB: function () { C# Modifiers Parallel // do something ... Example return this; Conclusion } }; var obj = new Object(); obj.methodA().methodB(); 5 / 19 Christopher Chedeau
  • 6. Chaining Operator in Climb Extended Chaining HTML Document Traversing Introduction $(”li”) // li: List Item Method Chaining jQuery .has(”ul”) // ul: Unordered List Method Chaining Extended .eq(1) Climb .parent() Image Processing Implementation Attempts Dollar macro Extensions Modifiers Parallel Example Conclusion 6 / 19 Christopher Chedeau
  • 7. Chaining Operator in Climb Extended Chaining HTML Document Traversing Introduction $(”li”) // li: List Item Method Chaining jQuery .has(”ul”) // ul: Unordered List Method Chaining Extended .eq(1) Climb .parent() Image Processing Implementation Attempts SQL Query Dollar macro Extensions SQL(”select”) Modifiers Parallel .field(”∗”) Example .table(”users”) Conclusion .limit(10) 6 / 19 Christopher Chedeau
  • 8. Chaining Operator in Climb Extended Chaining HTML Document Traversing Introduction $(”li”) // li: List Item Method Chaining jQuery .has(”ul”) // ul: Unordered List Method Chaining Extended .eq(1) Climb .parent() Image Processing Implementation Attempts SQL Query Dollar macro Extensions SQL(”select”) Modifiers Parallel .field(”∗”) Example .table(”users”) Conclusion .limit(10) Asynchronous Tasks $(”<div/>”) .fetch(”navigation.html”) // Asynchronous .addClass(”column”) .appendTo(”#side”) 6 / 19 Christopher Chedeau
  • 9. Chaining Operator in Climb Image processing Introduction Method Chaining jQuery Method Chaining Image processing chains can be expressed through Extended Climb method chaining Image Processing Implementation Attempts Image(”lena.jpg”) Dollar macro .togray() Extensions Modifiers .otsu() Parallel Example .opening(8 connectivity) Conclusion .save(”lena opening.png”) 7 / 19 Christopher Chedeau
  • 10. Chaining Operator in Climb Straight Common Lisp Implementation Introduction Method Chaining jQuery Method Chaining Common Lisp methods do not belong to classes Extended Climb (let ((img (load ”lena.jpg”))) Image Processing Implementation (setf img (togray img)) Attempts Dollar macro (setf img (otsu img)) Extensions (setf img (opening img (8-connectivity))) Modifiers Parallel (save img ”lena opening.png”)) Example Conclusion 8 / 19 Christopher Chedeau
  • 11. Chaining Operator in Climb Straight Common Lisp Implementation Introduction Method Chaining jQuery Method Chaining Common Lisp methods do not belong to classes Extended Climb (let ((img (load ”lena.jpg”))) Image Processing Implementation (setf img (togray img)) Attempts Dollar macro (setf img (otsu img)) Extensions (setf img (opening img (8-connectivity))) Modifiers Parallel (save img ”lena opening.png”)) Example Conclusion The temporary variable is written 8 times 8 / 19 Christopher Chedeau
  • 12. Chaining Operator in Climb Without Temporary Variable Introduction (save Method Chaining (opening jQuery Method Chaining (otsu Extended Climb (togray Image Processing Implementation (load ”lena.jpg”) Attempts Dollar macro ) Extensions ) Modifiers Parallel (8−connectivity)) Example ”lena opening.png”) Conclusion 9 / 19 Christopher Chedeau
  • 13. Chaining Operator in Climb Without Temporary Variable Introduction (save Method Chaining (opening jQuery Method Chaining (otsu Extended Climb (togray Image Processing Implementation (load ”lena.jpg”) Attempts Dollar macro ) Extensions ) Modifiers Parallel (8−connectivity)) Example ”lena opening.png”) Conclusion Functions executed last are written first 9 / 19 Christopher Chedeau
  • 14. Chaining Operator in Climb Without Temporary Variable Introduction (save Method Chaining (opening jQuery Method Chaining (otsu Extended Climb (togray Image Processing Implementation (load ”lena.jpg”) Attempts Dollar macro ) Extensions ) Modifiers Parallel (8−connectivity)) Example ”lena opening.png”) Conclusion Functions executed last are written first Arguments are far away from function name 9 / 19 Christopher Chedeau
  • 15. Chaining Operator in Climb Introduction of Dollar $ Macro Dollar $ Macro Method Chaining Introduction Method Chaining ($ (load ”lena.jpg”) Image(”lena.jpg”) jQuery Method Chaining (togray) .togray() Extended Climb (otsu) .otsu() Image Processing (opening 8−connectivity) .opening(8 connectivity) Implementation Attempts Dollar macro (save ”lena opening.png”)) .save(”lena opening.png”) Extensions Modifiers Parallel Example It takes a sequence of actions Conclusion 10 / 19 Christopher Chedeau
  • 16. Chaining Operator in Climb Introduction of Dollar $ Macro Dollar $ Macro Method Chaining Introduction Method Chaining ($ (load ”lena.jpg”) Image(”lena.jpg”) jQuery Method Chaining (togray ) .togray() Extended Climb (otsu) .otsu() Image Processing (opening 8−connectivity) .opening(8 connectivity) Implementation Attempts Dollar macro (save ”lena opening.png”)) .save(”lena opening.png”) Extensions Modifiers Parallel Example It takes a sequence of actions Conclusion The result of each action is passed as first argument on the next Rewritten either with or without temporary variable Can express all the method chaining features 10 / 19 Christopher Chedeau
  • 17. Chaining Operator in Climb Modifiers Introduction Method Chaining jQuery Method Chaining Extended Not everything fits in the chaining pattern Climb Image Processing Implementation ($ (action) Attempts Dollar macro ’(print ”Something”) Extensions Modifiers (action)) Parallel Example Conclusion 11 / 19 Christopher Chedeau
  • 18. Chaining Operator in Climb Modifiers Introduction Method Chaining jQuery Method Chaining Extended Not everything fits in the chaining pattern Climb Image Processing Implementation ($ (action) Attempts Dollar macro ’(print ”Something”) Extensions Modifiers (action)) Parallel Example We introduce the quote ’ modifier Conclusion 11 / 19 Christopher Chedeau
  • 19. Chaining Operator in Climb Modifiers Normal behavior Introduction (before) Method Chaining jQuery (action arg) Method Chaining Extended (after ) Climb Image Processing Implementation Attempts Dollar macro Extensions Modifiers Parallel Example Conclusion 12 / 19 Christopher Chedeau
  • 20. Chaining Operator in Climb Modifiers Normal behavior Introduction (before) Method Chaining jQuery (action arg) Method Chaining Extended (after ) Climb Image Processing Quote ’ Modifier Implementation Attempts Dollar macro (before) $1, $2 ... Extensions Modifiers ’(action arg $1) Parallel (after ) Example Conclusion 12 / 19 Christopher Chedeau
  • 21. Chaining Operator in Climb Modifiers Normal behavior Introduction (before) Method Chaining jQuery (action arg) Method Chaining Extended (after ) Climb Image Processing Quote ’ Modifier Implementation Attempts Dollar macro (before) $1, $2 ... Extensions Modifiers ’(action arg $1) Parallel (after ) Example Conclusion Sharp # Modifier (before) $1, $2 ... #(action arg $1) (after ) 12 / 19 Christopher Chedeau
  • 22. Chaining Operator in Climb Grouped Actions Image(”lena.png”) Introduction .preprocess() Method Chaining jQuery Method Chaining Extended .background() Climb .fill(red) Image Processing Implementation Attempts Dollar macro Extensions Modifiers .foreground() Parallel .fill(green) Example Conclusion . 13 / 19 Christopher Chedeau
  • 23. Chaining Operator in Climb Grouped Actions Image(”lena.png”) [lena] Introduction .preprocess() [lena, proc] Method Chaining jQuery . Method Chaining Extended .background() [lena, proc, background] Climb .fill(red) [lena, proc, background] Image Processing Implementation .end() [lena, proc] Attempts Dollar macro . Extensions Modifiers .foreground() [lena, proc, foreground] Parallel .fill(green) [lena, proc, foreground] Example .end() [lena, proc] Conclusion . Feels more like a hack Hard to know which methods push to the stack Elements in the stack cannot be garbage collected 13 / 19 Christopher Chedeau
  • 24. Chaining Operator in Climb Introduction of // Macro ($ (load ”lena.png”) Introduction (preprocess) Method Chaining jQuery Method Chaining Extended (// Climb ((background) Image Processing Implementation (fill red)) Attempts Dollar macro Extensions ((foreground) Modifiers Parallel (fill green)))) Example Conclusion 14 / 19 Christopher Chedeau
  • 25. Chaining Operator in Climb Introduction of // Macro ($ (load ”lena.png”) Introduction (preprocess) Method Chaining jQuery Method Chaining Extended (// Climb ((background ) Image Processing Implementation (fill red)) Attempts Dollar macro Extensions ((foreground ) Modifiers Parallel (fill green)))) Example Conclusion Explicit dispatch of the value 14 / 19 Christopher Chedeau
  • 26. Chaining Operator in Climb Introduction of // Macro ($ (load ”lena.png”) Introduction (preprocess) Method Chaining jQuery Method Chaining Extended (// Climb ((background) Image Processing Implementation (fill red)) Attempts Dollar macro Extensions ((foreground) Modifiers Parallel (fill green))) Example Conclusion (combine )) Explicit dispatch of the value Last value of branch can be collected 14 / 19 Christopher Chedeau
  • 27. Chaining Operator in Climb Example Introduction Method Chaining Otsu Sauvola 1 Sauvola 5 jQuery Method Chaining Extended Climb Image Processing Implementation Attempts Dollar macro Extensions Modifiers Parallel Otsu - Sauvola 1 Otsu - Sauvola 5 Sauvola 1 - 5 Example Conclusion 15 / 19 Christopher Chedeau
  • 28. Chaining Operator in Climb Example ($ (load ”lenagray.png”) Introduction Method Chaining jQuery Method Chaining Extended Climb Image Processing Implementation Attempts Dollar macro Extensions Modifiers Parallel Example Conclusion 16 / 19 Christopher Chedeau
  • 29. Chaining Operator in Climb Example ($ (load ”lenagray.png”) Introduction (// Method Chaining jQuery Method Chaining Extended Climb Image Processing Implementation Attempts Dollar macro Extensions Modifiers Parallel Example Conclusion 16 / 19 Christopher Chedeau
  • 30. Chaining Operator in Climb Example ($ (load ”lenagray.png”) Introduction (// Method Chaining (’(timer−start) jQuery Method Chaining Extended Climb Image Processing Implementation Attempts Dollar macro Extensions Modifiers Parallel Example Conclusion 16 / 19 Christopher Chedeau
  • 31. Chaining Operator in Climb Example ($ (load ”lenagray.png”) Introduction (// Method Chaining (’(timer−start) (otsu) jQuery Method Chaining Extended Climb Image Processing Implementation Attempts Dollar macro Extensions Modifiers Parallel Example Conclusion 16 / 19 Christopher Chedeau
  • 32. Chaining Operator in Climb Example ($ (load ”lenagray.png”) Introduction (// Method Chaining (’(timer−start) (otsu) jQuery Method Chaining ’(timer−print ”Otsu”) Extended Climb Image Processing Implementation Attempts Dollar macro Extensions Modifiers Parallel Example Conclusion 16 / 19 Christopher Chedeau
  • 33. Chaining Operator in Climb Example ($ (load ”lenagray.png”) Introduction (// Method Chaining (’(timer−start) (otsu) jQuery Method Chaining ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1 Extended Climb Image Processing Implementation Attempts Dollar macro Extensions Modifiers Parallel Example Conclusion 16 / 19 Christopher Chedeau
  • 34. Chaining Operator in Climb Example ($ (load ”lenagray.png”) Introduction (// Method Chaining (’(timer−start) (otsu) jQuery Method Chaining ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1 Extended (’(timer−start) (sauvola (box2d 1)) Climb Image Processing ’(timer−print ”Sauvola 1”) (save ”sauvola1.png”)) ; $2 Implementation Attempts Dollar macro Extensions Modifiers Parallel Example Conclusion 16 / 19 Christopher Chedeau
  • 35. Chaining Operator in Climb Example ($ (load ”lenagray.png”) Introduction (// Method Chaining (’(timer−start) (otsu) jQuery Method Chaining ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1 Extended (’(timer−start) (sauvola (box2d 1)) Climb Image Processing ’(timer−print ”Sauvola 1”) (save ”sauvola1.png”)) ; $2 Implementation Attempts (’(timer−start) (sauvola (box2d 5)) Dollar macro Extensions ’(timer−print ”Sauvola 5”) (save ”sauvola5.png”))) ; $3 Modifiers Parallel Example Conclusion 16 / 19 Christopher Chedeau
  • 36. Chaining Operator in Climb Example ($ (load ”lenagray.png”) Introduction (// Method Chaining (’(timer−start) (otsu) jQuery Method Chaining ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1 Extended (’(timer−start) (sauvola (box2d 1)) Climb Image Processing ’(timer−print ”Sauvola 1”) (save ”sauvola1.png”)) ; $2 Implementation Attempts (’(timer−start) (sauvola (box2d 5)) Dollar macro Extensions ’(timer−print ”Sauvola 5”) (save ”sauvola5.png”))) ; $3 Modifiers Parallel (// Example (#(diff $1 $2) Conclusion 16 / 19 Christopher Chedeau
  • 37. Chaining Operator in Climb Example ($ (load ”lenagray.png”) Introduction (// Method Chaining (’(timer−start) (otsu) jQuery Method Chaining ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1 Extended (’(timer−start) (sauvola (box2d 1)) Climb Image Processing ’(timer−print ”Sauvola 1”) (save ”sauvola1.png”)) ; $2 Implementation Attempts (’(timer−start) (sauvola (box2d 5)) Dollar macro Extensions ’(timer−print ”Sauvola 5”) (save ”sauvola5.png”))) ; $3 Modifiers Parallel (// Example (#(diff $1 $2) (save ”diff1.png”)) Conclusion 16 / 19 Christopher Chedeau
  • 38. Chaining Operator in Climb Example ($ (load ”lenagray.png”) Introduction (// Method Chaining (’(timer−start) (otsu) jQuery Method Chaining ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1 Extended (’(timer−start) (sauvola (box2d 1)) Climb Image Processing ’(timer−print ”Sauvola 1”) (save ”sauvola1.png”)) ; $2 Implementation Attempts (’(timer−start) (sauvola (box2d 5)) Dollar macro Extensions ’(timer−print ”Sauvola 5”) (save ”sauvola5.png”))) ; $3 Modifiers Parallel (// Example (#(diff $1 $2) (save ”diff1.png”)) Conclusion (#(diff $1 $3) (save ”diff2.png”)) (#(diff $2 $3) (save ”diff3.png”)))) 16 / 19 Christopher Chedeau
  • 39. Chaining Operator in Climb Example ($ (load ”lenagray.png”) Introduction (// Method Chaining (’(timer−start) (otsu) jQuery Method Chaining ’(timer−print ”Otsu”) (save ”otsu.png”)) ; $1 Extended (’(timer−start) (sauvola (box2d 1)) Climb Image Processing ’(timer−print ”Sauvola 1”) (save ”sauvola1.png”)) ; $2 Implementation Attempts (’(timer−start) (sauvola (box2d 5)) Dollar macro Extensions ’(timer−print ”Sauvola 5”) (save ”sauvola5.png”))) ; $3 Modifiers Parallel (// Example (#(diff $1 $2) (save ”diff1.png”)) Conclusion (#(diff $1 $3) (save ”diff2.png”)) (#(diff $2 $3) (save ”diff3.png”)))) ; Otsu: 101ms ; Sauvola 1: 263ms ; Sauvola 5: 3407ms 16 / 19 Christopher Chedeau
  • 40. Chaining Operator in Climb Conclusion Introduction Method Chaining Chaining Operator jQuery Method Chaining • Ease of use Extended • Entire API has to be rethought Climb Image Processing Related Work Implementation Attempts Dollar macro • Implementation of two Component Tree Extensions algorithms ([NC04], [BGL+ 07]) Modifiers Parallel • Overhaul of Value representation Example • Rationalization of Site Set interface Conclusion Next Steps • New design patterns from dynamic languages • Explore image processing in the browser 17 / 19 Christopher Chedeau
  • 41. Chaining Operator in Climb Questions ? Introduction Method Chaining jQuery Method Chaining Extended Climb Image Processing Implementation Attempts Dollar macro Extensions Modifiers Parallel Example Conclusion 18 / 19 Christopher Chedeau
  • 42. Chaining Operator in Climb Bibliography Introduction Christophe Berger, Thierry G´raud, Roland Levillain, e Method Chaining jQuery Nicolas Widynski, Anthony Baillard, and Emmanuel Method Chaining Extended Bertin, Effective component tree computation with Climb application to pattern recognition in astronomical Image Processing Implementation imaging, Proceedings of the IEEE International Attempts Dollar macro Conference on Image Processing (ICIP) (San Extensions Modifiers Antonio, TX, USA), vol. 4, September 2007, Parallel pp. IV–41–IV–44. Example Conclusion L. Najman and M. Couprie, Quasi-linear algorithm for the component tree, IS&T/SPIE Symposium on Electronic Imaging, In Vision Geometry XII, 2004, pp. 18–22. 19 / 19 Christopher Chedeau