[Suggestion] Add $parent-size:

Discussion related to "Everything" 1.5 Alpha.
Post Reply
NotNull
Posts: 5514
Joined: Wed May 24, 2017 9:22 pm

[Suggestion] Add $parent-size:

Post by NotNull »

I was trying to create an Everything version of TreeSize and the like, butr ran into a missing $parent-size:
Now $parent-size: is technically speaking not a property of a file or folder (and probably be slightly expensive to keep up with), but would be cool if this was possible.
Would look similar to the screenshot below if functioning (first attempt):

2024-04-12 23_36_59-Percent of Parent - C__Windows - Everything (1.5a) 1.5.0.1371a (x64).png
2024-04-12 23_36_59-Percent of Parent - C__Windows - Everything (1.5a) 1.5.0.1371a (x64).png (95.82 KiB) Viewed 2980 times

Query used:

Code: Select all

addcol:A A-label:="Percent of Parent" A:=LEFT(REPT("|",25),EVAL(25*$size:/31606003309))LEFT(REPT(".",25),EVAL(25-25*$size:/31606003309))

(where 31606003309 is the size of the parent, C:\Windows)


Just something for the cool-factor :D
(definitely not a must-have)
void
Developer
Posts: 17131
Joined: Fri Oct 16, 2009 11:31 pm

Re: [Suggestion] Add $parent-size:

Post by void »

I'll add parent-size and root-size properties.

Thank you for the suggestion.
nikov
Posts: 131
Joined: Fri Dec 24, 2021 10:31 am

Re: [Suggestion] Add $parent-size:

Post by nikov »

I was trying to replicate NotNull's suggestion using column formula like this:

Code: Select all

addcolumn:a:1 a-label:="tmpSize" a:=getproperty($path:,"size")
but I was amazed because it was not working, even though Everything knows "$path:"'s size (it is visible in the "Size" column), but still it fails.
What am I missing?

Thank you.
NotNull
Posts: 5514
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

Ran into this too.
get-property (formula as well as preprocessor function) works only on files, not folders.
nikov
Posts: 131
Joined: Fri Dec 24, 2021 10:31 am

Re: [Suggestion] Add $parent-size:

Post by nikov »

NotNull wrote: Sat Apr 13, 2024 9:17 am Ran into this too.
get-property (formula as well as preprocessor function) works only on files, not folders.
@NotNull
Then why are you satisfied with only "$parent-size:"?
Wouldn't it be more generalized if get-property (formula as well as preprocessor function) was improved? :D
NotNull
Posts: 5514
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

My reasoning (which might be flawed):

get-property() retrieves properties of items. Those are the properties as known by the system (= Windows), like Author or Size.
This does not include Everything-specific properties, like Run Count or Folder Size.

Some of these Everything-specific properties are available throughh $<property>: , like $runcount:
Adding $parent-size: to them seemed more in line with the current setup.
reitwal
Posts: 21
Joined: Sat Apr 09, 2016 9:19 am

Re: [Suggestion] Add $parent-size:

Post by reitwal »

a:=getproperty($path:, "size") works in versions 1360a to 1366a, but not in the newer versions.

But of course "$parent-size:" would be the better solution.
NotNull
Posts: 5514
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

Nice find reitwal! Maybe it was intended to work that way after all ...
nikov
Posts: 131
Joined: Fri Dec 24, 2021 10:31 am

Re: [Suggestion] Add $parent-size:

Post by nikov »

My reasoning of why improving "get-property" is better than adding "$parent-size:":

"$runcount:" cannot be derived from formula. No mathematics or simple tricks can derive "run-count:", thus, it should be kept as a property. On the other hand, you can derive "$parent-size:" from formula (some mathematics or simple tricks only needed). But still if you want to add "$parent-size:" then shouldn't it make Everything property-system clutter? Moreover, people may then ask, please add "$parent-descendant-count:", "$parent-descendant-folder-count:", "$parent-date-modified:", "$parent-date-created:", etc. Then developer has to add everything that a user can do with a simple formula into the property-system. Thus, this non-generalized way is inconvenience for both user and developer. Also, what is the use of putting much effort into developing the formula system, if formula derivable properties should also be added?

Also note that, "Percent of Parent" concept is a nice thing mentioned, I just wanted to do it in a more generalized way.

Thank you.
nikov
Posts: 131
Joined: Fri Dec 24, 2021 10:31 am

Re: [Suggestion] Add $parent-size:

Post by nikov »

Yes, nice find reitwal,

I have checked the followings only in version 1366a. And they all work. The only problem I found till now in version 1366a regarding this is: If the properties are non-indexed, they are very slow but they should not be very slow because without formula Everything can retrieve them very fast.

Properties checked:

Code: Select all

addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"size")
addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"date-modified")
addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"date-created")
addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"descendant-count")
addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"descendant-file-count")
addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"descendant-folder-count")
addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"attributes")
Thank you.
NotNull
Posts: 5514
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

nikov wrote: Sat Apr 13, 2024 8:20 pm But still if you want to add "$parent-size:" then shouldn't it make Everything property-system clutter? Moreover, people may then ask, please add "$parent-descendant-count:", "$parent-descendant-folder-count:", "$parent-date-modified:", "$parent-date-created:", etc. Then developer has to add everything that a user can do with a simple formula into the property-system.
My thoughts exactly. In fact: put to words here (first part of the post).

However, $parent-size: is the more human-friendly way, which seems the preferred way in Everything.
The "go with the flow" approach seems to me the easiest to implement too.
NotNull
Posts: 5514
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

NotNull wrote: Sat Apr 13, 2024 10:01 pm $parent-size: is the more human-friendly way,
On second (third?) thought: the amount of 'humans' that has a need for $parent-size is probably *very* limited.
If get-property() will support $path again in the future, that should suffice (IMO)
void
Developer
Posts: 17131
Joined: Fri Oct 16, 2009 11:31 pm

Re: [Suggestion] Add $parent-size:

Post by void »

I am working on getproperty()
Ideally, getproperty() should get the indexed value if it exists..



For now, the following should work:

getproperty($path:,"totalsize")
void
Developer
Posts: 17131
Joined: Fri Oct 16, 2009 11:31 pm

Re: [Suggestion] Add $parent-size:

Post by void »

Everything 1.5.0.1384a adds a Parent Size and Root Size property.

GETPROPERTY() will now return the indexed value (if it exists)
NotNull
Posts: 5514
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

Parent size an d root size work. Nice!
With that, the following is possible:
2024-12-03 20_39_22-Percent of Parent - C_ - Everything 1.5.0.1386a (x64).jpg
2024-12-03 20_39_22-Percent of Parent - C_ - Everything 1.5.0.1386a (x64).jpg (202.44 KiB) Viewed 1223 times

How?
  • Download Percent of Parent.csv
    (this contains Unicode characters, so posting as text on the forum might get mangled by the forum software)
  • In Everything: Menu => Search => Organize Filters
  • Press the Import button
  • Select Percent of Parent.csv and press the OK button.
  • Activate the Percent of Parent filter
  • Use the Folders sidebar for browsing
Attachments
Percent of Parent.csv
(506 Bytes) Downloaded 27 times
tuska
Posts: 1098
Joined: Thu Jul 13, 2017 9:14 am

Re: [Suggestion] Add $parent-size:

Post by tuska »

Mmh, at the moment it still looks like this for me:
"OMIT" is missing

#[define:width=20#]: NO-OMIT-RESULTS: columns:A,name,size,dm C:=ROUND(1.0*[width:]*$size:/$parent-size:) A-label:=Percent of Parent" A:=REPT(""▒""
#[define:width=20#]: NO-OMIT-RESULTS: columns:A,name,size,dm C:=ROUND(1.0*[width:]*$size:/$parent-size:) A-label:=Percent of Parent" A:=REPT(""▒"")
... then search results are available... Column A remains empty ...
 
2024-12-03_Everything version of TreeSize - Add $parent-size.png
2024-12-03_Everything version of TreeSize - Add $parent-size.png (14.12 KiB) Viewed 1215 times
 
Could you please check it again?
Thanks.
NotNull
Posts: 5514
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

Thanks for testing and reporting @tuska!

Got the same issue here. Importing the CSV only gets half of the search query :? (the part you posted).

Could you try to manually change the search of the "Percent of Parent" filter to:

Code: Select all

#[define:width=20#]:  NO-OMIT-RESULTS:  columns:A,name,size,dm   C:=ROUND(1.0*[width:]*$size:/$parent-size:)   A-label:="Percent of Parent"   A:=REPT(""▒"",$C:)REPT(""░"",[width:]-$C:)""   ""100*$size:/$parent-size:""%""    sort:size-descending mix-sort:   folders-sidebar:    treeview-or-root-no-subfolders:

If that gives the expected results, I'll update the instructions above.
Thanks!
tuska
Posts: 1098
Joined: Thu Jul 13, 2017 9:14 am

Re: [Suggestion] Add $parent-size:

Post by tuska »

Hi,
The percentage is still missing.
NotNull
Posts: 5514
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

OK, will look at it tomorrow ..
spooky
Posts: 43
Joined: Mon Feb 14, 2022 7:16 am

Re: [Suggestion] Add $parent-size:

Post by spooky »

Hey NotNull, any updates on this? The whole, full CSV would be appreciated :D
NotNull
Posts: 5514
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

No update yet. Time is the big issue here...

BTW: the CSV itself is "whole, full". Only when importing it, it imports only part of the filter definition.
I suspect it needs a different encoding (like UTF-16 or UTF-8 BOM)
spooky
Posts: 43
Joined: Mon Feb 14, 2022 7:16 am

Re: [Suggestion] Add $parent-size:

Post by spooky »

Yes, I was talking about the percentage. That's the finishing touch, and I'm not quite sure how to add it myself.
tingfzy
Posts: 3
Joined: Tue Dec 10, 2024 4:33 am

Re: [Suggestion] Add $parent-size:

Post by tingfzy »

I manually adjusted the search for the "Percent of Parent" filter to the following:

Code: Select all

#[define:width=20#]:  NO-OMIT-RESULTS:  columns:A,name,size,dm   C:=ROUND(1.0*[width:]*$size:/$parent-size:)   A-label:="Percent of Parent"   A:=REPT(""▒"",$C:)REPT(""░"",[width:]-$C:)REPT(" ",1)""100*$size:/$parent-size:""REPT("%",1)     sort:size-descending mix-sort:   folders-sidebar:    treeview-or-root-no-subfolders:
This shows the full percentage.
Image
Attachments
image.png
image.png (19.65 KiB) Viewed 876 times
spooky
Posts: 43
Joined: Mon Feb 14, 2022 7:16 am

Re: [Suggestion] Add $parent-size:

Post by spooky »

Is there a way to round those numbers? I don't really mind about the decimal places.
void
Developer
Posts: 17131
Joined: Fri Oct 16, 2009 11:31 pm

Re: [Suggestion] Add $parent-size:

Post by void »

Please try TEXT() to format numbers.

TEXT(0.123456,"0%")
=> 12%
TEXT(0.123456,"0.00%")
=> 12.34%

TEXT() works the same as the Excel TEXT function.



12%

Code: Select all

#[define:width=10#]:  NO-OMIT-RESULTS:  columns:A,name,size,dm   C:=ROUND(1.0*[width:]*$size:/$parent-size:)   A-label:="Percent of Parent"   A:=REPT(""▒"",$C:)REPT(""░"",[width:]-$C:)REPT(" ",1)TEXT($size:/$parent-size:,"0%")     sort:size-descending mix-sort:   folders-sidebar:    treeview-or-root-no-subfolders:
12.34%

Code: Select all

#[define:width=10#]:  NO-OMIT-RESULTS:  columns:A,name,size,dm   C:=ROUND(1.0*[width:]*$size:/$parent-size:)   A-label:="Percent of Parent"   A:=REPT(""▒"",$C:)REPT(""░"",[width:]-$C:)REPT(" ",1)TEXT($size:/$parent-size:,"0.00%")     sort:size-descending mix-sort:   folders-sidebar:    treeview-or-root-no-subfolders:
NotNull
Posts: 5514
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

void wrote: Wed Dec 11, 2024 11:36 pm Please try TEXT() to format numbers.
Coincidentally, I sent @tuska a version of this that uses TEXT() too.
He found out that TEXT() does not round the numbers, but takes the floor.
( i.e 0.199 => 19% )

ROUND(100*0.199,0) => 20 (zero decimals)
ROUND(100*0.199,1) => 19.9 (one decimal)


(We have worked on a version that *does* work. Will be posted soon)
void
Developer
Posts: 17131
Joined: Fri Oct 16, 2009 11:31 pm

Re: [Suggestion] Add $parent-size:

Post by void »

Everything 1.5.0.1389a improves TEXT()

Like Excel, TEXT() will now round numbers away from zero.

=TEXT(0.49,"0")
=> 0
=TEXT(0.5,"0")
=> 1
=TEXT(0.49,"0.0")
=> 0.5
=TEXT(0.49,"0.00")
=> 0.49
=TEXT(0.5,"0.0")
=> 0.5
=TEXT(0.5,"0.0")
=> 0.5
=TEXT(-0.5,"0")
=> -1

=TEXT(0.995,"0%")
=> 100%
=TEXT(0.995,"0.0%")
=> 99.5%
Post Reply