<commit_before>;;;;; tré – Copyright (c) 2008–2013 <NAME> <<EMAIL>>

(defun make-log-stream ()
  (make-stream :fun-in       #'((str))
               :fun-out      #'((c str)
                                  (logwindow-add-string (? (string? c)
                                                           c
                                                           (char-string c))))
	           :fun-eof	  #'((str)
                               t)))

(defvar *standard-log* (make-log-stream))
(= *standard-output* (make-log-stream))
(= *standard-error* (make-log-stream))

(defvar *logwindow* nil)

(defvar *terminal-css* (new :margin "0"
                            :background  "#000"
                            :color       "#0f0"
                            :white-space "pre-wrap"
                            :font-family "monospace"
                            :font-weight "bold"))
 
(defvar *log-event-module* nil)

(dont-obfuscate
	window
	document
	title
    open
	writeln
	scroll-to)

(defun open-log-window ()
  (unless *logwindow*
    (= *logwindow* (window.open "" "log" "width=640, height=480, scrollbars=yes"))
    (let doc *logwindow*.document
      (document-extend doc)
      (= doc.title "Console")
      (doc.body.add (new *element "div"))
	  (doc.body.set-styles (hash-merge *terminal-css* (new :width "100%")))
      ,@(when *have-compiler?*
          '((let form (new *element "form")
              (doc.body.add form)
              (with (txt    (new *element "textarea" nil (new :width "98%"
                                                              :height "12em"))
                     submit (new *element "input" (new :type "submit"
                                                       :value "Evaluate...")))
                (form.add txt)
                (form.add submit)
                (event-manager.init-document doc)
                (event-manager.set-send-natively-by-default? doc t)
                (init-event-module *log-event-module* "log")
                (*log-event-module*.click [(_.discard)
                                           (_.send-natively nil)<commit_msg>Adapt to modern "HD" resolution.<commit_after>; tré – Copyright (c) 2008–2013,2016 <NAME> <<EMAIL>>

(defun make-log-stream ()
  (make-stream :fun-in    #'((str))
               :fun-out   #'((c str)
                              (logwindow-add-string (? (string? c)
                                                       c
                                                       (char-string c))))
	           :fun-eof	  #'((str)
                              t)))

(defvar *standard-log* (make-log-stream))
(= *standard-output* (make-log-stream))
(= *standard-error* (make-log-stream))

(defvar *logwindow* nil)

(defvar *terminal-css* (new :margin "0"
                            :background  "#000"
                            :color       "#0f0"
                            :white-space "pre-wrap"
                            :font-family "monospace"
                            :font-weight "bold"))
 
(defvar *log-event-module* nil)

(dont-obfuscate
	window
	document
	title
    open
	writeln
	scroll-to)

(defun open-log-window ()
  (unless *logwindow*
    (= *logwindow* (window.open "" "log" "width=1200, height=300, scrollbars=yes"))
    (let doc *logwindow*.document
      (document-extend doc)
      (= doc.title "Console")
      (doc.body.add (new *element "div"))
	  (doc.body.set-styles (hash-merge *terminal-css* (new :width "100%")))
      ,@(when *have-compiler?*
          '((let form (new *element "form")
              (doc.body.add form)
              (with (txt    (new *element "textarea" nil (new :width "98%"
                                                              :height "12em"))
                     submit (new *element "input" (new :type "submit"
                                                       :value "Evaluate...")))
                (form.add txt)
                (form.add submit)
                (event-manager.init-document doc)
                (event-manager.set-send-natively-by-default? doc t)
                (init-event-module *log-event-module* "log")
                (*log-event-module*.click [(_.discard)
                                           (_.send-natively nil)
{'fraction_non_alphanumeric': 0.1411764705882353, 'fraction_numerical': 0.01388235294117647, 'mean_word_length': 1.2527821939586645, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 21, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6939080', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1172, 'n_words': 267}