It is currently April 19th, 2024, 8:19 pm

RexExpSubstitute - Easy but Asking Anyway [Solved]

Get help with creating, editing & fixing problems with skins
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

RexExpSubstitute - Easy but Asking Anyway [Solved]

Post by Mor3bane »

Hello, In a Measure I wish to Substitute a base "0" with a "forced" "05", I can do that but now every "0" is Substituted, in a Measure where there is no actual Decimal value output. So no need to have a decimal preceding the "05".

Thanks for any help.

EDIT: Sorry - Got it : "^0$":".05"
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: RexExpSubstitute - Easy but Asking Anyway [Solved]

Post by balala »

Mor3bane wrote: February 27th, 2020, 12:36 am EDIT: Sorry - Got it : "^0$":".05"
Yep, but note that this substitution works only if you set the RegExpSubstitute option of the measure to 1 (RegExpSubstitute=1), because the default value of this option is 0.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: RexExpSubstitute - Easy but Asking Anyway [Solved]

Post by Mor3bane »

balala wrote: February 27th, 2020, 8:03 pm Yep, but note that this substitution works only if you set the RegExpSubstitute option of the measure to 1 (RegExpSubstitute=1), because the default value of this option is 0.
Thanks balala.

I remembered both. Just took a few minutes.

It seems sometimes, that after asking a question we suddenly already know the answer - sometimes not. :great:
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: RexExpSubstitute - Easy but Asking Anyway [Solved]

Post by Mor3bane »

So I feel compelled to explain what this is for...

I am touching up some roundline skins.

When the value reaches 0 I get an annoying gap. The reason for that is aesthetically I have integrated gaps between the 'used' and 'free' portions of the roundline meters e.g. for system monitoring; gpu, cpu, etc.

I know there is a more elegant and mathematical way to do it - pure math. However in my case, I am a logical-emotive person, rather than a logical-intuitive - who would suss out the formula, rather than like me, average out a solution that is not so purely logical. :oops:
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5397
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: RexExpSubstitute - Easy but Asking Anyway [Solved]

Post by eclectic-tech »

Mor3bane wrote: February 28th, 2020, 1:26 am So I feel compelled to explain what this is for...

I am touching up some roundline skins.

When the value reaches 0 I get an annoying gap. The reason for that is aesthetically I have integrated gaps between the 'used' and 'free' portions of the roundline meters e.g. for system monitoring; gpu, cpu, etc.

I know there is a more elegant and mathematical way to do it - pure math. However in my case, I am a logical-emotive person, rather than a logical-intuitive - who would suss out the formula, rather than like me, average out a solution that is not so purely logical. :oops:
If you could post an example of your code for this, someone may be able to help find an alternate solution...
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: RexExpSubstitute - Easy but Asking Anyway [Solved]

Post by Mor3bane »

eclectic-tech wrote: February 28th, 2020, 2:34 am If you could post an example of your code for this, someone may be able to help find an alternate solution...
Made an rmskin :)
MorGPU_1.xx.rmskin
You do not have the required permissions to view the files attached to this post.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RexExpSubstitute - Easy but Asking Anyway [Solved]

Post by Yincognito »

Mor3bane wrote: February 28th, 2020, 5:10 am Made an rmskin :)

MorGPU_1.xx.rmskin
Setting RotationAngle=-3.06 in the [GPUFree] measure and RotationAngle=3.1415 in the [GPU2Free] measure seemed to remove the gaps - if those were the "gaps" you were talking about. Don't ask me why though... :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: RexExpSubstitute - Easy but Asking Anyway [Solved]

Post by Mor3bane »

Yincognito wrote: February 28th, 2020, 9:07 pm Setting RotationAngle=-3.06 in the [GPUFree] measure and RotationAngle=3.1415 in the [GPU2Free] measure seemed to remove the gaps - if those were the "gaps" you were talking about. Don't ask me why though... :confused:
Hi Yincognito - you misunderstood me - the gaps are aesthetic - I want them. The part i dont want is when the value reaches 0 or 100 % essentially since the gap remains due to the basic solution I was not able to math it better - so I made the MinValue=-1 thus creating a permanent read of a positive image in the Roundline and in suit making the 0 gap disappear due to 'not being there anymore'.

Not very elegant but if anything rainmeter is about making things look nice in whatever way we hopefully can make happen in the script. The 100% value has not been much of a problem due to that reading being rarely visible for more than a second or so. But would be nice to fix as well.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: RexExpSubstitute - Easy but Asking Anyway [Solved]

Post by balala »

Yincognito wrote: February 28th, 2020, 9:07 pm Setting RotationAngle=-3.06 in the [GPUFree] measure and RotationAngle=3.1415 in the [GPU2Free] measure seemed to remove the gaps - if those were the "gaps" you were talking about. Don't ask me why though... :confused:
Although I read Mor3bane's reply, note that even if I'm not sure what the RotationAngle=-3.06 value ([GPUFree]) represents, but in case of the [GPU2Free] meter, instead of RotationAngle=3.1415, I recommend to use RotationAngle=PI, because the value of this constant is not 3.1415, it being an irrational constant, which means it has an infinite number of decimals. Much more precise to use it with the Pi constant...
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RexExpSubstitute - Easy but Asking Anyway [Solved]

Post by Yincognito »

balala wrote: February 29th, 2020, 7:47 am Although I read Mor3bane's reply, note that even if I'm not sure what the RotationAngle=-3.06 value ([GPUFree]) represents, but in case of the [GPU2Free] meter, instead of RotationAngle=3.1415, I recommend to use RotationAngle=PI, because the value of this constant is not 3.1415, it being an irrational constant, which means it has an infinite number of decimals. Much more precise to use it with the Pi constant...
While your suggestion to use the built-in Rainmeter function to get the value of PI is entirely correct from a coding point of view, I doubt it would make a practical difference in the above scenario, because:
- it's already decimal precision 4, and any decimal precision above that would be invisible to the naked eye - you surely know that from your own very well done projects using the same features
- since PI, as you didactically (and correctly) pointed out, is an irrational constant having an infinite number of decimals, not even a computer or a software can replicate all PI's decimals (since their number is infinite), meaning you can't get a truly precise PI no matter what, so why even trying?

Bottom line, it's like thinking using 16/9 instead of 1.7778 would make a big difference when talking about aspect ratios in practical terms, where the number of pixels on a regular screen is insufficient to produce truly accurate representations of that anyway.
And yeah, I know what PI is - most of my early projects used trigonometric functions to draw circles on computers without a Circle function, simulate 3D function graphs, polar coordinate system and 3D environments in 2D applications, so PI and I are "old friends", if I can say so... :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth