Flycut icon indicating copy to clipboard operation
Flycut copied to clipboard

Enhanced "Remember" limit management

Open MarkJerde opened this issue 8 years ago • 0 comments

Here's what I'm currently working on, open for any comments.

Sometimes I have a clipping that I could benefit from it being remembered longer than it is. A lot of what I copy and paste is only used once, and never needed from Flycut. What if Flycut could chose to "forget" something other than the last entry in the clipping store?

My solution is to give each clipping a "value", initialized to zero for each new clipping. If the clipping is recalled from Flycut its value is increased. Clippings one through ten have their value increased by one. Clippings beyond the first ten (the older clippings) have their value increased by how far they are above ten (e.g. clipping 17 would have 7 added to its value, or clipping 39 would have 29 added). Greater value for clippings that have shown they are needed longer after being copied and thus need more help to last even longer. Clippings that are recalled from Flycut multiple times would have their value increased multiple times and get a little more advantage to be held longer. Clippings that are never recalled from Flycut would have a value of zero, and be forgotten quicker.

When it is time to make room in the clipping store, clippings are searched from the end of the list looking for the lowest value without reaching the front ten. The front ten may be too fresh to have been recalled, so they are protected. The lowest value is the one to remove.

As clippings are being searched for one to remove, each clipping checked has its value decremented so nothing is stuck forever on the store. Everything decays eventually. In the search, once a zero is found it stops looking so newer items won't decay until they are part of the group being artificially preserved. If the clipping to remove is the eleventh (newest possible to remove), then the entire group that was scanned has their values decreased by their lowest value minus one or two (so they still have another round or two of protection). For any other clipping removed, the group of clippings that were scanned have their value decreased by the distance removal is from the end divided by ten (e.g. removing item 27 of 40 would be (40 - 27) = 13; (13 / 10) => 1 (integer math); so an extra 1 would be removed from each value). The reason for these extra decreases beyond a single point per search is to prevent the store from getting full of nothing but preserved clippings while new clippings are forgotten once they leave the front ten. If there is considered value to recalling things from outside the first ten, then it is necessary to ensure that new clippings can survive beyond that first ten. This solution of score management should handle any scenario of usage without side effect; appearing no different than before except that the user finds what they were hoping Flycut still remembered more often than they currently do.

An extra capability that could come from this feature is that the "Save forgotten items" feature could have an option to only automatically save clippings that have had their value reach at least a minimum value at some point. (e.g. User selects to only autosave clippings that have reached value "1" or greater, so clippings that were never recalled from Flycut will never be autosaved.)

What do you think? Any thoughts, comments, or suggestions?

Thanks! Mark

MarkJerde avatar Feb 27 '16 04:02 MarkJerde