SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Downloaden Sie, um offline zu lesen
Tutorial


                              August 28, 2007


Contents
1   ParenScript Tutorial                                                       1

2   Setting up the ParenScript environment                                     1

3   A simple embedded example                                                  2

4   Adding an inline ParenScript                                               2

5   Generating a JavaScript ïŹle                                                4

6   A ParenScript slideshow                                                    5

7   Customizing the slideshow                                               10


1    ParenScript Tutorial
This chapter is a short introductory tutorial to ParenScript. It hopefully will
give you an idea how ParenScript can be used in a Lisp web application.


2    Setting up the ParenScript environment
In this tutorial, we will use the Portable Allegroserve webserver to serve the
tutorial web application. We use the ASDF system to load both Allegroserve
and ParenScript. I assume you have installed and downloaded Allegroserve
and Parenscript, and know how to setup the central registry for ASDF.

       (asdf:oos ’asdf:load-op :aserve)

       ; ... lots of compiler output ...

       (asdf:oos ’asdf:load-op :parenscript)

       ; ... lots of compiler output ...

The tutorial will be placed in its own package, which we ïŹrst have to deïŹne.




                                      1
(defpackage :js-tutorial
         (:use :common-lisp :net.aserve :net.html.generator :parenscript))

       (in-package :js-tutorial)

The next command starts the webserver on the port 8080.

       (start :port 8080)

We are now ready to generate the ïŹrst JavaScript-enabled webpages using
ParenScript.


3    A simple embedded example
The ïŹrst document we will generate is a simple HTML document, which fea-
tures a single hyperlink. When clicking the hyperlink, a JavaScript handler
opens a popup alert window with the string “Hello world”. To facilitate the
development, we will factor out the HTML generation to a separate function,
and setup a handler for the url “/tutorial1”, which will generate HTTP headers
and call the function TUTORIAL1. At ïŹrst, our function does nothing.

       (defun tutorial1 (req ent)
         (declare (ignore req ent))
         nil)

       (publish :path "/tutorial1"
                :content-type "text/html; charset=ISO-8859-1"
                :function (lambda (req ent)
                            (with-http-response (req ent)
                              (with-http-body (req ent)
                                (tutorial1 req ent)))))

Browsing “http://localhost:8080/tutorial1” should return an empty HTML page.
It’s now time to ïŹll this rather page with content. ParenScript features a macro
that generates a string that can be used as an attribute value of HTML nodes.

       (defun tutorial1 (req ent)
         (declare (ignore req ent))
         (html
          (:html
           (:head (:title "ParenScript tutorial: 1st example"))
           (:body (:h1 "ParenScript tutorial: 1st example")
                  (:p "Please click the link below." :br
                      ((:a :href "#" :onclick (ps-inline
                                                (alert "Hello World")))
                       "Hello World"))))))

Browsing “http://localhost:8080/tutorial1” should return the following HTML:

       <html><head><title>ParenScript tutorial: 1st example</title>
       </head>
       <body><h1>ParenScript tutorial: 1st example</h1>
       <p>Please click the link below.<br/>


                                      2
<a href="#"
          onclick="javascript:alert(&quot;Hello World&quot;);">Hello World</a>
       </p>
       </body>
       </html>


4    Adding an inline ParenScript
Suppose we now want to have a general greeting function. One way to do
this is to add the javascript in a SCRIPT element at the top of the HTML page.
This is done using the JS-SCRIPT macro (deïŹned below) which will generate
the necessary XML and comment tricks to cleanly embed JavaScript. We will
redeïŹne our TUTORIAL1 function and add a few links:

       (defmacro js-script (&rest body)
         "Utility macro for including ParenScript into the HTML notation
       of net.html.generator library that comes with AllegroServe."
         ‘((:script :type "text/javascript")
           (:princ (format nil "~%// <![CDATA[~%"))
           (:princ (ps ,@body))
           (:princ (format nil "~%// ]]>~%"))))

       (defun tutorial1 (req ent)
         (declare (ignore req ent))
         (html
          (:html
           (:head
            (:title "ParenScript tutorial: 2nd example")
            (js-script
             (defun greeting-callback ()
               (alert "Hello World"))))
           (:body
            (:h1 "ParenScript tutorial: 2nd example")
            (:p "Please click the link below." :br
                ((:a :href "#" :onclick (ps-inline (greeting-callback)))
                 "Hello World")
                :br "And maybe this link too." :br
                ((:a :href "#" :onclick (ps-inline (greeting-callback)))
                 "Knock knock")
                :br "And finally a third link." :br
                ((:a :href "#" :onclick (ps-inline (greeting-callback)))
                 "Hello there"))))))

This will generate the following HTML page, with the embedded JavaScript
nicely sitting on top. Take note how GREETING-CALLBACK was converted to
camelcase, and how the lispy DEFUN was converted to a JavaScript function
declaration.

       <html><head><title>ParenScript tutorial: 2nd example</title>
       <script type="text/javascript">
       // <![CDATA[
       function greetingCallback() {
         alert("Hello World");


                                      3
}
       // ]]>
       </script>
       </head>
       <body><h1>ParenScript tutorial: 2nd example</h1>
       <p>Please click the link below.<br/>
       <a href="#"
          onclick="javascript:greetingCallback();">Hello World</a>
       <br/>
       And maybe this link too.<br/>
       <a href="#"
          onclick="javascript:greetingCallback();">Knock knock</a>
       <br/>

       And finally a third link.<br/>
       <a href="#"
          onclick="javascript:greetingCallback();">Hello there</a>
       </p>
       </body>
       </html>


5    Generating a JavaScript ïŹle
The best way to integrate ParenScript into a Lisp application is to generate a
JavaScript ïŹle from ParenScript code. This ïŹle can be cached by intermediate
proxies, and webbrowsers won’t have to reload the JavaScript code on each
pageview. We will publish the tutorial JavaScript under “/tutorial.js”.

       (defun tutorial1-file (req ent)
         (declare (ignore req ent))
         (html (:princ
                (ps (defun greeting-callback ()
                      (alert "Hello World"))))))

       (publish :path "/tutorial1.js"
                :content-type "text/javascript; charset=ISO-8859-1"
                :function (lambda (req ent)
                            (with-http-response (req ent)
                              (with-http-body (req ent)
                                (tutorial1-file req ent)))))

       (defun tutorial1 (req ent)
         (declare (ignore req ent))
         (html
          (:html
           (:head
            (:title "ParenScript tutorial: 3rd example")
            ((:script :language "JavaScript" :src "/tutorial1.js")))
           (:body
            (:h1 "ParenScript tutorial: 3rd example")
            (:p "Please click the link below." :br
                ((:a :href "#" :onclick (ps-inline (greeting-callback)))
                 "Hello World")


                                      4
:br "And maybe this link too." :br
                ((:a :href "#" :onclick (ps-inline (greeting-callback)))
                 "Knock knock")
                :br "And finally a third link." :br
                ((:a :href "#" :onclick (ps-inline (greeting-callback)))
                 "Hello there"))))))

This will generate the following JavaScript code under “/tutorial1.js”:

       function greetingCallback() {
         alert("Hello World");
       }

and the following HTML code:

       <html><head><title>ParenScript tutorial: 3rd example</title>
       <script language="JavaScript" src="/tutorial1.js"></script>
       </head>
       <body><h1>ParenScript tutorial: 3rd example</h1>
       <p>Please click the link below.<br/>
       <a href="#" onclick="javascript:greetingCallback();">Hello World</a>
       <br/>
       And maybe this link too.<br/>
       <a href="#" onclick="javascript:greetingCallback();">Knock knock</a>
       <br/>

       And finally a third link.<br/>
       <a href="#" onclick="javascript:greetingCallback();">Hello there</a>
       </p>
       </body>
       </html>


6    A ParenScript slideshow
While developing ParenScript, I used JavaScript programs from the web and
rewrote them using ParenScript. This is a nice slideshow example from

            http://www.dynamicdrive.com/dynamicindex14/dhtmlslide.htm

The slideshow will be accessible under “/slideshow”, and will slide through
the images “photo1.png”, “photo2.png” and “photo3.png”. The ïŹrst Paren-
Script version will be very similar to the original JavaScript code. The second
version will then show how to integrate data from the Lisp environment into
the ParenScript code, allowing us to customize the slideshow application by
supplying a list of image names. We ïŹrst setup the slideshow path.

       (publish :path "/slideshow"
                :content-type "text/html"
                :function (lambda (req ent)
                            (with-http-response (req ent)
                              (with-http-body (req ent)
                                (slideshow req ent)))))



                                       5
(publish :path "/slideshow.js"
                :content-type "text/html"
                :function (lambda (req ent)
                            (with-http-response (req ent)
                              (with-http-body (req ent)
                                (js-slideshow req ent)))))

The images are just random ïŹles I found on my harddrive. We will publish
them by hand for now.
       (publish-file :path    "/photo1.jpg"
                     :file    "/home/viper/photo1.jpg")
       (publish-file :path    "/photo2.jpg"
                     :file    "/home/viper/photo2.jpg")
       (publish-file :path    "/photo3.jpg"
                     :file    "/home/viper/photo3.jpg")

The function SLIDESHOW generates the HTML code for the main slideshow
page. It also features little bits of ParenScript. These are the callbacks on the
links for the slideshow application. In this special case, the javascript generates
the links itself by using document.write in a “SCRIPT” element. Users that
don’t have JavaScript enabled won’t see anything at all.
    SLIDESHOW also generates a static array called PHOTOS which holds the
links to the photos of the slideshow. This array is handled by the ParenScript
code in “slideshow.js”. Note how the HTML code issued by ParenScrip is gen-
erated using the PS-HTML construct. In fact, there are two different HTML
generators in the example below, one is the AllegroServe HTML generator, and
the other is the ParenScript standard library HTML generator, which produces
a JavaScript expression which evaluates to an HTML string.
       (defun slideshow (req ent)
         (declare (ignore req ent))
         (html
          (:html
           (:head (:title "ParenScript slideshow")
                  ((:script :language "JavaScript"
                            :src "/slideshow.js"))
                  (js-script
                   (defvar *linkornot* 0)
                   (defvar photos (array "photo1.jpg"
                                         "photo2.jpg"
                                         "photo3.jpg"))))
           (:body (:h1 "ParenScript slideshow")
                (:body (:h2 "Hello")
                       ((:table :border 0
                                :cellspacing 0
                                :cellpadding 0)
                        (:tr ((:td :width "100%" :colspan 2 :height 22)
                  (:center
                   (js-script
                    (let ((img (ps-html
                                ((:img :src (aref photos 0)
                                       :name "photoslider"
                                       :style (+ "filter:"


                                        6
(lisp (ps (reveal-trans
                                                            (setf duration 2)
                                                            (setf transition 23)))))
                                       :border 0)))))
                    (document.write
                     (if (= *linkornot* 1)
                         (ps-html ((:a :href "#"
                                       :onclick (lisp (ps-inline (transport))))
                                   img))
                         img)))))))
                      (:tr ((:td :width "50%" :height "21")
                            ((:p :align "left")
                             ((:a :href "#"
                                  :onclick (ps-inline (backward)
                                                      (return false)))
                              "Previous Slide")))
                           ((:td :width "50%" :height "21")
                            ((:p :align "right")
                             ((:a :href "#"
                                  :onclick (ps-inline (forward)
                                                      (return false)))
                              "Next Slide"))))))))))

SLIDESHOW generates the following HTML code (long lines have been bro-
ken):
      <html><head><title>ParenScript slideshow</title>
      <script language="JavaScript" src="/slideshow.js"></script>
      <script type="text/javascript">
      // <![CDATA[
      var LINKORNOT = 0;
      var photos = [ "photo1.jpg", "photo2.jpg", "photo3.jpg" ];
      // ]]>
      </script>
      </head>
      <body><h1>ParenScript slideshow</h1>
      <body><h2>Hello</h2>
      <table border="0" cellspacing="0" cellpadding="0">
      <tr><td width="100%" colspan="2" height="22">
      <center><script type="text/javascript">
      // <![CDATA[
      var img =
          "<img src="" + photos[0]
          + "" name="photoslider"
            style="filter:revealTrans(duration=2,transition=23)"
            border="0"></img>";
      document.write(LINKORNOT == 1 ?
                         "<a href="#"
                             onclick="javascript:transport()">"
                         + img + "</a>"
                         : img);
      // ]]>
      </script>
      </center>
      </td>


                                   7
</tr>
       <tr><td width="50%" height="21"><p align="left">
       <a href="#"
          onclick="javascript:backward(); return false;">Previous Slide</a>

       </p>
       </td>
       <td width="50%" height="21"><p align="right">
       <a href="#"
          onclick="javascript:forward(); return false;">Next Slide</a>
       </p>
       </td>
       </tr>
       </table>
       </body>
       </body>
       </html>

The actual slideshow application is generated by the function JS-SLIDESHOW,
which generates a ParenScript ïŹle. Symbols are converted to JavaScript vari-
ables, but the dot “.” is left as is. This enables convenient access to object slots
without using the SLOT-VALUE function all the time. However, when the ob-
ject we are referring to is not a variable, but for example an element of an array,
we have to revert to SLOT-VALUE.

       (defun js-slideshow (req ent)
         (declare (ignore req ent))
         (html
          (:princ
           (ps
             (defvar *preloaded-images* (make-array))
             (defun preload-images (photos)
               (dotimes (i photos.length)
                 (setf (aref *preloaded-images* i) (new *Image)
                       (slot-value (aref *preloaded-images* i) ’src)
                       (aref photos i))))

              (defun apply-effect ()
                (when (and document.all photoslider.filters)
                  (let ((trans photoslider.filters.reveal-trans))
                    (setf (slot-value trans ’*Transition)
                          (floor (* (random) 23)))
                    (trans.stop)
                    (trans.apply))))

              (defun play-effect ()
                (when (and document.all photoslider.filters)
                  (photoslider.filters.reveal-trans.play)))

              (defvar *which* 0)

              (defun keep-track ()
                (setf window.status
                      (+ "Image " (1+ *which*) " of " photos.length)))


                                         8
(defun backward ()
              (when (> *which* 0)
                (decf *which*)
                (apply-effect)
                (setf document.images.photoslider.src
                      (aref photos *which*))
                (play-effect)
                (keep-track)))

            (defun forward ()
              (when (< *which* (1- photos.length))
                (incf *which*)
                (apply-effect)
                (setf document.images.photoslider.src
                      (aref photos *which*))
                (play-effect)
                (keep-track)))

            (defun transport ()
              (setf window.location (aref photoslink *which*)))))))

JS-SLIDESHOW generates the following JavaScript code:
      var PRELOADEDIMAGES = new Array();
      function preloadImages(photos) {
        for (var i = 0; i != photos.length; i = i++) {
          PRELOADEDIMAGES[i] = new Image;
          PRELOADEDIMAGES[i].src = photos[i];
        }
      }
      function applyEffect() {
        if (document.all && photoslider.filters) {
          var trans = photoslider.filters.revealTrans;
          trans.Transition = Math.floor(Math.random() * 23);
          trans.stop();
          trans.apply();
        }
      }
      function playEffect() {
        if (document.all && photoslider.filters) {
          photoslider.filters.revealTrans.play();
        }
      }
      var WHICH = 0;
      function keepTrack() {
        window.status = "Image " + (WHICH + 1) + " of " +
                        photos.length;
      }
      function backward() {
        if (WHICH > 0) {
          --WHICH;
          applyEffect();
          document.images.photoslider.src = photos[WHICH];
          playEffect();


                                   9
keepTrack();
         }
       }
       function forward() {
         if (WHICH < photos.length - 1) {
           ++WHICH;
           applyEffect();
           document.images.photoslider.src = photos[WHICH];
           playEffect();
           keepTrack();
         }
       }
       function transport() {
         window.location = photoslink[WHICH];
       }


7    Customizing the slideshow
For now, the slideshow has the path to all the slideshow images hardcoded in
the HTML code, as well as in the publish statements. We now want to cus-
tomize this by publishing a slideshow under a certain path, and giving it a list
of image urls and pathnames where those images can be found. For this, we
will create a function PUBLISH-SLIDESHOW which takes a preïŹx as argument,
as well as a list of image pathnames to be published.
       (defun publish-slideshow (prefix images)
         (let* ((js-url (format nil "~Aslideshow.js" prefix))
                (html-url (format nil "~Aslideshow" prefix))
                (image-urls
                 (mapcar (lambda (image)
                           (format nil "~A~A.~A" prefix
                                   (pathname-name image)
                                   (pathname-type image)))
                         images)))
           (publish :path html-url
                    :content-type "text/html"
                    :function (lambda (req ent)
                                (with-http-response (req ent)
                                  (with-http-body (req ent)
                                    (slideshow2 req ent image-urls)))))
           (publish :path js-url
                    :content-type "text/html"
                    :function (lambda (req ent)
                                (with-http-response (req ent)
                                  (with-http-body (req ent)
                                    (js-slideshow req ent)))))
           (map nil (lambda (image url)
                      (publish-file :path url
                                    :file image))
                images image-urls)))

       (defun slideshow2 (req ent image-urls)
         (declare (ignore req ent))


                                      10
(html
         (:html
          (:head (:title "ParenScript slideshow")
                 ((:script :language "JavaScript"
                           :src "/slideshow.js"))
                 ((:script :type "text/javascript")
                  (:princ (format nil "~%// <![CDATA[~%"))
                  (:princ (ps (defvar *linkornot* 0)))
                  (:princ (ps* ‘(defvar photos (array ,@image-urls))))
                  (:princ (format nil "~%// ]]>~%"))))
          (:body (:h1 "ParenScript slideshow")
               (:body (:h2 "Hello")
                      ((:table :border 0
                               :cellspacing 0
                               :cellpadding 0)
                       (:tr ((:td :width "100%" :colspan 2 :height 22)
               (:center
                (js-script
                 (let ((img (ps-html
                             ((:img :src (aref photos 0)
                                    :name "photoslider"
                                    :style (+ "filter:"
                                               (lisp (ps (reveal-trans
                                                          (setf duration 2)
                                                          (setf transition 23)))))
                                    :border 0)))))
                      (document.write
                       (if (= *linkornot* 1)
                           (ps-html ((:a :href "#"
                                         :onclick (lisp (ps-inline (transport))))
                                     img))
                           img)))))))
                       (:tr ((:td :width "50%" :height "21")
                             ((:p :align "left")
                              ((:a :href "#"
                                   :onclick (ps-inline (backward)
                                                       (return false)))
                               "Previous Slide")))
                            ((:td :width "50%" :height "21")
                             ((:p :align "right")
                              ((:a :href "#"
                                   :onclick (ps-inline (forward)
                                                       (return false)))
                               "Next Slide"))))))))))

We can now publish the same slideshow as before, under the “/bknr/” preïŹx:

      (publish-slideshow "/bknr/"
        ‘("/home/viper/photo1.jpg" "/home/viper/photo2.jpg" "/home/viper/photo3.jpg"))

That’s it, we can now access our customized slideshow under

         http://localhost:8080/bknr/slideshow




                                    11

Weitere Àhnliche Inhalte

Was ist angesagt?

Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisRuslan Shevchenko
 
An introduction to Apache Thrift
An introduction to Apache ThriftAn introduction to Apache Thrift
An introduction to Apache ThriftMike Frampton
 
Greach 2014 - Metaprogramming with groovy
Greach 2014 - Metaprogramming with groovyGreach 2014 - Metaprogramming with groovy
Greach 2014 - Metaprogramming with groovyIvĂĄn LĂłpez MartĂ­n
 
R ext world/ useR! Kiev
R ext world/ useR!  KievR ext world/ useR!  Kiev
R ext world/ useR! KievRuslan Shevchenko
 
Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)N Masahiro
 
Node.js System: The Approach
Node.js System: The ApproachNode.js System: The Approach
Node.js System: The ApproachHaci Murat Yaman
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lispfukamachi
 
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesLarge-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesHiroshi SHIBATA
 
Modern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldModern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldSATOSHI TAGOMORI
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architectureElizabeth Smith
 
Play Framework Logging
Play Framework LoggingPlay Framework Logging
Play Framework Loggingmitesh_sharma
 
Fluentd v0.12 master guide
Fluentd v0.12 master guideFluentd v0.12 master guide
Fluentd v0.12 master guideN Masahiro
 
About Clack
About ClackAbout Clack
About Clackfukamachi
 
The art of concurrent programming
The art of concurrent programmingThe art of concurrent programming
The art of concurrent programmingIskren Chernev
 
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ..."Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...Vadym Kazulkin
 
Fast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCFast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCTim Burks
 
Javascript asynchronous
Javascript asynchronousJavascript asynchronous
Javascript asynchronouskang taehun
 

Was ist angesagt? (20)

Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with this
 
An introduction to Apache Thrift
An introduction to Apache ThriftAn introduction to Apache Thrift
An introduction to Apache Thrift
 
Greach 2014 - Metaprogramming with groovy
Greach 2014 - Metaprogramming with groovyGreach 2014 - Metaprogramming with groovy
Greach 2014 - Metaprogramming with groovy
 
R ext world/ useR! Kiev
R ext world/ useR!  KievR ext world/ useR!  Kiev
R ext world/ useR! Kiev
 
Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)
 
Sql killedserver
Sql killedserverSql killedserver
Sql killedserver
 
Node.js System: The Approach
Node.js System: The ApproachNode.js System: The Approach
Node.js System: The Approach
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lisp
 
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesLarge-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 Minutes
 
Modern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldModern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real World
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
 
Play Framework Logging
Play Framework LoggingPlay Framework Logging
Play Framework Logging
 
Fluentd v0.12 master guide
Fluentd v0.12 master guideFluentd v0.12 master guide
Fluentd v0.12 master guide
 
About Clack
About ClackAbout Clack
About Clack
 
The art of concurrent programming
The art of concurrent programmingThe art of concurrent programming
The art of concurrent programming
 
RubyGems 3 & 4
RubyGems 3 & 4RubyGems 3 & 4
RubyGems 3 & 4
 
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ..."Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
 
Fast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCFast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPC
 
Javascript asynchronous
Javascript asynchronousJavascript asynchronous
Javascript asynchronous
 
PHP Development Tools
PHP  Development ToolsPHP  Development Tools
PHP Development Tools
 

Andere mochten auch

R E S E R V A T I O N P O L I C Y & S U P E R L I V I N G D R
R E S E R V A T I O N   P O L I C Y &  S U P E R L I V I N G  D RR E S E R V A T I O N   P O L I C Y &  S U P E R L I V I N G  D R
R E S E R V A T I O N P O L I C Y & S U P E R L I V I N G D Rbanothkishan
 
I S M E D I T A T I O N H A R M F U L D R S H R I N I W A S K A S H A L ...
I S  M E D I T A T I O N  H A R M F U L  D R  S H R I N I W A S  K A S H A L ...I S  M E D I T A T I O N  H A R M F U L  D R  S H R I N I W A S  K A S H A L ...
I S M E D I T A T I O N H A R M F U L D R S H R I N I W A S K A S H A L ...banothkishan
 
Active Insight - Event Stream Processing In The Cloud
Active Insight - Event Stream Processing In The CloudActive Insight - Event Stream Processing In The Cloud
Active Insight - Event Stream Processing In The CloudMike Telem
 
Winter%200405%20-%20Advanced%20Javascript
Winter%200405%20-%20Advanced%20JavascriptWinter%200405%20-%20Advanced%20Javascript
Winter%200405%20-%20Advanced%20Javascripttutorialsruby
 
D A N C E S A N D D A N C E S D R S H R I N I W A S K A S H A L I K A R
D A N C E S  A N D  D A N C E S  D R  S H R I N I W A S  K A S H A L I K A RD A N C E S  A N D  D A N C E S  D R  S H R I N I W A S  K A S H A L I K A R
D A N C E S A N D D A N C E S D R S H R I N I W A S K A S H A L I K A Rbanothkishan
 
F E S T I V A L S D R
F E S T I V A L S  D RF E S T I V A L S  D R
F E S T I V A L S D Rbanothkishan
 
N I S H K A M A K A R M A D R
N I S H K A M A  K A R M A  D RN I S H K A M A  K A R M A  D R
N I S H K A M A K A R M A D Rbanothkishan
 
CRIMINAL COMPLAINT ATTEMPTED MURDER BOYDEN GRAY
CRIMINAL COMPLAINT ATTEMPTED MURDER BOYDEN GRAY CRIMINAL COMPLAINT ATTEMPTED MURDER BOYDEN GRAY
CRIMINAL COMPLAINT ATTEMPTED MURDER BOYDEN GRAY Prayer Warriors Institute
 
Saeed Ghasemi's CV.
Saeed Ghasemi's CV.Saeed Ghasemi's CV.
Saeed Ghasemi's CV.SAEED GHASEMI
 
El modelo de la clase. Experiencia Vivencial
El modelo de la clase. Experiencia VivencialEl modelo de la clase. Experiencia Vivencial
El modelo de la clase. Experiencia VivencialPle remedio solano
 
TY08BSOoverview
TY08BSOoverviewTY08BSOoverview
TY08BSOoverviewtutorialsruby
 
Estatuas Humanas
Estatuas HumanasEstatuas Humanas
Estatuas HumanasMireia Buchaca
 
Des De Ru Ssia Amb Amor
Des De Ru Ssia Amb AmorDes De Ru Ssia Amb Amor
Des De Ru Ssia Amb AmorMireia Buchaca
 
CEO CoAdvantage D Williams Reference
CEO CoAdvantage D Williams ReferenceCEO CoAdvantage D Williams Reference
CEO CoAdvantage D Williams ReferenceChristine Bouquin
 
Experiencia de aprendizaje
Experiencia de aprendizajeExperiencia de aprendizaje
Experiencia de aprendizajePle remedio solano
 

Andere mochten auch (20)

R E S E R V A T I O N P O L I C Y & S U P E R L I V I N G D R
R E S E R V A T I O N   P O L I C Y &  S U P E R L I V I N G  D RR E S E R V A T I O N   P O L I C Y &  S U P E R L I V I N G  D R
R E S E R V A T I O N P O L I C Y & S U P E R L I V I N G D R
 
I S M E D I T A T I O N H A R M F U L D R S H R I N I W A S K A S H A L ...
I S  M E D I T A T I O N  H A R M F U L  D R  S H R I N I W A S  K A S H A L ...I S  M E D I T A T I O N  H A R M F U L  D R  S H R I N I W A S  K A S H A L ...
I S M E D I T A T I O N H A R M F U L D R S H R I N I W A S K A S H A L ...
 
perl_lessons
perl_lessonsperl_lessons
perl_lessons
 
blank-edelman
blank-edelmanblank-edelman
blank-edelman
 
Active Insight - Event Stream Processing In The Cloud
Active Insight - Event Stream Processing In The CloudActive Insight - Event Stream Processing In The Cloud
Active Insight - Event Stream Processing In The Cloud
 
Winter%200405%20-%20Advanced%20Javascript
Winter%200405%20-%20Advanced%20JavascriptWinter%200405%20-%20Advanced%20Javascript
Winter%200405%20-%20Advanced%20Javascript
 
D A N C E S A N D D A N C E S D R S H R I N I W A S K A S H A L I K A R
D A N C E S  A N D  D A N C E S  D R  S H R I N I W A S  K A S H A L I K A RD A N C E S  A N D  D A N C E S  D R  S H R I N I W A S  K A S H A L I K A R
D A N C E S A N D D A N C E S D R S H R I N I W A S K A S H A L I K A R
 
F E S T I V A L S D R
F E S T I V A L S  D RF E S T I V A L S  D R
F E S T I V A L S D R
 
N I S H K A M A K A R M A D R
N I S H K A M A  K A R M A  D RN I S H K A M A  K A R M A  D R
N I S H K A M A K A R M A D R
 
CRIMINAL COMPLAINT ATTEMPTED MURDER BOYDEN GRAY
CRIMINAL COMPLAINT ATTEMPTED MURDER BOYDEN GRAY CRIMINAL COMPLAINT ATTEMPTED MURDER BOYDEN GRAY
CRIMINAL COMPLAINT ATTEMPTED MURDER BOYDEN GRAY
 
Saeed Ghasemi's CV.
Saeed Ghasemi's CV.Saeed Ghasemi's CV.
Saeed Ghasemi's CV.
 
HERA Mural
HERA MuralHERA Mural
HERA Mural
 
El modelo de la clase. Experiencia Vivencial
El modelo de la clase. Experiencia VivencialEl modelo de la clase. Experiencia Vivencial
El modelo de la clase. Experiencia Vivencial
 
TY08BSOoverview
TY08BSOoverviewTY08BSOoverview
TY08BSOoverview
 
Estatuas Humanas
Estatuas HumanasEstatuas Humanas
Estatuas Humanas
 
Aprendizaje vivencial
Aprendizaje vivencial Aprendizaje vivencial
Aprendizaje vivencial
 
Des De Ru Ssia Amb Amor
Des De Ru Ssia Amb AmorDes De Ru Ssia Amb Amor
Des De Ru Ssia Amb Amor
 
VACCINE EXEMPTION MEMORANDUM OF LAW
VACCINE EXEMPTION MEMORANDUM OF LAWVACCINE EXEMPTION MEMORANDUM OF LAW
VACCINE EXEMPTION MEMORANDUM OF LAW
 
CEO CoAdvantage D Williams Reference
CEO CoAdvantage D Williams ReferenceCEO CoAdvantage D Williams Reference
CEO CoAdvantage D Williams Reference
 
Experiencia de aprendizaje
Experiencia de aprendizajeExperiencia de aprendizaje
Experiencia de aprendizaje
 

Ähnlich wie parenscript-tutorial

AFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack EncoreAFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack EncoreEngineor
 
Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress Maurizio Pelizzone
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3tutorialsruby
 
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/tutorialsruby
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3tutorialsruby
 
React mit TypeScript – eine glĂŒckliche Ehe
React mit TypeScript – eine glĂŒckliche EheReact mit TypeScript – eine glĂŒckliche Ehe
React mit TypeScript – eine glĂŒckliche Eheinovex GmbH
 
Zeppelin Helium: Spell
Zeppelin Helium: SpellZeppelin Helium: Spell
Zeppelin Helium: SpellPArk Hoon
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsRemy Sharp
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereLaurence Svekis ✔
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java scriptnanjil1984
 
Intro to Rack
Intro to RackIntro to Rack
Intro to RackRubyc Slides
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareAlona Mekhovova
 
JavaScript - Getting Started.pptx
JavaScript - Getting Started.pptxJavaScript - Getting Started.pptx
JavaScript - Getting Started.pptxJonnJorellPunto
 
Web Server and how we can design app in C#
Web Server and how we can design app  in C#Web Server and how we can design app  in C#
Web Server and how we can design app in C#caohansnnuedu
 
Even Faster Web Sites at The Ajax Experience
Even Faster Web Sites at The Ajax ExperienceEven Faster Web Sites at The Ajax Experience
Even Faster Web Sites at The Ajax ExperienceSteve Souders
 

Ähnlich wie parenscript-tutorial (20)

AFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack EncoreAFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack Encore
 
Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
 
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
 
React mit TypeScript – eine glĂŒckliche Ehe
React mit TypeScript – eine glĂŒckliche EheReact mit TypeScript – eine glĂŒckliche Ehe
React mit TypeScript – eine glĂŒckliche Ehe
 
Zeppelin Helium: Spell
Zeppelin Helium: SpellZeppelin Helium: Spell
Zeppelin Helium: Spell
 
Lecture8
Lecture8Lecture8
Lecture8
 
Tomcat + other things
Tomcat + other thingsTomcat + other things
Tomcat + other things
 
Day1
Day1Day1
Day1
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript Here
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
 
Intro to Rack
Intro to RackIntro to Rack
Intro to Rack
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
 
Lecture-15.pptx
Lecture-15.pptxLecture-15.pptx
Lecture-15.pptx
 
JavaScript - Getting Started.pptx
JavaScript - Getting Started.pptxJavaScript - Getting Started.pptx
JavaScript - Getting Started.pptx
 
Web Server and how we can design app in C#
Web Server and how we can design app  in C#Web Server and how we can design app  in C#
Web Server and how we can design app in C#
 
Even Faster Web Sites at The Ajax Experience
Even Faster Web Sites at The Ajax ExperienceEven Faster Web Sites at The Ajax Experience
Even Faster Web Sites at The Ajax Experience
 

Mehr von tutorialsruby

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0tutorialsruby
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentationtutorialsruby
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentationtutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 

Mehr von tutorialsruby (20)

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 

KĂŒrzlich hochgeladen

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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĂșjo
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

KĂŒrzlich hochgeladen (20)

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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

parenscript-tutorial

  • 1. Tutorial August 28, 2007 Contents 1 ParenScript Tutorial 1 2 Setting up the ParenScript environment 1 3 A simple embedded example 2 4 Adding an inline ParenScript 2 5 Generating a JavaScript ïŹle 4 6 A ParenScript slideshow 5 7 Customizing the slideshow 10 1 ParenScript Tutorial This chapter is a short introductory tutorial to ParenScript. It hopefully will give you an idea how ParenScript can be used in a Lisp web application. 2 Setting up the ParenScript environment In this tutorial, we will use the Portable Allegroserve webserver to serve the tutorial web application. We use the ASDF system to load both Allegroserve and ParenScript. I assume you have installed and downloaded Allegroserve and Parenscript, and know how to setup the central registry for ASDF. (asdf:oos ’asdf:load-op :aserve) ; ... lots of compiler output ... (asdf:oos ’asdf:load-op :parenscript) ; ... lots of compiler output ... The tutorial will be placed in its own package, which we ïŹrst have to deïŹne. 1
  • 2. (defpackage :js-tutorial (:use :common-lisp :net.aserve :net.html.generator :parenscript)) (in-package :js-tutorial) The next command starts the webserver on the port 8080. (start :port 8080) We are now ready to generate the ïŹrst JavaScript-enabled webpages using ParenScript. 3 A simple embedded example The ïŹrst document we will generate is a simple HTML document, which fea- tures a single hyperlink. When clicking the hyperlink, a JavaScript handler opens a popup alert window with the string “Hello world”. To facilitate the development, we will factor out the HTML generation to a separate function, and setup a handler for the url “/tutorial1”, which will generate HTTP headers and call the function TUTORIAL1. At ïŹrst, our function does nothing. (defun tutorial1 (req ent) (declare (ignore req ent)) nil) (publish :path "/tutorial1" :content-type "text/html; charset=ISO-8859-1" :function (lambda (req ent) (with-http-response (req ent) (with-http-body (req ent) (tutorial1 req ent))))) Browsing “http://localhost:8080/tutorial1” should return an empty HTML page. It’s now time to ïŹll this rather page with content. ParenScript features a macro that generates a string that can be used as an attribute value of HTML nodes. (defun tutorial1 (req ent) (declare (ignore req ent)) (html (:html (:head (:title "ParenScript tutorial: 1st example")) (:body (:h1 "ParenScript tutorial: 1st example") (:p "Please click the link below." :br ((:a :href "#" :onclick (ps-inline (alert "Hello World"))) "Hello World")))))) Browsing “http://localhost:8080/tutorial1” should return the following HTML: <html><head><title>ParenScript tutorial: 1st example</title> </head> <body><h1>ParenScript tutorial: 1st example</h1> <p>Please click the link below.<br/> 2
  • 3. <a href="#" onclick="javascript:alert(&quot;Hello World&quot;);">Hello World</a> </p> </body> </html> 4 Adding an inline ParenScript Suppose we now want to have a general greeting function. One way to do this is to add the javascript in a SCRIPT element at the top of the HTML page. This is done using the JS-SCRIPT macro (deïŹned below) which will generate the necessary XML and comment tricks to cleanly embed JavaScript. We will redeïŹne our TUTORIAL1 function and add a few links: (defmacro js-script (&rest body) "Utility macro for including ParenScript into the HTML notation of net.html.generator library that comes with AllegroServe." ‘((:script :type "text/javascript") (:princ (format nil "~%// <![CDATA[~%")) (:princ (ps ,@body)) (:princ (format nil "~%// ]]>~%")))) (defun tutorial1 (req ent) (declare (ignore req ent)) (html (:html (:head (:title "ParenScript tutorial: 2nd example") (js-script (defun greeting-callback () (alert "Hello World")))) (:body (:h1 "ParenScript tutorial: 2nd example") (:p "Please click the link below." :br ((:a :href "#" :onclick (ps-inline (greeting-callback))) "Hello World") :br "And maybe this link too." :br ((:a :href "#" :onclick (ps-inline (greeting-callback))) "Knock knock") :br "And finally a third link." :br ((:a :href "#" :onclick (ps-inline (greeting-callback))) "Hello there")))))) This will generate the following HTML page, with the embedded JavaScript nicely sitting on top. Take note how GREETING-CALLBACK was converted to camelcase, and how the lispy DEFUN was converted to a JavaScript function declaration. <html><head><title>ParenScript tutorial: 2nd example</title> <script type="text/javascript"> // <![CDATA[ function greetingCallback() { alert("Hello World"); 3
  • 4. } // ]]> </script> </head> <body><h1>ParenScript tutorial: 2nd example</h1> <p>Please click the link below.<br/> <a href="#" onclick="javascript:greetingCallback();">Hello World</a> <br/> And maybe this link too.<br/> <a href="#" onclick="javascript:greetingCallback();">Knock knock</a> <br/> And finally a third link.<br/> <a href="#" onclick="javascript:greetingCallback();">Hello there</a> </p> </body> </html> 5 Generating a JavaScript ïŹle The best way to integrate ParenScript into a Lisp application is to generate a JavaScript ïŹle from ParenScript code. This ïŹle can be cached by intermediate proxies, and webbrowsers won’t have to reload the JavaScript code on each pageview. We will publish the tutorial JavaScript under “/tutorial.js”. (defun tutorial1-file (req ent) (declare (ignore req ent)) (html (:princ (ps (defun greeting-callback () (alert "Hello World")))))) (publish :path "/tutorial1.js" :content-type "text/javascript; charset=ISO-8859-1" :function (lambda (req ent) (with-http-response (req ent) (with-http-body (req ent) (tutorial1-file req ent))))) (defun tutorial1 (req ent) (declare (ignore req ent)) (html (:html (:head (:title "ParenScript tutorial: 3rd example") ((:script :language "JavaScript" :src "/tutorial1.js"))) (:body (:h1 "ParenScript tutorial: 3rd example") (:p "Please click the link below." :br ((:a :href "#" :onclick (ps-inline (greeting-callback))) "Hello World") 4
  • 5. :br "And maybe this link too." :br ((:a :href "#" :onclick (ps-inline (greeting-callback))) "Knock knock") :br "And finally a third link." :br ((:a :href "#" :onclick (ps-inline (greeting-callback))) "Hello there")))))) This will generate the following JavaScript code under “/tutorial1.js”: function greetingCallback() { alert("Hello World"); } and the following HTML code: <html><head><title>ParenScript tutorial: 3rd example</title> <script language="JavaScript" src="/tutorial1.js"></script> </head> <body><h1>ParenScript tutorial: 3rd example</h1> <p>Please click the link below.<br/> <a href="#" onclick="javascript:greetingCallback();">Hello World</a> <br/> And maybe this link too.<br/> <a href="#" onclick="javascript:greetingCallback();">Knock knock</a> <br/> And finally a third link.<br/> <a href="#" onclick="javascript:greetingCallback();">Hello there</a> </p> </body> </html> 6 A ParenScript slideshow While developing ParenScript, I used JavaScript programs from the web and rewrote them using ParenScript. This is a nice slideshow example from http://www.dynamicdrive.com/dynamicindex14/dhtmlslide.htm The slideshow will be accessible under “/slideshow”, and will slide through the images “photo1.png”, “photo2.png” and “photo3.png”. The ïŹrst Paren- Script version will be very similar to the original JavaScript code. The second version will then show how to integrate data from the Lisp environment into the ParenScript code, allowing us to customize the slideshow application by supplying a list of image names. We ïŹrst setup the slideshow path. (publish :path "/slideshow" :content-type "text/html" :function (lambda (req ent) (with-http-response (req ent) (with-http-body (req ent) (slideshow req ent))))) 5
  • 6. (publish :path "/slideshow.js" :content-type "text/html" :function (lambda (req ent) (with-http-response (req ent) (with-http-body (req ent) (js-slideshow req ent))))) The images are just random ïŹles I found on my harddrive. We will publish them by hand for now. (publish-file :path "/photo1.jpg" :file "/home/viper/photo1.jpg") (publish-file :path "/photo2.jpg" :file "/home/viper/photo2.jpg") (publish-file :path "/photo3.jpg" :file "/home/viper/photo3.jpg") The function SLIDESHOW generates the HTML code for the main slideshow page. It also features little bits of ParenScript. These are the callbacks on the links for the slideshow application. In this special case, the javascript generates the links itself by using document.write in a “SCRIPT” element. Users that don’t have JavaScript enabled won’t see anything at all. SLIDESHOW also generates a static array called PHOTOS which holds the links to the photos of the slideshow. This array is handled by the ParenScript code in “slideshow.js”. Note how the HTML code issued by ParenScrip is gen- erated using the PS-HTML construct. In fact, there are two different HTML generators in the example below, one is the AllegroServe HTML generator, and the other is the ParenScript standard library HTML generator, which produces a JavaScript expression which evaluates to an HTML string. (defun slideshow (req ent) (declare (ignore req ent)) (html (:html (:head (:title "ParenScript slideshow") ((:script :language "JavaScript" :src "/slideshow.js")) (js-script (defvar *linkornot* 0) (defvar photos (array "photo1.jpg" "photo2.jpg" "photo3.jpg")))) (:body (:h1 "ParenScript slideshow") (:body (:h2 "Hello") ((:table :border 0 :cellspacing 0 :cellpadding 0) (:tr ((:td :width "100%" :colspan 2 :height 22) (:center (js-script (let ((img (ps-html ((:img :src (aref photos 0) :name "photoslider" :style (+ "filter:" 6
  • 7. (lisp (ps (reveal-trans (setf duration 2) (setf transition 23))))) :border 0))))) (document.write (if (= *linkornot* 1) (ps-html ((:a :href "#" :onclick (lisp (ps-inline (transport)))) img)) img))))))) (:tr ((:td :width "50%" :height "21") ((:p :align "left") ((:a :href "#" :onclick (ps-inline (backward) (return false))) "Previous Slide"))) ((:td :width "50%" :height "21") ((:p :align "right") ((:a :href "#" :onclick (ps-inline (forward) (return false))) "Next Slide")))))))))) SLIDESHOW generates the following HTML code (long lines have been bro- ken): <html><head><title>ParenScript slideshow</title> <script language="JavaScript" src="/slideshow.js"></script> <script type="text/javascript"> // <![CDATA[ var LINKORNOT = 0; var photos = [ "photo1.jpg", "photo2.jpg", "photo3.jpg" ]; // ]]> </script> </head> <body><h1>ParenScript slideshow</h1> <body><h2>Hello</h2> <table border="0" cellspacing="0" cellpadding="0"> <tr><td width="100%" colspan="2" height="22"> <center><script type="text/javascript"> // <![CDATA[ var img = "<img src="" + photos[0] + "" name="photoslider" style="filter:revealTrans(duration=2,transition=23)" border="0"></img>"; document.write(LINKORNOT == 1 ? "<a href="#" onclick="javascript:transport()">" + img + "</a>" : img); // ]]> </script> </center> </td> 7
  • 8. </tr> <tr><td width="50%" height="21"><p align="left"> <a href="#" onclick="javascript:backward(); return false;">Previous Slide</a> </p> </td> <td width="50%" height="21"><p align="right"> <a href="#" onclick="javascript:forward(); return false;">Next Slide</a> </p> </td> </tr> </table> </body> </body> </html> The actual slideshow application is generated by the function JS-SLIDESHOW, which generates a ParenScript ïŹle. Symbols are converted to JavaScript vari- ables, but the dot “.” is left as is. This enables convenient access to object slots without using the SLOT-VALUE function all the time. However, when the ob- ject we are referring to is not a variable, but for example an element of an array, we have to revert to SLOT-VALUE. (defun js-slideshow (req ent) (declare (ignore req ent)) (html (:princ (ps (defvar *preloaded-images* (make-array)) (defun preload-images (photos) (dotimes (i photos.length) (setf (aref *preloaded-images* i) (new *Image) (slot-value (aref *preloaded-images* i) ’src) (aref photos i)))) (defun apply-effect () (when (and document.all photoslider.filters) (let ((trans photoslider.filters.reveal-trans)) (setf (slot-value trans ’*Transition) (floor (* (random) 23))) (trans.stop) (trans.apply)))) (defun play-effect () (when (and document.all photoslider.filters) (photoslider.filters.reveal-trans.play))) (defvar *which* 0) (defun keep-track () (setf window.status (+ "Image " (1+ *which*) " of " photos.length))) 8
  • 9. (defun backward () (when (> *which* 0) (decf *which*) (apply-effect) (setf document.images.photoslider.src (aref photos *which*)) (play-effect) (keep-track))) (defun forward () (when (< *which* (1- photos.length)) (incf *which*) (apply-effect) (setf document.images.photoslider.src (aref photos *which*)) (play-effect) (keep-track))) (defun transport () (setf window.location (aref photoslink *which*))))))) JS-SLIDESHOW generates the following JavaScript code: var PRELOADEDIMAGES = new Array(); function preloadImages(photos) { for (var i = 0; i != photos.length; i = i++) { PRELOADEDIMAGES[i] = new Image; PRELOADEDIMAGES[i].src = photos[i]; } } function applyEffect() { if (document.all && photoslider.filters) { var trans = photoslider.filters.revealTrans; trans.Transition = Math.floor(Math.random() * 23); trans.stop(); trans.apply(); } } function playEffect() { if (document.all && photoslider.filters) { photoslider.filters.revealTrans.play(); } } var WHICH = 0; function keepTrack() { window.status = "Image " + (WHICH + 1) + " of " + photos.length; } function backward() { if (WHICH > 0) { --WHICH; applyEffect(); document.images.photoslider.src = photos[WHICH]; playEffect(); 9
  • 10. keepTrack(); } } function forward() { if (WHICH < photos.length - 1) { ++WHICH; applyEffect(); document.images.photoslider.src = photos[WHICH]; playEffect(); keepTrack(); } } function transport() { window.location = photoslink[WHICH]; } 7 Customizing the slideshow For now, the slideshow has the path to all the slideshow images hardcoded in the HTML code, as well as in the publish statements. We now want to cus- tomize this by publishing a slideshow under a certain path, and giving it a list of image urls and pathnames where those images can be found. For this, we will create a function PUBLISH-SLIDESHOW which takes a preïŹx as argument, as well as a list of image pathnames to be published. (defun publish-slideshow (prefix images) (let* ((js-url (format nil "~Aslideshow.js" prefix)) (html-url (format nil "~Aslideshow" prefix)) (image-urls (mapcar (lambda (image) (format nil "~A~A.~A" prefix (pathname-name image) (pathname-type image))) images))) (publish :path html-url :content-type "text/html" :function (lambda (req ent) (with-http-response (req ent) (with-http-body (req ent) (slideshow2 req ent image-urls))))) (publish :path js-url :content-type "text/html" :function (lambda (req ent) (with-http-response (req ent) (with-http-body (req ent) (js-slideshow req ent))))) (map nil (lambda (image url) (publish-file :path url :file image)) images image-urls))) (defun slideshow2 (req ent image-urls) (declare (ignore req ent)) 10
  • 11. (html (:html (:head (:title "ParenScript slideshow") ((:script :language "JavaScript" :src "/slideshow.js")) ((:script :type "text/javascript") (:princ (format nil "~%// <![CDATA[~%")) (:princ (ps (defvar *linkornot* 0))) (:princ (ps* ‘(defvar photos (array ,@image-urls)))) (:princ (format nil "~%// ]]>~%")))) (:body (:h1 "ParenScript slideshow") (:body (:h2 "Hello") ((:table :border 0 :cellspacing 0 :cellpadding 0) (:tr ((:td :width "100%" :colspan 2 :height 22) (:center (js-script (let ((img (ps-html ((:img :src (aref photos 0) :name "photoslider" :style (+ "filter:" (lisp (ps (reveal-trans (setf duration 2) (setf transition 23))))) :border 0))))) (document.write (if (= *linkornot* 1) (ps-html ((:a :href "#" :onclick (lisp (ps-inline (transport)))) img)) img))))))) (:tr ((:td :width "50%" :height "21") ((:p :align "left") ((:a :href "#" :onclick (ps-inline (backward) (return false))) "Previous Slide"))) ((:td :width "50%" :height "21") ((:p :align "right") ((:a :href "#" :onclick (ps-inline (forward) (return false))) "Next Slide")))))))))) We can now publish the same slideshow as before, under the “/bknr/” preïŹx: (publish-slideshow "/bknr/" ‘("/home/viper/photo1.jpg" "/home/viper/photo2.jpg" "/home/viper/photo3.jpg")) That’s it, we can now access our customized slideshow under http://localhost:8080/bknr/slideshow 11