Author Topic: 9.3  (Read 33656 times)

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #60 on: July 15, 2020, 11:27:00 AM »
I'll rewrite the old OS 9.2.3 programs in English and with my new libraries and make them open source as a demo in the OS 9.3 SDK. For the replacement of Finder I'm still stuck with taking over the desktop.

There's more good news: I bought a HP EliteBook 2530p in the second handstore for 20 euro and it has Windows 10 Pro. After some recharging and self test I could boot and it works fine, not one disk error and used for only 1776 hours. Now I can do what wasn't possible on my other computers.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #61 on: September 05, 2020, 04:07:08 AM »
I updated all my REALbasic programs.

They are faster.
They use less memory.
The interface is smoother.
They are safer because reading and writing binary data are separated by wrapper classes.
They use the same stream classes and utilities modules.
They are a bit bigger.
Results are now written to a file instead of a window.
Instead of a "New 1" folder with a report, you get a report with a datestamp.
New output is placed in a new folder with a datestamp.
Similar programs have now a similar interface.
BasicFilter can now do 4 things at the same time with the same selection.
CountTypesAndCreators saves the report now as Mac text instead of Unicode and you can choose the number format.
ReplaceAll can now search several regular expressions at the same time.
You can now drag items to the MakePaths icon or open them from the menu.
XRayVision has now Select all and Deselect all buttons and undo.

http://www.fileconvoy.com/dfl.php?id=g4b48edecfc5e66e01000278883e3d37fc9e7f8fc98

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: 9.3
« Reply #62 on: September 05, 2020, 06:02:48 AM »
wow, so there are still true one-click filehosters.
insert arbitrary signature here

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #63 on: October 21, 2020, 08:12:48 AM »
Before I continue here I want to write an external editor for CodeWarrior to get more control over my text. See this discussion:

http://macos9lives.com/smforum/index.php/topic,5740.0.html

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #64 on: December 02, 2020, 12:58:52 PM »
Just a warning in case that you want to write a contextual menu extension. If you have multiple volumes, and you make a folder on each volume with the same name, and you move those folders to the desktop, and you use a contextual menu extension in those folders, then the CMM can act on the wrong folder with the same name. A CMM uses Finder object specifiers, and things on the desktop with the same name have the same Finder object specifier. The new Finder won't have this problem if it uses FSSpecs instead of Finder object specifiers.

There's another complication: window path select doesn't work without Finder because it sends a reveal objects event to Finder. I can install an Apple event handler for this event in Finder that resends the event to the new Finder, but this feature won't work without Finder.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #65 on: December 08, 2020, 11:05:25 AM »
I updated my extensions.
There's one new extension.
It logs the patches which are installed in the programs of your choice.

I know, I'm hopping from subject to subject,
but this is logic
because good ideas don't come all at once and in the right order.

Offline snes1423

  • Enthusiast Member
  • ***
  • Posts: 25
  • New Member
Re: 9.3
« Reply #66 on: December 10, 2020, 01:48:21 PM »
Ooh can I beta test would love to try this out in a early stage of development  :P

Offline Hopfenholz

  • Enthusiast Member
  • ***
  • Posts: 37
  • New Member
Re: 9.3
« Reply #67 on: December 10, 2020, 02:31:14 PM »
I thought of a cool name for it

9der

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #68 on: March 15, 2021, 10:44:19 AM »
I updated my C++ framework. The main change is that I respond now to possible errors in functions which can’t return an error code like constructors, destructors and operator delete. And I removed ExitToShell everywhere, so that a program always exits from main.

Now I'm testing all the programs.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #69 on: April 26, 2021, 07:32:48 AM »
See the progress in the attachment.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #70 on: May 17, 2021, 11:18:37 AM »
There was a bug in the RequiredSuiteTest demo program. OpenOrPrintDocList has to be DoAEOpenOrPrintDoc.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #71 on: July 26, 2021, 10:26:53 AM »
All my programs work now with paths that may be longer than 255 characters.

I wrote a new program that writes the documentation in HTML. The old program was too complicated.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #72 on: August 09, 2021, 10:12:53 AM »
I copied an AVL tree implementation in C++ from www.github.com It's written by Prabal Basu of the Utah state university. I found his implementation interesting because his functions take a pointer by value and return a pointer, which is much easier than what I was doing. Perhaps he wrote this first in LISP? It's very slow because it recalculates the height and balance every time they are needed. The speed is comparable to Apple's AVL tree. I changed this to store the height and balance in every node and this appeared to be the fastest AVL tree implementation that I have seen. Insertion is 4% faster and deletion is 3% faster compared to my own solution. I'm using this now in all my programs.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #73 on: August 18, 2021, 12:06:09 PM »
I changed the old program that writes the documentation in HTML into a link checker.

The old program copied a HTML file folder. In these files I inserted Scheme expressions between French quotes. These expressions were evaluated and replaced with the result. This was wonderful, but there's a simpler solution. HTML pages can be generated in C++ by means of macros. This is easier than typing HTML in a text editor.

Code: [Select]
#define E(x) ""
#define S_(x,attr) "<" x attr ">"
#define SE_(x,attr,text) S_(x,attr) text E(x)

#define A_(attr,text) SE_("a",attr,text)
#define B_(attr,text) SE_("b",attr,text)
#define BODY_(attr,text) SE_("body",attr,text)
#define BR_(attr) S_("hr",attr)
#define H1_(attr,text) SE_("h1",attr,text)
#define H2_(attr,text) SE_("h2",attr,text)
#define H3_(attr,text) SE_("h3",attr,text)
#define H4_(attr,text) SE_("h4",attr,text)
#define HEAD_(attr,text) SE_("head",attr,text)
#define HR_(attr) S_("hr",attr)
#define HTML_(attr,text) SE_("html",attr,text)
#define I_(attr,text) SE_("i",attr,text)
#define IMG_(attr) S_("img",attr)
#define LI_(attr,text) SE_("li",attr,text)
#define LINK_(attr) S_("link",attr)
#define META_(attr) S_("meta",attr)
#define P_(attr,text) SE_("p",attr,text)
#define PRE_(attr,text) SE_("pre",attr,text)
#define SPAN_(attr,text) SE_("span",attr,text)
#define TABLE_(attr,text) SE_("table",attr,text)
#define TD_(attr,text) SE_("td",attr,text)
#define TITLE_(attr,text) SE_("title",attr,text)
#define TR_(attr,text) SE_("tr",attr,text)
#define UL_(attr,text) SE_("ul",attr,text)

#define DQ(x) "\"" x "\""
#define SQ(x) "'" x "'"
#define AV(attr,val) " " attr "=" DQ(val)

#define A(href,text) A_(AV("href",href),text)
#define B(text) B_("",text)
#define BODY(text) BODY_("",text)
#define BR() BR_("")
#define H1(text) H1_("",text)
#define H2(text) H2_("",text)
#define H3(text) H3_("",text)
#define H4(text) H4_("",text)
#define HEAD(text) HEAD_("",text)
#define HR() HR_("")
#define HTML(text) HTML_("",text)
#define I(text) I_("",text)
#define IMG(src) IMG_(AV("src",src))
#define LI(text) LI_("",text)
#define LINK(href,type,rel) LINK_(AV("href",href) AV("type",type) AV("rel",rel))
#define META(name,content) META_(AV("name",name) AV("content",content))
#define P(text) P_("",text)
#define PRE(text) PRE_("",text)
#define SPAN(text) SPAN_("",text)
#define TABLE(text) TABLE_("",text)
#define TD(text) TD_("",text)
#define TITLE(text) TITLE_("",text)
#define TR(text) TR_("",text)
#define UL(text) UL_("",text)

static const char* const c=
    HTML(HEAD(TITLE("Test"))
         BODY(H1("Test")
              H2("Chapter 1")
              P("Paragraph 1")
              HR()
              P("Paragraph 2")
              HR()
              H2("Chapter 2")
              P("This is a "
                B(I("test"))
                ".")
              HR()
              P(IMG("Logo.png"))
              P(A("Contents.htm","Contents"))));
Then I wrote a program that converts HTML into C++ macros.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #74 on: August 23, 2021, 08:29:45 AM »
The definition of E appeared incorrectly because it's interpreted as HTML. I'll try again.

Code: [Select]
#define E(x) "<" "/" x ">"

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #75 on: August 31, 2021, 08:12:38 AM »
I wrote Prabal Basu’s AVL tree solution in Scheme.

Code: [Select]
(define node
  (class object% (k)
    (private
      [key k]
      [height 1]
      [balance 0]
      [left #f]
      [right #f]
      (get-cond-height (lambda (x)
                         (if x
                             (send x get-height)
                             0))))
    (public
      (get-key (lambda () key))
      (set-key (lambda (k) (set! key k)))
      (get-height (lambda () height))
      (get-balance (lambda () balance))
      (get-left (lambda () left))
      (set-left (lambda (l) (set! left l)))
      (get-right (lambda () right))
      (set-right (lambda (r) (set! right r)))
      (calc-height-and-balance (lambda ()
                                 (define left-height (get-cond-height left))
                                 (define right-height (get-cond-height right))
                                 (begin
                                   (set! height (+ 1 (max left-height right-height)))
                                   (set! balance (- left-height right-height))))))
    (sequence
      (super-init))))

(define (balance-node node)
  (define balance (send node get-balance))
  (cond ((< 1 balance)
         (if (< 0 (send (send node get-left) get-balance))
             (rotate-ll node)
             (rotate-lr node)))
        ((< balance -1)
         (if (< 0 (send (send node get-right) get-balance))
             (rotate-rl node)
             (rotate-rr node)))
        (else node)))

(define (rotate-ll node)
  (define temp (send node get-left))
  (begin
    (send node set-left (send temp get-right))
    (send temp set-right node)
    (send node calc-height-and-balance)
    (send temp calc-height-and-balance)
    temp))

(define (rotate-rr node)
  (define temp (send node get-right))
  (begin
    (send node set-right (send temp get-left))
    (send temp set-left node)
    (send node calc-height-and-balance)
    (send temp calc-height-and-balance)
    temp))

(define (rotate-lr node)
  (begin
    (send node set-left (rotate-rr (send node get-left)))
    (rotate-ll node)))

(define (rotate-rl node)
  (begin
    (send node set-right (rotate-ll (send node get-right)))
    (rotate-rr node)))

(define (get-in-order-predecessor node)
  (define (get-most-right x)
    (define r (send x get-right))
    (if r
        (get-most-right r)
        x))
  (get-most-right (send node get-left)))

(define (update-node node)
  (begin
    (send node calc-height-and-balance)
    (balance-node node)))

(define (dump-node node)
  (list (send node get-key)
        (let ((left (send node get-left)))
          (if left
              (dump-node left)
              #f))
        (let ((right (send node get-right)))
          (if right
              (dump-node right)
              #f))))

(define (verify-node node)
  (define key (send node get-key))
  (and (<= -1 (send node get-balance) 1)
       (let ((left (send node get-left)))
         (or (not left)
             (and (< (send left get-key) key)
                  (verify-node left))))
       (let ((right (send node get-right)))
         (or (not right)
             (and (< key (send right get-key))
                  (verify-node right))))))

(define (find-node last k)
  (define key (send last get-key))
  (cond ((< k key)
         (let ((left (send last get-left)))
           (if left
               (find-node left k)
               #f)))
        ((< key k)
         (let ((right (send last get-right)))
           (if right
               (find-node right k)
               #f)))
        (else last)))

(define (insert-node last k)
  (if last
      (let ((last-key (send last get-key)))
        (cond ((< k last-key)
               (begin
                 (send last set-left (insert-node (send last get-left) k))
                 (update-node last)))
              ((< last-key k)
               (begin
                 (send last set-right (insert-node (send last get-right) k))
                 (update-node last)))
              (else (error "Double: " k))))
      (make-object node k)))

(define (delete-node last k)
  (if last
      (let ((last-key (send last get-key)))
        (cond ((< k last-key)
               (begin
                 (send last set-left (delete-node (send last get-left) k))
                 (update-node last)))
              ((< last-key k)
               (begin
                 (send last set-right (delete-node (send last get-right) k))
                 (update-node last)))
              ((and (send last get-left)
                    (send last get-right))
               (let* ((temp (get-in-order-predecessor last))
                      (temp-key (send temp get-key)))
                 (begin
                   (send last set-key temp-key)
                   (send last set-left (delete-node (send last get-left) temp-key))
                   (update-node last))))
              (else (let* ((last-left (send last get-left))
                           (temp (if last-left
                                     last-left
                                     (send last get-right))))
                      (if temp
                          (update-node temp)
                          #f)))))
      (error "Not found: " k)))

(define tree
  (class object% ()
    (private
      [top #f])
    (public
      (dump (lambda ()
              (if top
                  (dump-node top)
                  #f)))
      (verify (lambda ()
                (if top
                    (verify-node top)
                    #f)))
      (find (lambda (k)
              (if top
                  (find-node top k)
                  #f)))
      (insert (lambda (k)
                (set! top (insert-node top k))))
      (delete (lambda (k)
                (set! top (delete-node top k)))))
    (sequence
      (super-init))))

(define t (make-object tree))

(define (dump) (send t dump))
(define (verify) (send t verify))
(define (insert x) (send t insert x))
(define (find x) (send t find x))
(define (delete x) (send t delete x))

(define test1
  '(53 90 71 63 16 9 6 58 79 37
       70 77 41 94 52 17 42 38 98 46
       49 95 68 3 14 45 13 91 26 15
       2 92 36 64 51 80 61 59 67 30
       8 20 5 100 29 31 21 56 69 73
       24 27 93 32 54 66 19 78 57 55
       60 83 22 62 82 4 75 40 28 76
       86 89 12 72 44 84 43 65 97 81
       88 7 47 10 18 96 50 35 1 23
       11 33 87 39 74 48 99 34 85 25))

(for-each insert test1)

(verify)

(define test2
  '(11 81 9 42 12 75 87 60 57 3
       56 79 52 36 83 44 100 69 47 99
       95 43 46 13 19 78 70 64 80 71
       82 34 35 68 98 28 51 62 31 32
       30 73 97 5 21 17 53 7 85 6
       20 33 92 24 89 38 26 45 96 77
       22 1 63 39 40 29 76 90 2 74
       23 72 16 41 91 8 61 50 37 84
       65 59 66 58 25 48 18 93 55 27
       88 67 10 54 94 14 49 4 86 15))

(map find test2)

(define test3
  '(33 45 44 63 27 89 51 85 98 68
       82 20 100 17 8 86 40 73 61 97
       2 9 71 57 52 23 22 87 64 13
       81 66 79 26 31 84 62 34 48 10
       19 46 15 59 58 47 69 37 99 70
       32 55 30 90 56 78 42 21 77 39
       93 49 74 80 53 54 6 95 14 65
       11 38 50 72 83 76 92 67 12 96
       88 60 41 18 5 36 3 29 24 1
       35 91 7 75 25 43 16 94 4 28))

(for-each delete test3)

(dump)[code]

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #76 on: August 31, 2021, 08:14:48 AM »
I'm improving my REALbasic programs with threads, Cancel and a progress bar.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: 9.3
« Reply #77 on: September 06, 2021, 08:57:53 AM »
To get it right I should rewrite my REALbasic programs in C++. I wrote these programs in REALbasic because I wanted to use them on Windows too, but since I use them only on OS 9 I’m better off with C++.

Then I should use HFS+ instead of HFS. But in some cases HFS is better. Scanning a directory with HFS+ is 18% slower.

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: 9.3
« Reply #78 on: October 02, 2021, 04:28:12 PM »
Code: [Select]
#define E(x) "<" "/" x ">"

the euler constant should be written as small e anyway.

if not as (U+2107) or Ɛ (U+0190)
« Last Edit: October 02, 2021, 04:39:41 PM by IIO »
insert arbitrary signature here