So I'm using the #TMU_TRACK_PERC# line in the progress bar and I want a way to display how much time is left in the song.
This is what I've come up with:
Code:
$((TMU_TRACK_LENGTH#-#TMU_PLAYTIME#)/100)$
Of course, this returns the result in the format m.ss instead of m:ss (where m = minutes and ss = seconds), but oh well.
Now the problem I run into is that when the song is paused, instead of showing me the track length, it shows me "Unknown". So I thought I could solve this with conditionals like so:
Code:
$#TMU_TRACK_LENGTH#=Unknown?:$((TMU_TRACK_LENGTH#-#TMU_PLAYTIME#)/100)$
But all it gives me is $.
How do I fix this?
Just delte the $ in the middle.
CopKiller76 said:
Just delte the $ in the middle.
Click to expand...
Click to collapse
But now when the song plays it just gives me this:
-((TMU_TRACK_LENGTH#-#TMU_PLAYTIME#)/100)
minions301 said:
So I'm using the #TMU_TRACK_PERC# line in the progress bar and I want a way to display how much time is left in the song.
This is what I've come up with:
Code:
$((TMU_TRACK_LENGTH#-#TMU_PLAYTIME#)/100)$
Of course, this returns the result in the format m.ss instead of m:ss (where m = minutes and ss = seconds), but oh well.
Now the problem I run into is that when the song is paused, instead of showing me the track length, it shows me "Unknown". So I thought I could solve this with conditionals like so:
Code:
$#TMU_TRACK_LENGTH#=Unknown?:$((TMU_TRACK_LENGTH#-#TMU_PLAYTIME#)/100)$
But all it gives me is $.
How do I fix this?
Click to expand...
Click to collapse
Easier solution is to just use #TMU_REMAINING_TIME#. No need to do complicated math and way easier to handle in conditionals
kwerdenker said:
Easier solution is to just use #TMU_REMAINING_TIME#. No need to do complicated math and way easier to handle in conditionals
Click to expand...
Click to collapse
Haha. Oh. Yeah, that would be easier. I didn't know that existed! I searched for something like that but didn't find it. Thanks!
minions301 said:
Haha. Oh. Yeah, that would be easier. I didn't know that existed! I searched for something like that but didn't find it. Thanks!
Click to expand...
Click to collapse
Sure, no problem. Here is a dump of all available variables for future reference. You might find it useful
MU_PLAYTIME - Pretty string indicating how long current track is playing
MU_PLAYTIME_MILLIS - Total playing time in milliseconds
MU_TRACK_PERC - Total track percent played
MU_REMAINING_TIME - Pretty string indicating how track remaining time
MU_REMAINING_MILLIS - Total remaining time in milliseconds
MU_TRACK_NUM - Track number on album
MU_TRACK_LENGTH - Pretty string indicating track length
MU_TRACK_LENGTH_MILLIS - Total track length in milliseconds
MU_ALBUM - Album name
MU_ARTIST - Artist name
MU_TRACK - Track name
kwerdenker said:
Sure, no problem. Here is a dump of all available variables for future reference. You might find it useful
MU_PLAYTIME - Pretty string indicating how long current track is playing
MU_PLAYTIME_MILLIS - Total playing time in milliseconds
MU_TRACK_PERC - Total track percent played
MU_REMAINING_TIME - Pretty string indicating how track remaining time
MU_REMAINING_MILLIS - Total remaining time in milliseconds
MU_TRACK_NUM - Track number on album
MU_TRACK_LENGTH - Pretty string indicating track length
MU_TRACK_LENGTH_MILLIS - Total track length in milliseconds
MU_ALBUM - Album name
MU_ARTIST - Artist name
MU_TRACK - Track name
Click to expand...
Click to collapse
Awesome, thanks!
Related
Hi
I love my desire. The HTC calculator is nice with the finger friendly buttons with haptic feedback, and I love the fact it's respecting the operator priorities. But what's wrong with the calculator?
100 - 99,9 = 0,09999999999999999
100 - 99,8 = 0,2
100 - 99,7 = 0,2999999999
100 -99,6 = 0,4
100 - 99,5 = 0,5
100 - 99,4 = 0,599999999
100 - 99,3 = 0,7
100 - 99,2= 0,7999999999
100 - 99,1 = 0,9
is this a known issue?
Do you know another calculator where you can review all the line you typed and correct it if needed, that has big buttons, has parenthesis, and that give accurate results? I used to use HiCalc on WinMo, but I can't seem to find a good substitute on android.
Turn the phone to landscape and more functions are available like parentheses. Not sure about your other points!
funny - i needed this calculator for my school time
100 - 99,2= 0,7999999999
i have same result
br stupsi
stupsi99 said:
100 - 99,2= 0,7999999999
Click to expand...
Click to collapse
Google floating point precision
nparley said:
Google floating point precision
Click to expand...
Click to collapse
Most likely this.
And I use RealCalc which seems to correct for it.
This is mad.
My calculated is screwed too. Lol
Sent from my HTC Desire using XDA App
Why are you putting commas in not decimal points? 99.7 not 99,7
^^^^ Other people in the world write things differently to us
ok...this is new...lol
do you guys think a solution is possible? or should we all get another calculator?lol
You need to get another calculator.
Seems that HTC's calculator is using floating point rather than fixed point or decimal floating point.
Regards,
Dave
it is also a problem on the Vanilla calculator.
I'm using OpenDesire and it also has this problem.
bedeabc said:
^^^^ Other people in the world write things differently to us
Click to expand...
Click to collapse
they might, but if the calculator is configured to work with points not commas I'm not surprised it fails
Edit
Wrong! Is the same with points as commas. My bad
When we use the calculator we press the . button, as there is no comma.
FYI when in the UK you write 1,002.50 the rest of the world writes 1 000,50.
HTC answered me to find another calculator on the maket, cause the HTC calculator is a basic one. LMAO I know it won't solve complex equations, but 100 - 99.9 should be solved by any basic calculator, even by a 7 year old pupil...so I guess it should be solved by a calculator that displays basic trigonometry buttons, shouldn't it?
It fails with points as well.
100-99.9=0.0999999999
So it's not a localisation thing, it's just a rubbish calculator.
This happens to any substraction having the following pattern:
n-((n-1)+p), where p = {0.9, 0.7, 0.4, 0.2}
And it doesn't matter whether the Calculator uses '.' or ',' for digits.
Very strange...
Benj555 said:
FYI when in the UK you write 1,002.50 the rest of the world writes 1 000,50.
Click to expand...
Click to collapse
That depends on your definition of the rest of the world.
The two most populous nations on the planet, namely China and India, use the point as the decimal separator, as does the US, Japan, and most of the ex-British empire.
For the most part, the "Decimal Comma" is in use in mainland Europe and most of South America.
Regards,
Dave
Benj555 said:
When we use the calculator we press the . button, as there is no comma.
FYI when in the UK you write 1,002.50 the rest of the world writes 1 000,50.
Click to expand...
Click to collapse
The 'rest of the world' write: 1.000,50 (they use the '.' to group thousands - e.g. 154.234.345,243)
nparley said:
Google floating point precision
Click to expand...
Click to collapse
Don't see why floating point should have anything to do with this. Floating point is relevant where there is a greater number of digits required to do the calculation than would normally be displayed. This is a simple subtraction of a number with one decimal place. This is just plain wrong!
norm2002 said:
Don't see why floating point should have anything to do with this. Floating point is relevant where there is a greater number of digits required to do the calculation than would normally be displayed. This is a simple subtraction of a number with one decimal place. This is just plain wrong!
Click to expand...
Click to collapse
nparley is correct.
Whomever wrote the HTC calc app used binary floating point data types. The subtraction is being performed "correctly" within the limitations imposed by the use of that data type. 0.1 cannot be exactly represented by that data type, which is why this issue shows up.
Regards,
Dave
No, in the UK we would use . to indicate decimal and , to indicate thousands. Which I think is standard?
I realize there's a ton of different sites that sell NFC stickers and they all have various storage sizes ranging from 512 bytes to 2 Kb. So what's the general rule of thumb when it comes to actions vs storage space?
Obviously the higher the storage space, the more that can be automated with 1 tag. But say you just want to toggle a few system settings (volume, Bluetooth, brightness) and open one or two apps. Would a 512 byte tag suffice?
Maybe someone with more knowledge on the subject should create a guide generalizing this sort of stuff (broadly of course). I know it would certainly help me and any others wondering the same thing.
squiddy20 said:
I realize there's a ton of different sites that sell NFC stickers and they all have various storage sizes ranging from 512 bytes to 2 Kb. So what's the general rule of thumb when it comes to actions vs storage space?
Obviously the higher the storage space, the more that can be automated with 1 tag. But say you just want to toggle a few system settings (volume, Bluetooth, brightness) and open one or two apps. Would a 512 K tag suffice?
Maybe someone with more knowledge on the subject should create a guide generalizing this sort of stuff (broadly of course). I know it would certainly help me and any others wondering the same thing.
Click to expand...
Click to collapse
512k is a lot of space (where are 512k tags?).
Generally speaking 144 bytes (Ultralight C, NTAG203) is quite a bit and suitable for most applications.
If you need more space Classic 1K tags work (but these technically aren't NFC forum tags). 2K and 4K tags are generally overkill but are available.
If you are planning on using NFCTL most actions take 4-5 bytes (with the header being about 25 bytes). Actions that must store text (launching an App or URL for example) will store more space as they must store the string on the tag (generally 1 byte per string character plus 2 bytes instruction set).
Oh, oops. Meant to put 512 bytes. Correcting OP. Thanks for catching that.
Ok. So what about making a tag a toggle? Since (I imagine) you have to have a command for on and a command for off, does using it that way essentially double the space used?
squiddy20 said:
Oh, oops. Meant to put 512 bytes. Correcting OP. Thanks for catching that.
Ok. So what about making a tag a toggle? Since (I imagine) you have to have a command for on and a command for off, does using it that way essentially double the space used?
Click to expand...
Click to collapse
Unsure exactly what you're referencing. For a single Toggle command in a Task tag it takes no more space than enable,disable - the command merely indicates toggle instead of enable or disable. If you're referencing a switch tag then it writes essentially two Task tags to the physical tag (so that requires more space).
krohnjw said:
Unsure exactly what you're referencing. For a single Toggle command in a Task tag it takes no more space than enable,disable - the command merely indicates toggle instead of enable or disable. If you're referencing a switch tag then it writes essentially two Task tags to the physical tag (so that requires more space).
Click to expand...
Click to collapse
Haha my bad. I'm a total noob with this stuff (obviously) as I only got my Galaxy Nexus 2 weeks ago and only just started looking into this stuff. What I mean is 1 tag that when tapped once, turns volume up, screen brightness up, and opens an application, and a second tap will essentially revert the settings and maybe close the aforementioned app. Correct me if I'm wrong, but from the sound of my own description, it sounds like a combination of a toggle command (tap1: volume up, tap2: volume down) and a switch tag (opening and closing an app).
alicechong89 said:
512 bytes should be plenty.
On NFC Task Launcher, if I set these actions: enable wifi, set alarm, launch calculator, and set ringer volume, the total required is about 65 bytes.
Click to expand...
Click to collapse
Thanks for that bit of info, that clarifies things quite simply as I imagine that's pretty much all I'll be using the tech for.
curious why you wouldn't just make a profile using tasker to do the command combinations, then program the smallest tag to execute that one profile/script/macro ?
/first post!
danfinger said:
curious why you wouldn't just make a profile using tasker to do the command combinations, then program the tag to execute that one profile/script/macro ?
/first post!
Click to expand...
Click to collapse
Don't have Tasker and I'm not sure if I want to delve into its complexities, even though it would probably be easier (in some ways) to go that route.
Congrats on your first post, btw!
Hey all
I have a vertical progress bar,placed at y=-264,min value 900 (9.00 AM),max value 1850 (6.50 PM). It's current value is defined by progressbarcurrentvalue = $#Dm#)>50?(#DHH#+1):#DH#$$#Dm#<50?#Dmm#:00$ That is,if minutes<50 it displays current hour and minute without spaces or any chars,but if minutes>50 it displays next hour for 10 mins (like if its 16.55 it displays 1700 ). So far so good.
I want to have a horizontal line to follow my progress bar's current value. I came up with the solution that if I use the parameter [oy](ceil((progressbarcurrentvalue-900)*11/19)-264)[\oy] in my horizontal line it should do the trick. But the problem is I can't get to calculate progressbarcurrentvalue-900 it just does not do the calculation. How can i solve this?
TL;DR
I want to do the calculation $#Dm#)>50?(#DHH#+1):#DH#$$#Dm#<50?#Dmm#:00$-900 but i can't. Why?
Many thanks!
djbaha said:
Hey all
I have a vertical progress bar,placed at y=-264,min value 900 (9.00 AM),max value 1850 (6.50 PM). Its current value is defined by progressbarcurrentvalue = $#Dm#)>50?(#DHH#+1):#DH#$$#Dm#<50?#Dmm#:00$ That is,if minutes<50 it displays current hour and minute without spaces or any chars,but if minutes>50 it displays next hour for 10 mins (like if its 16.55 it displays 1700 ). So far so good.
I want to have a horizontal line to follow my progress bars current value. I came up with the solution that if I use the parameter [oy](ceil((progressbarcurrentvalue-900)*11/19)-264)[\oy] in my horizontal line it should do the trick. But the problem is I cant get to calculate progressbarcurrentvalue-900 it just does not do the calculation. How can i solve this?
TL;DR
I want to do the calculation $#Dm#)>50?(#DHH#+1):#DH#$$#Dm#<50?#Dmm#:00$-900 but i cant. Why?
Many thanks!
Click to expand...
Click to collapse
You need to enclose mathematical expressions in $'s in order for it to be evaluated as a mathematical expression. But this is not going to work:
Code:
[oy]$(ceil(($#Dm#>50?(#DHH#+1):#DH#$$#Dm#<50?#Dmm#:00$-900)*11/19)-264)$[\oy]
because you can't embed conditionals. What you need to do is condense all calculations into a single conditional.
First you can condense these 2 conditionals
Code:
$#Dm#>50?(#DHH#+1):#DH#$$#Dm#<50?#Dmm#:00$
into 1
Code:
$#Dm#>50?(#DHH#00+100):#DHmm#$
Then this
Code:
[oy]$(ceil(($#Dm#>50?(#DHH#00+100):#DHmm#$-900)*11/19)-264)$[/oy]
can be condensed by just incuding the additional calculations within the conditional
Code:
[oy]$#Dm#>50?(ceil(((#DHH#00+100)-900)*11/19)-264):(ceil((#DHHmm#-900)*11/19)-264)$[/oy]
You need to double check the above. I got a little confused with all the parentheses.
jr67 said:
You need to enclose mathematical expressions in $'s in order for it to be evaluated as a mathematical expression. But this is not going to work:
Code:
[oy]$(ceil(($#Dm#>50?(#DHH#+1):#DH#$$#Dm#<50?#Dmm#:00$-900)*11/19)-264)$[\oy]
because you can't embed conditionals. What you need to do is condense all calculations into a single conditional.
First you can condense these 2 conditionals
Code:
$#Dm#>50?(#DHH#+1):#DH#$$#Dm#<50?#Dmm#:00$
into 1
Code:
$#Dm#>50?(#DHH#00+100):#DHmm#$
Then this
Code:
[oy]$(ceil(($#Dm#>50?(#DHH#00+100):#DHmm#$-900)*11/19)-264)$[/oy]
can be condensed by just incuding the additional calculations within the conditional
Code:
[oy]$#Dm#>50?(ceil(((#DHH#00+100)-900)*11/19)-264):(ceil((#DHHmm#-900)*11/19)-264)$[/oy]
You need to double check the above. I got a little confused with all the parentheses.
Click to expand...
Click to collapse
Thank you so much !
The last formula worked flawlessly. Now im studying it to understand how it works..
Thanks!
Ok first of all im not good in english, do'nt:silly: blame me
Since i got the moto 360 i was looking for any watchface with cool animations. There was difficult to find what i was looking for. But, I found watchmaker and i got really good looking watchfaces on face repo. I read some of the Lua Watchmaker wiki and try to aply animations. No luck. But i asked a few times in Google+ community and i got the understanding. Now i will try to post what i think is one of the most beautiful and simple animation i've had on my mind since smartwatches appeared on the market. I would recommend you to do this in a copy of your watch face because if you are not too experienced you can modify a misunderstood value and you have to download the entire watch face again.
EDIT: Corrected error on "on_display_bright()"
Instructions:
1 - Find a watchface you can edit, go to the script and write this code because it makes the magic:
Code:
tweens.rotate_sec=1
tweens.rotate_min=1
tweens.rotate_hour=1
function on_display_bright()
wm_schedule {action='tween', tween='rotate_sec', from=0, to=1, duration=1.5, easing=inOutCirc}
wm_schedule {action='tween', tween='rotate_min', from=0, to=1, duration=1.3, easing=inOutCirc}
wm_schedule {action='tween', tween='rotate_hour', from=0, to=1, duration=1, easing=inOutCirc}
end
(*You can change all the values of duration and easing, but you will find more easing functions on the Watchmaker Lua Wiki
2 - Now you have to find the 3 gauge layers and edit the "Rotation" parameter. In most of cases you will find:
{drs} on seconds
{drm} on minutes
{drh} on hours
(*this can vary in many cases like {drss} simulating automatic watches but the important thing is the layer (parenthesis in a parenthesis (i really like {drss}))) -> ok pls staph!
you have to change "Rotation" parameters in each layer to this:
on seconds
Code:
tweens.rotate_sec*{drs}
on minutes
Code:
tweens.rotate_min*{drm}
on hours
Code:
tweens.rotate_hour*{drh}
3 - Send to the watch.
I recommend to set the "Display" parameter of this 3 layers to Bright only if you don't use it in ambient mode. The main reason is unless you do it, if you wake up the watch a lag occurs between last position of gauges before slept and the animation, and it looks weird. You can try it.
I hope you enjoy it, because it is easy to implement it to your watches and I think it's really cool.
Tell me if it works for you and if you like it. Post any variation of this code if you want to share it.
I can't post any watches due to commercial or non-commercial terms of use so i just post a video.
I can' post links because i'm new here but you can copy and paste in your browser and it works.
Regards
EDIT: here's a video of one of the examples:
dropbox.com/s/if7qa0z9mcv3sf8/VID_20150602_021553.mp4?dl=0
I'm getting an error on the script...also getting an error on the rotation values. I just copy/paste them in there...didn't free write them at all. you sure the code is correct? I know nothing about scripting so I can't find whats wrong.
it says 5: '(expected near'_display_bright' as the error code
any thoughts? running the beta app
There was a mistake on "function"
Hi, sorry about it, there was a mistake on the next lines:
A space between "on" and "_display". It should be written "on_diaplay". thats all
function on _display_bright()
function on_display_bright()
You know green is the correct way forget the red marked line because is the error, everything seems to be correct now.
moracabanas said:
Hi, sorry about it, there was a mistake on the next lines:
A space between "on" and "_display". It should be written "on_diaplay". thats all
function on _display_bright()
function on_display_bright()
You know green is the correct way forget the red marked line because is the error, everything seems to be correct now.
Click to expand...
Click to collapse
that did it...looks fantastic!
Example the rom name K50a40_S112_150610_ROW_TO_K50a40_S114_150618_ROW_W CDE.zip
Forum setup long word to 50 characters.
123456789012345678901234567890123456789012345678901234567890
123456789012345678901234567890123456789012345678901234567890
Yep, this has always been the case, for as long as I can remember. Not sure if the limitation is vBulletin, SQL or something else?
We've encountered the same in our forum & turned out to be vBulletin bug.
@natong
It would be better if you put all those long filenames inside CODE tag.
Titokhan said:
We've encountered the same in our forum & turned out to be vBulletin bug.
@natong
It would be better if you put all those long filenames inside CODE tag.
Click to expand...
Click to collapse
Could you adjust more width and unlimit height for CODE tag ?
Currently it limit to display only 10-20 lines height with scrollbar.
@natong
Sorry, I can't help you with that. But its indeed better to get a CODE window without any horizontal scrollbar.
I known how to post long word now.
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890