old_contents:
 msg←SelectAdvanced;result;output;sel;froot;prev
⍝ Test /Examples/DC/SelectAdvanced

⍝ Ensure 'multi' (the selection list) is there:
 msg←'selection list not there'
 :If 0≢sel←Find'multi'
   ⍝ Grab the 2 elements already chosen:
     Click'PressMe'
     output←Find'output'
     {0≠⍴output.Text}Retry ⍬ ⍝ Wait to see if it gets populated
     msg←'Expected output was not produced.'
 :AndIf 'You picked: Bananas Pears'≡prev←output.Text
   ⍝ Make a single selection:
     froot←'Grapes'
    'multi'SelectByText'-'froot
         Click'PressMe'
     output←Find'output'
     {prev≢output.Text}Retry ⍬ ⍝ Wait to see if it gets populated
:AndIf (prev←output.Text)≡'You picked: ',froot
   ⍝ Make another selection:
    'multi'SelectByText'Pears'
         Click'PressMe'
     output←Find'output'
     {prev≢output.Text}Retry ⍬ ⍝ Wait to see if it gets populated
    :AndIf (prev←output.Text)≡'You picked: ',froot,' Pears'
    msg←''
 :EndIf

new_contents:
 msg←SelectAdvanced;result;output;sel;froot;prev
⍝ Test /Examples/DC/SelectAdvanced

⍝ Ensure 'multi' (the selection list) is there:
 msg←'selection list not there'
 :If 0≢sel←Find'multi'
   ⍝ Grab the 2 elements already chosen:
     Click'PressMe'
     output←Find'output'
     {0≠⍴output.Text}Retry ⍬ ⍝ Wait to see if it gets populated
     msg←'Expected output was not produced.'
 :AndIf 'You picked: Bananas Pears'≡prev←output.Text
   ⍝ Make a single selection:
     froot←'Grapes'
     'multi'SelectItemText'~'froot
     Click'PressMe'
     output←Find'output'
     {prev≢output.Text}Retry ⍬ ⍝ Wait to see if it gets populated
 :AndIf (prev←output.Text)≡'You picked: ',froot
   ⍝ Make another selection:
     'multi'SelectItemText'Pears'
     Click'PressMe'
     output←Find'output'
     {prev≢output.Text}Retry ⍬ ⍝ Wait to see if it gets populated
 :AndIf (prev←output.Text)≡'You picked: ',froot,' Pears'
     msg←''
 :EndIf

subject: Rename of SelectByText to SelectItemText

license: mit


old_contents:
:Class EditFieldSimple : MiPageSample
⍝ Control:: _DC.EditField _DC.Button _html.label
⍝ Description:: Collect input and echo it on a button press

    ∇ Compose;btn;F1;label;name
      :Access Public

      F1←'myform'Add _.Form ⍝ Create a form
      label←('for"name"')F1.Add _.label'Please enter your name'
      name←'name'F1.Add _.EditField
      done←'done'F1.Add _.Button'Done'
      done.On'click' 'CallbackFn'

      'result'F1.Add _.div ⍝ a div to contain output, updated by CallbackFn
    ∇

    ∇ r←CallbackFn
      :Access Public
      r←'#result'Replace _.p('Hello, ',(Get'name'),'!')
    ∇

:EndClass

new_contents:
:Class EditFieldSimple : MiPageSample
⍝ Control:: _DC.EditField _DC.Button _html.label
⍝ Description:: Collect input and echo it on a button press

    ∇ Compose;btn;F1;label;name
      :Access Public

      F1←'myform'Add _.Form ⍝ Create a form
      label←('for="name"')F1.Add _.label'Please enter your name'
      name←'name'F1.Add _.EditField
      done←'done'F1.Add _.Button'Done'
      done.On'click' 'CallbackFn'

      'result'F1.Add _.div ⍝ a div to contain output, updated by CallbackFn
    ∇

    ∇ r←CallbackFn
      :Access Public
      r←'#result'Replace _.p('Hello, ',(Get'name'),'!')
    ∇

:EndClass

subject: Add missing '=' in MS3/Examples/DC/EditFieldSample


old_contents:
:Class MS3Server : MiServer
⍝ This is an example of a customized MiServer
⍝ The MiServer class exposes several overridable methods that can be customized by the user
⍝ In this case we customize the onServerLoad method
⍝ The ClassName parameter in the Server.xml configuration file is used to specify the customized class

    :Include #.MS3SiteUtils ⍝∇:require =/MS3SiteUtils

    ∇ Make config
      :Access Public
      :Implements Constructor :Base config
     ⍝ Version warning
      :If 14>{⊃(//)⎕VFI ⍵/⍨2>+\'.'=⍵}2⊃'.'⎕WG'APLVersion'
          ⎕←''
          ⎕←'MiServer 3.0 itself will run under Dyalog APL versions 13.2 and later'
          ⎕←'However, the MS3 MiSite uses features found only in Dyalog APL versions beginning with 14.0'
          ⎕←''
          ⎕←'Please restart the MS3 MiSite using Dyalog APL version 14.0 or later...'
          →
      :EndIf
    ∇

    ∇ onServerLoad
      :Access Public Override
    ⍝ Handle any server startup processing
      {}C ⍝ initialize CACHE
    ∇

:EndClass

new_contents:
:Class MS3Server : MiServer
⍝ This is an example of a customized MiServer
⍝ The MiServer class exposes several overridable methods that can be customized by the user
⍝ In this case we customize the onServerLoad method
⍝ The ClassName parameter in the Server.xml configuration file is used to specify the customized class

    :Include #.MS3SiteUtils ⍝∇:require =/MS3SiteUtils

    ∇ Make config
      :Access Public
      :Implements Constructor :Base config
     ⍝ Version warning
      :If 14>{⊃(//)⎕VFI ⍵/⍨2>+\'.'=⍵}2⊃'.'⎕WG'APLVersion'
          ⎕←''
          ⎕←'MiServer 3.0 itself will run under Dyalog APL versions 13.2 and later'
          ⎕←'However, the MS3 MiSite uses features found only in Dyalog APL versions beginning with 14.0'
          ⎕←'From version 15.0, Dyalog APL is available free of charge at http://www.dyalog.com'
          ⎕←''
          ⎕←'Please restart the MS3 MiSite using Dyalog APL version 14.0 or later...'
          →
      :EndIf
    ∇

    ∇ onServerLoad
      :Access Public Override
    ⍝ Handle any server startup processing
      {}C ⍝ initialize CACHE
    ∇

:EndClass

subject: Upgrade message inculdes note of 15.0+ being free.


old_contents:
:class aSimple : MiPageSample
⍝ Control:: _html.a
⍝ Description:: Insert a hyperlink

    ∇ Compose
      :Access public
      Add 'Click '
      'href' 'http://www.dyalog.com/meet-team-dyalog.htm'Add _.a'here'
      Add ' to meet us.'
    ∇

:endclass

new_contents:
:class aSimple : MiPageSample
⍝ Control:: _html.a
⍝ Description:: Insert a hyperlink

    ∇ Compose
      :Access public
      Add'Click '
      'href=http://www.dyalog.com/meet-team-dyalog.htm'Add _.a'here'
      Add' to meet us.'
    ∇

:endclass

subject: Fix to new ParseAttr syntax

message: Fix to new ParseAttr syntax


old_contents:
#!/usr/local/bin/apl -s

'Day 3: Perfectly Spherical Houses in a Vacuum'

i ← (0 0)
cmds ← ('<' '>' '^' 'v')
dirs ← ((¯1 0) (1 0) (0 ¯1) (0 1))
houses ← ∪ (0 0) , i { ++\⍵ } { dirs[ti] ⊣ ti ← cmds ⍳ ⍵ } ⍞
⍴ houses ⍝ the amount of houses to visit

)OFF

new_contents:
#!/usr/local/bin/apl -s

'Day 3: Perfectly Spherical Houses in a Vacuum'

cmds ← ('<' '>' '^' 'v')
dirs ← ((¯1 0) (1 0) (0 ¯1) (0 1))
houses ← ∪ (0 0) , { ++\⍵ } { dirs[ti] ⊣ ti ← cmds ⍳ ⍵ } ⍞
⍴ houses ⍝ the amount of houses to visit

)OFF

subject: Trim fat on apl nr 1

message: Trim fat on apl nr 1


old_contents:
:class abbrsample: MiPage
⍝ Control:: HTML.abbr
⍝ Description:: this is an example of use of abbr which allows you to display text when hovering over an area
⍝
⍝ This is an example of using the HTML 'abbr' element.

    ∇ Compose
      :Access public
    ⍝ We simply display the text 'Hover over THIS to reveal.'

    ⍝ First we add the text 'Hover over', then
      Add'Hover over '
    ⍝ Then we add the element 'abbr' containing the text 'THIS',
    ⍝ making sure the text to display when hovering over it
    ⍝ (the title) displays 'True Http Internet Scripts'
      'title' 'True Http Internet Scripts'Add _.abbr'THIS'
    ⍝ then we add the final text.
      Add' to reveal.'
    ∇
:endclass

new_contents:
:class abbrsample: MiPage
⍝ Control:: HTML.abbr
⍝ Description:: this is an example of use of abbr which allows you to display text when hovering over an area

⍝ This is an example of using the HTML 'abbr' element.

    ∇ Compose
      :Access public
    ⍝ We simply display the text 'Hover over THIS to reveal.'

    ⍝ First we add the text 'Hover over', then
      Add'Hover over '
    ⍝ Then we add the element 'abbr' containing the text 'THIS',
    ⍝ making sure the text to display when hovering over it
    ⍝ (the title) displays 'True Http Internet Scripts'
      'title' 'True Http Internet Scripts'Add _.abbr'THIS'
    ⍝ then we add the final text.
      Add' to reveal.'
    ∇
:endclass

subject: Remove empty comment that messes up the index page


new_contents:
#!/usr/local/bin/apl --script
NEWLINE ← ⎕UCS 10
HEADERS ← 'Content-Type: text/plain', NEWLINE
HEADERS
⍝ ⎕←HEADERS
⍝ ⍕⎕TS
)OFF

⍝ testVars←'FUCKYEAH'
⍝ ≠\~(testVars ∊ 'AEIOU')
⍝ (124 × 4)≠(+/124 124 124)
⍝ testVars ∊ '<>'

message:
Add boilerplate APL script to serve CGI webpages

I can no longer tell if I've gone insane, or I've just become bored with
web development. Probably a collusion of both.

Either way, getting this script working required some changes in the GNU
APL preferences file (interpreter built from source: v1.5 / SVN revision
694). The following settings were changed to the designated values:

  * Welcome:      No
  * Color:        No
  * SharedVars:   Disabled

That last setting is especially critical for running the APL interpreter
as a CGI handler. Since multiple arguments can't be passed to a hashbang
(at least in Apache), we can't set --script and --noSV at the same time.
This leads to an error message being spat to STDOUT when the interpreter
is invoked, screwing with the HTTP headers.

license: isc