Post Reply 
newRPL - Updated to build 1510 [official build remains at 1487]
07-11-2023, 06:26 AM
Post: #281
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(07-11-2023 02:28 AM)Claudio L. Wrote:  [quote='spiff72' pid='174546' dateline='1688996706']

....
Regarding the display chopping the right bits, I've seen it happen only with a Samsung Edge phone, which had a "virtual" size on the screen that included the curved part and fooled the Qt library into resizing the screen too big. I don't know why it would do the same on the Pixel7, though.

The calculator front in general seems to have been sized correctly, so I'd have thought the true space available for the emulated calc display could be gleaned from that result?
I dunno nuthin' about Android app design, though.
Find all posts by this user
Quote this message in a reply
07-15-2023, 02:05 PM
Post: #282
RE: newRPL - Updated to build 1510 [official build remains at 1487]
Btw why is there no version of newRPL for Prime G2?
I'm not really complaining, I have a G1 in dire need of a new raison d'etre....
Find all posts by this user
Quote this message in a reply
07-15-2023, 02:30 PM
Post: #283
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(07-15-2023 02:05 PM)n3mmr Wrote:  Btw why is there no version of newRPL for Prime G2?
I'm not really complaining, I have a G1 in dire need of a new raison d'etre....

I asked the same earlier in thread - I think it's because the CPU is different and compatibility issues. That was my reason to find a nice G1 on eBay...so the G2 can live in stock form!
Find all posts by this user
Quote this message in a reply
07-15-2023, 03:11 PM
Post: #284
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(07-15-2023 02:30 PM)spiff72 Wrote:  
(07-15-2023 02:05 PM)n3mmr Wrote:  Btw why is there no version of newRPL for Prime G2?
I'm not really complaining, I have a G1 in dire need of a new raison d'etre....

I asked the same earlier in thread - I think it's because the CPU is different and compatibility issues. That was my reason to find a nice G1 on eBay...so the G2 can live in stock form!

If I'm not mistaken it's more because the G2 integrates a protection system against the installation of other OS than the native OS for the "exam mode".
Find all posts by this user
Quote this message in a reply
07-15-2023, 03:20 PM
Post: #285
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(07-15-2023 03:11 PM)Gilles Wrote:  
(07-15-2023 02:30 PM)spiff72 Wrote:  I asked the same earlier in thread - I think it's because the CPU is different and compatibility issues. That was my reason to find a nice G1 on eBay...so the G2 can live in stock form!

If I'm not mistaken it's more because the G2 integrates a protection system against the installation of other OS than the native OS for the "exam mode".

I tried searching for the answer but was unsuccessful. The search capability of this forum leave a bit to be desired.
Find all posts by this user
Quote this message in a reply
07-15-2023, 04:02 PM
Post: #286
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(07-15-2023 03:20 PM)spiff72 Wrote:  
(07-15-2023 03:11 PM)Gilles Wrote:  If I'm not mistaken it's more because the G2 integrates a protection system against the installation of other OS than the native OS for the "exam mode".

I tried searching for the answer but was unsuccessful. The search capability of this forum leave a bit to be desired.

Here you go

Greetings,
    Massimo

-+×÷ ↔ left is right and right is wrong
Visit this user's website Find all posts by this user
Quote this message in a reply
07-16-2023, 10:25 AM
Post: #287
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(07-15-2023 04:02 PM)Massimo Gnerucci Wrote:  
(07-15-2023 03:20 PM)spiff72 Wrote:  I tried searching for the answer but was unsuccessful. The search capability of this forum leave a bit to be desired.

Here you go

That is the very best kind of reason!

Is there some source of reliable info on the HW design of the HP Prime calcs, g1 as well as g2?
Find all posts by this user
Quote this message in a reply
07-16-2023, 12:34 PM
Post: #288
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(07-16-2023 10:25 AM)n3mmr Wrote:  Is there some source of reliable info on the HW design of the HP Prime calcs, g1 as well as g2?

Suggest you post a question like this in the Prime sub-forum, it will likely be seen by lots more folks that (whom?) are more focused on the Prime. RPL and Prime have very few common fans.. some do exist for sure (cough... Joe Horn... cough) but generally not too many.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
07-22-2023, 10:55 PM (This post was last modified: 08-13-2023 12:54 PM by Gilles.)
Post: #289
RE: newRPL - Updated to build 1510 [official build remains at 1487]
I spent some time tonight starting a ListExt library in newRPL.
For documentation and usage, see : https://www.hpcalc.org/details/7971 by David Mutter. It's a partial implementation for now. It's very fast because newRPL is very fast especially with the processing of lists. The rest will follow soon enough when I have time next week and will be integrated into a newRPL library with menu and on line help.

Code:
@================================================================
@  List Extension for newRPL  13/08/2023
@----------------------------------------------------------------
DIRECTORY
@---------------------------------------------------------------
'$LIBID' 'LstX' 
@---------------------------------------------------------------
'$TITLE' 
"List extended lib v1.01a Nemo59
Thanks to Claudio L. (newRPL)
and to D. Mutter (ListExt)" 
@================================================================
'LSEQ'   
  « → a  
   « CASE 
       a 1  ≥ THEN  1 a FOR 'n' n NEXT a →LIST END
       a -1 ≤ THEN -1 a FOR 'n' n -1 STEP a NEG →LIST END
      {} 
     END   
   » 
  »
@----------------------------------------------------------------
'LSEQR'   
  « → a b  
   « IF a b ≤  THEN 
      a b FOR 'n' n NEXT 
     ELSE 
      a b FOR 'n' n -1 STEP 
     END 
     a b - ABS 1 + →LIST
   »
  »
@----------------------------------------------------------------
'LASEQ'
  « → dep diff nbr 
   « 
    CASE 
     nbr NOT  THEN {} END
     nbr 1 == THEN dep 1 →LIST END
     dep 
     2 nbr START DUP diff + NEXT
     nbr →LIST
    END
   »
  » 
@----------------------------------------------------------------
'LMSEQ'   
  « → a b c 
   « CASE
       c 0 ≤ THEN {} END
       c 2 < THEN a 1 →LIST END
       a DUP     
       2 c START b * DUP NEXT
       DROP c →LIST
     END
   »
  »
@----------------------------------------------------------------
'LDSEQ' « SWAP INV SWAP LMSEQ »
@----------------------------------------------------------------
'LMRPT'
  « → List a  
   « {}
     IF a 1 ≥ THEN 1 a START List ADD NEXT END    
   » 
  »
  
@----------------------------------------------------------------
'LWHL'
  « DEPTH 3 - → LWHL.Pa LWHL.Pc LWHL.d
    « DO  
       DUP LWHL.Pa EVAL
      UNTIL DUP LWHL.Pc EVAL NOT END
      DROP
      DEPTH LWHL.d - →LIST
    »
  »
@----------------------------------------------------------------
'LDDUP'
  « 
   REVLIST OBJ→ {}
   1 ROT START
    IF SWAP DUP2 POS THEN DROP ELSE
      IF DUP TYPE 62 == THEN 1 →LIST END
      ADD 
    END
   NEXT 
  » 
@----------------------------------------------------------------
'LPOP' « DUP HEAD SWAP TAIL SWAP »
@----------------------------------------------------------------
'LPOPR' « DUPDUP SIZE 1 - LFRST SWAP 1 LLAST OBJ→ DROP »
@----------------------------------------------------------------
'LPUSH' « 1 →LIST SWAP ADD »
@----------------------------------------------------------------
'LPSHR' « 1 →LIST ADD »
@----------------------------------------------------------------
'LPICK' « SWAP → List « « List SWAP GET » MAP » »
@----------------------------------------------------------------
'LREPL' « ROT → List « 2 « 'List' UNROT REPL » DOLIST DROP List » »
@----------------------------------------------------------------
'LRMOV'
  « → List r 
   « IF r TYPE 10 == THEN
      @.........................................................
      @ Working with the stack in not significantly faster
      @ and more complicated than using two SUB. 
      @ Very different versus stock RPL
      @.........................................................
      List 1 r 1 - SUB
      List r 1 + List SIZE SUB
      ADD 
     ELSE
      IF r SIZE THEN 
       @.........................................................
       @ See to ameliorate? Not obvious because of // process
       @ For exemple { a b c d e } { 2 2 4 } LRMOV => { a c e }
       @ <=>  { a b c d e } 2 LRMOV 3 LRMOV  that is a lot faster
       @.........................................................
       r LDDUP SORT REVLIST
       1
       « → ri 
        « List 1 ri 1 - SUB 
          List ri 1 + List SIZE SUB
          ADD 'List' STO
        » 
       » 
       DOSUBS DROP List    
      END   
     END 
   » 
  »
@----------------------------------------------------------------
'LINSR'
  « → List n o
   « List n 1 - LFRST o ADD List DUP SIZE n - 1 + LLAST ADD »
  »
@----------------------------------------------------------------
'LFRST'  « 1 SWAP SUB »
@----------------------------------------------------------------
'LLAST' « OVER SIZE DUP ROT - 1 + SWAP SUB »
@----------------------------------------------------------------
'LDWHL'
  « OVER SIZE → LDWHL.List LDWHL.p LDWHL.s
   « IF LDWHL.s NOT THEN {} ELSE 
       0 'LDWHL.n' LSTO
       WHILE 'LDWHL.List' 'LDWHL.n' INCR GET LDWHL.p REPEAT END 
       LDWHL.List LDWHL.n LDWHL.s SUB
     END
   »
  »
@----------------------------------------------------------------
'LTWHL'
  « OVER SIZE → LTWHL.List LTWHL.p LTWHL.s
   « IF LTWHL.s NOT THEN {} ELSE 
       0 'LTWHL.n' LSTO
       WHILE 'LTWHL.List' 'LTWHL.n' INCR GET LTWHL.p REPEAT END 
       LTWHL.List 1 LTWHL.n 1 - SUB
     END
   »
  »
@----------------------------------------------------------------
'LDROP'
  « 0 RND → n
   « CASE
       n 0 > THEN DUP SIZE n 1 + SWAP SUB END
       n 0 < THEN DUP SIZE n + 1 SWAP SUB END
     END
   »
  »
@---------------------------------------------------------------
'LFILT'  
  « → LFILT.Filter 
    « 1 « IF DUP LFILT.Filter NOT THEN DROP END » DOSUBS »
  » 
@----------------------------------------------------------------
'LROLL' « DUP SIZE → List s « List 1 LLAST List s 1 - LFRST ADD » »
@----------------------------------------------------------------
'LRLLD' « DUP TAIL SWAP HEAD ADD »
@----------------------------------------------------------------
'LROT'
   « OVER SIZE → List a s  
    « CASE 
        a 0 > THEN List a LLAST List s a - LFRST  ADD END
        a 0 < THEN 'a' SNEG List s a - LLAST List a LFRST ADD END 
       List
      END   
    »
   »
@----------------------------------------------------------------
'LSWAP'  
   « →  a b 
    « DUP a GET
      OVER b GET
      UNROT b SWAP PUT
      SWAP a SWAP PUT
    »
   »
@---------------------------------------------------------------
'LSHUF'
   « IF DUP TYPE 10 == THEN LSEQ END 
     OBJ→ → s  
    « 
      1 s FOR n
        s n - 1 + RAND * IP n + ROLL
      NEXT
      s →LIST
     »
   »
@----------------------------------------------------------------
'DOPERM' 

@ DOPERM.L : Liste
@ DOPERM.P : Programme a éxécuter pour chaque permutation
@ DOPERM.T : Taille de de liste à permuter
@ DOPERM.B : Gestion du BREAK
@ DOPERM.S : Mémorise taille de la pile pour générer liste retour 
@ DOPERM.G : S/Prog récursif pour générer les permut successives
@................................................................

 « OVER SIZE 0 DEPTH 4 - → DOPERM.L DOPERM.P DOPERM.T DOPERM.B DOPERM.S
    «
       « 1 'DOPERM.B' STO »
  
       «  → DOPERM.K
         «
           IF DOPERM.B THEN 1 'LstX.Break?' LIBSTO EXIT END
           IF 'DOPERM.K==1' THEN DOPERM.L DOPERM.P  
           ELSE
             DOPERM.K 1 - DOPERM.G  
             1 DOPERM.K 1 - FOR 'DOPERM.I'
                IF DOPERM.K 2 MOD THEN
                 'DOPERM.L' 1 GET 'DOPERM.L' DOPERM.K GET
                 'DOPERM.L' 1 ROT PUT 'DOPERM.L' DOPERM.K ROT PUT
                ELSE
                 'DOPERM.L' DOPERM.I GET 'DOPERM.L' DOPERM.K GET
                 'DOPERM.L' DOPERM.I ROT PUT 'DOPERM.L' DOPERM.K ROT PUT
                END
                DOPERM.K 1 - DOPERM.G  
             NEXT
           END
         » 

       » → BREAK DOPERM.G
         « 
           0 'LstX.Break?' LIBSTO
           DOPERM.T DOPERM.G EVAL
           DEPTH DOPERM.S - →LIST
         »
    » 
  »
@---------------------------------------------------------------
'DOCOMB'

@ DOCOMB.L : Liste
@ DOCOMB.R : Nbr d'items à combiner
@ DOCOMB.P : Programme a éxécuter pour chaque combinaison
@ DOCOMB.E : Taille de de liste initiale
@ DOCOMB.B : Gestion du BREAK
@ DOCOMB.S : Mémorise taille de la pile pour générer liste retour 
@ DOCOMB.G : S/Prog récursif pour générer les combi successives
@................................................................

  « PICK3 SIZE PICK3 0 SWAP NDUPN →LIST 0 DEPTH 6 -
    → 'DOCOMB.L' 'DOCOMB.R' 'DOCOMB.P' 'DOCOMB.E' 'DOCOMB.D' 'DOCOMB.B' 'DOCOMB.S'
    « 
      « 1 'DOCOMB.B' STO » @ BREAK
  
      «  → DOCOMB.I DOCOMB.X 
        «
          IF DOCOMB.B 'LstX.Break?' LIBRCL OR THEN EXIT END
          IF  DOCOMB.X DOCOMB.R 1 + ==  THEN DOCOMB.D DOCOMB.P 
          ELSE
            IF DOCOMB.I DOCOMB.E ≤ THEN
              'DOCOMB.L' DOCOMB.I GET 'DOCOMB.D' DOCOMB.X ROT PUT
              DOCOMB.I 1 + DOCOMB.X 1 + DOCOMB.G
              DOCOMB.I 1 + DOCOMB.X DOCOMB.G
            END 
          END
        » 
      »
      → BREAK DOCOMB.G
      « 
        0 'LstX.Break?' LIBSTO
        1 1 DOCOMB.G EVAL
        DEPTH DOCOMB.S - →LIST
      »
   »
 »
@---------------------------------------------------------------
'DOCOPE'
 « → DOCOPE.P
   « « 'DOCOPE.P' RCL DOPERM IF DUP SIZE THEN OBJ→ END DROP » DOCOMB »
 »
@----------------------------------------------------------------
'NL→I' 
  « DUP SIZE 0 → s t
    « CASE 
        s NOT  THEN DROP 0 't' STO END
        s 1 == THEN 1 GET 't' STO END
        OBJ→  1 1 ROT  1 - START
          DUP UNROT * 't' STO+
          10 *
        NEXT
        * 't' STO+
      END
      t
    »
  »
@----------------------------------------------------------------
'I→NL'
  « ABS 0 RND DUP XPON → n s  
   « IF s 0 ≥ THEN s 0 FOR 'a' n a a DIGITS -1 STEP
     ELSE 0 0 's' STO END
     s 1 + →LIST     
   » 
  »  
@---------------------------------------------------------------
'LUNION' « ADD LDDUP »
@---------------------------------------------------------------
'LINTR'
  « → Lst2
    « 
      « IF DUP Lst2 SWAP POS NOT THEN DROP END » MAP 
      LDDUP
    »
  »
@---------------------------------------------------------------
'LMAX' « IF DUP SIZE 1 > THEN « MAX » STREAM ELSE 1 GET END »
@---------------------------------------------------------------
'LMIN' « IF DUP SIZE 1 > THEN « MIN » STREAM ELSE 1 GET END »
@---------------------------------------------------------------
'LCLLT' 
 « 
  { } → ri 
   « OBJ→ 
     « DEPTH →LIST 'ri' SWAP SADD » DOLIST
       DROP ri     
     »
   »
@---------------------------------------------------------------
'LDIST' 
  « OVER SIZE → List t s
   « IF t 0 < THEN s NEG 't' STO/ END
     IF s t IDIV2 THEN DROP List EXIT END
     'n' LSTO
     1 n FOR i
       0 s 1 - FOR j
         'List' i j + GET
         n STEP
         t →LIST
      NEXT
      n →LIST
   »
  »
@---------------------------------------------------------------
'LGRP' 
  «  DUP SIZE DEPTH 2 -  → List s d
    « IF s 2 < THEN List ELSE
        List 1 GET
        2 s FOR n
          IF List n GET DUP2 == THEN DROP END
        NEXT
        DEPTH d - →LIST
      END
    »
  »
@---------------------------------------------------------------
'LRPCT' 
  « DUP SIZE {} 1  → List s Count c
    « 
      CASE 
         s NOT THEN { { } { } } END
         s 1 == THEN List { 1 } 2 →LIST END
        DEPTH 'd' LSTO
        List 1 GET
        2 s FOR n
          IF List n GET DUP2 == THEN DROP 1 'c' STO+ 
          ELSE 'Count' c SADD 1 'c' STO 
          END
        NEXT
        'Count' c SADD
        DEPTH d - →LIST Count 2 →LIST 
      END
    »
   »
@---------------------------------------------------------------
'LRPC→' « OBJ→ « NDUPN DROP » DOLIST »
@---------------------------------------------------------------
'LSDIV'
  « OVER SIZE → List n s
    « IF s n IDIV2 s 0 == OR THEN DROP List EXIT ELSE ABS 't' LSTO END
      IF n 0 < THEN n ABS t 'n' STO 't' STO END
      1 s FOR 'i'
        List i i n + 1 - SUB
      n STEP
      t →LIST
    »
  »
@---------------------------------------------------------------
'SPLIT' « DUP2 1 SWAP SUB UNROT 1 + OVER SIZE SUB »
@---------------------------------------------------------------
'RSPLT' « OVER SIZE SWAP - SPLIT »
@---------------------------------------------------------------
'LSSR' « → List a b « List 1 a 1 - SUB List a b SUB REVLIST List b 1 + OVER SIZE SUB ADD ADD » »
@---------------------------------------------------------------
'LCNT' 
  « OVER SIZE 0 → List o s n 
    « IF s NOT THEN 0 ELSE
        1 s FOR 'i' 'List' i GET o SAME 'n' STO+ NEXT
        n
      END    
    » 
  »
@---------------------------------------------------------------
'LDUPL' 
  « DUP SIZE 0 → List s Exit
    « IF s 2 < THEN 0 'Exit' STO
      ELSE
        1 s 1 - FOR 'i'
         IF Exit THEN EXIT END
            'List' i GET 'o' LSTO
         i 1 + s FOR j
           IF 'List' j GET o SAME THEN 1 'Exit' STO EXIT END 
         NEXT
        NEXT
      END
      Exit
    » 
  »
@---------------------------------------------------------------
'MPOS' « → o « 1 « IF o SAME THEN NSUB END » DOSUBS » » 
@---------------------------------------------------------------
'LDIFF' 
  « → list2 
    « IF DUP SIZE THEN
        1 « IF list2 OVER POS THEN DROP END » 
        DOSUBS
      ELSE { } END
    » 
  » 
@---------------------------------------------------------------
'LXIL'  
  « 1
    « IF DUP TYPE 62 == THEN OBJ→ DROP END » DOSUBS
  »
@---------------------------------------------------------------  
'LXILR' « DO DUP LXIL UNTIL DUP ROT SAME END  »
@---------------------------------------------------------------
'FOOT' « DUP SIZE GET » 
@---------------------------------------------------------------
'MDIST' « SWAP LXILR SWAP LDIST » 
@---------------------------------------------------------------
'LMAP' 
  « → Pgm 
    « 1 « IF DUP TYPE 62 ≠ THEN Pgm END » DOSUBS » 
  »
@---------------------------------------------------------------
'DOLLST' « → Pgm « OBJ→ 'Pgm' DOLIST » »
@---------------------------------------------------------------
'LCPRD'
« 
  « OVER SIZE OVER SIZE → l1 l2 s1 s2
    «
      IF s1 s2 AND THEN
        1 s1 FOR i
          1 s2 FOR j
            l1 i GET l2 j GET ADD 
          NEXT
        NEXT
        s1 s2 * →LIST 
      ELSE
        { }
      END
    »
  »
  → List Recur
  «  
     IF List TYPE 62 == List SIZE AND THEN
       WHILE List SIZE 1 > REPEAT
         List 2 LFRST OBJ→ DROP Recur EVAL
         List 2 LDROP
         SWAP LPUSH 'List' STO
       END
       List LXIL
     ELSE {} END
  »
» 
  

@===============================================================
@ Library meta data
@---------------------------------------------------------------
'$VISIBLE' 
{
 { 'LSEQ'   1 0 "" }
 { 'LSEQR'  2 0 "" }
 { 'LASEQ'  2 0 "" }
 { 'LMSEQ'  3 0 "" }
 { 'LDSEQ'  3 0 "" }
 { 'LMRPT'  2 0 "" }
 { 'LWHL'   3 0 "" } 
 
 { 'LDDUP'  1 0 "" }
 { 'LPOP'   1 0 "" }
 { 'LPOPR'  1 0 "" }
 { 'LPUSH'  2 0 "" }
 { 'LPSHR'  2 0 "" } 
 { 'LPICK'  2 0 "" }
 { 'LREPL'  3 0 "" }
 { 'LRMOV'  2 0 "" }
 { 'LINSR'  2 0 "" }
 { 'LFRST'  2 0 "" }
 { 'LLAST'  2 0 "" }
 { 'LDROP'  1 0 "" }
 { 'LDWHL'  2 0 "" }
 { 'LTWHL'  2 0 "" }
 { 'LFILT'  1 0 "" }
 
 { 'LROLL'  1 0 "" }
 { 'LRLLD'  1 0 "" }
 { 'LROT'   2 0 "" }
 { 'LSWAP'  3 0 "" }
 { 'LSHUF'  1 0 "" }
 
 { 'LINTR'  2 0 "" }
 { 'DOPERM' 2 0 "" }
 { 'DOCOMB' 3 0 "" }
 { 'DOCOPE' 3 0 "" }
 
 { 'LMAX'   1 1 "" }
 { 'LMIN'   1 1 "" }
 { 'LUNION' 2 0 "" }
 { 'NL→I'   1 0 "" }
 { 'I→NL'   1 0 "" }
 { 'LCLLT'  1 0 "" }
 { 'LDIST'  2 0 "" }
 { 'LGRP'   2 0 "" }
 { 'LRPCT'  1 0 "" }
 { 'LRPC→'  1 0 "" }
 { 'LSDIV'  1 0 "" }
 { 'SPLIT'  2 0 "" }
 { 'RSPLT'  2 0 "" }
 { 'LSSR'   3 0 "" }
 { 'LCNT'   2 0 "" }
 { 'LDUPL'  1 0 "" }
 { 'MPOS'   2 0 "" } 
 { 'LDIFF'  2 0 "" } 
 { 'LXIL'   2 0 "" } 
 { 'LXILR'  2 0 "" } 
 { 'FOOT'   1 0 "" }  
 { 'MDIST'  2 0 "" } 
 { 'LMAP'   2 0 "" } 
 { 'DOLLST' 2 0 "" }
 { 'LCPRD'  1 0 "" }
}

@---------------------------------------------------------------
'$MENU'
@ ===============================================================
@  Menu, submenus and help definition
@ =============================================== Begin Main menu
{
@-------------- ---------------------------- Begin create submenu
{ { "Creat" 1 }  « {

{ "LSEQ" LSEQ
"Create a list from 1 to n
or from -1 to -n
I<a> → L<1..a>" }
 
{ "LSEQR" LSEQR 
"Create a list from a to b

I<a> I<b> → L<a..b>" }

{ "LASEQ" LASEQ
"Numeric sequence by repetitive
addition
I<start> I<inc> I<times> → L<i>" }
 
{ "LMSEQ" LMSEQ 
"List multiplicative sequence
Ex: 2 2 4 → {2 4 8 16}
R<start> R<mult> I<times> → L" } 
 
{ "LDSEQ" LDSEQ 
"List divide sequence
Ex: 2 2 4 → {2 1 0.5 0.25}
R<start> R<div> I<times> → L" } 

{ "LMRPT" LMRPT 
"Repeat a list n times

L<l> I<n> → L<n times l>..." }

{ "LWHL" LWHL 
"Execute action repeatedly until
check condition is false
O P<action> P<condition> → L<o>..." }

} TMENULST » "Creates list" } 
@ -------------------------------------------- End Create submenu

@ -------------------------------------------- Begin Edit submenu
{ { "Edit" 1 } « { 

{ "LDDUP" LDDUP 
"Deduplicate items of a list
Ex : {a b c b d} → {a b c d} 
L<o> → L<o>" }

{ "LPOP" LPOP
"Retrieves first elmt in a list
leaving the rest on the stack
L<o> → L<o> O" }

{ "LPOPR" LPOPR
"Retrieves last elmt in a list
leaving the rest on the stack
L<o> → L<o> O" }

{ "LPUSH" LPUSH
"Add object to front of list
Unlike ADD, list is add as list
L O → L" }

{ "LPSHR" LPSHR
"Add object to end of list
Unlike ADD, list is add as list
L O → L" }

{ "LPICK" LPICK 
"return list elmts in specific order
Ex:{a b c d} {2 4} → {b d}
L<o> L<i> → L<o>" }

{ "LREPL" LREPL 
"{a b c d} {2 4} {x y}
→ {a x c y}
L<o> L<i> L<o> → L<o>" }

{ "LRMOV" LRMOV
"Remove one or more elmts
from a list as indicated 
L<o> L<i> or I → L<o>" }

{ "LINSR" LINSR 
"Insert one or more elmts
in a list
L<o> I L<o> or I → L<o>" }

{ "LFRST" LFRST
"returns the first <n> elmts
of a list
L<o> I → L<o>" }

{ "LLAST" LLAST
"returns the last <n> elmts
of a list
L<o> I → L<o>" }

{ "FOOT" FOOT
"Returns the last elmt
of a list
L<o> → O" }

{ "LDROP" LDROP
"Drop the specified count of
obj from begin(+) or end(-) 
L<o> I<+-> → L<o>" }

{ "LDWHL" LDWHL
"Drops elmts from beginning 
while match the  condition
L<o> P<t/f> → L<o>" }

{ "LTWHL" LTWHL
"Takes elmts from beginning 
while match the  condition
L<o> P<t/f> → L<o>" }

{ "LFILT" LFILT 
"Returns a list for wich
the supplied prog is true
L<o> P → L<o> " }

} TMENULST » "" }


@ ---------------------------------------------- End Edit submenu

@ ------------------------------------- Begin Arrangement submenu
{ { "Arrng" 1 }  « {
 
{ "LROLL" LROLL 
"Roll the list. Equivalent
to 1 LROT
L<o> I → L<o>" }

{ "LRLLD" LRLLD 
"Roll down the list. 
Equivalent to -1 LROT
L<o> I → L<o>" } 

{ "LROT"  LROT
"Rotates list elements left or 
right as indicated by count
L<o> I → L<o>" }

{ "LSWAP" LSWAP 
"Swap the position of two
elements of the list
L<o> I I → L<o>" }

{ "LSHUF" LSHUF 
"Shuffles the content of 
a list
L<o> →  L<o>" }

{ "LSSR" LSSR 
"Reverse a subsequence of
a list between a and b
L<o> I<a> I<b> → L<o>" }
 
} TMENULST » "Arrangement" } 
@ --------------------------------------- End Arrangement submenu

@ ------------------------------------------- Begin Group submenu
{ { "Group" 1 }  « {
 
{ "LCLLT" LCLLT 
"Collates a list of sublist

L<l<o>> → L<o>" }

{ "LDIST" LDIST 
"Distributes list in sublist
of size I
L<o> I → L<o>" }

{ "MDIST" MDIST 
"Distributes list in sublist
of size I after explode inner
L<o> I → L<o>" }

{ "LGRP" LGRP 
"Replaces repeated elmts with
a signle instance
L<o> → L<o>" }

{ "LRPCT" LRPCT 
"Like LGRP and count each elements

L<o> → L<l<o>l<o>>" }

{ "LRPC→" LRPC→ 
"Restores a list that was grouped
with LRCPT
L<l<o>l<o>> → L<o>" }

{ "LSDIV" LSDIV 
"Subdivides a list in list of
n elmts (or n list if n<0)
L<o> → L<l<o>...l<o>>" }

{ "SPLIT" SPLIT 
"Split a list in two parts
First part is I items
L<o> I → L<o> L<o>" }

{ "RSPLT" RSPLT 
"Split a list in two parts
Right part is I items
L<o> I → L<o> L<o>" }

{ "LXIL" LXIL 
"Return a list with first level
inner list exploded
L<o> → L<o>" }

{ "LXILR" LXILR
"Return a list with all the
inner list exploded
L<o> → L<o>" }

} TMENULST » "Gouping lists" } 
@ --------------------------------------------- End Group submenu

@ -------------------------------------------- Begin Test submenu
{ { "Test"  1 } « {

{ "LCNT" LCNT 
"Count occurences of an object
in a list
L<o> O → I" }

{ "MPOS" MPOS 
"Find all positions of an
object in a list
L<o> O → L<i>" }

{ "LDUPL" LDUPL 
"Test if there is duplicate 
objects in a list
L<o> → I<t/f>" }


} TMENULST » "Tests" } 
@ ---------------------------------------------- End Test submenu

@ ------------------------------------- Begin Combination submenu
{ { "Comb"  1 } « {

{ "DOCOMB" DOCOMB 
"Apply a pgm to all combinations
of n elmt of list. BREAK to exit
L<o> I<n> P → L<o>" }

{ "DOPERM" DOPERM 
"Apply a pgm to all permutations
of a list. BREAK to exit
L<o> P → L<o>" }

{ "DOCOPE" DOCOPE 
"Apply a pgm to all combinations
and permutations. BREAK to exit
L<o> I<n> P → L<o>" }

{ "DOLLST" DOLLST 
"Like DOLIST but with list of lists.
{{a b}{c d}} «+» → {'a+c' 'b+d'}
L<l<o>..l<o>> P → L<<lo>..l<o>>" }

{ "LMAP" LMAP 
"Apply a pgm to all elmt but
whithout explore inner list
L<o> P → L<o>" }

{ "LCPRD" LCPRD 
"Returns list of sublists with
cartesian product of s/lists input
L<l<o>l<o>...> → L<l<o>l<o>...>" }


} TMENULST » "Combinatorics" } 
@ --------------------------------------- End Combination submenu

@ -------------------------------------------- Begin Math submenu
{ { "Math"  1 } « {

{ "I→NL" I→NL 
"Convert an integer to
a list of digits
I → L<I>" }

{ "NL→I" NL→I
"Convert a list of digits
to an integer
L<i> → I" }

{ "LMAX" LMAX "Max item of a list" }

{ "LMIN" LMIN "Min item of a list" }

{ "LINTR" LINTR 
"2 Lists intersection.
Deduplicate
L<o> L<o> → L<o> " }

{ "LUNION" LUNION 
"2 Lists union
Deduplicate
L<o> L<o> → L<o> " }
 
{ "LDIFF" LDIFF 
"List of object in list level2 that
don't match object list level 1
L<o> L<o> → L<o>" }

} TMENULST » "Math on lists" } 
@ ---------------------------------------------- End Math submenu

@================================================================
ENDDIR

USAGE EXEMPLES :

returns the list of numbers from 1 to 1000 not divisible by 7 :
Code:
1000 LSEQ « 7 MOD » LFILT

List of the 69 numbers <1000 with sum on digits is 11 :
Code:
999 LSEQ « I→NL ΣLIST 11 == » LFILT

random shuffle from a list
Code:
49 LSEQ LSHUF

Sum of the 200 first decimals of PI (HP50g : 0.029 sec USB powered / 0.246 sec on battery)
Code:
GETPREC 202 SETPREC 
  π →NUM FP 1E200 * I→NL ΣLIST 
SWAP SETPREC

Permute letters of a string
Code:
{ "a" "b" "c" "d" } « ΣLIST » DOPERM 
-> { "abcd" "bacd" "cabd" "acbd" "bcad" "cbad" "dbac" "bdac" "adbc"
"dabc" "badc" "abdc" "acdb" "cadb" "dacb" "adcb" "cdab" "dcab"
"dcba" "cdba" "bdca" "dbca" "cbda" "bcda" }

List of numbers with all the 1,2,3,4,7 digits witch are primes
Code:
{ 1 2 3 4 7 } « NL→I IF DUP ISPRIME? NOT THEN DROP END » DOPERM
->  { 12347 21347 31247 24137 12437 14327 34127 34217 24317 23417
12473 12743 27143 47123 14723 74231 72431 27431 73421 43721 34721
24371 43271 23741 72341 }
Find all posts by this user
Quote this message in a reply
07-23-2023, 11:54 AM
Post: #290
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(07-22-2023 10:55 PM)Gilles Wrote:  I spent some time tonight starting a ListExt library in newRPL.
For documentation and usage, see : https://www.hpcalc.org/details/7971
It's a partial implementation for now. It's very fast because newRPL is very fast especially with the processing of lists. The rest will follow soon enough when I have time next week and will be integrated into a newRPL library with menu and on line help.
Code:
@====================================================================
@  List Extension for newRPL v0.01, Le 22/07/23 
@  Use the same commands and syntax as :
@   https://www.hpcalc.org/details/7971
@--------------------------------------------------------------------
 LSEQ   
  « → a  
   « CASE 
      'a≥1'  THEN  1 a FOR 'n' n NEXT a →LIST END
      'a≤-1' THEN -1 a FOR 'n' n -1 STEP a NEG →LIST END
      {} 
     END   
   » 
  »
@--------------------------------------------------------------------
 LSEQR   
  « → a b  
   « IF 'a≤b' THEN 
      a b FOR 'n' n NEXT 
     ELSE 
      a b FOR 'n' n -1 STEP 
     END 
     a b - ABS 1 + →LIST
   »
  »
@--------------------------------------------------------------------
 LMRPT
  « → List a  
   « {}
     IF 'a≥1' THEN 1 a START List ADD NEXT END    
   » 
  »
@--------------------------------------------------------------------
 LDDUP
  « 
   REVLIST OBJ→ {}
   1 ROT START
    IF SWAP DUP2 POS THEN DROP ELSE ADD END
   NEXT 
  » 
@--------------------------------------------------------------------
 LASEQ
  « → dép diff nbr 
   « 
    CASE 
     nbr 0 == THEN {} END
     nbr 1 == THEN dép 1 →LIST END
     dép 
     2 nbr START DUP diff + NEXT
     nbr →LIST
    END
   »
  » 
@--------------------------------------------------------------------
 LPOP « DUP HEAD SWAP TAIL SWAP »
@--------------------------------------------------------------------
 LPOPR « DUP HEAD SWAP TAIL »
@--------------------------------------------------------------------
 LPUSH  « IF DUP {} SAME THEN 1 →LIST END SWAP ADD »
@--------------------------------------------------------------------
 LPICK
  « SWAP → List « « List SWAP GET » MAP » »
@--------------------------------------------------------------------
 LREPL
  « ROT → List « 2 « 'List' UNROT REPL » DOLIST DROP List » »
@--------------------------------------------------------------------
 LRMOV
  « → List r 
   « IF r TYPE 10 == THEN
      List 1 r 1 - SUB
      List r 1 + List SIZE SUB
      ADD 
     ELSE
      IF r SIZE THEN
       r LDDUP SORT REVLIST
       1
       « → ri 
        « List 1 ri 1 - SUB 
          List ri 1 + List SIZE SUB
          ADD 'List' STO
        » 
       » 
       DOSUBS DROP List    
      END   
     END 
   » 
  »
@--------------------------------------------------------------------
 LFRST  « 1 SWAP SUB »
@--------------------------------------------------------------------
 LLAST « OVER SIZE DUP ROT - 1 + SWAP SUB »
@--------------------------------------------------------------------
 LRCL  « IF DUP SIZE THEN RCL END »
@--------------------------------------------------------------------
 LROLL « DUP SIZE → List s « List 1 LLAST List s 1 - LFRST ADD » »
@--------------------------------------------------------------------
 LRLLD « DUP TAIL SWAP HEAD ADD »
@--------------------------------------------------------------------
 LZIP
  « OBJ→ DUP 'nl' LSTO « nl →LIST » DOLIST »
@--------------------------------------------------------------------
 LFILT  
  « → Filter 
    « 1 « IF DUP Filter NOT THEN DROP END » DOSUBS »
  » 
@--------------------------------------------------------------------
 NL→I
  « « →STR + » STREAM STR→ » 
@--------------------------------------------------------------------
 I→NL
  « ABS .5 + IP DUP XPON → n s  
   « IF 's≥0' THEN s 0 FOR 'a' n a a DIGITS -1 STEP
     ELSE 0 0 's' STO END
     s 1 + →LIST     
   » 
  »  
@------------------------------------------------------------------- 
 LROT
   « OVER SIZE → List a s  
    « CASE 
       'a>0' THEN List a LLAST List s a - LFRST  ADD END
       'a<0' THEN 'a' SNEG List s a - LLAST List a LFRST ADD END 
       List
      END   
    »
   »
@------------------------------------------------------------------- 
 LSWAP  
   « →  a b 
    « DUP a GET
      OVER b GET
      UNROT b SWAP PUT
      SWAP a SWAP PUT
    »
   »
@ This version is 2.6 time slower :
@  « → List a b 
@   « 'List(a)' →NUM 'List(b)' →NUM 'List(a)' STO  'List(b)' STO
@      List     
@   »
@  »

@------------------------------------------------------------------- 
 LUNION
  « ADD LDDUP »
@-------------------------------------------------------------------
 LINTR
  « → Lst2
   « « IF DUP Lst2 SWAP POS NOT THEN DROP END » MAP »
  »
@------------------------------------------------------------------- 
@ .... A suivre  !!!


this example returns the list of numbers from 1 to 1000 not divisible by 7 :
Code:
1000 LSEQ « 7 MOD » LFLTR

List of the 69 numbers <1000 with sum on digits is 11 :
Code:
999 LSEQ « I→NL ΣLIST 11 == » LFLTR

This is great! I can recommend a few things:
1) You can use CRLIB to create a user library to publish. Wiki-How to create user libraries
2) If plain text is your preferred format, you can use PACKDIR to convert and entire directory to user readable and editable text. It can be copy/pasted into the calc, compiled and stored into a variable with STO so it's a simple way to distribute an entire folder tree.
3) You can make those comments permanent with @@ so users can compile while preserving the helpful comments in the code
Find all posts by this user
Quote this message in a reply
07-23-2023, 06:00 PM (This post was last modified: 07-29-2023 10:34 AM by Gilles.)
Post: #291
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(07-23-2023 11:54 AM)Claudio L. Wrote:  This is great! I can recommend a few things:
1) You can use CRLIB to create a user library to publish. Wiki-How to create user libraries
2) If plain text is your preferred format, you can use PACKDIR to convert and entire directory to user readable and editable text. It can be copy/pasted into the calc, compiled and stored into a variable with STO so it's a simple way to distribute an entire folder tree.
3) You can make those comments permanent with @@ so users can compile while preserving the helpful comments in the code

Thanks, I will try this with a complete LIB, help on line with long press (great idea!) etc.. PACKDIR is nice. I changed my previous post with the correct structur for drag & drop onto the PC version & HP50

EDIT : It's progressing well ;D I'll post v1 library soon. Finally I made some infidelities to ListExt. For example, stopping DOPERM or DOCOMB is done with a BREAK command ex :
Code:
{ 1 3 5 7 9 } 3 « NL→I IF DUP ISPRIME? THEN BREAK ELSE DROP END » DOCOMB
There are also commands in ListExt that are useless in newRPL (LSUM, anything that only improves speed or fixes liimtations like ΣLIST or DOLIST DOSUBS etc...). So to be continued...
Find all posts by this user
Quote this message in a reply
07-29-2023, 08:01 PM (This post was last modified: 07-29-2023 10:02 PM by Gilles.)
Post: #292
RE: newRPL - Updated to build 1510 [official build remains at 1487]
Hello, I have some questions about the CRLIB command:

1/ When the name of the command is long and truncated in the menu, it is useful to display the complete name of the command with the "help long press". It works like this for internal commands. But is it possible to do it in a library?

2/ It's great that auto-completion works with add-on libraries. Cheer!

3/ Is there a build 1497 ou 1510 for Windows ? I dont find them and I would like to use the FORUP and FORDN loops to avoid some tests.
Find all posts by this user
Quote this message in a reply
07-29-2023, 10:33 PM (This post was last modified: 07-29-2023 10:36 PM by Claudio L..)
Post: #293
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(07-29-2023 08:01 PM)Gilles Wrote:  Hello, I have some questions about the CRLIB command:

1/ When the name of the command is long and truncated in the menu, it is useful to display the complete name of the command with the "help long press". It works like this for internal commands. But is it possible to do it in a library?

My apologies for not having complete documentation written on the wiki for CRLIB. The good news is I don't need to apologize for not supporting what you want to do because $VISIBLE is quite advanced. All you have to do is for any item you would normally have in the list, replace it with an inner list like this:
// $VISIBLE HAS THE FOLLOWING FORMAT:
// { { IDENT NARGS ALLOWINSYMB HELPTEXT } { IDENT NARGS ALLOWINSYMB HELPTEXT } ...

This gives the compiler a lot of extra info about your commands. 'IDENT' is the command name obviously, NARGS is the number of arguments it expects on the stack, this is needed for the compiler to issue an error when you use the command within a symbolic like MYCOMMAND(x,y,z). ALLOWINSYMB is a true/false, whether you want to make your command exist as a function (it has to return something that is valid within a symbolic object, of course or it will cause errors when evaluating the expression).
And last but not least is what you were looking for: HELPTEXT is a string in the same format as the help of the standard commands (a 3-line string where the first two lines are typically a description and the third one is a stack diagram.
The stack diagram follows a weird syntax I came up with (could be better but...):
Code:

@ Stack diagram symbols:
@ I = Integer number
@ R = Real number
@ Z = Complex number
@ S = String
@ L = List
@ U = Unit object
@ V = Vector
@ M = Matrix
@ N = Variable name
@ O = Any object
@ P = Program
@ A = Algebraic object (symbolic)
@ A description or usage for the symbol may be included in <...> following the symbol

For example:
Code:

USBRECV @@ (this is the command name for the example, not part of the string so ignore this line)
"Receive an object, timeout
after given time
R<time> → O I<T/F>"

So it takes a real number <time> and returns any object (whatever came thru the wire) and an integer representing TRUE or FALSE.
As for the description, you need to break the lines thinking of the 50g screen width, it won't break the lines for you.

2/ It's great that auto-completion works with add-on libraries. Cheer!

(07-29-2023 08:01 PM)Gilles Wrote:  3/ Is there a build 1497 ou 1510 for Windows ? I dont find them and I would like to use the FORUP and FORDN loops to avoid some tests.

I typically only do the Windows executables for the official builds, can't promise anything but I'll see if I have time and can move the official version forward, it's probably overdue anyway.
Find all posts by this user
Quote this message in a reply
07-30-2023, 07:53 PM (This post was last modified: 08-01-2023 11:58 PM by Gilles.)
Post: #294
RE: newRPL - Updated to build 1510 [official build remains at 1487]
Hi

I wonders what the sequence :: L2 TMENULST ; means in your exemples in the Wiki for the creation of menus with sub-menus. What is the difference with « L2 TMENULST » ?

EDIT: My LstX library works fine, with menus, submenus and online help ;D I'll do some testing and write a short documentation before publishing. It's really very fast :O ;D. The installation comes down to the ATTACH command. Most of the commands mimic David Mutter's ListExt, so the documentation will be minimal.
Find all posts by this user
Quote this message in a reply
08-03-2023, 02:56 PM (This post was last modified: 08-13-2023 09:51 AM by Gilles.)
Post: #295
RE: newRPL - Updated to build 1510 [official build remains at 1487]
I wrote my first library for newRPL. LstX 1.0 (update v 1.01a) is a library that adds powerful list management commands to newRPL. It is an adaptation of David Mutter's excellent ListExt library which runs on HP49-50 in standard RPL. The library uses sub-menu and help (long press on the command). You can get plenty of help from the ListExt documentation to use LstX, but beware there are a few differences (DOCOM / DOPERM/ DOCOPE ).

Version 1.01, with new commands, no use of Flag (I use LIBSTO and LIBRCL instead), and speed improvments :
Library code. Must be on level 1 and ATTACH
(DETACH the lib first for update)

Documentation and examples

It's very fast. For example calculating the frequency of the first 1000 decimals of PI takes... 0.60 sec on my HP50g (0.54 sec with USB connection and... 0 sec with the PC version)

Code:
 « GETPREC 1002 SETPREC
   π →NUM FP 1000 ALOG * I→NL SORT LRPCT
   SWAP SETPREC »

{
  { 0  1   2   3   4  5  6  7   8   9 }
  { 93 116 103 102 93 97 94 95 101 106 }
}


Nota : KSORT is not implemented yet. newRPL crashes when I tried to sort embedded list like { { 2 "A"} {1 "B" } {3 "C"} } wich is correct in stock RPL (the sort is on the first item of sublists)
Find all posts by this user
Quote this message in a reply
08-08-2023, 03:27 AM
Post: #296
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(07-30-2023 07:53 PM)Gilles Wrote:  Hi

I wonders what the sequence :: L2 TMENULST ; means in your exemples in the Wiki for the creation of menus with sub-menus. What is the difference with « L2 TMENULST » ?

L2 is simply the level 2 menu list (the example has menus L1, L2 and L3 here we are assuming you have the list of the L2 example stored in a variable named L2.
TMENULST is the same as TMENU, it displays a temporary menu. The LST suffix stands for "last" meaning it will replace whatever menu the user pressed last. For example if you have your level 1 menu displayed on menu1 (the top one) and you use TMENULST in a menu handler routine, the user obviously activated menu 1 last since your handler is running so TMENULST will open your level 2 menu in the same menu1. You may want to keep your main menu always visible and always open submenus in menu2 for example. In that case you would use TMENUOTHR which does TMENU on the "other" menu meaning the one the user did not interact with.
Remember that the user can always swap menus 1 and 2 at will, so it's not a good idea to hard code your memnus to be in menu1 or menu2. It's recommended that you use TMENULST and TMENUOTHR instead.

The difference between using :: ; versus << >> is that the latter will be pushed to the stack as an object and then you need to do EVAL. The former is executed immediately and in place. When used as menu handlers, there is one additional difference: << >> programs will interrupt the command line editor while :: ; routines run in "transparent" mode, allowing you to remain in the editor.
Find all posts by this user
Quote this message in a reply
08-08-2023, 09:36 AM (This post was last modified: 08-13-2023 09:51 AM by Gilles.)
Post: #297
RE: newRPL - Updated to build 1510 [official build remains at 1487]
Thanks, i will change this in the 1.1 version with other things.

Here is an example of use in v1.0f ( note that i've update above in v1.01a):

Solve the cryptaritm : send+more=money

Code:
« 0 0 0 0 0 0 0 0 → s e n d m o r y
  «
    0 9 LSEQR
    8
    « { s e n d m o r y } STO
      IF s THEN
       IF m THEN
         IF s m + 9 > THEN
           IF   { s e n d } RCL NL→I 
                { m o r e } RCL NL→I + 
              { m o n e y } RCL NL→I == THEN { s e n d m o r y } DUP RCL - BREAK END
           END
         END
       END
    » 
    DOCOPE
  »    
»

=> { { 's-9' 'e-5' 'n-6' 'd-7' 'm-1' 'o-0' 'r-8' 'y-2' } }
Time newRPL PC : 32 sec
The solution is unique as you can see by removing the BREAK command.

If you remark that it's obvious that m=1 the solution is provided in 6,3 sec on a PC :

Code:
« 1 0 0 0 0 0 0 0 → m s e n d o r y
  «
    0 9 LSEQR
    7
    « { s e n d o r y } STO
      IF s 8 > THEN
        IF   { s e n d } RCL NL→I 
             { m o r e } RCL NL→I + 
           { m o n e y } RCL NL→I == THEN { s e n d m o r y } DUP RCL - BREAK END
      END
    » 
    DOCOPE
  »    
»

But then it also obvious that s equals 9 and so:

Code:
« 1 9 0 0 0 0 0 0 → m s e n d o r y
  «
    0 9 LSEQR
    6
    « { e n d o r y } STO
      IF   { s e n d } RCL NL→I 
           { m o r e } RCL NL→I + 
         { m o n e y } RCL NL→I == THEN { s e n d m o r y } DUP RCL - BREAK END
    » 
    DOCOPE
  »    
»
.
Time newRPL PC : 0.1 sec / HP 50g & HP39gs : 18,5 sec (Update 1.1 with no USB connection, see Claudio post below)

PS : The newRPL overlays for 50g et 39gs are great ! see the topic ;D
Find all posts by this user
Quote this message in a reply
08-11-2023, 01:30 AM
Post: #298
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(08-08-2023 09:36 AM)Gilles Wrote:  Time newRPL PC : 0.187 sec / HP 50g : 26 sec / HP39gs : 18 sec (?)

Possible explanation for those timings:
a) The 50g had weak batteries such that half way it switched to the slow clock
b) The 50g was connected to the USB port. I'd have to look at the source code but I think I recall locking the clock at an intermediate speed when connected to the USB to keep the communications flowing. I might be wrong on this one, though.
c) The 50g had its large memory very dirty and had to run an exhausting garbage collection in the middle of that run. Try running MEM immediately before on both calcs to force a GC before doing benchmarks.

Other than that, it's impossible for the 39gs to be almost twice as fast when it's running the same code on the same hardware.
Find all posts by this user
Quote this message in a reply
08-11-2023, 09:15 AM
Post: #299
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(08-11-2023 01:30 AM)Claudio L. Wrote:  b) The 50g was connected to the USB port. I'd have to look at the source code but I think I recall locking the clock at an intermediate speed when connected to the USB to keep the communications flowing. I might be wrong on this one, though..

Hi Claudio,
I'm early in my journey with newRPL and enjoying it hugely. Thank you for your wonderful creation.
My 39gs, running build 1487, draws approx 110mA on USB power with no calculation running. Maybe this power level correlates with the higher clock speed as you mentioned? This is power from a laptop albeit with data transfer locked down by my employer's policy. (I'm only seeking to save battery life when at work and the power level is not a problem.)

- Geoff
Find all posts by this user
Quote this message in a reply
08-12-2023, 01:40 PM (This post was last modified: 08-12-2023 01:41 PM by Claudio L..)
Post: #300
RE: newRPL - Updated to build 1510 [official build remains at 1487]
(08-11-2023 09:15 AM)Mr_F Wrote:  Hi Claudio,
I'm early in my journey with newRPL and enjoying it hugely. Thank you for your wonderful creation.
My 39gs, running build 1487, draws approx 110mA on USB power with no calculation running. Maybe this power level correlates with the higher clock speed as you mentioned? This is power from a laptop albeit with data transfer locked down by my employer's policy. (I'm only seeking to save battery life when at work and the power level is not a problem.)

The calculator typically (as in when not connected to USB) puts the CPU in idle state, and only wakes it up with interrupts. On normal use, interrupts can be sporadic, like a timer to blink the cursor, or the press of a key. When connected to USB, there's a packet being sent every 2 or 3 ms (can't recall) and it needs to be acknowledged, so it will keep the CPU in wake state much more.
If you need to save battery from your laptop, I guess the solution is to run your calc disconnected and only connect it when you need to send/receive something. I rarely need to connect mine, merely when I processed a long list and don't want to do the data entry again in Excel.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)