Read This! | Picolisp | Picolisp Machine | Pil Sources | Pil Tutorials | Picolisp By Example | Linux | BASH | C-Programmming | Javascipt | Python | Scheme | Operating Systems | AssemblyLanguage | Computer Security | Firewalls | Exploitation | Social Engineering | Metasploit | Emacs | vim | Pharo Smalltalk | Databases | Networking | Machine Learning | Git | Machine Learning | Algorithms | Open Data Science |

The Health Application

Health is a small application that I co-wrote with Alexander Burger to help newcomers understand the nuts and bolts of a very simplified picolisp application.

It uses the standard libraries. Especially http.l, xhtml.l and form.l

The app consists of two files, health.l and day.l, who's sources are given below.

Sources


# 09may17abu
# (c) Software Lab. Alexander Burger

(allowed ()
   "!work" "@lib.css" "day.l" )

(load "@lib/http.l" "@lib/xhtml.l" "@lib/form.l" "@lib/adm.l")

(class +Day +Entity)
(rel dat (+Key +Date))                 # Date
(rel w (+Number) 3)                    # Weight [kg]

(dm T @
   (pass super 'dat (date)) )

(dm url> ()
   (list "day.l" '*ID This) )


(de choDay (Dst)
   (choDlg Dst "Days" '(dat +Day)
      NIL
      '(pack (datStr (: dat)) ": " (format (: w) 1)) ) )

(de menu (Ttl . Prg)
   (action
      (html 0 Ttl "@lib.css" NIL
         (<ping> 7)
         (<layout>
            ((180 0 'menu)
               (<div> @
                  (expires)
                  (<menu>
                     (,"Home" "!work")
                     ("Day" "day.l") ) )
               ((NIL NIL 'main)
                  (<div> @ (run Prg 1)) ) ) ) ) ) )

(de work ()
   (app)
   (menu "Health"
      (<h2> NIL "Health") ) )

(de main ()
   (pool "health.db") )

(de go ()
   (server 8080 "!work") )

# vi:et:ts=3:sw=3





# 09may17abu
# (c) Software Lab. Alexander Burger

(menu "Day"
   (idForm "Day" '(choDay) 'dat '+Day T '(may Delete) '((datStr (: dat)))
      (<grid> 2
         "Date" (gui '(+E/R +DateField) '(dat : home obj) 10)
         "Weight" (gui '(+E/R +FixField) '(w : home obj) 3 7) )
      (<spread> NIL (editButton T)) ) )

# vi:et:ts=3:sw=3


http:///wiki/?pilhealth

24jun17   admin