Post Reply 
(48G/GX) DIRSTAT - Find RAM Hogs
05-16-2014, 05:43 PM
Post: #1
(48G/GX) DIRSTAT - Find RAM Hogs
As the name suggests, this is a clone of programs like WinDirStat/KDirStat. Run it to see the sizes of all variables and subdirectories in the current directory, sorted in descending order of size. You can then navigate to other directories by selecting them and pressing ENTER (then waiting for the program to rebuild the list). There's a lot of G/GX-specific stuff here, so it's not compatible with the S/SX without heavy modification. The installed size is 481 bytes.

This also requires CHOOSF, which is a drop-in full-screen replacement for CHOOSE. You can either get CHOOSF from this old Usenet posting, or just download the 48G/GX version attached to this post. The installed size of CHOOSF is only 109.5 bytes. Definitely worth having around if you use CHOOSE at all.

Code:
%%HP: T(3)A(D)F(.);
\<< 0 \-> T
  \<<
    DO
      0 'T' STO
@ Get the current directory name for the title bar.
      PATH DUP SIZE GET "" +
      "Getting contents..." 1 DISP
@ List all vars and...
      VARS 1
@ ...build a list item for each: { size { "name: size" name } }
@ Also total up the bytes used in the current dir.
@ Pardon the opaque stackrobatics here. (And also the portmanteau.)
      \<< DUP BYTES
        SWAP DROP DUP 'T'
        STO+ OVER DUP VTYPE
        15 == "\\ " ": "
        IFTE + OVER + ROT 2
        \->LIST 2 \->LIST
      \>> DOLIST
@ Add total bytes to the window title.
      SWAP ": " + T \->STR + SWAP
@ Sort vars descending by the first element of each sublist (bytes).
      "Sorting..." 1 DISP
      SORT REVLIST
      "Preparing..." 1 DISP
@ Pull out the { "name: size" name } sublists to pass to CHOOSF.
      1
      \<< 2 GET
      \>> DOLIST
@ Add a ".." item if we're not in HOME already.
      IF PATH SIZE 1 >
      THEN
        { { ".." \<< UPDIR \>> } } SWAP +
      END
      "" 1 DISP
@ Put highlight on first item.
      1
@ Show the CHOOSF window.
      IF CHOOSF
      THEN
        CASE
@ User selected an item with a subroutine attached (e.g. "..").
@ Run it then reload.
          DUP TYPE 8 == THEN EVAL 0 END
@ User selected a directory. Navigate to it and reload.
          DUP VTYPE 15 == THEN EVAL 0 END
@ User selected something else. Recall it to the stack and exit.
          RCL 1
        END
@ User canceled the CHOOSF window. Just exit.
      ELSE
        1
      END
    UNTIL
    END
  \>>
\>>


.zip  CHOOSF.zip (Size: 216 bytes / Downloads: 6)
Visit this user's website Find all posts by this user
Quote this message in a reply
05-18-2014, 10:23 AM
Post: #2
RE: (48G/GX) DIRSTAT - Find RAM Hogs
Google is NOT usenet. For anybody posting usenet links, would you please include the usenet message-id field? That way we can find the post(s) via a regular usenet (NNTP) reader. Many of us do not use google.

No offense intended to Dave, whose presence here is much appreciated Smile

It ain't OVER 'till it's 2 PICK
Find all posts by this user
Quote this message in a reply
05-18-2014, 07:56 PM (This post was last modified: 05-18-2014 07:59 PM by Dave Britten.)
Post: #3
RE: (48G/GX) DIRSTAT - Find RAM Hogs
Duly noted. Here's the whole message for anybody that wants it. I've only ever been a casual user of Usenet.

Code:
Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: "John H Meyers" <jhme...@miu.edu>
Newsgroups: comp.sys.hp48
Subject: Full-screen CHOOSE for any calculator
Date: Thu, 23 Mar 2006 01:55:18 -0600
Organization: http://www.mum.edu
Lines: 180
Message-ID: <op.s6uwagnowmwqgg@news.cis.dfn.de>
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: individual.net BuQxcEy/E4YBxvhtTtFwDwFEpWSprsQ6R/cZj3AC6fuOo4EjBA
User-Agent: Opera M2/8.53 (Win32, build 7722)
Xref: g2news1.google.com comp.sys.hp48:5311

Want to see more of what you are choosing?
Want to see more items at a time?

Stand-alone FULL-screen CHOOSE for any calculator:

HP49G, HP49G+, HP48Gii, ???
CHOOSF.49  Uses current font, or minifont with flag -90
(99 bytes)

HP48G, HP48GX, HP48G+
CHOOSF.48  Uses 5x7 [medium] font, like regular CHOOSE
CHOOSM.48  Uses small font - all caps, variable width
(CHOOSF is 99 bytes, CHOOSM is 188 bytes)

Usage:
o Store in HOME as 'CHOOSF' or 'CHOOSM'
o Edit UserRPL programs
   to change CHOOSE to CHOOSF or CHOOSM
o Works the same as built-in CHOOSE.

Extra functionality:
o Accepts zero as initial item#
   (for scrolling viewer, rather than chooser)
   just like original HP48 built-in CHOOSE
o Accepts an empty list
(always returns zero in these cases,
indicating that nothing was chosen).


A WinZip-decodable file containing all binaries
will be found at the end of this post.

Calc-decodable binaries
(rename on calc to CHOOSF or CHOOSM):

@ CHOOSF.49 (including 48Gii)
"D9D201A262823621192015300D9D2079"
"E60D9D20F53339394378E7298253B213" +
"0A324379E6029E203B016075243A7263" +
"182431F2621155329E203B000031A437" +
"39F2D9D200915329A43A7263B11334EC" +
"301AA4329E200B0B90B2130C49F2B213" +
"0B2130" + DUP BYTES DROP #4DDh ==
{ #100001h LIBEVAL } IFT 'CHOOSF.49' STO

@ CHOOSF.48 (*not* 48Gii)
"D9D2086A812BF811192015300D9D2079"
"E60D9D202BB463D816DEBB0C0126B213
0BBF0679E6029E203B04608DF0613236" +
"20016AEC81AB42629E203B0000DA9164
B2A2D9D2011226C2A1613236300404EC" +
"30B3A1629E200B0990B21309C2A2B213
0B21304FC4" + ASC\-> 'CHOOSF.48' STO

@ CHOOSM.48 (*not* 48Gii)
"D9D2086A812BF811192015300D9D2079"
"E60D9D20E3C463D816D9D2029E203B0F
3029E203B046008F11C7416C8416F851" +
"11BF264CA366E7F4BBF06CAF06976111
8A30B213049B463D816D9D205304029E" +
"203B0650CB916E0E3018A30B2130E9B4
63D816D9D205304018A30B21302BB463" +
"D816DEBB0C0126B2130BBF0679E6029E
203B04608DF061323620016AEC81AB42" +
"629E203B0000DA9164B2A2D9D2011226
C2A1613236300404EC30B3A1629E200B" +
"0990B21309C2A2B2130B2130EB56" +
ASC\-> 'CHOOSM.48' STO


Source:

"
( 49 series full-screen CHOOSF.49 )
( Uses current font, or minifont with flag -90 )
( CRC: #EF97h  Bytes: 99 )
:: CK3NOLASTWD CK&DISPATCH1 # 351
   ::
     ' :: SIXTY #=casedrop TrueTrue DROPFALSE ;
     4ROLL ' ROMPTR B3 61
     5ROLL DUPLENCOMP 6ROLL COERCE #MIN
     ROMPTR B3 0 NOTcase %0
     :: DUPTYPELIST? NOT?SEMI
        DUPLENCOMP TWO #< ?SEMI
        ROMPTR B0 9B ; %1
   ;
;
" 'CHOOSF.49s' STO

"
( 48G[X][+] full-screen CHOOSF.48 )
( Uses 5x7 [medium] font )
( CRC: #4CF4h  Bytes: 99 )
:: CK3NOLASTWD CK&DISPATCH1 # 351
   ::
     ' :: SIXTY #=casedrop TrueTrue DROPFALSE ;
     4ROLL ' ROMPTR B3 64
     5ROLL DUPLENCOMP 6ROLL COERCE #MIN
     ROMPTR B3 0 NOTcase %0
     :: DUPTYPELIST? NOT?SEMI
        DUPLENCOMP TWO #< ?SEMI
        ROMPTR B0 99 ; %1
   ;
;
" 'CHOOSF.48s' STO

"
( 48G[X][+] full-screen CHOOSM.48 )
( Uses small font - all caps, variable width )
( CRC: #65BEh  Bytes: 188 )
:: CK3NOLASTWD CK&DISPATCH1 # 351
   ::
   ' ::
       EIGHTYONE  #=casedrop
       :: ROMPTR B3 3F ROMPTR B3 64 $>grob
          7GETLAM 8GETLAM MAKEGROB DUPROT ONEONE
          CKGROBFITS 4ROLL UNROT GROB! TRUE ;
       FIFTYSEVEN #=casedrop
       :: SEVEN ROMPTR B3 56 IT #1- TRUE ;
       FIFTYEIGHT #=casedrop :: SEVEN TRUE ;
       SIXTY #=casedrop TrueTrue DROPFALSE
     ;
       4ROLL ' ROMPTR B3 64
       5ROLL DUPLENCOMP 6ROLL COERCE #MIN
       ROMPTR B3 0 NOTcase %0
       :: DUPTYPELIST? NOT?SEMI
          DUPLENCOMP TWO #< ?SEMI
          ROMPTR B0 99 ; %1
   ;
;
" 'CHOOSM.48s' STO

@ Test return values:
\<< CLEAR "Title"
{ {} { A } { Bee B } { Cee C X } D }
9 CHOOSF \>> 'P1' STO
@ Correct results: {}, {A}, B, C, D

@ Heavy exerciser (vary title and list lengths)
\<< CLEAR RAND 0 RND "Choose" "" IFTE
    "----+----1----+----2----+----3----+" @ long
    1 12 START RAND 100 * NEXT 13 \->LIST
    1 13 RAND * CEIL SUB DUP 1 GET +
    1 CHOOSF \>> 'P2' STO

@ End


All binaries in one zip file:
o Paste the entire remaining text (no line wrapping)
   into a plain text file named CHOOSF.MIM
   (E.g. use Notepad and save in ANSI encoding)
o Open saved file using WinZip
   (answer "yes" or open the enclosed zip file)
o Test CRCs (Actions > Test)
o Extract desired file(s)
   [drag and drop from Zip window to desktop or folder]

Copy all text below:

--boundary--
Content-Type: application/zip; name="CHOOSF.zip";
Content-Transfer-Encoding: base64

UEsDBBQAAgAIAE6bdjSBEW8OuQAAAMQAAAAJAAAAQ0hPT1NNLjQ48wjwCDCx0A2fq9uwTGJTv+BE
pkDmCzeZpucBCTsfs97EuboKL5k2f2CepGfAncLwQ7BG5JhHYr+o4O+kI1Zpdf67+Y/9SqgUE1zB
rG3osDPlssS1m0ymDiAtCax7JJ89YG602iDEPM8bbFIAMwuYuwnEfbv7gECStuGG3wnT80DqHdhu
8IspJzMJLDsnsUtFDSjCwLBW0k1ba66ugGKSjhRQjtnB4RyztRRQbsMETm3DCTpaQP1CzABQSwME
CgACAAAAL5t2NECFXJ1rAAAAawAAAAkAAABDSE9PU0YuNDlIUEhQNDktV50tEComKGMSkQJRA9DZ
Apdu0NkCXzOTkzSHfpIoNSsxoCM0l24g6QKzEAZXQqMnNoFCEy8mEVUj6QKzAAATSnOTL50tABk1
kkqjJzYbMUPOA6FKI+kCsLAJKzHAlC8rMbASA1BLAwQUAAIACABEm3Y0PAKnLWoAAABrAAAACQAA
AENIT09TRi40OPMI8AgwsdANn6vbsExiU7/gRKZA5gs3mabnAYlN3ma9iW93HxBI0jbc8Dthep7C
S6bNDmw3+MWUk5kElp2T2KWiBhRhYFgr6aatNVdXQDFJRwoox+zgcI7ZWgoot2ECp7bhBB0toH4h
ZgBQSwECFAAUAAIACABOm3Y0gRFvDrkAAADEAAAACQAAAAAAAAAAACEAAAAAAAAAQ0hPT1NNLjQ4
UEsBAhQACgACAAAAL5t2NECFXJ1rAAAAawAAAAkAAAAAAAAAAAAhAAAA4AAAAENIT09TRi40OVBL
AQIUABQAAgAIAESbdjQ8AqctagAAAGsAAAAJAAAAAAAAAAAAIQAAAHIBAABDSE9PU0YuNDhQSwUG
AAAAAAMAAwClAAAAAwIAAAAA
--boundary--

[r->] [OFF]
Visit this user's website Find all posts by this user
Quote this message in a reply
05-19-2014, 05:43 AM
Post: #4
RE: (48G/GX) DIRSTAT - Find RAM Hogs
Thank you, sir.

The line that says
Code:
Message-ID: <op.s6uwagnowmwqgg@news.cis.dfn.de>

is the "usenet message id." If you have a good newsreader you can actually paste or type that in and it will send a command to whatever server(s) you are connected to and pull up the exact post if it's still being retained. And all of this with no participation of google.

Admittedly google does have an edge in retention since they vacuum up all stray bits on the net at taxpayer expense...

It ain't OVER 'till it's 2 PICK
Find all posts by this user
Quote this message in a reply
05-19-2014, 09:58 AM
Post: #5
RE: (48G/GX) DIRSTAT - Find RAM Hogs
(05-19-2014 05:43 AM)HP67 Wrote:  Thank you, sir.

The line that says
Code:
Message-ID: <op.s6uwagnowmwqgg@news.cis.dfn.de>

is the "usenet message id." If you have a good newsreader you can actually paste or type that in and it will send a command to whatever server(s) you are connected to and pull up the exact post if it's still being retained. And all of this with no participation of google.

Admittedly google does have an edge in retention since they vacuum up all stray bits on the net at taxpayer expense...

Yeah, I was trying to get just that line, but copy/paste in iPad Safari very frequently falls on its face and prevents selecting only very specific parts of text, so I had to grab the whole thing. For a company so obsessed with interface polish and usability, Apple does have a tendency to leave some really irritating UI bugs languishing for years.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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