            <% loop $ArticleCategories %>

$Title

                        $Content

                        <% loop Children %>
                        <li <% if $Pos > 5 %>class="hidden-link"<% end_if %>>

                                $MenuTitle

                                    <% if $PublishDate %>
                                        $PublishDate.format('j. n. Y')
                                    <% end_if %>

                        <% end_loop %>

            <% end_loop %>

Fix "hidden links" in Document listing

            <% loop $ArticleCategories %>

$Title

                        $Content

                        <% loop Children %>

                                $MenuTitle

                                    <% if $PublishDate %>
                                        $PublishDate.format('j. n. Y')
                                    <% end_if %>

                        <% end_loop %>

            <% end_loop %>


;;;
;;; Justin Ethier
;;; husk scheme
;;;
;;; The game of life example from r7rs.
;;; Main program
;;;
;;; To execute from the husk directory:
;;;
;;;  > cd examples/game-of-life
;;;  > huski life.scm
;;;
(import (scheme base)
        (only (example life) life)
        (rename (prefix (example grid) grid-)
                (grid-make make-grid)))

;; Initialize a grid with a glider.
(define grid (make-grid 24 24))
(grid-put! grid 1 1 #t)
(grid-put! grid 2 2 #t)
(grid-put! grid 3 0 #t)
(grid-put! grid 3 1 #t)
(grid-put! grid 3 2 #t)
;; Run for x iterations.
(life grid 10) ;80

Allow this program to compile

;;;
;;; Justin Ethier
;;; husk scheme
;;;
;;; The game of life example from r7rs.
;;; Main program
;;;
;;; To execute from the husk directory:
;;;
;;;  > cd examples/game-of-life
;;;  > huski life.scm
;;;
(import (scheme base)
        (example life)
        (example grid))
;; TODO:
;        (only (example life) life)
;        (rename (prefix (example grid) grid-)
;                (grid-make make-grid)))

;; Initialize a grid with a glider.
;(define grid (make-grid 24 24))
;(grid-put! grid 1 1 #t)
;(grid-put! grid 2 2 #t)
;(grid-put! grid 3 0 #t)
;(grid-put! grid 3 1 #t)
;(grid-put! grid 3 2 #t)
(define grid (make 24 24))
(put! grid 1 1 #t)
(put! grid 2 2 #t)
(put! grid 3 0 #t)
(put! grid 3 1 #t)
(put! grid 3 2 #t)
;; Run for x iterations.
(life grid 80)


;
; A more accurate interrogative detector, based on LG link types.
;
(define interrogative-LG
    (BindLink
        (VariableList
            (TypedVariableLink
                (VariableNode "$interp")
                (TypeNode "InterpretationNode")
            )
            (TypedVariableLink
                (VariableNode "$parse")
                (TypeNode "ParseNode")
            )
            (TypedVariableLink
                (VariableNode "$wall-inst")
                (TypeNode "WordInstanceNode")
            )
            (TypedVariableLink
                (VariableNode "$wh-word-inst")
                (TypeNode "WordInstanceNode")
            )
        )
        (AndLink
            (InterpretationLink
                (VariableNode "$interp")
                (VariableNode "$parse")
            )
            (WordInstanceLink
                (VariableNode "$wall-inst")
                (VariableNode "$parse")
            )

            (ReferenceLink
                (VariableNode "$wall-inst")
                (WordNode "###LEFT-WALL###")
            )

            ;; If left wal is linked with any of Wq, Ws, Wj or Ww
            ;; or Qd, Qe, Qw then its interrogative.
            (ChoiceLink
                (EvaluationLink (LinkGrammarRelationshipNode "Wq")
                (ListLink
                    (VariableNode "$wall-inst")
                    (VariableNode "$wh-word-inst")))

                (EvaluationLink (LinkGrammarRelationshipNode "Ws")
                (ListLink
                    (VariableNode "$wall-inst")
                    (VariableNode "$wh-word-inst")))

                (EvaluationLink (LinkGrammarRelationshipNode "Wj")
                (ListLink
                    (VariableNode "$wall-inst")
                    (VariableNode "$wh-word-inst")))

                (EvaluationLink (LinkGrammarRelationshipNode "Ww")
                (ListLink
                    (VariableNode "$wall-inst")
                    (VariableNode "$wh-word-inst")))

                (EvaluationLink (LinkGrammarRelationshipNode "Qd")
                (ListLink
                    (VariableNode "$wall-inst")
                    (VariableNode "$wh-word-inst")))

                (EvaluationLink (LinkGrammarRelationshipNode "Qe")
                (ListLink
                    (VariableNode "$wall-inst")
                    (VariableNode "$wh-word-inst")))

                (EvaluationLink (LinkGrammarRelationshipNode "Qw")
                (ListLink
                    (VariableNode "$wall-inst")
                    (VariableNode "$wh-word-inst")))
            )
        )
        ; Mark this as a question
        (InheritanceLink
            (VariableNode "$interp")
            (DefinedLinguisticConceptNode "InterrogativeSpeechAct"))
    )
)


	<% _t("TreeTools.DisplayLabel","Display:") %>
	<% if CanOrganiseSitetree %>

		<input type="radio" name="view-mode" class="view-mode" value="draggable" id="view-mode-draggable" />
		<% _t("ENABLEDRAGGING","Drag'n'drop") %>

	<% end_if %>

		<input type="radio" name="view-mode" class="view-mode" value="multiselect" id="view-mode-multiselect" />
		<% _t("MULTISELECT","Multi-selection") %>

<% include CMSPagesController_ContentToolActions %>

Check the drag and drop radio by default.

	<% _t("TreeTools.DisplayLabel","Display:") %>
	<% if CanOrganiseSitetree %>

		<input type="radio" name="view-mode" class="view-mode" value="draggable" id="view-mode-draggable" checked="checked" />
		<% _t("ENABLEDRAGGING","Drag'n'drop") %>

	<% end_if %>

		<input type="radio" name="view-mode" class="view-mode" value="multiselect" id="view-mode-multiselect" />
		<% _t("MULTISELECT","Multi-selection") %>

<% include CMSPagesController_ContentToolActions %>


(library
    (harlan front expand-include)
  (export expand-include)
  (import
   (except (chezscheme) gensym)
   (only (elegant-weapons helpers) define-match)
   (harlan driver)
   (elegant-weapons match))

  (define-match expand-include
    ((module . ,decls)
     `(module . ,(expand-decls (cons '(import core) decls)))))

  (define-match expand-decls
    (((import ,name) . ,rest)
     (expand-decls (append (load-include (string-append
                                          (symbol->string name) ".kfc"))
                           rest)))
    ((,a . ,[d]) `(,a . ,d))
    (() '()))

  (define (load-include name)
    (let-values (((source _)
                  (read-source (string-append "lib/harlan/" name))))
      (match source
        ((module . ,decls) decls))))
  )

Make sure we don't include the same libraries twice. This means our library structures can form a DAG.

(library
    (harlan front expand-include)
  (export expand-include)
  (import
   (except (chezscheme) gensym)
   (only (elegant-weapons helpers) define-match)
   (harlan driver)
   (elegant-weapons match))

  (define-match expand-include
    ((module . ,decls)
     `(module . ,(expand-decls (cons '(import core) decls) '()))))

  (define (expand-decls decls libs)
    (match decls
      (((import ,name) . ,rest)
       (if (memq name libs)
           (expand-decls rest libs)
           (expand-decls (append (load-include (string-append
                                                (symbol->string name) ".kfc"))
                                 rest)
                         (cons name libs))))
      ((,a . ,[d]) `(,a . ,d))
      (() '())))

  (define (load-include name)
    (let-values (((source _)
                  (read-source (string-append "lib/harlan/" name))))
      (match source
        ((module . ,decls) decls))))
  )


(load "mk/mk-vicare.scm")
(load "mk/mk.scm")
(load "mk/test-check.scm")
(load "interp-hm.scm")

(test 'lambda-1
  (run 1 (type)
    (:o '((lambda (id) id) (lambda (x) x)) type))
  '(((-> _.0 _.0))))

(test 'lambda-2
  (run 1 (type)
    (:o '((lambda (id) (id id)) (lambda (x) x)) type))
  ;; Failure is expected because simulating let with lambda loses polymorphism.
  '())

(test 'let-1
  (run 1 (type)
    (:o '(let ((id (lambda (x) x))) id) type))
  '(((-> _.0 _.0))))

(test 'let-2
  (run 1 (type)
    (:o '(let ((id (lambda (x) x))) (id id)) type))
  '(((-> _.0 _.0))))

(test 'letrec-1
  (run 1 (type)
    (:o '(letrec ((id (lambda (x) x))) id) type))
  '(((-> _.0 _.0))))

(test 'letrec-2
  (run 1 (type)
    (:o '(letrec ((id (lambda (x) x))) (id id)) type))
  '(((-> _.0 _.0))))

Test deterministic type inference using run*

(load "mk/mk-vicare.scm")
(load "mk/mk.scm")
(load "mk/test-check.scm")
(load "interp-hm.scm")

(test 'lambda-1
  (run* (type)
    (:o '((lambda (id) id) (lambda (x) x)) type))
  '(((-> _.0 _.0))))

(test 'lambda-2
  (run* (type)
    (:o '((lambda (id) (id id)) (lambda (x) x)) type))
  ;; Failure is expected because simulating let with lambda loses polymorphism.
  '())

(test 'let-1
  (run* (type)
    (:o '(let ((id (lambda (x) x))) id) type))
  '(((-> _.0 _.0))))

(test 'let-2
  (run* (type)
    (:o '(let ((id (lambda (x) x))) (id id)) type))
  '(((-> _.0 _.0))))

(test 'letrec-1
  (run* (type)
    (:o '(letrec ((id (lambda (x) x))) id) type))
  '(((-> _.0 _.0))))

(test 'letrec-2
  (run* (type)
    (:o '(letrec ((id (lambda (x) x))) (id id)) type))
  '(((-> _.0 _.0))))


ADD - View file for client subscriptions

<% require themedCSS(page-projects) %>

						Subscriptions

<% _t('SSP.EDITPROFILE','Edit profile') %>

<% _t('SSP.LOGOUT','Logout') %>

Your Subscriptions

								ID
								ProjectID
								URL
								Status

								1234
								5678
								jimmykung.com
								Inactive
								»

								2234
								5679
								kungpaomeow.com
								Active
								»

								3234
								5680
								jimmycrackcorn.sitesprocket.com
								Active
								»


<button href="$Link" class="ss-gridfield-add-new-inline ss-ui-action-constructive ss-ui-button" data-icon="add">
	$Title
</button>

FIX Upgrade button to use bootstrap classes

<button href="$Link" class="ss-gridfield-add-new-inline btn btn-primary" data-icon="add">
	$Title
</button>


;; Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
;; Use of this source code is governed by a BSD-style license that can be
;; found in the LICENSE file.

;; Run xbindkeys -dg for some example configuration file with explanation

; Cycle chroots
(xbindkey '(control shift alt F1) "
    for key in Control Shift Alt Meta; do
        echo 'keyup '$key'_L'
        echo 'keyup '$key'_R'
    done | xte
    croutoncycle prev")
(xbindkey '(control shift alt F2) "
    for key in Control Shift Alt Meta; do
        echo 'keyup '$key'_L'
        echo 'keyup '$key'_R'
    done | xte
    croutoncycle next")

; Extra bindings that must only be activated in chroot X11/Xephyr
(if (not (string-null? (getenv "XMETHOD")))
    (begin
        ; Brightness control
        (xbindkey '(XF86MonBrightnessDown) "brightness down")
        (xbindkey '(XF86MonBrightnessUp) "brightness up")

        ; Load ~/.xbindkeysrc.scm for customization if the current user has one
        (let ((usercfg (string-append (getenv "HOME") "/.xbindkeysrc.scm")))
            (if (access? usercfg F_OK) (load usercfg))
        )
    )
)

Fix X11 errors on switch.

;; Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
;; Use of this source code is governed by a BSD-style license that can be
;; found in the LICENSE file.

;; Run xbindkeys -dg for some example configuration file with explanation

; Cycle chroots
(xbindkey '(control shift alt F1) "
    for key in Control_L Control_R Shift_L Shift_R Alt_L Meta_L; do
        echo 'keyup '$key
    done | xte
    croutoncycle prev")
(xbindkey '(control shift alt F2) "
    for key in Control_L Control_R Shift_L Shift_R Alt_L Meta_L; do
        echo 'keyup '$key
    done | xte
    croutoncycle next")

; Extra bindings that must only be activated in chroot X11/Xephyr
(if (not (string-null? (getenv "XMETHOD")))
    (begin
        ; Brightness control
        (xbindkey '(XF86MonBrightnessDown) "brightness down")
        (xbindkey '(XF86MonBrightnessUp) "brightness up")

        ; Load ~/.xbindkeysrc.scm for customization if the current user has one
        (let ((usercfg (string-append (getenv "HOME") "/.xbindkeysrc.scm")))
            (if (access? usercfg F_OK) (load usercfg))
        )
    )
)


;;; Utility functions
;;; This are not specified in R5RS

;; Check if the list is empty
;;
;; @param lst - the list to check
;;
;; @return boolean
(define (empty? lst)
  (if (eq? '() lst)
      #t
      #f))

;; Check if every element of the list passes a predicate
;;
;; @param predicate? - The predicate for each element
;; @param lst        - The list to check
;;
;; @return boolean
(define (every? predicate? lst)
  (if (eq? '() lst) #f
      (let ((checked-results (map predicate? lst)))
        (if (memv #f checked-results) #f #t))))

Add Filter and Some? Utilities

;;; Utility functions
;;; This are not specified in R5RS

;; Check if the list is empty
;;
;; @param lst - the list to check
;;
;; @return boolean
(define (empty? lst)
  (if (eq? '() lst)
      #t
      #f))

;; Check if every element of the list passes a predicate
;;
;; @param predicate? - The predicate for each element
;; @param lst        - The list to check
;;
;; @return boolean
(define (every? predicate? lst)
  (if (eq? '() lst) #f
      (let ((checked-results (map predicate? lst)))
        (if (memv #f checked-results) #f #t))))

;; Check if some elements of the list passes a predicate.
;;
;; @param predicate? - The predicate for each element
;; @param lst        - The list to check
;;
;; @return boolean
(define (some? predicate? lst)
  (cond
   ((null? lst) #f)
   ((predicate? (car lst)) #t)
   (else
    (some? predicate? (cdr lst)))))

;; Filter a list against a predicate and returned a list of
;; filtered elements
;;
;; @param predicate? - The predicate for each element
;; @param lst        - The list to check
;;
;; @return list of filtered elements
(define (filter predicate? lst)
  (cond
   ((eq? '() lst) '())
   ((predicate? (car lst))
    (cons (car lst) (filter predicate? (cdr lst))))
   (else
    (filter predicate? (cdr lst)))))


(define-module (opencog nlp))

(use-modules (opencog) (opencog atom-types))

; User-modifiable config paramters.
(define-public relex-server-host "127.0.0.1")
(define-public relex-server-port 4444)

; Load various parts....
(load "nlp/nlp-utils.scm")
(load "nlp/disjunct-list.scm")
(load "nlp/processing-utils.scm")

Fix crazy guile module bug.

(define-module (opencog nlp))

(use-modules (opencog) (opencog atom-types))

; User-modifiable config paramters.
(define-public relex-server-host "127.0.0.1")
(define-public relex-server-port 4444)

; Load various parts....
(load "nlp/nlp-utils.scm")
(load "nlp/disjunct-list.scm")
(load "nlp/processing-utils.scm")

; Weird ... MUST say `(export)` or no define-publics are visible!
(export)


(define expr
 '(define fib
    (lambda (n)
      (if (= 0 n)
        0
        (if (= 1 n)
          1
          (+ (fib (- n 1)) (fib (- n 2))))))))

(eval-vm expr)

(print (eval-vm '(fib 30)))
(newline)

;; first heap based vm version
;;
;; $ time ./lisp < samples/fib-vm.scm
;; 832040
;; ./lisp < samples/fib-vm.scm  6.69s user 1.98s system 116% cpu 7.417 total
;;
;;
;; stack based vm version (4.1)
;;
;; $ time ./lisp < samples/fib-vm.scm
;; 832040
;; ./lisp < samples/fib-vm.scm  4.48s user 1.37s system 120% cpu 4.855 total
;;
;;
;; stack based vm version (after 4.7)
;;
;; $ time ./lisp < samples/fib-vm.scm
;; 832040
;; ./lisp < samples/fib-vm.scm  4.10s user 0.67s system 84% cpu 5.643 total
;;
;;
;; naive interpreter version
;;
;; $ time ./lisp < samples/fib.scm
;; 832040
;; ./lisp < samples/fib.scm  4.16s user 0.52s system 104% cpu 4.454 total

Add stack based vm's benchmark (revised)

(define expr
 '(define fib
    (lambda (n)
      (if (= 0 n)
        0
        (if (= 1 n)
          1
          (+ (fib (- n 1)) (fib (- n 2))))))))

(eval-vm expr)

(print (eval-vm '(fib 30)))
(newline)

;; first heap based vm version
;;
;; $ time ./lisp < samples/fib-vm.scm
;; 832040
;; ./lisp < samples/fib-vm.scm  6.69s user 1.98s system 116% cpu 7.417 total
;;
;;
;; stack based vm version (4.1)
;;
;; $ time ./lisp < samples/fib-vm.scm
;; 832040
;; ./lisp < samples/fib-vm.scm  4.48s user 1.37s system 120% cpu 4.855 total
;;
;;
;; stack based vm version (after 4.7)
;;
;; $ time ./lisp < samples/fib-vm.scm
;; 832040
;; ./lisp < samples/fib-vm.scm  3.57s user 0.42s system 104% cpu 3.813 total
;;
;;
;; naive interpreter version
;;
;; $ time ./lisp < samples/fib.scm
;; 832040
;; ./lisp < samples/fib.scm  4.16s user 0.52s system 104% cpu 4.454 total


;; This is an operating system configuration generated
;; by the graphical installer.

(use-modules (gnu))
(use-modules (nongnu packages linux)
             (nongnu system linux-initrd))
(use-modules (gnu packages version-control))
(use-modules (gnu packages gnuzilla))
(use-modules (gnu packages vim))
(use-modules (gnu packages ssh))

(use-service-modules desktop networking ssh xorg)

(define %xorg-libinput-config
  "Section \"InputClass\"
  Identifier \"Touchpads\"
  Driver \"libinput\"
  MatchDevicePath \"/dev/input/event*\"
  MatchIsTouchpad \"on\"

  Option \"Tapping\" \"on\"
  Option \"TappingDrag\" \"on\"
  Option \"DisableWhileTyping\" \"on\"
  Option \"MiddleEmulation\" \"on\"
  Option \"ScrollMethod\" \"twofinger\"
EndSection
Section \"InputClass\"
  Identifier \"Keyboards\"
  Driver \"libinput\"
  MatchDevicePath \"/dev/input/event*\"
  MatchIsKeyboard \"on\"
EndSection
")

(operating-system
  (locale "en_GB.utf8")
  (timezone "Europe/London")
  (keyboard-layout (keyboard-layout "pl"))
  (host-name "vm")
  (users (cons* (user-account
                  (name "cyryl")
                  (comment "")
                  (group "users")
                  (home-directory "/home/cyryl")
                  (supplementary-groups
                    '("wheel" "netdev" "audio" "video")))
                %base-user-accounts))
  (packages
    (append
      (list (specification->package "i3-wm")
            (specification->package "i3status")
            (specification->package "dmenu")
            (specification->package "st")
            (specification->package "nss-certs")
	git
	icecat
	vim
	openssh)
      %base-packages))
  (services
    (append
      (list (service gnome-desktop-service-type)
            (set-xorg-configuration
              (xorg-configuration
                (keyboard-layout keyboard-layout)
                (extra-config (list %xorg-libinput-config)))))
      %desktop-services))
  (bootloader
    (bootloader-configuration
      (bootloader grub-bootloader)
      (target "/dev/sda")
      (keyboard-layout keyboard-layout)))
  (mapped-devices
    (list (mapped-device
            (source
              (uuid "19d49460-ecdd-4058-99c5-82d35b0369d3"))
            (target "cryptroot")
            (type luks-device-mapping))))
  (file-systems
    (cons* (file-system
             (mount-point "/")
             (device "/dev/mapper/cryptroot")
             (type "btrfs")
             (dependencies mapped-devices))
           %base-file-systems)))


/* mapping of google_map_N to an array of markers */
<% if DownloadJS %>
var infoWindows = [];
var gmarkers = [];
var mapLayers = [];
var mapLines = [];
<% end_if %>
registerMap('$GoogleMapID', $LatLngCentre, $Zoom, $MapType,
$MapMarkers,$Lines,$KmlFiles, $JsonMapStyles, $EnableAutomaticCenterZoom, $UseClusterer,
$AllowFullScreen);

Use options instead of lots of parameters to render a map

/* mapping of google_map_N to an array of markers */
<% if DownloadJS %>
var infoWindows = [];
var gmarkers = [];
var mapLayers = [];
var mapLines = [];
<% end_if %>
var options = {
	centre: $LatLngCentre,
	zoom: $Zoom,
	maptype: '$MapType',
	domid: '$GoogleMapID',
	allowfullscreen: $AllowFullScreen,
	mapmarkers: $MapMarkers,
	lines: $Lines,
	kmlfiles: $KmlFiles,
	mapstyles: $JsonMapStyles,
	useclusterer: $UseClusterer,
	enableautocentrezoom: $EnableAutomaticCenterZoom
}

registerMap(options);

/*
registerMap('$GoogleMapID', $LatLngCentre, $Zoom, $MapType,
$MapMarkers,$Lines,$KmlFiles, $JsonMapStyles, $EnableAutomaticCenterZoom, $UseClusterer,
$AllowFullScreen);
*/


/* mapping of google_map_N to an array of markers */
<% if DownloadJS %>
var infoWindows = [];
var gmarkers = [];
var mapLayers = [];
var mapLines = [];
<% end_if %>
registerMap('$GoogleMapID', $LatLngCentre, $Zoom, $MinLat,$MinLng,$MaxLat,$MaxLng, $MapType,
$MapMarkers,$Lines,$KmlFiles, $JsonMapStyles, $EnableAutomaticCenterZoom, $UseClusterer,
$AllowFullScreen);

Remove min/max bounds from register map call

/* mapping of google_map_N to an array of markers */
<% if DownloadJS %>
var infoWindows = [];
var gmarkers = [];
var mapLayers = [];
var mapLines = [];
<% end_if %>
registerMap('$GoogleMapID', $LatLngCentre, $Zoom, $MapType,
$MapMarkers,$Lines,$KmlFiles, $JsonMapStyles, $EnableAutomaticCenterZoom, $UseClusterer,
$AllowFullScreen);


(use-modules (ice-9 match)
             (srfi srfi-1)
             (guix gexp)
             (guix packages)
             (guix licenses)
             (guix download)
             (guix git-download)
             (guix build-system python)
             (gnu packages)
             (gnu packages base)
             (gnu packages python))

(define %source-dir (dirname (current-filename)))

(define python-pyld-signatures
  (package
    (name "python-pyld-signatures")
    (version "git")
    (source (local-file %source-dir
                        #:recursive? #t
                        #:select? (git-predicate %source-dir)))
    (build-system python-build-system)
    (propagated-inputs
     `(("python-pyld" ,python-pyld)))
    (home-page "https://github.com/Spec-Ops/pyld-signatures/")
    (synopsis "Implementation of Linked Data Signatures using python-pyld.")
    (description "python-pyld-signatures is a Python library implementing
the Linked Data Signatures algorithm, for verifiable claims and other purposes.
It builds on python-pyld and integrates nicely with existing json-ld applications.")
    (license bsd-3)))

;; Make sure we have Python in our environment
(package
  (inherit python-pyld-signatures)
  (inputs
   `(("python" ,python))))

Add python-cryptography to inputs of pyld-signatures library

(use-modules (ice-9 match)
             (srfi srfi-1)
             (guix gexp)
             (guix packages)
             (guix licenses)
             (guix download)
             (guix git-download)
             (guix build-system python)
             (gnu packages)
             (gnu packages base)
             (gnu packages python))

(define %source-dir (dirname (current-filename)))

(define python-pyld-signatures
  (package
    (name "python-pyld-signatures")
    (version "git")
    (source (local-file %source-dir
                        #:recursive? #t
                        #:select? (git-predicate %source-dir)))
    (build-system python-build-system)
    (propagated-inputs
     `(("python-pyld" ,python-pyld)
       ("python-cryptography" ,python-cryptography)))
    (home-page "https://github.com/Spec-Ops/pyld-signatures/")
    (synopsis "Implementation of Linked Data Signatures using python-pyld.")
    (description "python-pyld-signatures is a Python library implementing
the Linked Data Signatures algorithm, for verifiable claims and other purposes.
It builds on python-pyld and integrates nicely with existing json-ld applications.")
    (license bsd-3)))

;; Make sure we have Python in our environment
(package
  (inherit python-pyld-signatures)
  (inputs
   `(("python" ,python))))


<% if $Pages %>

	<% loop $Pages %>
	<% if $Last %>

$MenuTitle

	<% else %>

$MenuTitle

	<% end_if %>
	<% end_loop %>

<% end_if %>


  <% if $SiteConfig.CustomCMSLogo %>

        <% if $SiteConfig.CustomCMSLogo.ID %>
          {$SiteConfig.CustomCMSLogo}
        <% else %>
          {$SiteConfig.CustomCMSLogo.RAW}
        <% end_if %>

  <% else %>

      <% if $SiteConfig %>$SiteConfig.Title<% else %>$ApplicationName<% end_if %>

  <% end_if %>

Update cms-sitename__title to include CMSVersion


; For users who are not aware of readline ...
(use-modules (ice-9 readline))
(activate-readline)

; Stuff actually needed to get the chatbot running...
(use-modules (opencog) (opencog cogserver))

(use-modules (opencog nlp) (opencog nlp chatbot))
(use-modules (opencog nlp relex2logic))

(load-r2l-rulebase)

Fix up a little bit

; For users who are not aware of readline ...
(use-modules (ice-9 readline))
(activate-readline)

; Stuff actually needed to get r2l running...
(use-modules (opencog) (opencog nlp))

; The primary R2L wrapper is actually in the chatbot dir.
(use-modules (opencog nlp chatbot))
(use-modules (opencog nlp relex2logic))

(load-r2l-rulebase)


(set! load/suppress-loading-message? #t)
(load "/home/manzyuk/Projects/BCL-AD/ls/dvl/load")
(pp (compile-to-raw-fol (read)))
(%exit 0)

Replace the absolute path in the DVL wrapper script with a relative one.

(set! load/suppress-loading-message? #t)

(define (self-relatively thunk)
  (if (current-eval-unit #f)
      (with-working-directory-pathname
       (directory-namestring (current-load-pathname))
       thunk)
      (thunk)))

(define (load-relative filename)
  (self-relatively (lambda () (load filename))))

(load-relative "../../ls/dvl/load")
(pp (compile-to-raw-fol (read)))
(%exit 0)


<%-- Adapted from TabSet.ss (framework) --%>

	<% loop $Tabs %>

$Title

	<% end_loop %>

	<% loop $Tabs %>
		<% if $Tabs %>

			$FieldHolder

		<% else %>

				<% loop $Fields %>
					$FieldHolder
				<% end_loop %>

		<% end_if %>
	<% end_loop %>

Add support for having multiple tabs with only one having an inner sidebar

<%-- Adapted from TabSet.ss (framework) --%>

	<% loop $Tabs %>

$Title

	<% end_loop %>

	<% loop $Tabs %>
		<% if $Tabs %>

			$FieldHolder

		<% else %>

				<% loop $Fields %>
					<% if $Type=='rightsidebar' %>

					<% end_if %>
				<% end_loop %>

				<% loop $Fields %>
					$FieldHolder
				<% end_loop %>

				<% loop $Fields %>
					<% if $Type=='rightsidebar' %>

					<% end_if %>
				<% end_loop %>

		<% end_if %>
	<% end_loop %>


<% require themedCSS(account,shop) %>
<% include AccountNavigation %>

	<% if Order %>
		<% with Order %>

			<%-- Silvershop Bank Deposit --%>
			<% if $Status == "Unpaid" %>
				<% include Order_BankDepositNeededStatement %>
			<% end_if %>

<%t Order.OrderHeadline "Order #{OrderNo} {OrderDate}" OrderNo=$Reference OrderDate=$Created.Nice %>

		<% end_with %>
	<% end_if %>
	<% if Message %>

$Message

	<% end_if %>
	<% if Order %>
		<% with Order %>
			<% include Order %>
		<% end_with %>

		<%-- Silvershop Bank Deposit --%>
		<% if $Order.Status == "Unpaid" %>
			$ActionsForm
		<% end_if %>

	<% end_if %>

Update CSS loaded in test theme

<% require css("silvershop/css/account.css") %>
<% require themedCSS("shop") %>
<% require themedCSS("account") %>
<% include AccountNavigation %>

	<% if Order %>
		<% with Order %>

			<%-- Silvershop Bank Deposit --%>
			<% if $Status == "Unpaid" %>
				<% include Order_BankDepositNeededStatement %>
			<% end_if %>

<%t Order.OrderHeadline "Order #{OrderNo} {OrderDate}" OrderNo=$Reference OrderDate=$Created.Nice %>

		<% end_with %>
	<% end_if %>
	<% if Message %>

$Message

	<% end_if %>
	<% if Order %>
		<% with Order %>
			<% include Order %>
		<% end_with %>

		<%-- Silvershop Bank Deposit --%>
		<% if $Order.Status == "Unpaid" %>
			$ActionsForm
		<% end_if %>

	<% end_if %>


Add missing sld for casual hand gather extents

<NamedLayer>
    <Name>{{info['name']}}</Name>
    <UserStyle>
        <Name>name</Name>
        <FeatureTypeStyle>
            <Rule>
                <Name>{{ _('Casual Hand Gather Extents') }}</Name>
                <PolygonSymbolizer>
                    <Stroke>
                        <SvgParameter name="stroke">#b99bc8</SvgParameter>
                        <SvgParameter name="stroke-width">2px</SvgParameter>
                    </Stroke>
                    <Fill>
                        <SvgParameter name="fill">#ffff71</SvgParameter>
                        <SvgParameter name="fill-opacity">0</SvgParameter>
                    </Fill>
                </PolygonSymbolizer>
            </Rule>
        </FeatureTypeStyle>
    </UserStyle>
</NamedLayer>


<div class="<% if $Children || $Parent %>large-9 large-push-3<% else %>large-12<% end_if %> columns">

$Title

		$Content
		$Form

<% if $Children || $Parent %><%--Determine if Side Nav should be rendered, you can change this logic--%>

		<% include SideNav %>

<% end_if %>

FIX closing tag for h2


<% loop AllChildren %>

$Caption

<% end_loop %>

Move caching to inside the template for the slider

<% cached ID, LastEdited,Locale,$CacheKey('homepagesliderfullwidth','ChildPage') %>

<% loop AllChildren %>

$Caption

<% end_loop %>

 <% end_cached %>


/* mapping of google_map_N to an array of markers */
<% if DownloadJS %>
var infoWindows = [];
var gmarkers = [];
var mapLayers = [];
var mapLines = [];
<% end_if %>
var options = {
	centre: $LatLngCentre,
	zoom: $Zoom,
	maptype: '$MapType',
	domid: '$GoogleMapID',
	allowfullscreen: $AllowFullScreen,
	mapmarkers: $MapMarkers,
	lines: $Lines,
	kmlfiles: $KmlFiles,
	mapstyles: $JsonMapStyles,
	useclusterer: $UseClusterer,
	enableautocentrezoom: $EnableAutomaticCenterZoom
}

registerMap(options);

/*
registerMap('$GoogleMapID', $LatLngCentre, $Zoom, $MapType,
$MapMarkers,$Lines,$KmlFiles, $JsonMapStyles, $EnableAutomaticCenterZoom, $UseClusterer,
$AllowFullScreen);
*/

Remove commented out code that was doubling the JSON output for the markers


;;;
;;; Extra processing functions
;;;

(define-library (led extra)

   ;; there are intentionally no led-specific imports

   (import
      (owl base))

   (export
      extra-functions
      find-extra)

   (begin

      (define null '())

      (define (lex-less? a b)
         (cond
            ((null? a) #true)
            ((null? b) #false)
            ((< (car a) (car b)) #true)
            ((= (car a) (car b))
               (lex-less? (cdr a) (cdr b)))
            (else #false)))

      (define (lex-sort lines)
         (sort lex-less? lines))

      (define (format lines)
         (list
            (foldr append '() lines)))

      ;;; paragraph formatting

      (define (pick-line data len)
         (cond
            ((null? data)
               (values null null))
            ((eq? len 0)
               (values #f #f))
            ((eq? (car data) #\space)
               (lets ((this rest (pick-line (cdr data) (- len 1))))
                  (if this
                     (values
                        (cons #\space this)
                        rest)
                     (values null (cdr data)))))
            (else
               (lets ((this rest (pick-line (cdr data) (- len 1))))
                  (if this
                     (values (cons (car data) this) rest)
                     (values #f #f))))))

      (define (format-lines data)
         (if (null? data)
            null
            (lets ((this rest (pick-line data 80)))
               (if this
                  (cons this (format-lines rest))
                  (list data)))))

      (define (format-merged lines)
         (format-lines
            (s/  */ /g
               (foldr append null lines))))

      (define extra-functions
         (list
            (cons "sort" lex-sort)
            (cons "fmt" format-merged)
            ))

      (define (find-extra name)
         (let ((res (assoc name extra-functions)))
            (if (pair? res)
               (cdr res)
               #false)))
))

Revert "added a minimal version of fmt"

;;;
;;; Extra processing functions
;;;

(define-library (led extra)

   ;; there are intentionally no led-specific imports

   (import
      (owl base))

   (export
      extra-functions
      find-extra
      )

   (begin

      (define (lex-less? a b)
         (cond
            ((null? a) #true)
            ((null? b) #false)
            ((< (car a) (car b)) #true)
            ((= (car a) (car b))
               (lex-less? (cdr a) (cdr b)))
            (else #false)))

      (define (lex-sort lines)
         (sort lex-less? lines))

      (define extra-functions
         (list
            (cons "sort" lex-sort)))

      (define (find-extra name)
         (let ((res (assoc name extra-functions)))
            (if (pair? res)
               (cdr res)
               #false)))))


		<% loop $Breadcrumbs %>
			<% if $Last %>
				$Title.XML
			<% else %>
				$Title.XML
				/
			<% end_if %>
		<% end_loop %>

Allow breadcrumbs to define HTML support or not.

		<% loop $Breadcrumbs %>
			<% if $Last %>
				$Title
			<% else %>
				$Title
				/
			<% end_if %>
		<% end_loop %>


$Title

$PublishDate.format('j. n. Y')

                    $Content

                $SideBarInfo

                Loading...

Change form in Support section


		<% control Headings %>
			<a href="$SortLink" class="<% if Sorted %>sorted $SortDir<% end_if %>">$Label
		<% end_control %>

	<% control ProjectResults %>

			<% control Fields %>
				$Value
			<% end_control %>

	<% end_control %>

			$PerPageDropdown
			<% if PrevLink %>
				<a href="$PrevLink" title="<% _t('SSPAdmin.PREVIOUS','Previous') %>"><% _t('SSPAdmin.PREVIOUS','Previous') %>
			<% end_if %>
			<% if NextLink %>
				<a href="$NextLink" title="<% _t('SSPAdmin.NEXT','NEXT') %>"><% _t('SSPAdmin.NEXT','Next') %>
			<% end_if %>

ADD - Unread bold class for admin project list

		<% control Headings %>
			<a href="$SortLink" class="<% if Sorted %>sorted $SortDir<% end_if %>">$Label
		<% end_control %>

	<% control ProjectResults %>

			<% control Fields %>
				<a href="$EditLink" rel="right"<% if UnreadAdmin %> class="unread"<% end_if %>>$Value
			<% end_control %>

	<% end_control %>

			$PerPageDropdown
			<% if PrevLink %>
				<a href="$PrevLink" title="<% _t('SSPAdmin.PREVIOUS','Previous') %>"><% _t('SSPAdmin.PREVIOUS','Previous') %>
			<% end_if %>
			<% if NextLink %>
				<a href="$NextLink" title="<% _t('SSPAdmin.NEXT','NEXT') %>"><% _t('SSPAdmin.NEXT','Next') %>
			<% end_if %>


=inc
"ll"
"factorial"
"fizzbuzz"
=

(fun do_factorials '(n)
    (if (> n 0)
        (
            (println "%: %" n (factorial n))
            (do_factorials (- n 1))
        )
        none
    )
)

(println "testing factorials")
(do_factorials 5)

(println "testing fizzbuzz")
(fizzbuzz 20)

(println "testing sequences")
(println "%" (seq 1 2 0.1))
(println "%" (seq 2 1 -0.1))

(let demo_array '("here" "is" "an" "array" "of" "mixed" "types" 1 2 3 4 5))
(println "demo array:")
(println "%" demo_array)

(letm mvar "This is a mutable variable")
(println "%" mvar)
(set mvar "And now it has a different value")
(println "%" mvar)

Make the factorial count up, and to 10 this time instead

=inc
"ll"
"factorial"
"fizzbuzz"
=

(fun do_factorials '(n)
    (
        (if (> n 0)
            (do_factorials (- n 1))
            none
        )
        (println "%: %" n (factorial n))
    )
)

(println "testing factorials")
(do_factorials 10)

(println "testing fizzbuzz")
(fizzbuzz 20)

(println "testing sequences")
(println "%" (seq 1 2 0.1))
(println "%" (seq 2 1 -0.1))

(let demo_array '("here" "is" "an" "array" "of" "mixed" "types" 1 2 3 4 5))
(println "demo array:")
(println "%" demo_array)

(letm mvar "This is a mutable variable")
(println "%" mvar)
(set mvar "And now it has a different value")
(println "%" mvar)


<div id="$HolderID" class="form-group field<% if $extraClass %> $extraClass<% end_if %>">
    <% if $Title %>
    	$Title
    <% end_if %>
	<div id="$ID" <% include SilverStripe/Forms/AriaAttributes %>
		class="form__fieldgroup form__field-holder
			<% if not $Title %> form__field-holder--no-label<% end_if %>
			<% if $Zebra %> form__fieldgroup-zebra<% end_if %>
			<% if $extraClass %> $extraClass<% end_if %>"
	>
		$Field
        <%-- TODO: change $MessageType to match Bootstraps alert types, e.g. alert-info, alert-danger etc --%>
		<% if $Message %>
$Message
<% end_if %>
        <% if $Description %>
$Description
<% end_if %>

    <% if $RightTitle %>
$RightTitle
<% end_if %>

FIX Remove duplicate "field" class in FieldGroup holder template

<div id="$HolderID" class="form-group<% if $extraClass %> $extraClass<% end_if %>">
    <% if $Title %>
    	$Title
    <% end_if %>
	<div id="$ID" <% include SilverStripe/Forms/AriaAttributes %>
		class="form__fieldgroup form__field-holder
			<% if not $Title %> form__field-holder--no-label<% end_if %>
			<% if $Zebra %> form__fieldgroup-zebra<% end_if %>
			<% if $extraClass %> $extraClass<% end_if %>"
	>
		$Field
        <%-- TODO: change $MessageType to match Bootstraps alert types, e.g. alert-info, alert-danger etc --%>
		<% if $Message %>
$Message
<% end_if %>
        <% if $Description %>
$Description
<% end_if %>

    <% if $RightTitle %>
$RightTitle
<% end_if %>


ADD - View file for client subscriptions

Your Subscriptions

	<% _t('SSP.NEWPROJECT','New project') %>
	<% _t('SSP.EDITPROFILE','Edit profile') %>
	<% _t('SSP.LOGOUT','Logout') %>

				ID
				ProjectID
				URL
				Status

				1234
				5678
				jimmykung.com
				Inactive
				»

				2234
				5679
				kungpaomeow.com
				Active
				»

				3234
				5680
				jimmycrackcorn.sitesprocket.com
				Active
				»


		<%--
			If JavaScript is disabled multi-step forms are displayed as a single page
			so the 'prev' and 'next' button are not used. These buttons are made visible via JavaScript.
		--%>

			<button class="step-button-prev">Prev</button>

			<button class="step-button-next">Next</button>

		<% if $Actions %>

		<% loop $Actions %>
			$Field
		<% end_loop %>

		<% end_if %>

Fix misplacement of actions class


#! /usr/bin/env scheme-script
;; -*- scheme -*-
(import
  (chezscheme)
  (harlan compile-opts)
  (harlan driver)
  (harlan backend print-c)
  (harlan compiler)
  (util system) ;; HARLAND
  )

;; This could be set from the env var HARLAND, or based on the
;; directory in which this script resides.  Using the latter:
(HARLAND (path-parent (car (command-line))))

;; Converts foo/bar.kfc to bar
(define (output-filename input)
  (let ((base (path-last (path-root input))))
    (if (make-shared-object)
        (string-append base ".so")
        base)))

(define print-compile-harlan
  (lambda (filename)
    (let-values (((input testspec) (read-source filename)))
      (if (assq 'iterate testspec)
          (error 'harlanc
                 "Test iteration is not supported. Use run-tests.scm instead.")
          (let* ((c-expr (compile-harlan input))
                 (c-code (harlan-format-c c-expr)))
            (if (verbose) (printf c-code))
            (g++-compile-stdin c-code (output-filename filename)))))))

(define (harlanc args)
  (let ((args (parse-args (cdr args))))
    (unless (null? args)
      ;; There should be a usage.
      (let ((filename (car args)))
        (print-compile-harlan filename)))))

(harlanc (command-line))

Include print-c when time passes is enabled.

#! /usr/bin/env scheme-script
;; -*- scheme -*-
(import
  (chezscheme)
  (harlan compile-opts)
  (harlan driver)
  (harlan backend print-c)
  (harlan compiler)
  (util system) ;; HARLAND
  )

;; This could be set from the env var HARLAND, or based on the
;; directory in which this script resides.  Using the latter:
(HARLAND (path-parent (car (command-line))))

;; Converts foo/bar.kfc to bar
(define (output-filename input)
  (let ((base (path-last (path-root input))))
    (if (make-shared-object)
        (string-append base ".so")
        base)))

(define print-compile-harlan
  (lambda (filename)
    (let-values (((input testspec) (read-source filename)))
      (if (assq 'iterate testspec)
          (error 'harlanc
                 "Test iteration is not supported. Use run-tests.scm instead.")
          (let* ((c-expr (compile-harlan input))
                 (c-code (if (timing)
                             (time (harlan-format-c c-expr))
                             (harlan-format-c c-expr))))
            (if (verbose) (printf c-code))
            (g++-compile-stdin c-code (output-filename filename)))))))

(define (harlanc args)
  (let ((args (parse-args (cdr args))))
    (unless (null? args)
      ;; There should be a usage.
      (let ((filename (car args)))
        (print-compile-harlan filename)))))

(harlanc (command-line))


;;; Hello world program
(define name "World")
(display (string-append "Hello " name "!" ))
(newline)
(display (/ 10 4))
(newline)

Check if variables are mutable

;;; Hello world program
(define name "World")
(display (string-append "Hello " name "!" ))
(newline)
(display (/ 10 4))
(newline)

(define name "Another world")
(display (string-append "Hello " name "!" ))
(newline)


Add solution for Problem001 written in Scheme

(define (range a b)
  (if (>= a b)
      '()
      (cons a (range (+ a 1) b))))

(define (filter f l)
  (cond ((null? l) '())
        ((f (car l)) (cons (car l) (filter f (cdr l))))
        (#t (filter f (cdr l)))))

(define (mult3-5 x)
  (or (= (remainder x 3) 0)
      (= (remainder x 5) 0)))

(define (sum l)
  (apply + l))

(define (main)
  (let ((answer (sum (filter mult3-5 (range 0 1000)))))
    (display answer)
    (newline)))

(main)


		<% with $EditForm %>

				<% with $Controller %>
					<% include SilverStripe\\Admin\\CMSBreadcrumbs %>
				<% end_with %>

			<% if $Fields.hasTabset %>
				<% with $Fields.fieldByName('Root') %>

					<% loop $Tabs %>
						<li<% if $extraClass %> class="$extraClass"<% end_if %>>$Title

					<% end_loop %>

				<% end_with %>
			<% end_if %>
		<% end_with %>

	$EditForm

FIX "My profile" title in CMS is now vertical centered as other LeftAndMain screens are


<%-- Args: $Title, $Link, $DesktopImage [, $MobileImage [, $TabletImage ]] --%>

	<% if $DesktopImage.exists %>

	<% end_if %>
	<% if $MobileImage.exists %>

	<% end_if %>
	<% if $TabletImage.exists %>

	<% end_if %>

Allow the MobileImage to be displayed.

<%-- Args: $Title, $Link, $DesktopImage [, $MobileImage [, $TabletImage ]] --%>

	<% if $DesktopImage.exists %>

	<% end_if %>
	<% if $TabletImage.exists %>

	<% end_if %>
	<% if $MobileImage.exists %>

	<% end_if %>


<div class="element $SimpleClassName.LowerCase<% if $StyleVariant %> $StyleVariant<% end_if %><% if $ExtraClass %> $ExtraClass<% end_if %>" id="$Anchor">
	<% uncached %>
		<% if canEdit && isCMSPreview == 0 %>

				Edit

		<% end_if %>
	<% end_uncached %>

	$Element

FIX Remove admin edit button from element holder to prevent canEdit errors

<div class="element $SimpleClassName.LowerCase<% if $StyleVariant %> $StyleVariant<% end_if %><% if $ExtraClass %> $ExtraClass<% end_if %>" id="$Anchor">
	$Element


;
; Person and gender conversion.
;

; AIML-tag person -- Convert 1st to third person, and back.
(define-public (do-aiml-person TEXT)
	(define (cvt WORD)
		(define ws (cog-name WORD))
		(cond
			((equal? ws "we") "they")
			((equal? ws "me") "they")
			((equal? ws "they") "I")
			((equal? ws "us") "them")
			((equal? ws "them") "us")
			(else ws)
		)
	)
	(ListLink (map cvt (cog-outgoing-set TEXT)))
)

; AIML-tag person2 -- Convert 1st to second person, and back.
(define-public (do-aiml-person2 TEXT)
	TEXT
)

; AIML-tag gender -- Convert male to female and back.
(define-public (do-aiml-gender TEXT)
	TEXT
)

; ==============================================================
;; mute the thing
*unspecified*

Fix the person tag handling

;
; Person and gender conversion.
;

; AIML-tag person -- Convert 1st to third person, and back.
(define-public (do-aiml-person TEXT)
	(define (cvt WORD)
		(define ws (cog-name WORD))
		(cond
			((equal? ws "we") "they")
			((equal? ws "me") "they")
			((equal? ws "they") "I")
			((equal? ws "us") "them")
			((equal? ws "them") "us")
			(else ws)
		)
	)
	(define (wcvt str) (Word (cvt str)))
	(ListLink (map wcvt (cog-outgoing-set TEXT)))
)

; AIML-tag person2 -- Convert 1st to second person, and back.
(define-public (do-aiml-person2 TEXT)
	TEXT
)

; AIML-tag gender -- Convert male to female and back.
(define-public (do-aiml-gender TEXT)
	TEXT
)

; ==============================================================
;; mute the thing
*unspecified*


<form $FormAttributes data-layout-type="border">

		<% if $Message %>

$Message

		<% else %>

		<% end_if %>

		<fieldset>
			<% if $Legend %><legend>$Legend</legend><% end_if %>
			<% loop $Fields %>
				$FieldHolder
			<% end_loop %>

		</fieldset>

		<% if $Actions %>

			<% loop $Actions %>
				$Field
			<% end_loop %>
			<% if $Controller.LinkPreview %>

					<%t SilverStripe\Admin\LeftAndMain.PreviewButton 'Preview' %> »

			<% end_if %>

		<% end_if %>

</form>

FIX Use double escapes backslashes in translation string

<form $FormAttributes data-layout-type="border">

		<% if $Message %>

$Message

		<% else %>

		<% end_if %>

		<fieldset>
			<% if $Legend %><legend>$Legend</legend><% end_if %>
			<% loop $Fields %>
				$FieldHolder
			<% end_loop %>

		</fieldset>

		<% if $Actions %>

			<% loop $Actions %>
				$Field
			<% end_loop %>
			<% if $Controller.LinkPreview %>

					<%t SilverStripe\\Admin\\LeftAndMain.PreviewButton 'Preview' %> »

			<% end_if %>

		<% end_if %>

</form>


For twitter loader

Remove debug from render tweet


<% include GoogleJavaScript %>

<% if $Caption %>
$Caption
<% end_if %>

Move JavaScript to a template that can be rendered at the end of the page


; Parse the contents of tagged template literals using
; a language inferred from the tag.

(call_expression
  (identifier) @injection.language
  (template_string) @injection.content) @injection.site

(call_expression
  (member_expression
    (property_identifier) @injection.language)
  (template_string) @injection.content) @injection.site

((regex
  (regex_pattern) @injection.content) @injection.site
 (set! injection.language "regex"))

Update injection query for new TS highlight API

; Parse the contents of tagged template literals using
; a language inferred from the tag.

(call_expression
  (identifier) @injection.language
  (template_string) @injection.content)

(call_expression
  (member_expression
    (property_identifier) @injection.language)
  (template_string) @injection.content)

; Parse regex syntax within regex literals

((regex_pattern) @injection.content
 (set! injection.language "regex"))


<% if $ListName %>

$ListName

<% end_if %>

<% if $Widget.Elements %>
	<ul class="$ClassName <% if $ExtraClass %> $ExtraClass<% end_if %>">
		<% loop $Widget.Elements %>

				$Me

		<% end_loop %>

<% end_if %>

Add Description to the default list template.

<% if $ListName %>

$ListName

<% end_if %>

$ListDescription

<% if $Widget.Elements %>
	<ul class="$ClassName <% if $ExtraClass %> $ExtraClass<% end_if %>">
		<% loop $Widget.Elements %>

				$Me

		<% end_loop %>

<% end_if %>


#!/gnu/store/kqq37w4xnl1q21g6vz93qq1rdb2y7ayc-guile-next-2.1.3/bin/guile \
-s
!#

;;; rcas-web - Web interface for RCAS
;;; Copyright © 2016  Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This program is free software: you can redistribute it and/or
;;; modify it under the terms of the GNU Affero General Public License
;;; as published by the Free Software Foundation, either version 3 of
;;; the License, or (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;;; Affero General Public License for more details.
;;;
;;; You should have received a copy of the GNU Affero General Public
;;; License along with this program.  If not, see
;;; <http://www.gnu.org/licenses/>.

(use-modules (rcas-web worker))
(set! %load-path (cons (getcwd) %load-path))
(worker-loop)


<%t CMSPageHistoryController_versions_ss.PREVIEW 'Website preview' %>

Update preview classes as area broken


	<% loop SortedSlides %>

<a href="<% if External %>$ExternalLink<% else %>$IntenalLink.Link<% end_if %>">
$Title

	<% end_loop %>

Change to links to allow for no link & Resize images in template

	<% loop SortedSlides %>
		<% if UseLink %>
			<% if ExternalLink %>

$Title

			<% else %>
$SlideImage.PaddedImage(1092,302)
$Title

<% end_if %>
		<% else %>

$Title

<% end_if %>
	<% end_loop %>


<% require css("silverstripe-admin/client/dist/styles/browser-warning.css") %>

SilverStripe

<%t SilverStripe\Admin\LeftAndMain.BROWSER_WARNING_HEADING 'Unsupported browser' %>

                <%t SilverStripe\Admin\LeftAndMain.BROWSER_WARNING_TEXT 'You're using a web browser that's not supported by SilverStripe.
Please upgrade to one of the following options.' %>

Internet Explorer(11+)

Mozilla Firefox

Google Chrome

<% require javascript("silverstripe-admin/client/dist/js/browserWarning.js") %>

Fix update asset files to be module aware

<% require css('silverstripe/admin: client/dist/styles/browser-warning.css') %>

SilverStripe

<%t SilverStripe\Admin\LeftAndMain.BROWSER_WARNING_HEADING 'Unsupported browser' %>

                <%t SilverStripe\Admin\LeftAndMain.BROWSER_WARNING_TEXT 'You're using a web browser that's not supported by SilverStripe.
Please upgrade to one of the following options.' %>

Internet Explorer(11+)

Mozilla Firefox

Google Chrome

<% require javascript('silverstripe/admin: client/dist/js/browserWarning.js') %>


<form $FormAttributes data-layout-type="border">

		<% if $Message %>

$Message

		<% else %>

		<% end_if %>

		<fieldset>
			<% if $Legend %><legend>$Legend</legend><% end_if %>
			<% loop $Fields %>
				$FieldHolder
			<% end_loop %>

		</fieldset>

		<% if $Actions %>

			<% loop $Actions %>
				$FieldHolder
			<% end_loop %>
				<% if $Controller.LinkPreview %>

				<%t SilverStripe\Admin\LeftAndMain.PreviewButton 'Preview' %> »

			<% end_if %>

			<% include SilverStripe\\Admin\\LeftAndMain_ViewModeSelector SelectID="preview-mode-dropdown-in-content" %>

		<% end_if %>

</form>

Reset ExtraClass on ViewModeSelector include

<form $FormAttributes data-layout-type="border">

		<% if $Message %>

$Message

		<% else %>

		<% end_if %>

		<fieldset>
			<% if $Legend %><legend>$Legend</legend><% end_if %>
			<% loop $Fields %>
				$FieldHolder
			<% end_loop %>

		</fieldset>

		<% if $Actions %>

			<% loop $Actions %>
				$FieldHolder
			<% end_loop %>
				<% if $Controller.LinkPreview %>

				<%t SilverStripe\Admin\LeftAndMain.PreviewButton 'Preview' %> »

			<% end_if %>

			<% include SilverStripe\\Admin\\LeftAndMain_ViewModeSelector SelectID="preview-mode-dropdown-in-content", ExtraClass='' %>

		<% end_if %>

</form>


(use-modules (opencog) (opencog test-runner))
(use-modules (opencog python))

(opencog-test-runner)
(define t "opencog-python-sniff-test")

(test-begin t)

; All that we do here is to make sure that python doesn't crash.
; Currently, `python-eval` returns an empty string.
(define rc (python-eval "print ('Hello world\\n', 2+2)"))

(test-assert "python-eval is borken" (string=? rc ""))

(test-end t)

Update unit test, now that python works

(use-modules (opencog) (opencog test-runner))
(use-modules (opencog python))

(opencog-test-runner)
(define t "opencog-python-sniff-test")

(test-begin t)

; All that we do here is to make sure that python doesn't crash.
; `python-eval` returns whatever python returned, as a string.
(define rc (python-eval "print ('Hello world\\n', 2+2)"))

; Python print returns 'None'
(test-assert "python-eval is borken" (string=? rc "None"))

(test-end t)


;; Equation (9) and (10) of:
;; Kaulakys, B., Ruseckas, J., Gontis, V. & Alaburda, M. Nonlinear stochastic models of 1/f noise and power-law distributions. Physica A: Statistical Mechanics and its Applications 365, 217–221 (2006).
(define-model kaulakys2006
  (variable t :independent :real)
  (variable X :real :default 1)
  (variable W :Wiener)
  (parameter mu :real :default 0)
  (parameter sigma :real :default 1)
  (parameter gamma :real :default 1/2)
  (parameter eta :real :default '(minus 5/2 mu))
  (parameter Gamma :real :default '(minus 1 (divide gamma (power sigma 2))))
  (eq (differential X)
      (plus (times Gamma
                   (power X (minus (times 2 eta) 1))
                   (differential t))
            (times (power X eta)
                   (differential W)))))


<% control Messages %>
	<div class="project_message<% if You %> you<% end_if %>">

$Author.Name said on $Created.Nice

$MessageText

		<% if Attachments %>

			<% control Attachments %>

  [$Name <% _t('SSP.ATTACHED','attached') %>]

			<% end_control %>

		<% end_if %>

		<% if PaymentOption %>

				<% control PaymentOption %>
					<% _t('SSPAdmin.PAYMENTOPTION','Payment option') %>: $Description ($Cost.Nice)
					<% _t('SSPAdmin.PAID','Paid?') %> $Paid.Nice
				<% end_control %>

		<% end_if %>

<% end_control %>

FIX - changed class name to remove conflict with existing class


Add example of a dynamically computed constraint

(*functional-properties* '(rdf:type))

(*unique-variables* '(?user ?role))

(*query-functional-properties?* #t)

(*queried-properties* '())

(*headers-replacements* '(("<SESSION>" mu-session-id uri)))

(define-constraint
  'read/write
  (lambda ()
    (let* ((role (alist-ref 'role
                   (sparql-select-unique (conc "SELECT ?role WHERE { "
                                               " <~A> mu:account ?user."
                                               " ?user <http://mu.semte.ch/vocabularies/school/role> ?role "
                                               " }")
                                         (or (header 'mu-session-id)
                                             "http://mu.semte.ch/sessions/3ae1614a-e1bd-11e7-9bcc-000000000000")))))
      (log-message "~%ROLE: ~A~%" role)
      (format   "
PREFIX graphs: <http://mu.semte.ch/school/graphs/>
PREFIX school: <http://mu.semte.ch/vocabularies/school/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
PREFIX dct: <http://purl.org/dc/terms/>

CONSTRUCT {
 ?a ?b ?c.
}
WHERE {
 GRAPH <http://mu.semte.ch/authorization> {
  <SESSION> mu:account ?user.
 }
 {
  @access Type(?type)
  FILTER (?type != school:Grade)
  GRAPH ?graph {
   ?a ?b ?c.
   ?a rdf:type ?type.
  }
 }
 UNION {
  @access Grade
  FILTER (?type = school:Grade)
  GRAPH ?graph {
   ?a ?b ?c.
   ?a rdf:type ?type.
  }
 ~A
 }
 VALUES (?graph ?type) {
  (graphs:grades school:Grade)
  (graphs:subjects school:Subject)
  (graphs:classes school:Class)
  (graphs:people foaf:Person)
 }
}" (match role
     ("principle" "")
     ("teacher"  (conc " GRAPH graphs:classes { "
                       "   ?class school:hasTeacher ?user. "
                       "   ?class school:classGrade ?a. "
                       " } "))
    ("student" (conc " GRAPH graphs:grades { "
                     "   ?a school:gradeRecipient ?user. "
                     " } ")))))))


;; Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
;; Use of this source code is governed by a BSD-style license that can be
;; found in the LICENSE file.

;; Run xbindkeys -dg for some example configuration file with explanation

; Cycle chroots
(xbindkey '(control shift alt F1) "
    for key in Control Shift Alt Meta; do
        echo 'keyup '$key'_L'
        echo 'keyup '$key'_R'
    done | xte
    croutoncycle prev")
(xbindkey '(control shift alt F2) "
    for key in Control Shift Alt Meta; do
        echo 'keyup '$key'_L'
        echo 'keyup '$key'_R'
    done | xte
    croutoncycle next")

; Extra bindings that must only be activated in chroot X11/Xephyr
(if (not (string-null? (getenv "XMETHOD")))
    (begin
        ; Brightness control
        (xbindkey '(XF86MonBrightnessDown) "brightness down")
        (xbindkey '(XF86MonBrightnessUp) "brightness up")

        ; Load ~/.xbindkeysrc.scm for customization if the current user has one
        (let ((usercfg (string-append (getenv "HOME") "/.xbindkeysrc.scm")))
            (if (access? usercfg F_OK) (load usercfg))
        )
    )
)

Fix X11 errors on switch.

;; Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
;; Use of this source code is governed by a BSD-style license that can be
;; found in the LICENSE file.

;; Run xbindkeys -dg for some example configuration file with explanation

; Cycle chroots
(xbindkey '(control shift alt F1) "
    for key in Control_L Control_R Shift_L Shift_R Alt_L Meta_L; do
        echo 'keyup '$key
    done | xte
    croutoncycle prev")
(xbindkey '(control shift alt F2) "
    for key in Control_L Control_R Shift_L Shift_R Alt_L Meta_L; do
        echo 'keyup '$key
    done | xte
    croutoncycle next")

; Extra bindings that must only be activated in chroot X11/Xephyr
(if (not (string-null? (getenv "XMETHOD")))
    (begin
        ; Brightness control
        (xbindkey '(XF86MonBrightnessDown) "brightness down")
        (xbindkey '(XF86MonBrightnessUp) "brightness up")

        ; Load ~/.xbindkeysrc.scm for customization if the current user has one
        (let ((usercfg (string-append (getenv "HOME") "/.xbindkeysrc.scm")))
            (if (access? usercfg F_OK) (load usercfg))
        )
    )
)


;; Like moses-pln-synergy-pm.scm but this version relies on the
;; forward chainer.

;; Load MOSES model
(load "moses-model.scm")

;; Load the background knowledge
(load "background-knowledge.scm")

;; Load the PLN configuration for this demo
(load "pln-config.scm")

;; Set logger to DEBUG
(use-modules (opencog logger))
(cog-logger-set-level "debug")

(pln-fc if-X-takes-Y-and-Y-contains-Z-then-X-takes-Z)

Move logger config at the beginning

;; Like moses-pln-synergy-pm.scm but this version relies on the
;; forward chainer.

;; Set logger to DEBUG
(use-modules (opencog logger))
;; (cog-logger-set-sync #t)
(cog-logger-set-level "debug")

;; Load MOSES model
(load "moses-model.scm")

;; Load the background knowledge
(load "background-knowledge.scm")

;; Load the PLN configuration for this demo
(load "pln-config.scm")

(pln-fc if-X-takes-Y-and-Y-contains-Z-then-X-takes-Z)


<form $FormAttributes data-layout-type="border">

		<% if $Message %>

$Message

		<% else %>

		<% end_if %>

		<fieldset>
			<% if $Legend %><legend>$Legend</legend><% end_if %>
			<% loop $Fields %>
				$FieldHolder
			<% end_loop %>

		</fieldset>

		<% if $Actions %>

			<% loop $Actions %>
				$Field
			<% end_loop %>
			<% if $Controller.LinkPreview %>

					<% _t('LeftAndMain.PreviewButton', 'Preview') %> »

			<% end_if %>

		<% end_if %>

</form>

Swap out .Actions class for bootstrap .btn-toolbar


<% _t('SSP.ORDERDETAILS','Initial Order details') %>

	<% control SelectedOptions %>

			<% control Option %>

$Title $Price.Nice

$Description

			<% end_control %>
			<% if Attachments %>

				<% control Attachments %>

$Name <% _t('SSP.ATTACHED','attached') %> download

				<% end_control %>

			<% end_if %>

	<% end_control %>

Total paid by credit card: $TotalCost.Nice

	<% if Notes %>

<% _t('SSP.NOTES','Notes') %>

$Notes

	<% end_if %>

FIX - added arrows for consistency

<% _t('SSP.ORDERDETAILS','Initial Order details') %>

	<% control SelectedOptions %>

			<% control Option %>

$Title $Price.Nice

$Description

			<% end_control %>
			<% if Attachments %>

				<% control Attachments %>

$Name <% _t('SSP.ATTACHED','attached') %> « download

				<% end_control %>

			<% end_if %>

	<% end_control %>

Total paid by credit card: $TotalCost.Nice

	<% if Notes %>

<% _t('SSP.NOTES','Notes') %>

$Notes

	<% end_if %>


/* mapping of google_map_N to an array of markers */
<% if DownloadJS %>
var infoWindows = [];
var gmarkers = [];
var mapLayers = [];
var mapLines = [];
<% end_if %>
var options = {
	centre: $LatLngCentre,
	zoom: $Zoom,
	maptype: '$MapType',
	domid: '$GoogleMapID',
	allowfullscreen: $AllowFullScreen,
	mapmarkers: $MapMarkers,
	lines: $Lines,
	kmlfiles: $KmlFiles,
	mapstyles: $JsonMapStyles,
	useclusterer: $UseClusterer,
	clusterergridsize: $ClustererGridSize,
	clusterermaxzoom: $ClustererMaxZoom,
	enableautocentrezoom: $EnableAutomaticCenterZoom
}

registerMap(options);

Use unique name for each options variable

/* mapping of google_map_N to an array of markers */
<% if DownloadJS %>
var infoWindows = [];
var gmarkers = [];
var mapLayers = [];
var mapLines = [];
<% end_if %>
var options_$GoogleMapID = {
	centre: $LatLngCentre,
	zoom: $Zoom,
	maptype: '$MapType',
	domid: '$GoogleMapID',
	allowfullscreen: $AllowFullScreen,
	mapmarkers: $MapMarkers,
	lines: $Lines,
	kmlfiles: $KmlFiles,
	mapstyles: $JsonMapStyles,
	useclusterer: $UseClusterer,
	clusterergridsize: $ClustererGridSize,
	clusterermaxzoom: $ClustererMaxZoom,
	enableautocentrezoom: $EnableAutomaticCenterZoom
}
registerMap(options_$GoogleMapID);


( define (compile-program x)
  (emit ".sub main :main")
  (emit "say ~a" x)
  (emit ".end"))

Use PCT-PAST in generated PIR.

; $Id$
; PAST-Generator for Eclectus

( define (compile-program x)

  (emit ".namespace")

  (emit ".sub '__onload' :init")
  (emit "    load_bytecode 'PGE.pbc'")
  (emit "    load_bytecode 'PGE/Text.pbc'")
  (emit "    load_bytecode 'PGE/Util.pbc'")
  (emit "    load_bytecode 'PGE/Dumper.pbc'")
  (emit "    load_bytecode 'PCT.pbc'")
  (emit ".end")
  (emit "")
  (emit ".sub main :main")
  (emit "")
  (emit "    .local pmc val_x")
  (emit "    val_x = new 'PAST::Val'")
  (emit "    val_x.init( 'value' => '~a', 'returns' => 'Integer' )" x )
  (emit "")
  (emit "    .local pmc var_last")
  (emit "    var_last = new 'PAST::Var'")
  (emit "    var_last.init( 'name' => 'last', 'scope' => 'package', 'lvalue' => 1 )")
  (emit "               ")
  (emit "    .local pmc op_bind")
  (emit "    op_bind = new 'PAST::Op'")
  (emit "    op_bind.init( var_last, val_x, 'pasttype' => 'bind' )")
  (emit "           ")
  (emit "    .local pmc op_say")
  (emit "    op_say = new 'PAST::Op'")
  (emit "    op_say.init( op_bind, 'name' => 'say', 'pasttype' => 'call' )")
  (emit "")
  (emit "    .local pmc stmts")
  (emit "    stmts = new 'PAST::Stmts'")
  (emit "    stmts.'init'( op_say, 'name'=>'stmts' )")
  (emit "")
  (emit "    # compile to PIR and display")
  (emit "    .local pmc astcompiler")
  (emit "    astcompiler = new [ 'PCT::HLLCompiler' ]")
  (emit "    astcompiler.'removestage'('parse')")
  (emit "    astcompiler.'removestage'('past')")
  (emit "")
  (emit "    astcompiler.'eval'(stmts)")
  (emit "")
  (emit ".end")
  (emit "")
  (emit "")
  (emit ".sub 'say'")
  (emit "    .param pmc args :slurpy")
  (emit "    if null args goto end")
  (emit "    .local pmc iter")
  (emit "    iter = new 'Iterator', args")
  (emit "  loop:")
  (emit "    unless iter goto end")
  (emit "    $P0 = shift iter")
  (emit "    print $P0")
  (emit "    goto loop")
  (emit "  end:")
  (emit "    say ''")
  (emit "    .return ()")
  (emit ".end"))


<% include SideBar %>

$Title

		$Content
		<% loop AllChildren %>

$Title

			$Summary

		<% end_loop %>

	$Form
	$CommentsForm

Use BestCrop method to select best cropping available


<% include GoogleJavaScript %>

<% if $Caption %>
$Caption
<% end_if %>

Remove hardwired style and move to css


;
; rule-engine-utils.scm
;
;;; Commentary:
;
; Handy utilities for working with the rule-engine. In particular to
; configure a rule-based system (rbs).
;
; Utilities include:
; -- ure-add-weighed-rules -- Associate rules to an rbs
; -- ure-set-num-parameter -- Set a numeric parameter of an rbs
; -- ure-set-fuzzy-bool-parameter -- Set a fuzzy boolean parameter of an rbs
;
;;; Code:
; Copyright (c) 2015, OpenCog Foundation
;

; Given an rbs and a list of pairs (rule weight) create for each rule
;
; MemberLink (stv weight 1)
;    rule
;    rbs
(define (ure-add-rules rbs rules)
  (define (ure-add-rule weighted-rule)
    (let ((rule (car weighted-rule))
          (weight (cadr weighted-rule)))
      (MemberLink (stv weight 1)
         rule
         rbs)))
  (for-each ure-add-rule rules)
)

; Set numerical parameters. Given an rbs, a parameter name and its
; value, create
;
; ExecutionLink
;    SchemaNode name
;    rbs
;    (NumberNode "value")
;
; It will also delete the any
;
; ExecutionLink
;    SchemaNode name
;    rbs
;    *
;
; to be sure there is ever only one value associated to that
; parameter. The value is automatically converted into string.
;
; TODO: fix the deletion of previous ExecutionLink
(define (ure-set-num-parameter rbs name value)
  ;; ; Delete any previous parameter
  ;; (cog-bind (BindLink
  ;;              (ExecutionLink
  ;;                 (SchemaNode name)
  ;;                 rbs
  ;;                 (VariableNode "__VALUE__"))
  ;;              (DeleteLink
  ;;                 (ExecutionLink
  ;;                    (SchemaNode name)
  ;;                    rbs
  ;;                    (VariableNode "__VALUE__")))))
  ; Set new value for that parameter
  (ExecutionLink
     (SchemaNode name)
     rbs
     (NumberNode (number->string value)))
)

; Set (fuzzy) bool parameters. Given an RBS, a parameter name and its
; value, create (or overwrite)
;
; EvaluationLink (stv value 1)
;    PredicateNode name
;    rbs
(define (ure-set-fuzzy-bool-parameter rbs name value)
  (EvaluationLink (stv value 1)
     (SchemaNode name)
     rbs)
)


;; Copyright 2018 Google LLC
;;
;; Licensed under the Apache License, Version 2.0 (the License);
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;;     http://www.apache.org/licenses/LICENSE-2.0
;;
;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an AS IS BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.

(library
    (lambda-3)
  (export do-test)
  (import (rnrs))

  ;; Test if we can call lambdas in a local variable
  (define (do-test)
    (let ((x (lambda (y) y)))
      (x #t))))


(use-modules (unit-test))

(define (square a) (* a a))
(define (excercise1.1 a b c)
     (if (< b c)
         (+ (square a) (square c))
         (if (< a b)
             (+ (square b) (square c))
             (+ (square a) (square b)))))

(assert-equal 0 (excercise1.1 0 0 0))
(assert-equal 1 (excercise1.1 1 0 0))
(assert-equal 4 (excercise1.1 2 0 0))
(assert-equal 5 (excercise1.1 2 1 0))
(assert-equal 5 (excercise1.1 1 0 2))
(assert-equal 13 (excercise1.1 2 1 3))
(assert-equal 13 (excercise1.1 1 3 2))

Choose second and third, when b is lower then c

(use-modules (unit-test))

(define (square a) (* a a))
(define (excercise1.1 a b c)
     (if (< b c)
         (if (< a  b)
             (+ (square b) (square c))
             (+ (square a) (square c)))
         (if (< a b)
             (+ (square b) (square c))
             (+ (square a) (square b)))))

(assert-equal 0 (excercise1.1 0 0 0))
(assert-equal 1 (excercise1.1 1 0 0))
(assert-equal 4 (excercise1.1 2 0 0))
(assert-equal 5 (excercise1.1 2 1 0))
(assert-equal 5 (excercise1.1 1 0 2))
(assert-equal 13 (excercise1.1 2 1 3))
(assert-equal 13 (excercise1.1 1 3 2))
(assert-equal 13 (excercise1.1 1 2 3))


;; Load SRFI-64 lightweight testing specification
(use-modules (srfi srfi-64))

;; Require bob impl
(add-to-load-path (dirname (current-filename)))
(use-modules (leap-year))

(test-begin "leap-year")

(test-eqv "vanilla-leap-year"
          #t
          (leap-year? 1996))

(test-eqv "any-old-year"
          #f
          (leap-year? 1997))

(test-eqv "non-leap-even-year"
          #f
          (leap-year? 1998))

(test-eqv "century"
          #f
          (leap-year? 1900))

(test-eqv "exceptional-century"
          #t
          (leap-year? 2400))

(test-end "leap-year")

Fix comment on module import

;; Load SRFI-64 lightweight testing specification
(use-modules (srfi srfi-64))

;; Require module
(add-to-load-path (dirname (current-filename)))
(use-modules (leap-year))

(test-begin "leap-year")

(test-eqv "vanilla-leap-year"
          #t
          (leap-year? 1996))

(test-eqv "any-old-year"
          #f
          (leap-year? 1997))

(test-eqv "non-leap-even-year"
          #f
          (leap-year? 1998))

(test-eqv "century"
          #f
          (leap-year? 1900))

(test-eqv "exceptional-century"
          #t
          (leap-year? 2400))

(test-end "leap-year")


Add a model of Arnold-Beltrami-Childress (ABC) flow

;; Arnold-Beltrami-Childress (ABC) flow
(define-model abc
  (variable t :independent)
  (variable x)
  (variable y)
  (variable z)
  (parameter A)
  (parameter B)
  (parameter C)
  (eq (diff (bvar t) x)
      (plus (times A (sin z)) (times C (cos y))))
  (eq (diff (bvar t) y)
      (plus (times B (sin x)) (times A (cos z))))
  (eq (diff (bvar t) z)
      (plus (times C (sin y)) (times B (cos x)))))


Add the PLN rule to be tested by derived_rule

;; =====================================================================
;; Implication construction rule
;;
;; P
;; Q
;; |-
;; ImplicationLink
;;    P
;;    Q
;;
;; To properly deal with this we should support deep type and infer
;; that P and Q are over the same domain.
;;
;; Overlaps:
;;
;; - can probably be replaced by a deduction rule with B == Universe
;;
;; ----------------------------------------------------------------------

(define implication-construction-variables
  (VariableList
     (TypedVariableLink
        (VariableNode "$P")
        (TypeChoice
           (TypeNode "PredicateNode")
           (TypeNode "LambdaLink")))
     (TypedVariableLink
        (VariableNode "$Q")
        (TypeChoice
           (TypeNode "PredicateNode")
           (TypeNode "LambdaLink")))))

(define implication-construction-body
  (AndLink
     (VariableNode "$P")
     (VariableNode "$Q")
     (NotLink
        (EqualLink
           (VariableNode "$P")
           (VariableNode "$Q")))))

(define implication-construction-rewrite
  (ExecutionOutputLink
     (GroundedSchemaNode "scm: implication-construction-formula")
     (ListLink
        (VariableNode "$P")
        (VariableNode "$Q"))))

(define implication-construction-rule
  (BindLink
     implication-construction-variables
     implication-construction-body
     implication-construction-rewrite))

(define (implication-construction-formula P Q)
  (let* (
         (P-s (cog-stv-strength P))
         (P-c (cog-stv-confidence P))
         (Q-s (cog-stv-strength Q))
         (Q-c (cog-stv-confidence Q))
         ; Compute the implication TV
         (Impl-s Q-s)
         (Impl-c (if (< 0.9 (* Q-s Q-c)) ; Hack to overcome the lack
                                         ; of distributional TV
                        Q-c
                        (* P-c Q-c)))) ; Big hack because the naive
                                       ; formula sucks
    (if (= Impl-c 0) ; Try to avoid constructing informationless
                     ; knowledge
        (cog-undefined-handle)
        (cog-merge-hi-conf-tv!
         (ImplicationLink
            P
            Q)
         (cog-new-stv Impl-s Impl-c)))))

;; Name the rule
(define implication-construction-rule-name
  (DefinedSchemaNode "implication-construction-rule"))
(DefineLink implication-construction-rule-name
  implication-construction-rule)


	$Image
	<% if $Content %>

			$Content

	<% end_if %>

Implement the slide image as a background image instead of a separate  element.

	<% if $Content %>

			$Content

	<% end_if %>


<% cached 'accessKeys', Aggregate(Page).Max(LastEdited) %>

Access Keys

<% control PagesWithAccessKeys %>
$Title
<% end_control %>
Skip to Content
Skip to Top Level Navigation
Skip to Section Navigation

<% end_cached %>

Change access keys to a list and use site config for navigation key

<% cached 'accessKeys', Aggregate(Page).Max(LastEdited) %>

Access Keys

<% if PagesWithAccessKeys %>
<% control PagesWithAccessKeys %>

$Title

<% end_control %>
<% end_if %>
<% if SiteConfig.SkipToMainContentAccessKey %>
<% _t('AccessKey.SKIP_TO_CONTENT', 'Next') %>
<% end_if %>

<% end_cached %>


            <%t Symbiote\\GridFieldExtensions\\GridFieldConfigurablePaginator.SHOW 'Show' is 'Verb. Example: Show 1 of 2' %>
            <select name="$PageSizesName" class="pagination-page-size-select" data-skip-autofocus="true">
            <% loop $PageSizes %>
                <option <% if $Selected %>selected="selected"<% end_if %>>$Size</option>
            <% end_loop %>
            </select>
            $PageSizesSubmit

        <% if not $OnlyOnePage %>

                $FirstPage $PreviousPage

                    <%t SilverStripe\\Forms\\GridField\\GridFieldPaginator.Page 'Page' %>
                    <input class="text" value="$CurrentPageNum" data-skip-autofocus="true" />
                    <%t SilverStripe\\Forms\\GridField\\GridFieldPaginator.OF 'of' is 'Example: View 1 of 2' %>
                    $NumPages

                $NextPage $LastPage

        <% end_if %>

            {$FirstShownRecord}–{$LastShownRecord}
            <%t SilverStripe\\Forms\\GridField\\GridFieldPaginator.OF 'of' is 'Example: View 1 of 2' %>
            $NumRecords

FIX Disable change tracking on configurable paginator inputs

            <%t Symbiote\\GridFieldExtensions\\GridFieldConfigurablePaginator.SHOW 'Show' is 'Verb. Example: Show 1 of 2' %>
            <select name="$PageSizesName" class="pagination-page-size-select no-change-track" data-skip-autofocus="true">
            <% loop $PageSizes %>
                <option <% if $Selected %>selected="selected"<% end_if %>>$Size</option>
            <% end_loop %>
            </select>
            $PageSizesSubmit

        <% if not $OnlyOnePage %>

                $FirstPage $PreviousPage

                    <%t SilverStripe\\Forms\\GridField\\GridFieldPaginator.Page 'Page' %>
                    <input class="text no-change-track" value="$CurrentPageNum" data-skip-autofocus="true" />
                    <%t SilverStripe\\Forms\\GridField\\GridFieldPaginator.OF 'of' is 'Example: View 1 of 2' %>
                    $NumPages

                $NextPage $LastPage

        <% end_if %>

            {$FirstShownRecord}–{$LastShownRecord}
            <%t SilverStripe\\Forms\\GridField\\GridFieldPaginator.OF 'of' is 'Example: View 1 of 2' %>
            $NumRecords


<% control Messages %>
	<div class="project_message<% if You %> you<% end_if %>">

$Author.Name said on $Created.Nice

$MessageText

		<% if Attachments %>

			<% control Attachments %>

  [$Name <% _t('SSP.ATTACHED','attached') %>]

			<% end_control %>

		<% end_if %>

		<% if PaymentOption %>

				<% control PaymentOption %>
					<% _t('SSPAdmin.PAYMENTOPTION','Payment option') %>: $Description ($Cost.Nice)
					<% _t('SSPAdmin.PAID','Paid?') %> $Paid.Nice
				<% end_control %>

		<% end_if %>

<% end_control %>

FIX - Moved styling div to remove erroneous payment option areas


<% if NextPage || PreviousPage %>

		<% if PreviousPage %>

$PreviousPage.Title

		<% end_if %>

		<% if NextPage %>

$NextPage.Title

		<% end_if %>

<% end_if %>

Add arrows to next / previous.

<% if NextPage || PreviousPage %>

		<% if PreviousPage %>

« $PreviousPage.Title

		<% end_if %>

		<% if NextPage %>

$NextPage.Title »

		<% end_if %>

<% end_if %>


My Account

 Past Orders

 Edit Profile

 Address Book

		<% with CurrentMember %>

Name

$Name

Email

$Email

Member Since

$Created.Nice

Last Visit

$LastVisited.Nice

Number of orders

<% if PastOrders %>$PastOrders.Count<% else %>0<% end_if %>

		<% end_with %>

	 Log Out

Simplify logout and remove bad

My Account

 Past Orders

 Edit Profile

 Address Book

 Log Out

		<% with CurrentMember %>

Name

$Name

Email

$Email

Member Since

$Created.Nice

Last Visit

$LastVisited.Nice

Number of orders

<% if PastOrders %>$PastOrders.Count<% else %>0<% end_if %>

		<% end_with %>


<% if DownloadJS %>
<% if DelayLoadMapFunction %>
<% else %>
<% require javascript("//maps.google.com/maps/api/js?sensor=false&hl=$Lang") %>
<% if $UseCompressedAssets %>
<% require javascript("mappable/javascript/google/mappablegoogle.min.js") %>
<% else %>
<script type="text/javascript">
var mappableMaps = [];
</script>
<% require javascript("mappable/javascript/google/FullScreenControl.js") %>
<% require javascript("mappable/javascript/google/markerclusterer.js") %>
<% require javascript("mappable/javascript/google/maputil.js") %>
<% end_if %>
<% end_if %>
<!-- end of common js -->
<% end_if %>

Load google maps asynchronously and use callback to prime maps with provided data. This gets around the issue of timing and google map library not being found

<% if DownloadJS %>
<% if DelayLoadMapFunction %>
<% else %>
<script type="text/javascript">
function loadScript() {
  var script = document.createElement('script');
  script.type = 'text/javascript';
  script.src = 'https://maps.googleapis.com/maps/api/js?' +
      '&ensor=false&callback=loadedGoogleMapsAPI&hl=en';
  document.body.appendChild(script);
}
window.onload = loadScript;
</script>
<% if $UseCompressedAssets %>
<% require javascript("mappable/javascript/google/mappablegoogle.min.js") %>
<% else %>
<script type="text/javascript">
var mappableMaps = [];
var shortcodeMaps = [];
var shortcodeStreetview = [];
</script>
<% require javascript("mappable/javascript/google/FullScreenControl.js") %>
<% require javascript("mappable/javascript/google/markerclusterer.js") %>
<% require javascript("mappable/javascript/google/maputil.js") %>
<% end_if %>
<% end_if %>
<!-- end of common js -->
<% end_if %>


Simple → <% include Navigation %>

		© Simple by Sara (Innovatif) / Powered by Silverstripe

FIX Remove link in footer that goes to spammy site


; Types

(type_identifier) @type
(predefined_type) @type.builtin
((identifier) @type
 (match? @type "^[A-Z]"))

(type_arguments
  "<" @punctuation.bracket
  ">" @punctuation.bracket)

; Variables

(required_parameter (identifier) @variable.parameter)
(optional_parameter (identifier) @variable.parameter)

; Keywords

"enum" @keyword
"export" @keyword
"interface" @keyword
"namespace" @keyword
"implements" @keyword
"private" @keyword
"public" @keyword
(readonly) @keyword

Add missing keywords to highlight query

; Types

(type_identifier) @type
(predefined_type) @type.builtin
((identifier) @type
 (match? @type "^[A-Z]"))

(type_arguments
  "<" @punctuation.bracket
  ">" @punctuation.bracket)

; Variables

(required_parameter (identifier) @variable.parameter)
(optional_parameter (identifier) @variable.parameter)

; Keywords

"abstract" @keyword
"declare" @keyword
"enum" @keyword
"export" @keyword
"implements" @keyword
"interface" @keyword
"keyof" @keyword
"namespace" @keyword
"private" @keyword
"protected" @keyword
"public" @keyword
"type" @keyword
(readonly) @keyword


$Name

Current Weather

Short Term Forecast

Long Term Forecast

Switch to URL Segments instead of ID


<link rel="stylesheet" type="text/css" href="{$BaseHref}staticsearch/css/tipuesearch.css">

<script type="text/javascript" src="{$BaseHref}{$ThemeDir}/js/lib/jquery.js"></script>
<script type="text/javascript" src="{$BaseHref}search_index"></script>
<script type="text/javascript" src="{$BaseHref}staticsearch/javascript/lib/tipuesearch/tipuesearch_set.js"></script>
<script type="text/javascript" src="{$BaseHref}staticsearch/javascript/lib/tipuesearch/tipuesearch.min.js"></script>
<script type="text/javascript" src="{$BaseHref}staticsearch/javascript/staticsearch.js"></script>

Remove mime type from js index

<link rel="stylesheet" type="text/css" href="{$BaseHref}staticsearch/css/tipuesearch.css">

<script type="text/javascript" src="{$BaseHref}{$ThemeDir}/js/lib/jquery.js"></script>
<script src="{$BaseHref}search_index"></script>
<script type="text/javascript" src="{$BaseHref}staticsearch/javascript/lib/tipuesearch/tipuesearch_set.js"></script>
<script type="text/javascript" src="{$BaseHref}staticsearch/javascript/lib/tipuesearch/tipuesearch.min.js"></script>
<script type="text/javascript" src="{$BaseHref}staticsearch/javascript/staticsearch.js"></script>


Instructions to import a sspak file into your local site after downloading

Note: Databases and asset snapshots are stored using the sspak format.
	You will need to install sspak using the following instructions if you wish to work with these snapshots locally.

If you want to restore database and assets from an existing sspak file you have downloaded from deploynaut, you can
	use one of the following methods:

Import the sspak file into an existing local site:

sspak load /path/to/downloaded/file.sspak /path/to/my/local/site

Extract the sspak file contents, allowing you to import the database and assets manually:

sspak extract /path/to/downloaded/file.sspak

Tweak heading to be more to the point

Importing a snapshot into your local site

Note: Databases and asset snapshots are stored using the sspak format.
	You will need to install sspak using the following instructions if you wish to work with these snapshots locally.

If you want to restore database and assets from an existing sspak file you have downloaded from deploynaut, you can
	use one of the following methods:

Import the sspak file into an existing local site:

sspak load /path/to/downloaded/file.sspak /path/to/my/local/site

Extract the sspak file contents, allowing you to import the database and assets manually:

sspak extract /path/to/downloaded/file.sspak


<% if $CurrentMember.CanSelectSubsite %>

		<select id="SubsitesSelect">
			<% loop $ListSubsites %>
				<option value="$ID" $CurrentState>$Title</option>
			<% end_loop %>
		</select>

<% end_if %>

Fix conditional logic for subsites dropdown

<% if $CurrentMember.Groups.Filter('CanSelectSubsite', 1).Count %>

		<select id="SubsitesSelect">
			<% loop $ListSubsites %>
				<option value="$ID" $CurrentState>$Title</option>
			<% end_loop %>
		</select>

<% end_if %>


(require-extension srfi-1)

;;; The scrape-list is a list of every url->video procedures.
(define scraper-list '())

;;; Allow "plugins" in sites/ to add procedures to the scraper-list
(define (add-scraper procedure)
  (set! scraper-list (cons procedure scraper-list)))

(include "sites/svt.scm")
(include "sites/tv4.scm")

;;; Dispatcher
;;; Each url->videos procedure is applied to the url. The resulting
;;; videos are appended into a video-list, which is returned.
(define (url->videos url)
  (delete-duplicates
   (apply append (filter-map (lambda (u->v) (u->v url)) scraper-list))))

Fix type in commit No functional change

(require-extension srfi-1)

;;; The scrape-list is a list of all url->video procedures
(define scraper-list '())

;;; Allow "plugins" in sites/ to add procedures to the scraper-list
(define (add-scraper procedure)
  (set! scraper-list (cons procedure scraper-list)))

(include "sites/svt.scm")
(include "sites/tv4.scm")

;;; Dispatcher
;;; Each url->videos procedure is applied to the url. The resulting
;;; videos are appended into a video-list, which is returned.
(define (url->videos url)
  (delete-duplicates
   (apply append (filter-map (lambda (u->v) (u->v url)) scraper-list))))


	<% with $CurrentMember %>

                <%t SilverStripe\Admin\LeftAndMain.Hello 'Hi' %>
                <% if $FirstName && $Surname %>$FirstName $Surname<% else_if $FirstName %>$FirstName<% else %>$Email<% end_if %>

	<% end_with %>

	<a href="$LogoutURL" class="cms-login-status__logout-link font-icon-logout" title="<%t SilverStripe\Admin\LeftAndMain.LOGOUT 'Log out' %>">

FIX Only show user's first name in CMS header

	<% with $CurrentMember %>

                <%t SilverStripe\\Admin\\LeftAndMain.Hello 'Hi' %>
                <% if $FirstName %>$FirstName<% else %>$Email<% end_if %>

	<% end_with %>

	<a href="$LogoutURL" class="cms-login-status__logout-link font-icon-logout" title="<%t SilverStripe\Admin\LeftAndMain.LOGOUT 'Log out' %>">


;; The solution of exercise 2.2
;; Consider the problem of representing line segments in a plane. Each
;; segment is represented as a pair of points: a starting point and an
;; ending point. Define a constructor `make-segment` and selectors `start-
;; segment` and `end-segment` that define the representation of segments
;; in terms of points. Furthermore, a point can be represented as a pair
;; of numbers: the x coordinate and the y coordinate. Accordingly, specify
;; a constructor make-point and selectors `x-point` and `y-point` that
;; define this representation.
;;
;; Finally, using your selectors and constructors, define a procedure
;; `midpoint-segment` that takes a line segment as argument and returns
;; its midpoint (the point whose coordinates are the average of the
;; coordinates of the endpoints). To try your procedures, you'll need a
;; way to print points:
;;
;;     (define (print-point p)
;;       (display "(")
;;       (display (x-point p))
;;       (display ",")
;;       (display (y-point p))
;;       (display ")")
;;       (newline))
;;
;; -------- (above from SICP)
;;

;; Make points
(define (make-point x y) (cons x y))
(define (x-point point) (car point))
(define (y-point point) (cdr point))

;; Make segments
(define (make-segment start-point end-point)
  (cons start-point end-point))
(define (start-segment segment) (car segment))
(define (end-segment segment) (cdr segment))

;; Compute the coordinates of the midpoint of the given segment
(define (midpoint-segment segment)
  (let* ((start-point (start-segment segment))
         (end-point (end-segment segment))
         (start-x-point (x-point start-point))
         (start-y-point (y-point start-point))
         (end-x-point (x-point end-point))
         (end-y-point (y-point end-point)))
    (make-point (/ (+ start-x-point
                      end-x-point)
                   2.0)
                (/ (+ start-y-point
                      end-y-point)
                   2.0))))

;; Print the coordinate of one point
(define (print-point p)
  (display "(")
  (display (x-point p))
  (display ", ")
  (display (y-point p))
  (display ")")
  (newline))

(define (main)
  (display "Load this file and use `midpoint-segment` procedure.\n")
  (display "Example: A(1.5, 7.5) . B(-1.5, -8.5)\n")
  (display "Make segment and print its midpoint: \n")
  (let ((test-segment
         (make-segment (make-point 1.5 7.5)
                       (make-point -1.5 -8.5))))
    (print-point (midpoint-segment test-segment))))

(main)


$Title

<% control MainImage %>
	<% control SetWidth(400) %>

	<% end_control %>
	<% end_control %>
$Content
$Form

Remove now obsolete control directive for looping

$Title

<% with MainImage %>
	<% with SetWidth(400) %>

	<% end_with %>
<% end_with %>
$Content
$Form


<% loop getGalleryImages %>

	<% with $Image.SetRatioSize(700,700) %>
    <a href="$URL"<% end_with %> title="$Caption.XML" rel="prettyPhoto[pp_gal]">
	<% with $Image.SetHeight(100) %><img src="$URL"<% end_with %> alt="$Title.XML"/>

<% end_loop %>

Move JS requirements to inline gallery

<% require css(ss3gallery/css/ss3Gallery.css) %>
<% require css(ss3gallery/css/prettyPhoto.css) %>
<% require javascript(framework/thirdparty/jquery/jquery.js) %>
<% require javascript(ss3gallery/javascript/jquery.prettyPhoto.js) %>
<% require javascript(ss3gallery/javascript/ss3gallery-pretty-photo.js) %>

<% loop getGalleryImages %>

	<% with $Image.SetRatioSize(1000,1000) %>
    <a href="$URL"<% end_with %> title="$Caption.XML" class="thumbnail" rel="prettyPhoto[pp_gal]">
	<% with $Image.CroppedFocusedImage(200,200) %><img src="$URL"<% end_with %> alt="$Title.XML"/>

<% end_loop %>


<% require css(gallery/css/jquery.ad-gallery.css) %>

<% require javascript(framework/thirdparty/jquery/jquery.js) %>
<% require javascript(gallery/javascript/jquery.ad-gallery.min.js) %>
<% require javascript(gallery/javascript/gallery.js) %>

$Title

		$Gallery

$Content

		$Form
		$PageComments

<% include SideBar %>

Make default template compatible with silverstrap

<% require javascript(http://cdn.jsdelivr.net/jquery/1.11.0/jquery.min.js) %>
<% require css(gallery/css/jquery.ad-gallery.css) %>
<% require javascript(gallery/javascript/jquery.ad-gallery.min.js) %>
<% require javascript(gallery/javascript/gallery.js) %>

$Title

			$Gallery
			$Content
			$Form


;
; OpenCog Rule Engine module
;
(define-module (opencog rule-engine))

; We need this to set the LTDL_LIBRARY_PATH
(use-modules (opencog))

(load-extension "libruleengine" "opencog_ruleengine_init")

(load-from-path "rule-engine/rule-engine-utils.scm")
(export-rule-engine-utils)

Fix the load path; missing prefix

;
; OpenCog Rule Engine module
;
(define-module (opencog rule-engine))

; We need this to set the LTDL_LIBRARY_PATH
(use-modules (opencog))

(load-extension "libruleengine" "opencog_ruleengine_init")

(load-from-path "opencog/rule-engine/rule-engine-utils.scm")
(export-rule-engine-utils)


<form $FormAttributes >
	$HiddenFields
	<% with FieldMap %>

	<% if $Top.Options.UserTitle %>
	Title
	$Title
	<% end_if %>
	Post content
	$Content

	$Up.Actions
	<input type="button" name="uploadTrigger" value="Upload" />

	<% if $LoggedInUsers %>

	<input type="button" class="specific-users" value="Post to" />

		$LoggedInUsers
		Logged in users

		Specific users
		$Members

		Groups
		$Groups

	<% end_if %>

	<% end_with %>
</form>

FIX Only output permission fields if they're defined

<form $FormAttributes >
	$HiddenFields
	<% with FieldMap %>

	<% if $Top.Options.UserTitle %>
	Title
	$Title
	<% end_if %>
	Post content
	$Content

	$Up.Actions
	<input type="button" name="uploadTrigger" value="Upload" />

	<% if $LoggedInUsers %>

	<input type="button" class="specific-users" value="Post to" />

		<% if $LoggedInUsers %>
		$LoggedInUsers
		Logged in users
		<% end_if %>

		<% if $Members %>
		Specific users
		$Members
		<% end_if %>

		<% if $Groups %>
		Groups
		$Groups
		<% end_if %>

	<% end_if %>

	<% end_with %>
</form>


;
; Opencog atom-types module
;
(define-module (opencog atom-types))

; Alternately, we could also have
; (define-module (opencog atomtypes nlp-types))
; (define-module (opencog atomtypes spacetime-types))
; and so on, but I don't see the point of that, at the moment...

; XXX Python bug work-around -- python is unable to locate shared
; libraries.  Work around this here, by explicitly setting the
; library path, and the scheme file search path. This is NOT needed
; by the scheme code; but python croaks without this. Go figure...
(setenv "LD_LIBRARY_PATH" "/usr/local/lib/opencog:/usr/local/lib/opencog/modules")
(add-to-load-path "/usr/local/share/opencog/scm")

; Load the C libraries that actually call the classserver to load
; the types.
(load-extension "libnlp-types" "nlp_types_init")
(load-extension "libspacetime-types" "spacetime_types_init")
(load-extension "libattention-types" "attention_types_init")
(load-extension "libembodiment-types" "embodiment_types_init")

(load-from-path "nlp/types/nlp_types.scm")
(load-from-path "spacetime/spacetime_types.scm")
(load-from-path "dynamics/attention/attention_types.scm")
(load-from-path "embodiment/embodiment_types.scm")

Revert hacky python bug work-around

;
; Opencog atom-types module
;
(define-module (opencog atom-types))

; Alternately, we could also have
; (define-module (opencog atomtypes nlp-types))
; (define-module (opencog atomtypes spacetime-types))
; and so on, but I don't see the point of that, at the moment...

; Load the C libraries that actually call the classserver to load
; the types.
(load-extension "libnlp-types" "nlp_types_init")
(load-extension "libspacetime-types" "spacetime_types_init")
(load-extension "libattention-types" "attention_types_init")
(load-extension "libembodiment-types" "embodiment_types_init")

(load-from-path "nlp/types/nlp_types.scm")
(load-from-path "spacetime/spacetime_types.scm")
(load-from-path "dynamics/attention/attention_types.scm")
(load-from-path "embodiment/embodiment_types.scm")


<% if DownloadJS %>
<% if DelayLoadMapFunction %>
<% else %>
<script src="//maps.google.com/maps/api/js?sensor=false&hl=$Lang" type="text/javascript"></script>
<% if $UseCompressedAssets %>
<script type="text/javascript" src="/mappable/javascript/google/mappablegoogle.min.js"></script>
<% else %>
<script type="text/javascript" src="/mappable/javascript/google/FullScreenControl.js"></script>
<script type="text/javascript" src="/mappable/javascript/google/markerclusterer.js"></script>
<script type="text/javascript" src="/mappable/javascript/google/maputil.js"></script>
<% end_if %>

<script type="text/javascript">google.maps.event.addDomListener(window, 'load', loadedGoogleMapsAPI);</script>
<% end_if %>
<script type="text/javascript">
// map details are stored here and used to invoke maps in the loadedGoogleMapsAPI function
var mappableMaps = [];
</script>
<!-- end of common js -->
<% end_if %>

Use requirements to load the JavaScript files

<% if DownloadJS %>
<% if DelayLoadMapFunction %>
<% else %>
<% require javascript("//maps.google.com/maps/api/js?sensor=false&hl=$Lang") %>

<% if $UseCompressedAssets %>
<% require javascript("mappable/javascript/google/mappablegoogle.min.js") %>
<% else %>
<% require javascript("mappable/javascript/google/FullScreenControl.js") %>
<% require javascript("mappable/javascript/google/markerclusterer.js") %>
<% require javascript("mappable/javascript/google/maputil.js") %>
<% end_if %>

<script type="text/javascript">google.maps.event.addDomListener(window, 'load', loadedGoogleMapsAPI);</script>
<% end_if %>
<script type="text/javascript">
// map details are stored here and used to invoke maps in the loadedGoogleMapsAPI function
var mappableMaps = [];
</script>
<!-- end of common js -->
<% end_if %>


(eval-vm
 '(define fib
    (lambda (n)
      (if (= 0 n)
        0
        (if (= 1 n)
          1
          (+ (fib (- n 1)) (fib (- n 2))))))))

(print (eval-vm '(fib 30)))
(newline)

Comment result of fib benchmark

(eval-vm
 '(define fib
    (lambda (n)
      (if (= 0 n)
        0
        (if (= 1 n)
          1
          (+ (fib (- n 1)) (fib (- n 2))))))))

(print (eval-vm '(fib 30)))
(newline)

;; first heap based vm version
;;
;; $ time ./lisp < samples/fib-vm.scm
;; 832040
;; ./lisp < samples/fib-vm.scm  6.37s user 1.59s system 111% cpu 7.102 total
;;
;; naive interpreter version
;;
;; $ time ./lisp < samples/fib.scm
;; 832040
;; ./lisp < samples/fib.scm  5.03s user 1.22s system 115% cpu 5.439 total


#lang typed-scheme

(: f3 (case-lambda (Integer * -> Integer) (Number * -> Number)))
(define (f3 x y) (+ x y))

(+ 1 'foo)

(: f2 (case-lambda (Number * -> Number)))
(define (f2 x y) (+ x y))

Remove this, as it isn't needed.

#lang typed-scheme

(: f3 (case-lambda (Integer * -> Integer) (Number * -> Number)))
(define (f3 x y) (+ x y))

(: f2 (case-lambda (Number * -> Number)))
(define (f2 x y) (+ x y))


<% if Deleted %>
	<% _t('MicroPost.DELETED', '[deleted]') %>
<% else %>

	<% if Content %>
		<% if IsOembed %>
		$Content.Raw
		<% else_if IsImage %>

		<% else %>
		$ConvertedContent.Parse(RestrictedMarkdown)
		<% end_if %>
	<% else %>
		<% if OwnerID == $CurrentMember.ID %>

		<% end_if %>
	<% end_if %>

	<% if Attachment %>
		Download original: $Attachment.Name
	<% end_if %>

	<% if $ParentID == 0 && $PostTarget %>
	<% if $currentContext %>

	<% else %>
	See: $PostTarget.Title
	<% end_if %>

	<% end_if %>
<% end_if %>

FIX Changed logic for whether to display target link

<% if Deleted %>
	<% _t('MicroPost.DELETED', '[deleted]') %>
<% else %>

	<% if Content %>
		<% if IsOembed %>
		$Content.Raw
		<% else_if IsImage %>

		<% else %>
		$ConvertedContent.Parse(RestrictedMarkdown)
		<% end_if %>
	<% else %>
		<% if OwnerID == $CurrentMember.ID %>

		<% end_if %>
	<% end_if %>

	<% if Attachment %>
		Download original: $Attachment.Name
	<% end_if %>

	<%-- Top level post, AND we have a target? Show the link back to that target if available --%>
	<% if $ParentID == 0 && $PostTarget %>
		<% if not $currentContext %>

See: $PostTarget.Title

		<% end_if %>
	<% end_if %>

<% end_if %>


(define s.car car)
(define s.cdr cdr)
(define s.+ +)
(define s.< <)
(define (num x) (if (number? x) x 0))
(define (if/nil Q A E)
  (if (equal? Q 'nil) (E) (A)))

(define (atom x) (if (pair? x) 'nil 't))
(define (car x) (if (pair? x) (s.car x) '()))
(define (cdr x) (if (pair? x) (s.cdr x) '()))
(define (equal x y) (if (equal? x y) 't 'nil))
(define (natp x)
  (if (integer? x) (if (< x 0) 'nil 't) 'nil))
(define (+ x y) (s.+ (num x) (num y)))
(define (< x y)
  (if (s.< (num x) (num y)) 't 'nil))

(define-syntax if
  (syntax-rules ()
    ((_ Q A E)
     (if/nil Q (lambda () A) (lambda () E)))))

(define-syntax defun
  (syntax-rules ()
    ((_ name (arg ...) body)
     (define (name arg ...) body))))

(define-syntax dethm
  (syntax-rules ()
    ((_ name (arg ...) body)
     (define (name arg ...) body))))

(defun size (x)
  (if (atom x)
    '0
    (+ '1 (+ (size (car x)) (size (cdr x))))))

Fix natp for Schemes like Guile.

(define s.car car)
(define s.cdr cdr)
(define s.+ +)
(define s.< <)
(define (num x) (if (number? x) x 0))
(define (if/nil Q A E)
  (if (equal? Q 'nil) (E) (A)))

(define (atom x) (if (pair? x) 'nil 't))
(define (car x) (if (pair? x) (s.car x) '()))
(define (cdr x) (if (pair? x) (s.cdr x) '()))
(define (equal x y) (if (equal? x y) 't 'nil))
(define (natp x)
  (if (integer? x) (if (s.< x 0) 'nil 't) 'nil))
(define (+ x y) (s.+ (num x) (num y)))
(define (< x y)
  (if (s.< (num x) (num y)) 't 'nil))

(define-syntax if
  (syntax-rules ()
    ((_ Q A E)
     (if/nil Q (lambda () A) (lambda () E)))))

(define-syntax defun
  (syntax-rules ()
    ((_ name (arg ...) body)
     (define (name arg ...) body))))

(define-syntax dethm
  (syntax-rules ()
    ((_ name (arg ...) body)
     (define (name arg ...) body))))

(defun size (x)
  (if (atom x)
    '0
    (+ '1 (+ (size (car x)) (size (cdr x))))))


<form $FormAttributes>

	<fieldset>

			$FieldMap.ReportTitle.FieldHolder
			$FieldMap.ReportDescription.FieldHolder

			<% if FieldMap.Filters.Children %>

Filter by

			<% control FieldMap.Filters %>
			<% control Children %>

				$Title
				$Field

			<% end_control %>
			<% end_control %>

			<% if FieldMap.action_updatereport %>
			$FieldMap.action_updatereport.Field
			<% end_if %>

			<% end_if %>

			$FieldMap.ReportContent.FieldHolder

			<% control HiddenFields %>$Field<% end_control %>

	</fieldset>
</form>

Add horizontal scrolling to reports when necessary. (from r96075)


;
; OpenCog Rule Engine module
;

(define-module (opencog rule-engine))

(load-extension "libruleengine" "opencog_ruleengine_init")

(load-from-path "rule-engine-utils.scm")
(export-rule-engine-utils)

Add missing LTDL library path

;
; OpenCog Rule Engine module
;
(define-module (opencog rule-engine))

; We need this to set the LTDL_LIBRARY_PATH
(use-modules (opencog))

(load-extension "libruleengine" "opencog_ruleengine_init")

(load-from-path "rule-engine-utils.scm")
(export-rule-engine-utils)